Compare commits

...

591 Commits

Author SHA1 Message Date
Zach H
4535a70b57 Define qtlogging.ini location (#5551) 2025-02-02 19:27:14 +00:00
BruebachL
6c1b7c83ec Debounce writing the setting to cache when adjusting card sizes. (#5550)
* Debounce writing the setting to cache when adjusting card sizes.

* Lint.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-02-02 18:45:26 +00:00
Zach H
f0adafb275 Reconnect Servatrice if DB Connection Dies (#5548) 2025-02-02 18:25:01 +00:00
BruebachL
9dd60d74d1 Hotfix VDS sizing scrollArea widget incorrectly when created while not visible by setting size in showEvent (#5547)
* Only resize on folder widget to make sure it doesn't squish the loading indicator.

* Clamp scrollArea widget to viewport width on showEvent to prevent widget being instantiated with wrong width when not visible.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-02-02 17:36:56 +00:00
RickyRister
1de09deb59 Fix size and image quality issues with new user icons (#5546) 2025-02-02 15:08:23 +00:00
BruebachL
a0b52ce450 Implement folder support for VDS. (#5545) 2025-02-02 15:08:04 +00:00
RickyRister
95cea0f191 Add custom server-side pawn colors (#5543) 2025-02-02 03:25:25 +00:00
RickyRister
0fc05e15cd pass ServerInfo_User down the chain (#5542) 2025-02-02 01:04:49 +00:00
RickyRister
26c0cdc072 Make settings window scrollable (#5539) 2025-02-01 05:03:30 +00:00
RickyRister
b1b48d50f3 move deck conversion settings into deck settings group (#5538) 2025-02-01 04:32:12 +00:00
Zach H
349c18aa6a Fix Crash with "c:" in deck editor (#5537) 2025-02-01 04:32:01 +00:00
Zach H
b956fd4bac Fix windows deck searching (#5536) 2025-02-01 04:13:46 +00:00
RickyRister
34e0130b90 fix view transform button disappearing on click (#5535) 2025-02-01 03:31:09 +00:00
BruebachL
33d8edeb9a Get file format from name. (#5532)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-27 19:41:29 -05:00
RickyRister
5d1e905255 remove refreshTree call in remote model's constructors (#5533) 2025-01-27 19:40:59 -05:00
RickyRister
51c542aa04 Disable add to deck submenu if no deck editor tabs are open (#5530)
* refactor

* just have the deck name

* clean up submenu parenting

* disable add to deck menu if no deck editor tabs are open
2025-01-26 10:24:09 -05:00
BruebachL
4d791f4d7a Edhrec tab (#5512)
---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-01-25 22:29:27 +00:00
RickyRister
aee68f8b00 add missing override and explicit specifiers in common (#5527) 2025-01-25 14:06:03 +00:00
RickyRister
b911ea6e28 add missing override and explicit specifiers in src/server (#5526) 2025-01-25 14:05:25 +00:00
RickyRister
a41e7c75c1 add missing override and explicit specifiers in src/deck and src/utility (#5525)
* add missing override and explicit specifiers in src/deck

* add missing override and explicit specifiers in src/utility
2025-01-25 14:05:00 +00:00
RickyRister
9f729bf636 add missing override and explicit specifiers in src/dialogs (#5524) 2025-01-25 14:04:26 +00:00
RickyRister
42e4c14a82 add missing override and explicit specifiers in src/client (#5523) 2025-01-25 14:03:54 +00:00
Zach H
37a0c00b3f Support right-click on game list menu (#5522) 2025-01-25 14:03:29 +00:00
Zach H
f6c31bf901 Invert "Show" games, so all games are visible by default (#5521) 2025-01-25 07:03:36 +00:00
Zach H
b48fe8b99c Better capitalization & Deck open first (#5520) 2025-01-25 05:45:44 +00:00
RickyRister
19b758591b Allow offline Replays tab (#5519) 2025-01-25 05:44:48 +00:00
Zach H
ec6a23de56 Support more indices (#5505)
* Support more indices

* Support more indices
2025-01-25 04:16:41 +00:00
BruebachL
ce416df3fb Add a dialog to prompt user to convert to .cod format if trying to apply tags to a .txt deck. (#5514)
* Add a dialog to prompt user to convert to .cod format if trying to apply tags to a .txt deck.

* Lint mocks.

* Address comments, move dialog to appropriate folder.

* Unlint.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-25 03:20:30 +00:00
BruebachL
4e96157091 Flow Layout fixes (#5515)
* Flow Layout fixes.

* Remove some comments.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-25 03:17:39 +00:00
RickyRister
f428148f64 Allow offline Deck Storage tab (#5518)
* make deck storage tab no longer close on disconnect

* add method for clearing remote decklist model

* handle connect/disconnect in deck storage tab
2025-01-25 03:16:40 +00:00
RickyRister
e8b1e3ef0c don't autoclose card view if single card gets dragged into same zone (#5517)
* rename canResize param to toNewZone

* pass toNewZone down

* don't autoclose card view if card gets dragged into same zone
2025-01-25 02:08:28 +00:00
RickyRister
085f0dd26c reduce unnecessary CardItem creation in ViewZone addCard process (#5513) 2025-01-24 05:13:08 +00:00
BruebachL
1d2ab8d3d3 Convert lastLoaded timestamp into proper QDateTime for correct comparison. (#5506)
* Convert lastLoaded timestamp into proper QDateTime for correct comparison.

* Reintroduce null check.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-22 12:58:19 +00:00
RickyRister
66e2e7a473 add missing override and explicit specifiers to all classes in src/game (#5511) 2025-01-22 12:57:56 +00:00
RickyRister
af161f00b7 Remove spacing in CardInfoWidget caused by invisible view transformation button (#5510) 2025-01-22 12:55:21 +00:00
RickyRister
420cca2402 fix after merge to use ZoneView::close (#5509) 2025-01-20 22:43:05 -05:00
RickyRister
97fdf11c8f Add setting to auto close card view when empty (#5502) 2025-01-21 03:08:01 +00:00
RickyRister
aeb1b9fb4f Fix segfault when game is closed while card view window is open (#5507) 2025-01-21 03:06:55 +00:00
RickyRister
b004e91aa4 fix segfault when bottoming card in deck view (#5508) 2025-01-21 03:06:00 +00:00
Zach H
090cc8c144 Support more indices (#5503) 2025-01-20 01:42:24 -05:00
tooomm
0467fae51b Add label to swap button (#5501) 2025-01-19 17:26:25 +00:00
BruebachL
aa24502129 Move logging from QDebug to QCDebug and introduce LoggingCategories. (#5491)
* Move logging from QDebug to QCDebug and introduce LoggingCategories.

* Lint.

* Unlint like one change.

* Remove .debug category since this is autofilled by Qt and used to differentiate between QCDebug and QCWarning and QCError.

* Uncomment defaults, include main category.

* Make PictureLoader logging a bit more useful.

* Lint...?

* Address comments.

* Clean up some unnecessary classes in logging statements.

* Add a new message format to the logging handler.

* Lint.

* Lint.

* Support Windows in Regex

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2025-01-19 13:14:23 +00:00
BruebachL
e752578d15 Add a button to easily view the transformed version of a card. (#5498)
* Add a button to easily view the transformed version of a card.

* Minor reword

* Minor fix

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2025-01-19 12:59:53 +00:00
BruebachL
724db755af Hide load from remote button in local games (#5499)
* Hide load from remote button in local games.

* Minor fix

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2025-01-19 12:59:33 +00:00
BruebachL
ec0caaf421 Give deckList a signal to emit when the tags change and hook up the display widget to that. (#5497)
* Give deckList a signal to emit when the tags change and hook up the display widget to that.

* Reload from file when loading a visual deck to ensure latest changes propagate to the decklist.

* Eliminate loadVisualDeck and use loadDeckFromFile instead.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-19 12:32:39 +00:00
Zach H
55b490ade0 Generate PDBs for Windows Builds (#5494) 2025-01-18 07:54:01 +00:00
ZeldaZach
1392bdd258 Fix Windows 7 Crash Dump 2025-01-18 00:33:30 -05:00
Zach H
648c96ac3d Allow Moderators to Grant Replay & Activate in TabAdmin (#5492) 2025-01-18 02:23:24 +00:00
Zach H
d3a1538af3 Fix Windows Crash Reporter (#5493)
* Fix Windows Crash Reporter

* Fix NSIS template
2025-01-18 02:23:05 +00:00
RickyRister
2bc71095dd get UserListProxy from TabSupervisor instead of passing it in the constructor (#5490) 2025-01-17 15:27:52 +00:00
RickyRister
92a903b035 fix chat messages not showing in the client (#5489) 2025-01-17 03:11:13 -05:00
transifex-integration[bot]
cd373edf3d Translate cockatrice_en@source.ts in pt_BR (#5487)
100% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-17 07:41:59 +00:00
RickyRister
ca2d438cda fix sideboard not being re-locked on load deck (#5486) 2025-01-17 05:25:01 +00:00
RickyRister
c148c8df7f replace foreach macro with standard for each loop (#5485) 2025-01-17 05:18:15 +00:00
Zach H
0cbad25385 General Cleanup of Unused Assets (#5484) 2025-01-17 05:08:53 +00:00
ZeldaZach
7b94d5d501 Better sanitization of pointers 2025-01-17 00:05:08 -05:00
RickyRister
ee938342f3 Change visible buttons in game lobby depending on if deck is loaded (#5480)
* rename method

* delete unused method

* refactor

* increase margins

* change visible buttons depending on if deck is loaded

* correctly send the ReadyStart command on unload

* fix force start button still being visible
2025-01-17 04:52:33 +00:00
Zach H
cb64a5eea0 Populate TabAccount if reopened (#5483) 2025-01-17 04:28:18 +00:00
BruebachL
80165c28a9 Add options to include/exclude set name and collector number during clipboard import/export. (#5482)
* Add options to include/exclude set name and collector number during clipboard import/export.

* Missing parentheses in action label.

* Revert the silliest lint in the world.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-17 02:38:01 +00:00
ZeldaZach
315c224f24 Fix crash on add/edit tags 2025-01-16 00:54:34 -05:00
ZeldaZach
55f624b634 Hide Loading Msg in VDE when not relevant 2025-01-16 00:06:25 -05:00
ZeldaZach
82b257b589 Fix index 0 tab not functioning 2025-01-15 23:55:51 -05:00
RickyRister
a51ca9f9cb fix incorrect values in deck editor tab's views menu on init (#5479) 2025-01-16 04:06:56 +00:00
RickyRister
7e19b52926 fix tab-specific menus not present when tab is opened on startup (#5478) 2025-01-16 04:04:15 +00:00
RickyRister
2d02955f8b delete overloaded signal in PendingCommand (#5477)
* remove overloaded signal since no one was using it

* remove usages of qOverload

* turns out new slot/signal syntax can ignore extra params
2025-01-15 13:16:06 +00:00
RickyRister
3a740f0bde group printings together when sorting in card reveal window (#5476) 2025-01-15 13:14:47 +00:00
RickyRister
455d68f9ea Move UserlistProxy to src/server/user and fix capitalization (#5475)
* move file

* fix capitalization
2025-01-15 13:14:16 +00:00
RickyRister
2def02e140 Remember which tabs are open between sessions (#5467) 2025-01-15 06:10:24 +00:00
RickyRister
23bd18a04c fix segfault that happens when account tab is closed (#5474) 2025-01-15 06:10:03 +00:00
RickyRister
d09b9eb533 Rename UserList class to UserListWidget (#5473) 2025-01-15 03:07:36 +00:00
github-actions[bot]
25caae6d0f Update translation files (#5472)
Co-authored-by: github-actions <github-actions@github.com>
2025-01-14 20:28:36 -05:00
BruebachL
a717e715b6 Introduce null checks, add setShortName and collectorNumber to deckList export. (#5471)
* Introduce null checks, add setShortName and collectorNumber to deckList export.

* Lint.

* Lint again.

* Lint AGAIN.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-14 10:54:15 -05:00
BruebachL
c079715c46 Properly check if a duplicate already exists in the list, no longer break loop. (#5470)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-14 10:12:53 -05:00
BruebachL
f6c1253e84 Add a placeholder label to indicate database is still loading. (#5469)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-14 14:19:32 +00:00
BruebachL
8462b6e906 Minor fix to sorted list reconstruction to fix duplication of cards in printing selector. (#5468)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-14 13:59:53 +00:00
RickyRister
cca82f59eb Don't re-sort VisualDeckStorage every time it gets tabbed to (#5466)
* remove showEvent

* refresh cards on init

* fix sort order not immediately being set
2025-01-14 13:58:44 +00:00
RickyRister
81662b7fec Reduce spacing in visual deck storage (#5465)
* move thing

* reduce spacing
2025-01-14 13:52:46 +00:00
RickyRister
d2c2128e9b Rename TabUserLists to TabAccount (#5464)
* rename class

* rename variables
2025-01-14 13:50:08 +00:00
RickyRister
686645c1e4 refactor DeckViewContainer into own file (#5455)
* cut-and-paste

* remove some includes

* move refreshShortcuts

* move deck_view into src/game/deckview

* move deck_view_container to src/game/deckview

* fix build failure
2025-01-14 07:00:09 +00:00
ZeldaZach
9df71fe1e8 Update VCPkg 2025-01-14 01:47:05 -05:00
Zach H
6309e7e318 Fix Windows FlowWidget duplication (#5460)
- Delete the item widget right away, as the delay is too great with deleteLater
2025-01-14 04:33:21 +00:00
Zach H
767e83c879 Disable Force Start for host on load (#5462)
- Fix #5444
2025-01-14 04:33:04 +00:00
RickyRister
78d54b0ef2 Remove unnecessary deck_view.h includes (#5461)
* remove unnecessary deck_view imports

* remove some more imports
2025-01-14 04:32:53 +00:00
BruebachL
497e4f1be0 Add loadFromFileAsync to deckLoader and connect VisualDeckStorageWidget to it. (#5456)
* Add loadFromFileAsync to deckLoader and connect VisualDeckStorageWidget to it.

* Address comments.

* Lint.

* Unlint something.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-14 03:02:33 +00:00
BruebachL
6072df3522 .txt decks reportedly don't get saved when they're loaded. (#5459)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-14 01:51:41 +00:00
BruebachL
ba89495dc0 Refactor Picture Loader (#5457) 2025-01-13 18:52:54 +00:00
RickyRister
a417b049da Make Visual Deck Storage tab be managed by TabSupervisor (#5453)
* remove closeRequest override

* remove visualDeckStorage from WindowMain

* manage visual deck storage in TabSupervisor

* open on startup

* refresh vds on db load finish

* open deck editor tab first on startup
2025-01-13 18:42:58 +00:00
github-actions[bot]
883f1a5c11 Update translation source strings (#5454)
Co-authored-by: github-actions <github-actions@github.com>
2025-01-13 11:08:32 -05:00
BruebachL
dd8ac14f99 Visual deck storage v2 (#5427)
* Restore some button states (ready/sideboard locked) to sensible defaults when unloading a deck.

* Update last loaded timestamp in decklist file and then restore original last modified timestamp if a user requests a deck load.

* Add some todos.

* Loading a deck from local file dialog should swap out scenes, enable unload button.

* Lint.

* Shuffle some classes and signals around.

* More sort options, sort widgets directly.

* Banner cards should respect providerIds.

* Properly updateSortOrder on load.

* Add the color identity to the Deck Preview Widget.

* Properly set sort indices.

* Change replace visualDeckStorageWidget with deckView to be in deckSelectFinished so that it also works on remote deck load.

* Include settings for unused color identities display.

* Change opacity scaling.

* Overload for Qt.

* Lint.

* Lint.

* Include QMouseEvent

* Template because MacOs.

* Include a quick filter for color identities.

* Include a quick filter for color identities.

* Save some space.

* Refactor DeckPreviewWidgets to reside in their own folder.

* Add Deck Loader logging category.

* Introduce a tagging system.

* Add some more default tags.

* Even more default tags.

* Lint.

* Lint a comma.

* Remove extra set of braces.

* Lint some stuff.

* Refresh banner cards when tags are added.

* Lint.

* Wrestle with Qt Checkboxes.

* Lint.

* Adjust some sizes, relayout.

* Address comments.

* Lint.

* Reorder kindred types.

* Add a search bar for tags.

* Remove close button (for now) and change "Add tags ..." to "Edit tags ..."

* Retranslate window title for Deck Tag Manager Dialog.

* Style tag addition widget to be consistent.

* Lint.

* Override paintEvent.

* Override sizeHint

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-12 17:46:22 -05:00
RickyRister
9bd024d39f Make all tabs closable; add tabs menu (#5451)
* make closeRequest call close by default

* make all tabs closable by default

* closeRequest instead of deleteLater on stop

* null out pointer on destroy

* no need to manually null out the tabs anymore

* comment

* pass tabsMenu into ctor

* comment

* implement tabs menu

* fix segfault on close (again)

* remove deck editor action from WindowMain
2025-01-12 16:15:19 -05:00
transifex-integration[bot]
e4611a8616 Translate cockatrice_en@source.ts in en_US (#5452)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-12 12:41:05 -05:00
RickyRister
3f41e5dd77 don't close replay tabs and do close message tabs on disconnect (#5450) 2025-01-12 02:47:36 -05:00
RickyRister
a6fc88c79a Always set TabSupervisor as parent in Tab subclasses (#5449)
* refactor closeTab

* always set tab parent to tabSupervisor

* set tabSupervisor parent

* use close instead of deleteLater

* be more clear about overloads
2025-01-12 02:34:11 -05:00
transifex-integration[bot]
3a4ec1062b Translate cockatrice_en@source.ts in pt_BR (#5448)
100% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-11 23:41:57 -05:00
RickyRister
7347ba88ac fix segfault on disconnect (#5447)
* add new param to closeRequest

* don't emit signals in dtors

* send closeRequest

* fix build failure

* fix build failure

* see if we can get away with the overloaded triggered

* fix build failure
2025-01-11 22:19:45 -05:00
tooomm
3b544a36a8 Fix button label (#5441) 2025-01-11 21:28:23 -05:00
RickyRister
2851d0c7e6 add override specifier to tab subclasses (#5445) 2025-01-11 21:28:02 -05:00
transifex-integration[bot]
2b296badea Translate cockatrice_en@source.ts in zh-Hans (#5446)
100% translated source file: 'cockatrice_en@source.ts'
on 'zh-Hans'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-11 21:27:00 -05:00
ZeldaZach
a12c4ee909 Fix MacOS Builds for Non-Main Repo PRs 2025-01-11 21:21:11 -05:00
ZeldaZach
7db9c9115e Fix SoundEngine on Windows (again) 2025-01-11 00:19:00 -05:00
ZeldaZach
503985a080 Initialize audioOutput for SoundEngine 2025-01-11 00:12:32 -05:00
RickyRister
9f466162b0 disable starting life total edit in game information window (#5440) 2025-01-10 23:14:46 -05:00
Zach H
8bea3f8997 Fix sounds on Qt6 (#5439) 2025-01-10 23:10:47 -05:00
RickyRister
1a3df84f0a fix segfault on exit if any closable tabs were open (#5435) 2025-01-10 17:27:26 -05:00
Zach H
2b3c47148e GHA MacOS Only Sign/Notarize if self repo (#5437) 2025-01-10 16:46:05 -05:00
transifex-integration[bot]
59ca4397e2 Translate oracle/oracle_en@source.ts in zh-Hans (#5436)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'zh-Hans'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-10 08:22:58 -05:00
transifex-integration[bot]
98266b0739 Translate oracle/oracle_en@source.ts in yue (#5434)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'yue'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-10 08:22:48 -05:00
Zach H
5a82ff106d Update VCPkg (#5433) 2025-01-09 23:23:00 -05:00
Zach H
2194430019 Sign macOS Releases (#5396) 2025-01-09 22:32:53 -05:00
RickyRister
1f11015a2f Refactor files in src/utility and src/deck to new Qt Slot/Signal syntax (#5432)
* refactor in src/utility

* refactor in src/deck

* fix build failure
2025-01-09 06:33:20 -05:00
RickyRister
c3421669d5 Refactor files in src/game to new Qt Slot/Signal syntax (#5431)
* fix signals in CardDatabaseParser

* update remaining signals

* cleanup

* wait this was always just broken

* fix build failure

* fix build failure

* fix build failure
2025-01-09 06:32:25 -05:00
RickyRister
6e8adddc6d Refactor tab_supervisor to new Qt Slot/Signal syntax (#5430)
* Refactor tab_supervisor to new Qt Slot/Signal syntax

* fix build failure
2025-01-09 06:26:42 -05:00
RickyRister
22a6ded4f0 reduce vertical spacing in visual deck storage (#5422) 2025-01-09 06:25:40 -05:00
transifex-integration[bot]
0d7669db2c Translate cockatrice_en@source.ts in yue (#5428)
100% translated source file: 'cockatrice_en@source.ts'
on 'yue'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-08 19:23:49 -05:00
transifex-integration[bot]
9526bca168 Translate cockatrice/cockatrice_en@source.ts in de (#5429)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-08 19:23:38 -05:00
transifex-integration[bot]
0683431f35 Translate cockatrice_en@source.ts in en_US (#5426)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-06 17:31:14 -05:00
github-actions[bot]
70790264b8 Update translation source strings (#5425)
Co-authored-by: github-actions <github-actions@github.com>
2025-01-06 12:42:46 -05:00
transifex-integration[bot]
c8a68c83e3 Translate cockatrice_en@source.ts in yue (#5424)
100% translated source file: 'cockatrice_en@source.ts'
on 'yue'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-06 12:38:58 -05:00
RickyRister
23171f79d0 Refactor window_main to new Qt Slot/Signal syntax (#5423) 2025-01-06 12:38:44 -05:00
RickyRister
b7f05a12a3 get swap cards button to work with multi-selections (#5421) 2025-01-05 22:44:40 -05:00
Zach H
6078dd092a Support viewing the bottom X cards of library (#5410)
* Get cardIds to update properly in bottom view (#5414)

* Get bottom view to update properly when card is inserted into known portion (#5415)

---------

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
2025-01-05 21:17:18 -05:00
BruebachL
81b85e97df Extend decklist parsing (#5316)
* Extend the decklist parsing from clipboard to also support SetName, CollectorNumber and Foil Status.

* Q_UNUSED foil for now but keep parsing logic for future PR's/compatibility.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-05 21:07:17 -05:00
RickyRister
cc16b8779c improve shortcut search to split by word (#5416) 2025-01-05 19:19:00 -05:00
BruebachL
62f7c7f9ce New visual deck storage (#5290)
* Add TabDeckStorageVisual

* Visual Deck Storage

* Add BannerCard to .cod format, use it in the visual deck storage widget.

* Show filename instead of deckname if deck name is empty.

* Lint.

* Don't delint cmake list through hooks.

* Add deck loading functionality.

* Open Decks on double click, not single click.

* Void event for now.

* Fix build issue with overload?

* Fix build issue with overload?

* Include QDebug.

* Turn the tab into a widget.

* Move the signals down to the widget, move the connections and slots up to the parent widgets.

* No banner card equals an empty CardInfoPtr.

* Add an option to sort by filename or last modified.

* Flip last modified comparison.

* Lint.

* Don't open decks twice in the storage tab.

* Fix unload deck not working by showing/hiding widgets instead of adding/removing to layout.

* Add a search bar.

* Add a card size slider.

* Lint.

* Lint.

* Lint.

* Fix settings mocks.

* No need to QDebug.

* No need to QDebug.

* Member variable.

* Member variable.

* Non-lambda.

* Change set to list conversion.

* Specify overload.

* Include MouseEvent

* Adjust font size dynamically.

* Add an option to show the visual deck storage on database load.

* Fix the close button not working on the tab, add an option to launch the visual deck storage tab to Cockatrice menu.

* Override virtual functions.

* Correct tab text.

* Add a setting to remember last used sorting order for visual deck storage widget.

* Update banner card combo box correctly.

* Fix mocks.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-01-05 18:12:20 -05:00
BruebachL
7496e79e8c Add a button to swap the card between mainboard and sideboard to the DeckEditor (#5175)
* Add a button to swap the card between mainboard and sideboard to the deck editor.

* Add new icon to cockatrice.qrc and force update.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-05 17:57:37 -05:00
RickyRister
b8cf3e2cab add ctrl enter as shortcut for ok in load deck from clipboard (#5417) 2025-01-05 17:41:03 -05:00
RickyRister
93fab3d78f Remember last opened directory when loading decks (#5418)
* remember last directory when loading deck

* move shared code into new dlg class
2025-01-05 17:40:20 -05:00
BruebachL
9c38c9ed1b Differentiate logging in order to silence certain modules. (#5419)
* Differentiate logging in order to silence certain modules.

* Lint cmake.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-05 17:38:51 -05:00
RickyRister
38e99f2e87 implement /card command (#5413) 2025-01-04 02:07:43 +00:00
RickyRister
68226786a2 don't redraw PrintingSelector's FlowWidget unless cards actually changed (#5392) 2025-01-04 01:49:54 +00:00
RickyRister
455cd9717a add menu action to open settings folder (#5412) 2025-01-04 01:49:41 +00:00
RickyRister
fa79c5c36a populate default debug.ini with more values (#5411)
* populate default debug.ini with more values

* move the default debug.ini to a resource
2025-01-03 20:50:30 +00:00
RickyRister
0402d4b853 add debug setting to load deck and ready on join (#5409)
* new property

* refactor deck loading to new method

* another new method

* works now
2025-01-02 17:08:51 -05:00
RickyRister
8a427955e7 Add debug setting to start local game on startup (#5408)
* new properties

* refactor

* start local game on startup

* disable autoconnect
2025-01-02 09:51:59 -05:00
RickyRister
bb4214e28a Make SettingsManager params const ref (#5405)
* pass settingsPath by const ref

* pass params by const ref

* cleanup
2025-01-02 00:33:37 -05:00
RickyRister
f924b04efd add debug settings; option to show cardIds (#5404)
* add debug settings; option to show cardIds

* pass param by const ref

* change group structure again

* create debug.ini if not exists
2025-01-02 00:32:58 -05:00
transifex-integration[bot]
62f60867a9 Translate cockatrice_en@source.ts in pt_BR (#5407)
100% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-02 00:32:29 -05:00
transifex-integration[bot]
b5844f1244 Translate cockatrice/cockatrice_en@source.ts in it (#5406)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-01-01 22:28:42 -05:00
ryder052
8c0093d453 Crashfix for opening Deck editor (#5403)
* CardDatabase::getCards() no longer copies the whole database

---------

Co-authored-by: Jakub Mrowinski <ryder052@outlook.com>
2025-01-01 19:25:04 -05:00
RickyRister
34df4cd060 support multi-select in deck editor (#5397)
* support multiselect in deck editor

* fix crash

* don't reset selection after each action

* maintain old reselecting behavior when changing cards from left side

* fix crash for real (probably)

* maintain reselection behavior when deleting single selection
2025-01-01 00:43:47 -05:00
Zach H
99eea3a662 Improve Database Backup Speed (#5400)
* Support better indexes for Servatrice

- Prevent searching only on msg for logs
2025-01-01 00:28:57 -05:00
Zach H
6e1047032d Keep card annotations on stack (#5399) 2024-12-31 14:08:25 -05:00
transifex-integration[bot]
b2a8748bc6 Translate cockatrice/cockatrice_en@source.ts in it (#5398)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-31 13:57:14 -05:00
transifex-integration[bot]
ded6d5b8eb Translate cockatrice/cockatrice_en@source.ts in de (#5395)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-30 19:18:00 +00:00
transifex-integration[bot]
832842c20c Translate cockatrice_en@source.ts in en_US (#5394)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-30 17:42:32 +00:00
github-actions[bot]
b43e4ae469 Update translation source strings (#5393)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-30 12:38:30 +00:00
Zach H
026afeb885 Support auto-reconnect for Servatrice (#5391)
- Fix #5022
2024-12-30 04:35:32 +00:00
RickyRister
b6793a5e01 fix cards having the wrong printing if rejoin game before card db finishes loading (#5390)
* rename cardInfoUpdated to refreshCardInfo and make it public

* refresh card infos when db finishes loading
2024-12-30 03:25:11 +00:00
moryall
d231264a16 Update Dockerfile Ubuntu version to newest LTS (#5108)
* Update Dockerfile to non-outdated Ubuntu version

1. Updated image to jammy as it is still in it's LTS window. Didn't go with 24.04/Noble as it released after latest version of cockatrice released.
2. Had to add new ARG
3. No qt5-default library, so replaced with qt5-qmake

* Update Dockerfile

Upped from Jammy -> Noble
Upped from Qt5 -> Tt6

* Update Dockerfile - new port

Added Port 4748 for new features

* Update Dockerfile

Changed Noble - > 24.04

* indentation

* remove unused dependencies

---------

Co-authored-by: tooomm <tooomm@users.noreply.github.com>
2024-12-30 01:54:18 +00:00
ryder052
6e02bdec2e Fix crash on replay list sorting, fix error popups on win debug (#5388)
* Fix annoying popups on start

* Fix replay list item parent index calculation #5311

---------

Co-authored-by: Jakub Mrowinski <ryder052@outlook.com>
2024-12-30 01:10:12 +00:00
transifex-integration[bot]
cfaadc40b1 Translate cockatrice_en@source.ts in pt_BR (#5386)
100% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-30 00:57:51 +00:00
transifex-integration[bot]
93475b43a5 Updates for project Cockatrice and language it (#5387)
* Translate cockatrice/cockatrice_en@source.ts in it

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'it'.

* Translate webclient/src/i18n-default.json in it

100% translated source file: 'webclient/src/i18n-default.json'
on 'it'.

* Translate oracle/oracle_en@source.ts in it

100% translated source file: 'oracle/oracle_en@source.ts'
on 'it'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-30 00:57:43 +00:00
RickyRister
3348e051a1 update recently opened decks when saving a new deck (#5389) 2024-12-30 00:57:31 +00:00
Zach H
dad1aea128 Show correct art on middle mouse popup (#5385) 2024-12-29 23:24:32 +00:00
Zach H
dec001114a Clone now clones the exact printing, when possible (#5384) 2024-12-29 23:24:20 +00:00
ZeldaZach
1ce7b9f7de Update number when 'Reveal top cards of library' used 2024-12-29 16:31:13 -05:00
Zach H
2ff99f12d8 Require Admin Permissions to install Cockatrice Windows (#5383)
Fix #5382
2024-12-29 16:22:39 +00:00
tooomm
6679705254 Simpler naming (#5381) 2024-12-29 15:41:30 +00:00
transifex-integration[bot]
7eafac5b1a Translate cockatrice_en@source.ts in en_US (#5377)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-29 07:11:02 +00:00
RickyRister
ac3aa949ad add "view related cards" right click menu to card info widget (#5375) 2024-12-29 06:11:12 +00:00
Zach H
b4036c8671 Disable CardMenu iff no items selected (#5376)
- Fix #4372
2024-12-29 06:10:27 +00:00
github-actions[bot]
4e0de1c066 Update translation source strings (#5373)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-29 03:37:53 +00:00
RickyRister
f32890916d don't disable autoconnect on disconnect (#5372)
* don't disable autoconnect on disconnect

* update autoConnect on clicking the checkbox
2024-12-29 03:07:00 +00:00
Zach H
24a0dac420 Fix Windows Portable Crash (#5371) 2024-12-29 03:02:52 +00:00
RickyRister
716bc00533 fix "forgot password" closing connection dialogue on cancel (#5369) 2024-12-29 02:23:58 +00:00
Zach H
32dd18998d Combine card legalities in Oracle (#5370)
- Some printings have different legalities, which cause Oracle to bug out
- Fix #4783
2024-12-29 02:23:39 +00:00
ZeldaZach
5e62069444 Fix Windows Crash due to nullptr 2024-12-28 21:02:10 -05:00
Zach H
bf63dc4ab7 Add option to remove saved sever (#5368)
* Add option to remove saved sever

- Fix #4099
- Removes old method that didn't work
2024-12-29 00:37:49 +00:00
Danny Piper
7679546e30 Add Nix shell (#5362) 2024-12-28 23:52:57 +00:00
Zach H
45b11dc984 Add password reset button label (#5367) 2024-12-28 23:52:14 +00:00
RickyRister
25d21a3da6 refactor: remove ReleaseChannel keeping track of its own indexes (#5366) 2024-12-28 23:51:37 +00:00
Zach H
c8d49b5bf9 Support macOS-15 Builds (#5364) 2024-12-28 23:09:01 +00:00
RickyRister
f737d9a794 fix bug with release channel setting not being remembered (#5365) 2024-12-28 23:08:07 +00:00
RickyRister
df9c5ae53c Check for client updates on startup (#5359) 2024-12-28 21:29:59 +00:00
transifex-integration[bot]
e0829a75d2 Translate cockatrice/cockatrice_en@source.ts in it (#5363)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-28 21:01:34 +00:00
Zach H
1f58f7e93d Support Mod/Admin Notes Section (#5361) 2024-12-28 18:05:49 +00:00
transifex-integration[bot]
14807ba036 Translate oracle/oracle_en@source.ts in pl (#5360)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'pl'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-28 15:31:16 +00:00
transifex-integration[bot]
75fb3894a6 Translate oracle/oracle_en@source.ts in pt_BR (#5358)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-28 12:08:58 +00:00
github-actions[bot]
18119bd11b Update translation source strings (#5357)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-28 06:33:57 +00:00
RickyRister
4c7796537f Support folder download in deck storage tab (#5356)
* refactor

* support folder download
2024-12-28 06:31:18 +00:00
RickyRister
3452cb01d0 fix replay download not working if replay folder is empty (#5355)
* fix downloading single replays

* fix downloading replay folder
2024-12-28 06:15:25 +00:00
RickyRister
6a151ef97a Add button to open decks folder (#5354) 2024-12-28 05:09:46 +00:00
RickyRister
e3d651668c Add button to open replays folder (#5352) 2024-12-28 05:06:26 +00:00
Zach H
7a5704beaa Support Moderator/Admin force activating users (#5353) 2024-12-28 05:01:31 +00:00
RickyRister
37b78a9a4c change action's text to "unconcede" when player is conceded (#5351) 2024-12-28 00:01:36 +00:00
Zach H
8bc5a9d581 Merge pull request #5350 from Cockatrice/fix_1953
Allow Moderators/Admins to Grant Replay Access
2024-12-27 18:51:11 -05:00
ZeldaZach
57ed162b79 Fix Linter 2024-12-27 18:35:52 -05:00
ZeldaZach
3524231500 Allow Moderators/Admins to Grant Replay Access
- Only to themselves, at this time
- Automatically refreshes feed, no need to re-login
2024-12-27 18:32:39 -05:00
Zach H
5cfe2b4762 Merge pull request #5348 from Cockatrice/set_owner
Establish Card Ownership & Return on Player Leave
2024-12-27 18:26:45 -05:00
ZeldaZach
a8bac1e468 Return Tagged Cards to Owner, if possible, on concede/leave 2024-12-27 18:23:39 -05:00
ZeldaZach
4f798286af Establish Card Ownership Tag 2024-12-27 18:23:09 -05:00
transifex-integration[bot]
8a04b2d69d Translate cockatrice/cockatrice_en@source.ts in de (#5349)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-27 22:26:03 +00:00
transifex-integration[bot]
17893d9747 Translate oracle/oracle_en@source.ts in it (#5347)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-27 20:13:57 +00:00
ZeldaZach
8af49406cd Un-translate 'ms' 2024-12-27 14:18:44 -05:00
transifex-integration[bot]
3b068b79fe Translate webclient/src/i18n-default.json in fr (#5346)
100% translated source file: 'webclient/src/i18n-default.json'
on 'fr'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-27 08:36:06 +00:00
transifex-integration[bot]
ce14e83e78 Translate webclient/src/i18n-default.json in es (#5345)
100% translated source file: 'webclient/src/i18n-default.json'
on 'es'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-27 08:35:58 +00:00
transifex-integration[bot]
f213d6fda7 Translate cockatrice_en@source.ts in en_US (#5344)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-27 08:35:48 +00:00
RickyRister
83db00d7a3 reduce vertical spacing in PrintingSelector (#5342) 2024-12-27 08:35:38 +00:00
ZeldaZach
7e9bd88eb4 Fix Shutdown Server 2024-12-27 01:38:21 -05:00
github-actions[bot]
ea716ca440 Update translation source strings (#5343)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-27 06:19:12 +00:00
ZeldaZach
3cd7a04002 Change Settings from Min to Base Size 2024-12-26 23:54:24 -05:00
RickyRister
914002f846 use grid instead of FlowWidget for PrintingSelector display options (#5341)
* use grid instead of FlowWidget for PrintingSelector display options

* remove one level of nesting
2024-12-27 02:08:07 +00:00
Zach H
17b82a186f Add QSet for faster lookups in CardDatabase (#5332) 2024-12-26 19:52:18 -05:00
RickyRister
7a8e957476 allow playing cards directly transformed from hand (#5339) 2024-12-26 19:51:58 -05:00
Zach H
6dfd354973 Support starting games with fewer than max players (#5338) 2024-12-26 18:32:20 -05:00
RickyRister
956c12eb32 remove shortcut workaround; always add card menu to player (#5337)
* remove workaround

* make aCardMenu less innocuous

* make card menus active for all players
2024-12-26 16:49:17 -05:00
RickyRister
d5ae4eed26 Ctrl drag now adds/removes to selection (#5336)
* refactor: clean up to use for-each loop

* track cards in rect so far and toggle isSelected on change

* only clear selection if ctrl isn't held

* fix build errors
2024-12-26 15:08:20 -05:00
RickyRister
ca486e5ed9 Don't display unusable actions in opponent's card menus (#5335) 2024-12-26 10:23:54 -05:00
RickyRister
de63066b0b fix deck storage open deck not working at all when folder is in selection (#5333) 2024-12-26 00:25:30 -05:00
Zach H
c7ca55ceb5 Support Picking Select Art per Card Basis (#5329) 2024-12-25 23:12:06 -05:00
RickyRister
024bef7ded add local rename button to replays tab (#5331) 2024-12-25 22:34:24 -05:00
RickyRister
34d3d60f95 fix text missing from chat macro list's buttons when hidden (#5330)
* fix text missing from chat macro list's buttons when hidden

* turns out you don't need to set tooltip if you already set text
2024-12-25 22:32:53 -05:00
RickyRister
ed907d7c6f Support downloading replay folders (#5325)
* rename old get replay match method to get enclosing

* creat raw getReplayMatch method

* implement thing
2024-12-25 07:33:36 -05:00
RickyRister
9d7fd66546 fix text missing from download url list's buttons when hidden (#5326) 2024-12-25 07:29:55 -05:00
RickyRister
9934841950 make better use of space in download url settings window (#5327) 2024-12-25 07:29:27 -05:00
RickyRister
432fe1100b gitignore all cmake-build folders (#5328) 2024-12-25 07:28:41 -05:00
Zach H
d987628935 Reorder String options for Filtering (#5324) 2024-12-25 00:58:59 -05:00
RickyRister
4c3ceae0e4 open replays on double-click in replays tab (#5323) 2024-12-25 00:34:43 -05:00
RickyRister
2b9d7538bf open decks on double-click in deck storage tab (#5322) 2024-12-25 00:33:48 -05:00
RickyRister
4ca1fc083d add "open recent" menu option to deck editor tab (#5319)
* add "open recent" menu option to deck editor tab

* change texts

* also get it to work with loading from deck storage tab

* add error message when fail to open

* only update recents on successful open

* only update recents on successful open

* reword to "Clear"
2024-12-24 19:55:04 -05:00
BruebachL
e7585271fb The printingSelector should set the deckEditor modified flag on adding/removing cards. (#5321)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-12-24 10:28:58 -05:00
RickyRister
6e6824117d add new folder button to local deck storage tab (#5318)
* add new folder button to local deck storage tab

* allow delete button to delete folders
2024-12-24 00:26:11 -05:00
RickyRister
3e5f2fd8b2 add new folder button to game replays tab (#5317) 2024-12-24 00:23:13 -05:00
RickyRister
6e470d788e Support multi-select for remote decks in deck storage tab (#5315)
* enable multiselection

* support multi open deck

* support multi download

* support multi delete
2024-12-24 00:05:49 -05:00
RickyRister
a40d8092ce support multi-select for local decks in deck storage tab (#5314)
* allow multi-select

* support multi upload

* support multi open deck

* support multi delete deck
2024-12-23 20:41:15 -05:00
RickyRister
0234a70bfd fix bug with uploading unnamed decks ignoring the prompt (#5313) 2024-12-23 20:39:57 -05:00
RickyRister
705b1e0c2b support multi-select for remote replays in game replays tab (#5310) 2024-12-23 20:38:47 -05:00
RickyRister
69379334f9 support multi-select for local replay tab (#5309) 2024-12-23 20:31:58 -05:00
transifex-integration[bot]
12e50a1f2f Translate cockatrice_en@source.ts in en_US (#5308)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-23 20:30:17 -05:00
RickyRister
ec17a477be shortcut search now displays all rows in section (#5307) 2024-12-23 20:29:52 -05:00
github-actions[bot]
205e1c7a59 Update translation source strings (#5305)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-22 18:35:34 -05:00
transifex-integration[bot]
ffb60c06cb Translate oracle_en@source.ts in en@pirate [Manual Sync] (#5295)
4% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'en@pirate'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:01:02 -05:00
transifex-integration[bot]
2280f59ee6 Translate i18n-default.json in nl [Manual Sync] (#5297)
19% of minimum 3% translated source file: 'i18n-default.json'
on 'nl'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:00:44 -05:00
transifex-integration[bot]
0d4dd63edc Translate i18n-default.json in es [Manual Sync] (#5299)
99% of minimum 3% translated source file: 'i18n-default.json'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:00:39 -05:00
transifex-integration[bot]
69f1f4c1a5 Translate i18n-default.json in fi [Manual Sync] (#5301)
13% of minimum 3% translated source file: 'i18n-default.json'
on 'fi'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:00:35 -05:00
transifex-integration[bot]
d930d9c237 Updates for project Cockatrice and language tr (#5296)
* Translate oracle_en@source.ts in tr [Manual Sync]

36% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'tr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate cockatrice_en@source.ts in tr [Manual Sync]

6% of minimum 3% translated source file: 'cockatrice_en@source.ts'
on 'tr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:00:31 -05:00
transifex-integration[bot]
9c782d130f Translate i18n-default.json in pt_BR [Manual Sync] (#5298)
100% translated source file: 'i18n-default.json'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:00:13 -05:00
transifex-integration[bot]
f12053f39d Translate i18n-default.json in de [Manual Sync] (#5300)
100% translated source file: 'i18n-default.json'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 18:00:05 -05:00
transifex-integration[bot]
bcf6ca4f87 Translate i18n-default.json in fr [Manual Sync] (#5302)
99% of minimum 3% translated source file: 'i18n-default.json'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 17:59:55 -05:00
transifex-integration[bot]
46619bb425 Translate i18n-default.json in ru [Manual Sync] (#5303)
14% of minimum 3% translated source file: 'i18n-default.json'
on 'ru'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 17:59:46 -05:00
transifex-integration[bot]
cdd870a129 Translate i18n-default.json in en_US [Manual Sync] (#5304)
100% translated source file: 'i18n-default.json'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 17:59:35 -05:00
transifex-integration[bot]
7a1b7b9438 Updates for project Cockatrice and language it (#5294)
* Translate cockatrice_en@source.ts in it [Manual Sync]

99% of minimum 3% translated source file: 'cockatrice_en@source.ts'
on 'it'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate i18n-default.json in it [Manual Sync]

100% translated source file: 'i18n-default.json'
on 'it'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 17:59:24 -05:00
transifex-integration[bot]
2183ada1f2 Translate oracle_en@source.ts in cs [Manual Sync] (#5293)
3% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'cs'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-22 17:58:35 -05:00
Zach H
1d9e64ec73 Fix settings dialog tr (#5292) 2024-12-22 17:39:43 -05:00
Zach H
5339be318e Fix "ghosting" of cards sticking on invalid moves (#5289) 2024-12-22 17:35:44 -05:00
Zach H
e1ba39c437 Fix multiple "Selected Cards" in Menu on MacOS (#5288) 2024-12-22 04:33:09 +00:00
BruebachL
07ee271478 Refactor codebase to new Qt Slot/Signal syntax - Pt1 (#5202)
---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2024-12-22 02:01:17 +00:00
RickyRister
4823cce622 Show conflicting shortcut in error message (#5287) 2024-12-22 01:58:55 +00:00
Zach H
23099f7e8b Fix token name highlight on open (#5286) 2024-12-22 01:43:00 +00:00
RickyRister
5bdbd51fa8 implement search bar in shortcuts menu (#5285)
* implement search bar in shortcuts menu

* remove unneeded imports

* use expandAll
2024-12-22 00:21:53 +00:00
BruebachL
a0e5871c6e Fix the image shrinking due to repeated scaling and FP precision loss. (#5284)
* Fix the image shrinking due to repeated scaling and FP precision loss.

* Add a setting for auto-rotating sideways layout cards.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-12-21 22:47:43 +00:00
RickyRister
3cf0904651 add action to select all cards in table row (#5280) 2024-12-21 18:52:19 +00:00
Zach H
2bd06ff0fd Add CrashDump support for Windows OS (#5282) 2024-12-21 18:52:07 +00:00
RickyRister
6ea333d0f1 move SearchLineEdit into custom_line_edit file (#5281) 2024-12-21 05:12:14 +00:00
Zach H
91d2485940 Update PegLib, Fix Database Searching CFG (#5244)
* Support C++20 Standard

* Update peglib.h

* Fix lambdas

* Move from for loops to std::any/all_of

* Support fixed CFG

* Fix Rarity Search to be more accurate
2024-12-21 03:37:08 +00:00
RickyRister
0d99b2bcf4 make unattach shortcut always active (#5278) 2024-12-20 05:56:48 +00:00
RickyRister
a54a424f84 add action to select all cards in column (#5277)
* add action to select all cards in column

* change default shortcut to Ctrl+Shift+C
2024-12-20 03:39:17 +00:00
RickyRister
3514699f5b check that target card is in play before attaching (#5275) 2024-12-19 23:55:04 +00:00
RickyRister
d196988cab allow attached cards to be moved to other zones (#5276) 2024-12-19 23:53:48 +00:00
BruebachL
03aff83135 Add the ability to define starting life total during game creation. (#5174)
* Have the server respect gameType info when setting up zones.

* ServerPlayer::setupZones is now passed the room->getGameTypes();
* ServerPlayer::setupZones now checks if the GameType String includes "Commander" and then sets the life total to 40 instead.

* Formatting.

* Remove debug logging imports.

* Move game option value declarations to dlg_create_game.

* Lint.

* Fix mocks.

* Add a default for backwards compatibility.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-12-19 23:52:47 +00:00
RickyRister
17e6bfaca6 fix bug with multi-attach sometimes only attaching one card (#5272) 2024-12-19 13:38:57 +00:00
Zach H
90281262be Revert "Revert "Rotate split cards (#5264)" (#5269)" (#5273)
This reverts commit d41aa30e10.
2024-12-19 13:25:54 +00:00
RickyRister
5bbc118920 fix bug introduced in #5267 (#5270)
* fix bug introduced in #5267

* remove default args to prevent similar bugs in the future

* add newInstance overload with default properties
2024-12-19 13:17:09 +00:00
ZeldaZach
dde2f8b9ad Bump Win Qt6 6.5.3->6.6.*
- Fix #4968
2024-12-19 01:09:04 -05:00
Zach H
d41aa30e10 Revert "Rotate split cards (#5264)" (#5269)
This reverts commit a5c509981b.
2024-12-19 06:03:48 +00:00
RickyRister
231d0380a7 reword "open deck in new tab" setting (#5268) 2024-12-19 05:52:40 +00:00
BruebachL
a5c509981b Rotate split cards (#5264) 2024-12-19 04:13:45 +00:00
Zach H
71b01e6110 ADD landscapeOrientation field (#5267) 2024-12-19 03:52:34 +00:00
RickyRister
c716f85962 refactor: remove cipt param from Player::playCard (#5266) 2024-12-19 02:46:14 +00:00
BruebachL
245d51caea New printing selector (#5182)
* Squashed Commits

Lint things.

Set focus back to deckView after selecting a card to enable keyboard navigation.

Bump scrollbar to top when selecting a new card.

Update card info on hover.

Layout cleanups

Add +- to buttons.

Merge buttons into card picture.

Cleanup size, min 2 cards by default in rows

Support layout settings config and set min to 525 so two cols are visible by default for printings, when opened

Move Printing Selector to before Deck, and visible true

Null safety for setCard.

Turn down the dropshadow a little.

Make PrintingSelector dockable, don't duplicate sets when bumping them to the front of the list.

When swapping cards between mainboard and sideboard, use preferred printing if no uuid is available (i.e. null).

Reorder includes...

Unwonk an include.

Give the card widget a snazzy drop shadow, appease the linter gods.

Handle jumping between segments

Remember scale factor when initializing new widgets.

Cleanup

Select Card works (Not M->SB tho)

Resize word-wrapped label properly.

Fix the layouting, mostly.

remove tx

Build Fix

Squashed Commits

Load and store redirects properly.

Layouting is fun :)

* Group PrintingSelectorCardDisplayWidgets into distinct containers for alignment purposes.

Override resizeEvent() properly.

Word wrap properly.

Keep widget sizes uniform for aesthetic reasons (grid pattern).

Label stuff, center card picture widget, allow cardSizeSlider to scale down.

Replace cards which have no uuid in the decklist when first selecting a printing.

Add buttons for previous and next card in DeckList.

Add a card size slider.

Move sort options initialization to implementation file.

Explicitly nullptr the parent for the PrintingSelector.

Address PR comments (minor cleanups).

Hook up to the rows removed signal to update card counts properly.

Include QDebug.

Add labels to the mainboard/sideboard button boxes.

Implement a search bar.

Expand node recursively when we add a new card.

Only create image widgets for the printing selector if it is visible in order to not slow down image loading.

Minor Tweaks

Invert decklist export logic to write out setName, collectorNumber, providerId value if it is NOT empty.

Linting.

Update CardCounts properly, update PrintingSelector on Database selection.

Initialize sideboard card count label properly.

Split mainboard/sideboard display and increment/decrement buttons.

Add button to sort all sortOptions by ascending or descending order.

Add option to sort by release date in ascending or descending order.

Add PrintingSelector to database view.

Display placeholder image before loading.

Fix deckEditor crash on mainboard/sideboard swap by correcting column index to providerId instead of shortName.

Include currentZoneName, fix the column when updating from DeckView indexChanged to be UUID and not setShortName so cards are properly fetched again.

The most minor linter change you've ever seen.

Null checks are important.

Linter again.

Linter and refactor to providerId.

Sort properly, (We don't need a map, we need a list, a map won't be ordered right [i.e. 1, 10, 11, 2, 3, 4, ..., 9])

Sort alphabetically or by preference.

Hook printingSelector up to the CardInfoFrameWidget.

Allow info from CardFrame to be retrieved, properly initialize PrintingSelector again.

Refactors to reflect CardInfoPicture becoming CardInfoPictureWidget.

Make PrintingSelector re-usable by introducing setCard().

Make PrintingSelector use the CardFrame, not the database index.

Add a new selector widget for printings.

* Support multiple <set> tags per card within the database

This will allow us to show off all different printings for cards that might appear multiple times in a set (alt arts, Secret Lairs, etc.)

* Support Flip Cards with related art

* Minor Cleanup

* Minor Cleanup

* Release Date DESC default

* Load widgets in batches.

* Refactor local batch variables to be class variables/defines.

* Clear timer on updateDisplay.

* Fix Timer & Builds on Qt5

* Not Override

* Yes Override

* Yes Override

* Lint

* Can't override in function definition.

* Resize setName to picture width on initialization.

Also add a new signal to card_info_picture_widget to emit when the scale factor changes.

Hook this up to the setName resizing method to ensure card size updates trigger it appropriately after initialization.

Clean up unused enter and resize methods that just delegated to base-class.

* Add ability to force preferred set art to be loaded for every card.

* Show related cards from printing selector by right-clicking card image.

* fix build

* Fix UST cards

* Inc QDebug

* Fix Qt5 Builds

* Fix Qt5 Builds

* Fix Qt5 Builds

* Fix Qt5 Builds

* Fix Qt5 Builds

* Fix cards being able to jump between side and mainboard

* Don't hide PrintingSelector button widgets if the deck contains a card from the set.

* Update PrintingSelector properly on DeckListModel::dataChanged

* Add option to disable bumping sets to the front of the list if the deck contains cards from the set.

* Linter behave.

* Linter behave.

* Fix mocks.

* Fix cards without providerIds being counted for all cards.

* Flip preference sort so descending means "Most to least preferred".

* Set the index correctly when removing a non-providerId printing for a providerId printing to avoid jumping to the next card.

* Move the "Next/Previous" card buttons to their own widget.

* Move the card size slider to its own widget.

* Lint the makelist.

* Linter

* Crash fix

* Move the sorting options to their own widget.

* Move the search bar to its own widget.

* Minor cleanup

* Minor cleanup

* Minor cleanup

* Only overwrite card in deck if UUID _and_ Number missing

* Adjust font size when adjusting card size.

* Clean up some imports.

* Pivot to a view options toolbar.

* Persist sort options and change default to 'preference'.

* Lint.

* Remember how many cards were originally in deck when replacing with uuid version.

* Relabel buttons for clarity.

* Fix tests.

* Fix tests properly.

* Fix dbconverter mock.

* Try to wrangle font sizes.

* Update mainboard/sideboard labels correctly.

* Initialize button sizes correctly.

* Label texts are supposed to be white.

* Adjust another deckModel->findCard call to include number parameter.

* Style buttons again.

* Negative currentSize means we don't render the widget yet, return a default value.

* Clean up debug statements.

* Boop the mainboard/sideboard label and the cardCount after a little bit of delay to make sure they initialize at the right size.

* Persist card size slider selection in SettingsCache.

* Good Lint Inc.

* updateCardCount to get white color in initializer

* Make the view display options functional.

* Comment ALL the things.

* Lint the things.

* Brief accidentally nuked some constants.

* Proper Qt slot for checkboxes.

* Don't use timers, Qt provides ShowEvent for anything necessary before the widget is shown.

* Cleanup from Reading

* Cleanup Lints

* Minor

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach Halpern <zahalpern+github@gmail.com>
2024-12-19 02:40:34 +00:00
RickyRister
e588917f6c don't snap already-expanded cardview windows (#5265) 2024-12-19 02:27:40 +00:00
RickyRister
27e5d21b6b fix bug with scrollbar resizing (#5263) 2024-12-18 05:16:47 +00:00
RickyRister
b894b75e6a add clone action to card menu in all zones that it functions in (#5259) 2024-12-18 04:48:06 +00:00
RickyRister
116397cdb3 add option to auto-play "put top card on stack until" hits (#5258)
* rename variables

* implement feature

* readd null check
2024-12-18 04:47:49 +00:00
RickyRister
a6b5abf271 clicking to play can now play all selected (#5254)
* play action now applies to all selected cards

* check card zone before applying action

* fix bug with wonky play from deck

* refactor

* don't play card if it's already on table

* add new setting

* make actPlay and friends public

* implement thing

* refactor card_item
2024-12-18 04:43:17 +00:00
RickyRister
fd5a649246 fix clone shortcut not working on opponent's cards (#5251)
* implement fix

* fix nullptr bug

* also add the selectAll action to the always active shortcuts
2024-12-18 04:41:12 +00:00
RickyRister
e8e57989ba Reload card database action now also reloads the download urls (#5262)
* add sync method to SettingsManager

* sync download urls on reload card database
2024-12-18 04:39:58 +00:00
RickyRister
03db4ccce6 ability to directly attach from other zones (#5250)
* add attach and draw arrow actions to more card menus

* implement attaching from other zones

* disallow attaching from deck

* do nothing if target is already attached

* add null check
2024-12-18 04:38:22 +00:00
RickyRister
c9d5d5609c Double click to untap works when multi-zone select (#5253) 2024-12-17 03:58:25 +00:00
RickyRister
ac16206ddb Add action to select all cards in zone (#5246)
* rip shortcut for aDrawArrow

* implement thing

* add separator below hide

* shorten text by 1 word

* move shortcut to under Playing_Area

* rebind draw arrow shortcut to Alt+A

* remove auto hotkey

* shorten to "Select All"

* add back auto-hotkey
2024-12-16 03:55:47 +00:00
RickyRister
5f8bcbd02d Add keyboard shortcut for "hide" action (#5248)
* implement hide shortcut

* remove parens
2024-12-15 20:34:33 +00:00
RickyRister
a0f74134bb make card view window max initial height configurable (#5236) 2024-12-14 03:02:00 +00:00
Zach H
0463a6fd70 Support Windows Debug Builds (#5242) 2024-12-13 21:58:46 +00:00
RickyRister
a5de633c64 warn if "play top card until" filter expression doesn't match any card in database (#5243)
* make FilterString::check const

* implement thing
2024-12-13 21:58:29 +00:00
RickyRister
b2ad2acff3 improve FilterString validation error message (#5240) 2024-12-13 06:26:58 +00:00
dependabot[bot]
4ee6ff73e0 Bump nanoid from 3.3.4 to 3.3.8 in /webclient (#5239)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.4 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.4...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 04:45:05 +00:00
RickyRister
628bdde939 hide action now applies to all selected cards (#5233)
* hide action now applies to all selected cards

* check card zone before applying action

so that we don't nuke cards from existence when we select across multiple zones

* small fixes

* remove redundant loop

* nullcheck view
2024-12-13 04:42:53 +00:00
RickyRister
e9b78c1c59 "Play top cards until" action now has option for number of hits (#5229)
* create new dlg window

* get thing to work

* move validation into dlg

* remove nodiscard

I'll revert this if someone else complains
2024-12-12 14:03:42 +01:00
RickyRister
315cbc0925 fix remaining wonkiness with rewind buffering in replays (#5235) 2024-12-11 10:54:36 +01:00
ebbit1q
69741d858c fix crash using uninitialised memory from #5228 (#5237) 2024-12-11 01:19:53 +00:00
tooomm
20d99a78b6 pretty print translation files (#5234) 2024-12-09 23:46:57 +00:00
RickyRister
2d68393e07 dynamically resize scrollbar when zone view window is resized (#5228) 2024-12-09 19:01:37 +00:00
RickyRister
8cb1470643 add option to show keyboard shortcuts in right click menu (#5225) 2024-12-09 18:58:37 +00:00
dependabot[bot]
8d9b27bf47 Bump path-to-regexp and express in /webclient (#5226)
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `path-to-regexp` from 0.1.10 to 0.1.12
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12)

Updates `express` from 4.21.0 to 4.21.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.0...4.21.2)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 18:54:47 +00:00
transifex-integration[bot]
0c5d9f1a7d Translate webclient/src/i18n-default.json in de (#5222)
100% translated source file: 'webclient/src/i18n-default.json'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-09 18:54:32 +00:00
transifex-integration[bot]
a7d88c06c1 Translate webclient/src/i18n-default.json in it (#5223)
100% translated source file: 'webclient/src/i18n-default.json'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-09 18:54:24 +00:00
transifex-integration[bot]
2735000fcf Translate webclient/src/i18n-default.json in pt_BR (#5224)
100% translated source file: 'webclient/src/i18n-default.json'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-09 18:54:15 +00:00
RickyRister
a39de270cd make rewind buffering timeout configurable (#5227)
* update settingsCache

* implement thing

* add new setting to window

* rename setting

* make it compile on qt5

* fix typo

* somehow changing the order here fixes a bug?

The loaded value was getting clamped to 99
2024-12-09 02:25:10 +00:00
tooomm
10f11213d3 fix indentation again (#5230) 2024-12-09 01:23:45 +00:00
tooomm
3b49cbf73b Rename label (#5232) 2024-12-09 01:23:27 +00:00
Zach H
e4cfe08113 Address weird crash case (#5221)
* Address weird crash case

* Address weird crash case

* remove const
2024-12-05 12:18:41 +01:00
transifex-integration[bot]
fa02cb885c Updates for project Cockatrice and language nl (#5220)
* Translate cockatrice/cockatrice_en@source.ts in nl

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'nl'.

* Translate oracle/oracle_en@source.ts in nl

100% translated source file: 'oracle/oracle_en@source.ts'
on 'nl'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-03 16:17:54 +01:00
transifex-integration[bot]
69b864fa02 Translate cockatrice_en@source.ts in en_US (#5217)
100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-12-01 19:59:19 -05:00
J. Cameron McDonald
b9ed9a6c0b feat: set prioritization by set type (#5097)
* feat: prefer 'Core' and 'Expansion' sets for prioritization

* rework set prioritization

* clean up priority enum

* formatting

* revert changes to CockatriceXml3Parser

* re-add missing null check

* remove priority fallback ternary from CardSet model

* make defaultSort logic easier to follow

* revert changes to v3 card database xsd

* remove unused invisible priority col from sets dialog

* move draft innovation and duel deck sets to secondary prio

* minor fixes

* change PriorityFallback to 1

* make priority optional in xml

* remove PriorityUndefined and set PriorityFallback to 0

* set priority when not found to PriorityOther

in case a new set type is added it's unlikey we want it sorted first,
it'll probably be a new product so it's probably best to sort it with
the funny things

* simplify sort function

---------

Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2024-12-01 19:59:00 -05:00
RickyRister
5156495b47 add more sort options (#5214)
* distinguish between groupBy and sortBy options

* add more sort options
2024-11-30 22:32:39 -05:00
RickyRister
b92047bc3f rename and refactor some stuff in ZoneViewWidget (#5213)
* fix QComboBox creation order in retranslateUi

* move bottom row creation closer to where it's used

* rename QGraphicsLinearLayout variables

hFilterbox and hPilebox don't make much sense now

* add comment about #5204
2024-11-30 18:54:55 -05:00
RickyRister
70559d32df fix bug where card view window with single card is too short (#5211)
It was a divide by 0 bug lol
2024-11-30 08:53:30 -05:00
RickyRister
bb84b75db9 fix bug where card view window with pile view is too short (#5212) 2024-11-30 08:53:10 -05:00
transifex-integration[bot]
f634177973 Updates for project Cockatrice and language nl (#5170)
* Translate cockatrice/cockatrice_en@source.ts in nl

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'nl'.

* Translate cockatrice/cockatrice_en@source.ts in nl

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'nl'.

* Translate cockatrice/cockatrice_en@source.ts in nl

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'nl'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-11-30 12:55:06 +01:00
Zach H
e33ff37c82 Pass QTime objects instead of references (#5209)
- References seem to go to 0 in newer Qt versions(?)

https://doc.qt.io/qt-6/qtime.html

> QTime objects should be passed by value rather than by reference to const; they simply package int.
2024-11-30 01:36:38 -05:00
RickyRister
d2bc7f6ac0 get retranslateUi to work with sort options (#5208) 2024-11-30 00:13:17 -05:00
RickyRister
5ef1ca06f5 store sort option in settings as QComboBox index instead of enum value (#5207)
* rename config property

* change default

* functional changes
2024-11-29 22:46:16 -05:00
Zach H
1d8651bc00 Fix Deck Popup Glitchy Rendering (#5204)
- QLabel sizes weren't taken into account until the widget is rendered
- Long QLabels can cause exacerbated issues
- Force refresh after 1ms to take QLabels into account
2024-11-29 12:53:19 -05:00
RickyRister
17eabf2004 add sort options to card view window (#5206)
* refactor to allow for sorting by property of choice

* implement thing

* prevent overlapping sort properties

* enable/disable pile view checkbox if groupBy is off

* fix compiler warnings

* check to disable pile view checkbox on init

* Fix builds on Qt5

* Fix builds on Qt5

---------

Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2024-11-29 12:53:06 -05:00
RickyRister
37bb1367db refactor method for positioning cards in ZoneViewZone (#5203)
* refactor out method for positioning cards in zone view

* rename some variables

* use max/min

* some small formatting stuff
2024-11-28 14:59:31 -05:00
RickyRister
24b5dab456 leave some documentation on Zone classes (#5199)
* leave some documentation on Zone classes

* small refactor

* undo functional change from refactor and clean up comments

* move variables into if block
2024-11-28 14:40:49 -05:00
Zach H
c6bfc8b8ea Fix Qt5 Slot/Signals for QCheckBoxes (#5201) 2024-11-27 22:11:55 +00:00
RickyRister
f2b0fa164e add padding to right side of card reveal window (#5198) 2024-11-27 00:17:37 -05:00
RickyRister
0ca8bdb3a8 refactor CardList (#5197) 2024-11-27 00:15:35 -05:00
RickyRister
a8471f62bc clean up DownloadSettings (#5194)
* refactor DownloadSettings

* only reset to default on first run

* use c++ foreach

* use addItems

* move default urls to static const
2024-11-26 02:12:56 +00:00
tooomm
5f1c03682f macOS version fix + wording (#5189) 2024-11-26 00:05:09 +01:00
RickyRister
3255ed3ffb add menu option to reload card db (#5196) 2024-11-25 07:43:08 +00:00
RickyRister
c51b54c0c5 rename variables for url list layout (#5195) 2024-11-25 06:27:21 +00:00
RickyRister
a3f0807d47 fix error message (#5192)
`QObject::connect: No such slot UserInterfaceSettingsPage::setNotificationEnabled(Qt::CheckState) in /Users/Ricky/GitHub/Cockatrice/cockatrice/src/dialogs/dlg_settings.cpp:448`
2024-11-24 14:52:56 +00:00
RickyRister
27055944df skip tap animation when rewinding (#5168) 2024-11-23 10:40:37 -05:00
Zach H
7b1653034b Bump macos14 XCode to 15.4 (#5188) 2024-11-22 22:52:42 -05:00
dependabot[bot]
39d8ca050f Bump cross-spawn from 7.0.3 to 7.0.6 in /webclient (#5181)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-22 22:22:36 -05:00
Zach H
50274cb66d Change 'custom(VER)' to 'custom-VER' because Fedora mad (#5180) 2024-11-22 22:22:22 -05:00
RickyRister
bd60a9fd2e don't blink highlighted phase when backwards skipping in replays (#5185) 2024-11-22 22:21:54 -05:00
BruebachL
83409c32c4 Cache redirects properly by implementing our own QSettings cache for urls. (#5186)
* Cache redirects properly by implementing our own QSettings cache for urls.

* Load and store redirects properly.

* Set the maximum network cache size from settings value on PictureLoaderWorker instantiation.

* Address comments.

* Lint.

* Adjust debug statements to be in line with existing ones.

* Minor Tweaks

* Make redirect cache ttl a user-adjustable setting.

* Fix Build

* Minor Cleanup

* Minor Cleanup

* Build Fix

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2024-11-22 22:21:26 -05:00
RickyRister
1bc92623dc add "open in new tab" button to decklist confirmation dialogue (#5183)
* refactor to use confirmOpen

* implement extra button in confirmation

* use brackets in one-liner if statements

* refactor save confirmation window into function
2024-11-21 23:24:50 +01:00
BruebachL
f73196841a Multiple Printings per Deck (#5171)
* Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure.

* Added Zach's work on storing printing information in the DeckList (#1)

* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name.

* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.

This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.

- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
 - Thread-safe static initialization for the singleton.

Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.

* fixed db issue an renamed sets to set in picture loader

* canibalized zach work and added it to the decklist builder

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>

* Reintroduce some changes lost in the merge.

* Introduce UUID attribute to abstract_card_item, card_item, deck_view_card, server_card and serverinfo_card.

* Have various game events respect the new UUID attribute on instantiation.

* Correct some calls to default to preferred printing.

* DeckList now tries to assign reasonable defaults for UUID and collectorNumber if none are found in loaded DeckLists.
Rename overloaded DeckListModel findChild() function to findCardChildByNameAndUUID() for clarity.

* canibalized zach work and added it to the decklist builder

* Change getPreferredPrintingForCard to getPreferredSetForCard to reflect refactor.

* Properly update and set the DeckEditor's CardFrame to fetch by name and UUID if a card was selected from the decklist.

* Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting.

* If the card info is null, there's no point in trying to look for the sets.

* Don't define methods twice.

* Convenience method to fetch a specific CardInfoPerSet instance for a cardName and a UUID.

* Check if the uuid starts with card_ when comparing.

* Address pull request comments (nullptr checks and additional comments, mostly.)

* Reformat code so the linter will stop yelling at me.

* DeckList no longer pre-populates uuids.

* Update Event_MoveCard to include the card UUID.

* Update Player::MoveCard to include the card UUID.

* Set the uuid when we set the cardName, in terms of hidden zones.

* [TEST/RevertMe] Set the uuid everywhere to test.

* Don't inline setUUID and mimic setName for AbstractCardItem.

* Revert blindly setting uuid for testing.

* Address PR comments (AbstractCardItem).

* Combine if-statement.

* Re-order uuid to visually align with its field number.

* Remove unnecessary new uuid field from event_move_card.

* Remove unused imports.

* Include cardName in the PixmapCacheKey in order to not break double-faced cards.

* Refactor setCode to cardUUID and introduce new cardSetShortName field.

* Override

* Refactor UUID to be providerId and change QString comparisons with empty string to isEmpty().

* Update translations.

* Change parent to be the first argument.

* Pull Parent argument up for CardItem.

* Pull Parent argument up for CardItem.

* Linter.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: LunaticCat <39006478+LunyaticCat@users.noreply.github.com>
Co-authored-by: luna <yannbrun1507@outlook.fr>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2024-11-18 21:56:44 -05:00
RickyRister
86a4b130ff don't open deck in new tab if current tab is blank (#5169) 2024-11-18 11:59:34 +01:00
tooomm
f4e2f117c3 Readme: Remove last Gitter hint (#5178) 2024-11-18 00:27:33 +01:00
BruebachL
8ef92d26c5 Add Utility Layouts and corresponding Widgets (#5177)
* Add FlowWidget class with flexible layout and scroll handling

- Implemented FlowWidget class to organize widgets in a flow layout with scrollable options.
- Integrated QScrollArea to handle overflow with configurable horizontal and vertical scroll policies.
- Incorporated dynamic layout selection (FlowLayout, HorizontalFlowLayout, VerticalFlowLayout) based on scroll policy.

* Add OverlapWidget and OverlapLayout for managing overlapping child widgets

- Implemented the OverlapWidget class to manage child widgets in an overlapping manner, supporting configurable overlap percentage, maximum columns, maximum rows, and layout direction.
- Introduced the OverlapLayout class, which arranges widgets with overlapping positions, allowing flexible stacking based on specified parameters.

* Add OverlapControlWidget.

* Delete FlowLayout items later to allow them to finish their event loop.

* Allow OverlapWidgets to adjust their rows/columns on resize.

* Clamp vertical FlowLayout to any available parent scrollAreas.

* Implement margins and spacing for FlowLayouts.

* Adjust/revert some things.

* Address pull request comments (nullptr checks and additional comments, mostly.)

* Reformat code so the linter will stop yelling at me.

* Remove undefined methods from FlowLayouts.

* Fix the build.

* Revert FlowLayout::takeAt to index check.

* Commits will continue until linter morale improves.

* Fix various warnings in FlowLayout.

* Fix various warnings in FlowLayout.h.

* Fix various warnings in the FlowLayout classes.

* Fix [[nodiscard]] warning.

* Fix more warnings.

* Final round of yellow squiggle fixing.

* Linter formatting.

* Refactor column/row calculation to be more readable.

* Code style.

* Address PR comments.

* Combine if-statements.

* Replace std::math functions with Qt equivalents.

* Fix non-consts and QtMath.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-11-17 13:32:31 -05:00
BruebachL
c8336df49d Refactor Card Info Widgets (#5176)
* Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure.

* Add optional HoverToZoom functionality to CardInfoPictureWidget (default: disabled) and utility class to display text over a CardInfoPictureWidget.

* Patch CardInfoWidgets to use the new CardDatabaseManager.

* Add HoverToZoom to CardInfoPictureWithTextOverlayWidget

* Refactors and new signals for CardInfoPictureWidgets.

* Address pull request comments (nullptr checks and additional comments, mostly.)

* Reformat code so the linter will stop yelling at me.

* Linting.

* Fix the build.

* Fix warnings.

* Formatting, const qualifiers.

* Sensibly call the base class's (QWidget) paint event.

* Address PR comments (card picture).

* QT Version check because enterEvent signature changed.

* Linting.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-11-17 10:49:22 -05:00
RickyRister
c2fe3cda35 Add option to open deck in new tab by default (#5143)
* add comments

* add new setting for openDeckInNewTab

* implement open deck in new tab

* rename setting

* fix typo

* set default to false
2024-11-10 18:16:50 -05:00
BruebachL
c54f47efbf Change CardInfo's PixmapCacheKey to be the UUID of the card in the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name. (#5158)
* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name.

* Clean up some variable names, clarify preferred Set insertion for PictureLoader, use the new CardDatabaseManager.

* Code formatting.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-11-10 17:49:11 -05:00
lumadd
3c40cc4b7d [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player group (#5079)
* [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family

* [4191] fix: fix formatting

* Revert "[4191] fix: fix formatting"

This reverts commit 86a4a675f3bc8118d4ba8dd45f408c4e8c348f33.

* Revert "[4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family"

This reverts commit 3ec183628df81c48123a8a248d0416c529ee0c8e.

* [4191] fix: Textbox and tab_game shortcut groups cannot conflict with Player group

* Revert "[4191] fix: Textbox and tab_game shortcut groups cannot conflict with Player group"

This reverts commit 36800393339d997df1a932bb798f95d2d387399a.

* [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family

* [4191] fix: Migrate shortcuts if new version is detected

* [4191] fix: formatting

* [4191] fix: Maybe fix build issue on Windows7, Debian11, UbuntuBionic and UbuntuFocal
2024-11-09 19:56:42 +01:00
RickyRister
f0fb77bade move replay-related constants into ReplayTimelineWidget (#5166)
* move constants

* make the existing static const into a constexpr
2024-11-09 11:18:51 +01:00
RickyRister
e894e78346 Do not open card reveal windows when skipping in replays (#5157)
* create EventProcessingOption QFlag

* pass EventProcessingOption all the way down

* implement reveal skipping logic
2024-11-09 02:06:23 +01:00
SlightlyCircuitous
dd04c610ec Remove Fedora 39 Build and Add Fedora 41 Build (#5151)
* Remove Fedora 39 docker file

EOL

* Add Fedora 41 Dockerfile

new release

* Remove Fedora 39, Add Fedora 41 to release template

* Remove Fedora 39, Add Fedora 41 to desktop build

---------

Co-authored-by: tooomm <tooomm@users.noreply.github.com>
2024-11-08 11:32:54 +01:00
tooomm
2e674efe50 Pretty print translation source (#5107) 2024-11-05 22:26:54 +01:00
ebbit1q
4d394c31f9 fix the timezones used for the user info box and add comments (#5162) 2024-11-05 14:54:38 -05:00
tooomm
11d58abbc3 CI: Update build matrix & clean naming (#5040)
---------

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2024-11-05 14:38:33 -05:00
BruebachL
5f4ad87a47 Refactor CardDatabase *db global variable to singleton CardDatabaseManager. (#5159)
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.

This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.

- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
 - Thread-safe static initialization for the singleton.

Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.

* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.

This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.

- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
 - Thread-safe static initialization for the singleton.

Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-11-05 19:32:59 +01:00
RickyRister
e43a21866c Buffer rewinds from backward skips in replays (#5141)
* split event processing to own method

* implement rewind throttling

* don't throttle backward skips from clicks

* use the term 'buffering' instead

* remove initial backup logic; just always buffer shortcut backward skips

* prevent segfault

* turns out you can just reuse the same one-shot timer

* try scaling timeout based on event count

* rewrite timeout calculation code

* fix linker error
2024-11-05 18:45:42 +01:00
RickyRister
6652012f4c fix bug with phase highlighting in replays (#5161)
* fix bug with incorrectly highlighted phases

* fix new bug with phases continuously darkening

* use preincrement instead of postincrement

* simplify conditional
2024-11-05 18:23:01 +01:00
BruebachL
0c4e8ca290 CardDatabase gains a new signal void cardDatabaseLoadingFinished(), which (#5156)
it will emit in loadCardDatabases(), mirroring the else branch where cardDatabaseLoadingFailed() is emitted.

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2024-11-03 23:45:19 +01:00
ebbit1q
230a2c5c62 fix crashes in local games because of using uninitialised pointers (#5147) 2024-10-26 21:03:32 +00:00
ebbit1q
590fb7f533 fix row colors swapping when using back button in replays (#5148)
only happens when there is an uneven amount of rows in the chat
2024-10-26 21:02:51 +00:00
github-actions[bot]
e8b88248f2 Update translation files (#5146) 2024-10-26 19:11:24 +02:00
transifex-integration[bot]
c6ba1b6a4e Translate cockatrice/cockatrice_en@source.ts in de (#5145)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-10-26 14:11:18 +02:00
RickyRister
c4c52bd8c0 Add keyboard shortcuts for skipping forward/backward in replays (#5140)
* split skipToTime into own function

* implement shortcut

* fix shortcut warning bug

* check boundary conditions in skipToTime

* change default fast forward shortcut to .

* implement big skip shortcuts

* remove unnecessary arg in lambda

* change default fast forward shortcut to Ctrl+F

* rename constants

* change default fast forward shortcut to Ctrl+P

* use static const
2024-10-23 14:00:23 +02:00
tooomm
c633a792f5 bump version (#5099) 2024-10-21 18:57:47 -04:00
Zach H
8d5421d9da Add backwards support Qt6.7's checkStateChanged on QCheckBoxes (#5137) 2024-10-20 23:35:34 -04:00
github-actions[bot]
b041f4ace2 Update translation source strings (#5117)
Co-authored-by: github-actions <github-actions@github.com>
2024-10-20 16:18:32 -04:00
RickyRister
d26f96db9e Add keyboard shortcuts for replays (#5136)
* add keyboard shortcut for play/pause

* add keyboard shortcut for fast-forward

* make shortcuts rebindable

* run formatter
2024-10-20 16:41:59 +02:00
LunaticCat
fa999880ee Major Directory Refactoring (#5118)
* refactored cardzone.cpp, added doc and changed if to switch case

* started moving every files into different folders

* remove undercase to match with other files naming convention

* refactored dialog files

* ran format.sh

* refactored client/tabs folder

* refactored client/tabs folder

* refactored client/tabs folder

* refactored client folder

* refactored carddbparser

* refactored dialogs

* Create sonar-project.properties

temporary file for lint

* Create build.yml

temporary file for lint

* removed all files from root directory

* removed all files from root directory

* added current branch to workflow

* fixed most broken import

* fixed issues while renaming files

* fixed oracle importer

* fixed dbconverter

* updated translations

* made sub-folders for client

* removed linter

* removed linter folder

* fixed oracle import

* revert card_zone documentation

* renamed db parser files name and deck_view imports

* fixed dlg file issue

* ran format file and fixed test file

* fixed carddb test files

* moved player folder in game

* updated translations and format files

* fixed peglib import

* format cmake files

* removing vcpkg to try to add it back later

* tried fixing vcpkg file

* renamed filter to filters and moved database parser to cards folder

* reverted translation files

* reverted oracle translated

* Update cockatrice/src/dialogs/dlg_register.cpp

Co-authored-by: tooomm <tooomm@users.noreply.github.com>

* Update cockatrice/src/client/ui/window_main.cpp

Co-authored-by: tooomm <tooomm@users.noreply.github.com>

* removed empty line at file start

* removed useless include from tab_supervisor.cpp

* refactored cardzone.cpp, added doc and changed if to switch case

* started moving every files into different folders

* remove undercase to match with other files naming convention

* refactored dialog files

* ran format.sh

* refactored client/tabs folder

* refactored client folder

* refactored carddbparser

* refactored dialogs

* removed all files from root directory

* Create sonar-project.properties

temporary file for lint

* Create build.yml

temporary file for lint

* added current branch to workflow

* fixed most broken import

* fixed issues while renaming files

* fixed oracle importer

* fixed dbconverter

* updated translations

* made sub-folders for client

* removed linter

* removed linter folder

* fixed oracle import

* revert card_zone documentation

* renamed db parser files name and deck_view imports

* fixed dlg file issue

* ran format file and fixed test file

* fixed carddb test files

* moved player folder in game

* updated translations and format files

* fixed peglib import

* reverted translation files

* format cmake files

* removing vcpkg to try to add it back later

* tried fixing vcpkg file

* pre-updating of cockatrice changes

* removed empty line at file start

* reverted oracle translated

* Update cockatrice/src/dialogs/dlg_register.cpp

Co-authored-by: tooomm <tooomm@users.noreply.github.com>

* Update cockatrice/src/client/ui/window_main.cpp

Co-authored-by: tooomm <tooomm@users.noreply.github.com>

* removed useless include from tab_supervisor.cpp

---------

Co-authored-by: tooomm <tooomm@users.noreply.github.com>
2024-10-20 10:11:35 -04:00
RickyRister
d1e0f9dfc5 fix bug (#5133) 2024-10-19 20:18:35 -04:00
RickyRister
2d86938375 Consolidate play/pause buttons in replays (#5131)
* Consolidate play/pause buttons in replays

* always enable fast forward button

* run formatter
2024-10-19 20:18:01 -04:00
ebbit1q
4865269a73 don't delete "" (#5135) 2024-10-19 13:06:18 +02:00
dependabot[bot]
038ce3dcec Bump send and express in /webclient (#5123)
Bumps [send](https://github.com/pillarjs/send) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `send` from 0.18.0 to 0.19.0
- [Release notes](https://github.com/pillarjs/send/releases)
- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md)
- [Commits](https://github.com/pillarjs/send/compare/0.18.0...0.19.0)

Updates `express` from 4.18.2 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.21.0)

---
updated-dependencies:
- dependency-name: send
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-11 04:28:41 +00:00
RickyRister
43b997fe40 follow symlinks when iterating through the custom image folder (#5126) 2024-10-11 04:27:24 +00:00
Polty
44e92f61ca #3945 deck list: Navigation keys (PageUp/Down, Home/End) (#5103)
* #3945 deck list: Navigation keys (PageUp/Down, Home/End) interact with the deck list.

* make Home/End work normally when there is text in the search textbox

* fix debug build, explicit cast from int to Qt::Key enum
2024-10-09 23:11:12 +02:00
Alexander Choi
b4bfa17cee In-game message macros available immediately in active games (#5113)
* In-game message macros available immediately in active games

* fix formatting

* init sayMenu actions with sayMenu as parent
2024-10-09 23:08:57 +02:00
tooomm
500b694cc6 CI: Fix logic in translation action after dependency update (#5124)
* Update translations-pull.yml

* Update translations-push.yml
2024-10-07 18:48:43 +00:00
dependabot[bot]
b998282304 Bump peter-evans/create-pull-request from 6 to 7 (#5110)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 20:05:44 +02:00
Alexander Choi
b704216553 fix macro shortcuts so that Ctrl+1 is not double-assigned (#5112) 2024-09-15 16:55:30 -04:00
transifex-integration[bot]
03ec02a749 Translate oracle/oracle_en@source.ts in fi (#5100) 2024-08-30 13:16:22 +02:00
Zach H
248ea82573 Support Game Events (#5087) 2024-08-25 00:31:20 +00:00
ebbit1q
bbe125beee replace cipt check with regex (#5094) 2024-08-25 00:31:01 +00:00
tooomm
95cd1c6f87 CI: Update install-qt-action (#5096) 2024-08-22 01:22:57 +02:00
J. Cameron McDonald
1c2107ae8f docs: fix readme "get involved" links (#5098) 2024-08-17 23:46:16 +02:00
ebbit1q
e826e17c6c add qtimageformats module (#5092)
* add qtimageformats module

* add qt6-image-formats-plugins to apt depends in cmakelists

* too many quotes

* add qt6-qtimageformats to rpm deps
2024-08-16 22:32:22 -04:00
Joseph Insalaco
b111f0921c Admin persistence changes (#5086) 2024-08-16 22:31:57 -04:00
transifex-integration[bot]
090a48515c Updates for project Cockatrice and language en_US (#5088)
* Translate cockatrice_en@source.ts in en_US

100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

* Translate oracle/oracle_en@source.ts in en_US

100% translated source file: 'oracle/oracle_en@source.ts'
on 'en_US'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-08-03 14:29:28 +02:00
transifex-integration[bot]
b8555d8c42 Translate cockatrice/cockatrice_en@source.ts in nl (#5089)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'nl'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-08-03 14:16:42 +02:00
Joseph Insalaco
cf1f4f12a9 Updating Session Persistence with all valid persistence calls (#5085)
* Updating Session Persistence with all valid persistence calls

* Spacing fixes

---------

Co-authored-by: Zach H <zahalpern+github@gmail.com>
2024-07-29 17:25:33 +00:00
ebbit1q
ef4413633a fix regression in #4762 to _fill_with_ template (#5083)
fixes #5062
2024-07-29 01:20:50 +00:00
Zach H
c5bb38e907 Add types for Moderator commands (#5084)
* Add types for Moderator commands

* Support User Priv Level & userLevel
2024-07-29 01:16:29 +00:00
github-actions[bot]
9f515fc804 Update translation files (#5080) 2024-07-23 11:53:07 +02:00
Zach H
245edcefdd Add openssl to windows reqs (#5074) 2024-07-13 12:38:43 -04:00
transifex-integration[bot]
153f73c308 Translate cockatrice/cockatrice_en@source.ts in de (#5073)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-07-13 13:11:03 +00:00
github-actions[bot]
315837b267 Update translation source strings (#5069)
Co-authored-by: github-actions <github-actions@github.com>
2024-07-01 19:04:16 +02:00
Joseph Insalaco
ea8da24215 Webatrice: Adding joined game to persistence layer (#5068)
* Adding joined game to persistence layer

* Linting fixes
2024-06-27 02:06:47 +00:00
Joseph Insalaco
1ab723ca64 Webatrice: Adding game created to persistence layer (#5067) 2024-06-27 01:03:21 +00:00
Joseph Insalaco
f8bc6cf998 Adding remove messages to persistence layer (#5066) 2024-06-27 00:44:40 +00:00
Zach H
8687163cca Add few more interfaces (#5063) 2024-06-25 05:00:45 +00:00
Zach H
e261e16d99 Re-Add ability to share editable deck views (#5060)
- Rolls back 6811819161
- Follow up to adbb607700
2024-06-24 21:52:11 +00:00
Jeremy Letto
bdcd083eea refactor imports (#5058) 2024-06-17 01:00:23 -04:00
Zach H
c4bf9eb61c Cleanup (#5057)
* Add Types

* Add Types
2024-06-17 00:32:36 -04:00
Zach H
0994d10410 More stuff (#5056)
* Skeleton + RemoveMessages

* GameJoinedData
2024-06-16 23:26:03 -04:00
Zach H
291c535edb More web stuff (#5055)
* Add Response.gamesOfuser

* Cleanup and confirm all
2024-06-16 22:48:07 -04:00
ZeldaZach
f04702fdd1 Backwards Compatibility for rolling dice 2024-06-16 21:10:07 -04:00
Zach H
b7fbc12ac0 Allow Judges to see all information, regardless of room settings (#5053) 2024-06-16 19:12:37 -04:00
Zach H
e2ab8db958 Add some sessions (#5052)
* Add AccountEdit

* Add PasswordChange

* Cleanup

* Add SessionService.accountImage

* Add SessionService.message

* Add SessionService.getUserInfo

* Lint
2024-06-14 23:06:50 -04:00
Zach H
34d70980e8 Webatrice admin commands (#5051)
* Add AdminCommand.updateServerMessage

* Add AdminCommand.shutdownServer

* Add AdminCommand.reloadConfig

* Cleanup

* Add AdminCommand.adjustMod

* Lint

* Lint
2024-06-13 02:52:40 +00:00
Zach H
e45c4042fe Webatrice: Add all ModeratorCommands (#5049)
* Move viewLogHistory to Moderator commands

* Add Moderator.banFromServer

* Add Moderator.getBanHistory

* Add Moderator.getWarnHistory

* Add Moderator.warnUser

* Add Moderator.getWarnList
2024-06-13 02:15:14 +00:00
Zach H
ce8092318e Allow up to 100 dice to be rolled at a time (#5047)
* Allow up to 100 dice to be rolled at a time
- Fix #4276
2024-06-12 08:37:04 -04:00
transifex-integration[bot]
c95cc1dd9d Translate webclient/src/i18n-default.json in it (#5045)
100% translated source file: 'webclient/src/i18n-default.json'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-06-06 23:53:15 +00:00
Zach H
1f72877728 Drop MacOS 10.15/11 Support :( (#5033) 2024-05-31 09:10:54 -04:00
tooomm
93b40343d9 EnableCIServerMode (#5034) 2024-05-25 12:40:40 -04:00
transifex-integration[bot]
ba10108207 Translate cockatrice/cockatrice_en@source.ts in de (#5038) 2024-05-24 19:05:11 +02:00
github-actions[bot]
c28f66d673 Update translation source strings (#4973)
Co-authored-by: github-actions <github-actions@github.com>
2024-05-18 22:11:07 +02:00
Zach H
59f327f97a Pin XCode versions for Mac Builds (#5032) 2024-05-13 18:57:33 -04:00
tooomm
872c92a244 CI: Use windows-2022 image with Visual Studio 17 2022 (#4999)
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2024-05-13 17:41:50 -04:00
dependabot[bot]
2303880b87 Bump ejs from 3.1.8 to 3.1.10 in /webclient (#5027)
Bumps [ejs](https://github.com/mde/ejs) from 3.1.8 to 3.1.10.
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](https://github.com/mde/ejs/compare/v3.1.8...v3.1.10)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 11:48:57 +00:00
github-actions[bot]
0e97cc1712 Update translation files (#5021)
Co-authored-by: github-actions <github-actions@github.com>
2024-04-24 19:37:31 -04:00
SlightlyCircuitous
d550e42441 Remove Fedora 38 Build and Add Fedora 40 Build (#5024)
* Remove Fedora 38 docker image

* Add Fedora 40 Dockerfile

* Remove Fedora 38, Add Fedora 40 to release template

* Remove Fedora 38, add Fedora 40 to desktop-build
2024-04-24 19:37:23 -04:00
SlightlyCircuitous
4279753030 Add Ubuntu 24.04 "Noble Numbat" Build (#5023)
* Create Ubuntu Noble Numbat dockerfile

* Add Noble Numbat to desktop_build

* Add Noble Numbat to release_template
2024-04-24 15:13:20 +02:00
Jeremy Letto
2f6c018b7a untangle updateStatus (#5018)
* untangle updateStatus

* fix test
2024-04-05 04:56:12 +00:00
Jeremy Letto
be5d42baba WebClient: refactor protobuf method structure (#5014) 2024-04-01 17:32:08 +00:00
ebbit1q
f174614496 assign new arrow id when arrow is moved to transformed card (#5012)
* add timeout to settingscache

* assign new arrow id when arrow is moved to transformed card

fixes bug introduced in #4907
fixes #5008
2024-03-27 14:47:00 +01:00
dependabot[bot]
e8c7fba8b0 Bump peter-evans/create-pull-request from 5 to 6 (#4997) 2024-03-19 19:42:08 +01:00
SlightlyCircuitous
5c49283023 Remove Ubuntu 23.04 Lunar Lobster Build (#5002)
* Delete .ci/UbuntuLunar directory

EOL

* Update release_template.md

Lunar is EOL

* Update desktop-build.yml

Lunar is EOL
2024-02-27 21:07:18 +01:00
ebbit1q
ad56b431a3 increase version number so we can create a beta (#5001) 2024-02-27 20:55:28 +01:00
SlightlyCircuitous
b0d8a33d5f Remove Fedora 37 Build, Add Fedora 39 Build (#5003) 2024-02-26 08:37:28 +01:00
dependabot[bot]
1715bcb216 Bump microsoft/setup-msbuild from 1 to 2 (#4996)
Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1 to 2.
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1...v2)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-10 15:31:13 -05:00
tooomm
96caeaca72 Enable MTT over parallel flag (#4998) 2024-02-10 15:30:43 -05:00
tooomm
c8723ae935 Remove Gitter chat (#4995) 2024-02-01 18:25:04 +01:00
tooomm
94e39c044c update mv mapping (#4896) 2024-01-30 00:27:45 -05:00
ebbit1q
9776ea53c9 make translation update script more specific in line selection (#4993) 2024-01-25 23:28:23 +01:00
github-actions[bot]
675d07dac0 Update translation files (#4991)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-23 22:29:40 +01:00
tooomm
1217820288 CI: GitHub Job Summary for Translation PRs (#4992) 2024-01-23 22:21:35 +01:00
tooomm
90e1a3cb76 Utilize new CPUs with more cores (#4988) 2024-01-22 23:15:20 +01:00
tooomm
7c1095ea50 CI: Fix ignore pattern & highlight status of translation automations (#4977)
* Add result of run to GHA summary

* Fix `paths-ignore`
2024-01-22 22:07:21 +01:00
dependabot[bot]
203e916a07 Bump actions/cache from 3 to 4 (#4990) 2024-01-22 19:32:27 +01:00
github-actions[bot]
7201e34b38 Update translation files (#4984)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-18 20:50:28 +01:00
Basile Clement
6d032c378f Improve drag & drop behavior (#4963)
* Improve drag & drop behavior

This patch tweaks the drag & drop behavior (in particular, the grid
placement) to be more intuitive. More precisely, with this patch the
drag & drop will:

 - Only use the "hot spot" (i.e. position of the cursor on the card)
   for zones where the card is actually displayed around the cursor (in
   particular, not on the table where the card snaps to the grid).

 - Use better boundaries computed with respect to the center of the
   card (rather than its top left corner) for determining which grid
   cell a card should go to

 - Align behavior of the preview and the actual effect when overflow of
   the 3-card stacks occurs

 - Avoid visual glitches where the cursor ends up outside of the card or
   at incorrect offsets when moving the mouse too fast (which translates
   to overflows of the hot spot computation)

* Address review comments

 - Use simpler computation for restricting hotSpot range
 - Prevent dropping cards onto full 3-card slots
2024-01-01 16:51:36 -05:00
dependabot[bot]
badd8952f5 Bump @babel/traverse from 7.20.0 to 7.23.2 in /webclient (#4917)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.0 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-20 21:31:12 -05:00
dependabot[bot]
7209eddb2d Bump crypto-js from 4.1.1 to 4.2.0 in /webclient (#4926)
Bumps [crypto-js](https://github.com/brix/crypto-js) from 4.1.1 to 4.2.0.
- [Commits](https://github.com/brix/crypto-js/compare/4.1.1...4.2.0)

---
updated-dependencies:
- dependency-name: crypto-js
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-20 21:31:04 -05:00
dependabot[bot]
a7ffd43b29 Bump actions/upload-artifact from 3 to 4 (#4969)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 23:58:37 +01:00
tooomm
724ba69483 macOS 12 --> 13 (#4966) 2023-12-17 13:39:06 -05:00
ebbit1q
1716801437 make package on macos 13 (#4961) 2023-12-15 21:15:57 -05:00
ebbit1q
fa727524dc make cards on the stack slightly overlap to stress order (#4930)
* make cards on the stack slightly overlap to stress order

dragging cards to the stack now places the card at the location it is
dropped

* make default play action append to stack

* add vertical overlap to settings and vertical hand

* Update cockatrice/src/dlg_settings.cpp

Co-authored-by: tooomm <tooomm@users.noreply.github.com>

* Fix format

---------

Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2023-12-15 14:00:58 -05:00
ebbit1q
28f80e18a0 add ctrl enter as shortcut for ok when setting annotation (#4929) 2023-12-15 13:55:11 -05:00
ebbit1q
4acc8bfe80 put cards on top in a random order (#4960) 2023-12-15 13:51:21 -05:00
Zach H
9f86ed7887 Fix Fedora Builds (#4964) 2023-12-15 13:49:32 -05:00
Basile Clement
cb18a55338 Support fractional scaling when scaling card images (#4962)
Fixes #4880
2023-12-14 14:24:35 +01:00
dependabot[bot]
78a928464c Bump @adobe/css-tools from 4.0.1 to 4.3.2 in /webclient (#4953)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.0.1 to 4.3.2.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-09 00:53:10 -05:00
Zach H
07a8cd0a5f Fix #4903: Parse Email Addresses whenever used (#4932) 2023-12-09 00:52:47 -05:00
Zach H
b73ef58567 Support WebP format for Card Images (#4950)
- Fix #4939
2023-12-09 00:52:14 -05:00
Zach H
519531f3a0 Support escaping single and double quotes in Deck Editor Search Regex Strings (#4948)
- Fix #4946
2023-12-09 00:51:54 -05:00
tooomm
4b8e47d079 Update default theme name (#4944) 2023-11-20 01:01:42 +01:00
transifex-integration[bot]
ed170f7e07 Updates for project Cockatrice and language de (#4942)
* Translate cockatrice/cockatrice_en@source.ts in de

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

* Translate oracle/oracle_en@source.ts in de

100% translated source file: 'oracle/oracle_en@source.ts'
on 'de'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-11-18 12:10:11 +01:00
transifex-integration[bot]
6bb559874c Translate cockatrice/cockatrice_en@source.ts in it (#4941)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-11-18 08:44:10 +01:00
transifex-integration[bot]
9cd68e25b3 Translate cockatrice/cockatrice_en@source.ts in de (#4937)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-11-12 19:22:58 +01:00
transifex-integration[bot]
72ac441598 Updates for project Cockatrice and language de (#4934)
* Translate cockatrice/cockatrice_en@source.ts in de

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

* Translate cockatrice/cockatrice_en@source.ts in de

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-11-05 19:15:48 +01:00
dependabot[bot]
f5fe56c85d Bump actions/setup-node from 3 to 4 (#4928)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-31 00:48:39 +01:00
tooomm
d4fc1be2cc CI: Cleanup & updates (#4921)
* simplify ci after 64bit only

* hint on macos 10.15 with qt6.2

* Update desktop-build.yml

* Update desktop-build.yml

* update xcode

* 14.3 finds 14.3.1, but 14.0 doesn't find 14.0.1

* Update desktop-build.yml
2023-10-28 14:36:50 -04:00
ebbit1q
7b3617a273 clean up #4904 for consistency (#4927)
note, this is not a racetime issue, see #4907
2023-10-28 14:35:15 -04:00
tooomm
3e8adae3de Rename "stack until found" feature (#4871)
* Rename "stack until found" feature

* lint
2023-10-25 18:43:57 +02:00
tooomm
9943133d6d TOTD: Exchange Gitter for Discord, Fix date format (#4920)
* Update tips_of_the_day.xml

* Delete cockatrice/resources/tips/images/gitter.png

* Add Discord icon

* Update cockatrice.qrc

* date format
2023-10-24 14:26:38 +02:00
tooomm
a5706a47af Include missing strings for translation (#4919) 2023-10-19 21:58:38 +02:00
github-actions[bot]
b3b911c64d Update translation files (#4913)
Co-authored-by: github-actions <github-actions@github.com>
2023-10-18 20:41:14 +02:00
github-actions[bot]
05beb4fcaf Update translation source strings (#4918) 2023-10-18 00:29:56 +02:00
tooomm
324b50e381 Improve Transifex pull action (#4916) 2023-10-16 22:51:08 +02:00
Zach H
186f4289e9 Address /W4 compiler warnings for Windows (#4910) 2023-10-15 20:31:13 -04:00
Zach H
cb90a8356b Use proto21 on macos11 (#4914) 2023-10-15 20:30:50 -04:00
tooomm
e9c502ab32 CI: Add action for pulling new translations (#4911)
* Update and rename translations.yml to translations-push.yml

* Rename update_translations.sh to update_translation_source_strings.sh

* Update and rename update_translations_template.md to update_translation_source_strings_template.md

* Add translations-pull.yml

* Update config

* Update desktop-lint.yml

* Update desktop-build.yml

* correct env var naming

* names
2023-10-15 18:47:15 -04:00
tooomm
f728520e97 Update release_template.md (#4909) 2023-10-13 22:52:08 -04:00
Zach H
c1b0d50237 Handle Qt6.6 Deprecations (#4908) 2023-10-13 20:53:47 -04:00
tooomm
b9cfc29059 CI: Use concurrency group (#4902) 2023-10-13 19:01:37 -04:00
ebbit1q
6bf7c79891 copy arrows on transform (#4907) 2023-10-13 19:01:08 -04:00
Zach H
2bd0e58354 HotFix: Prevent crashing if a Zone is null with an arrow while a player concedes race time (#4904) 2023-10-13 19:00:53 -04:00
Zach H
ee674cb0cf Support MacOS 12 & 13. Support Protobuf 23. Deprecate MacOS 11. (#4884) 2023-10-13 14:45:22 -04:00
transifex-integration[bot]
dd1b354d48 Translate webclient/src/i18n-default.json in de (#4906)
100% translated source file: 'webclient/src/i18n-default.json'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-10-13 14:26:05 -04:00
tooomm
d3e96f4a99 Switch to rolling release (#4905) 2023-10-13 14:25:40 -04:00
tooomm
90e2eb3db9 Webclient: Fix translation file names (#4897) 2023-10-09 18:05:43 +02:00
transifex-integration[bot]
102be6a350 Translate cockatrice_en@source.ts in en_US [Manual Sync] (#4893)
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-10-06 22:56:03 +02:00
transifex-integration[bot]
be6152948c Updates for project Cockatrice and lanuage es on branch master (#4886)
* Translate i18n-default.json in es [Manual Sync]

99% of minimum 80% translated source file: 'i18n-default.json'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate cockatrice_en@source.ts in es [Manual Sync]

98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate i18n-default.json in es [Manual Sync]

99% of minimum 95% translated source file: 'i18n-default.json'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate cockatrice_en@source.ts in es [Manual Sync]

98% of minimum 95% translated source file: 'cockatrice_en@source.ts'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-10-06 22:52:37 +02:00
transifex-integration[bot]
f14bf4b205 Updates for project Cockatrice and lanuage it on branch master (#4887)
* Translate i18n-default.json in it [Manual Sync]

99% of minimum 80% translated source file: 'i18n-default.json'
on 'it'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate cockatrice_en@source.ts in it [Manual Sync]

98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'it'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate i18n-default.json in it [Manual Sync]

99% of minimum 95% translated source file: 'i18n-default.json'
on 'it'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-10-06 21:37:59 +02:00
transifex-integration[bot]
123ac2ca25 Updates for project Cockatrice and lanuage fr on branch master (#4888)
* Translate cockatrice_en@source.ts in fr [Manual Sync]

98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate i18n-default.json in fr [Manual Sync]

99% of minimum 80% translated source file: 'i18n-default.json'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate i18n-default.json in fr [Manual Sync]

99% of minimum 95% translated source file: 'i18n-default.json'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-10-06 21:36:56 +02:00
transifex-integration[bot]
7216b976ec Updates for project Cockatrice and lanuage pt_BR on branch master (#4890)
* Translate cockatrice_en@source.ts in pt_BR [Manual Sync]

98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate webclient/src/i18n-default.json in pt_BR

100% translated source file: 'webclient/src/i18n-default.json'
on 'pt_BR'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-10-06 21:36:16 +02:00
ebbit1q
7fb698cfbf update release template with #4883 deprecating 32 bit (#4885) 2023-10-02 14:09:19 -04:00
Zach H
b0470ab678 Move to OpenSSLv3 (& Drop 32-bit) (#4883) 2023-10-01 17:19:31 -04:00
Zach H
0deb037035 Address connect errors in logs (#4882) 2023-10-01 15:30:54 -04:00
ZeldaZach
064b362d60 Bump to 2.9.0 :) 2023-09-14 22:14:22 -04:00
tooomm
6bbe228a84 README: Cleanup translations widget and links (#4870)
* Fix translations widget and links

* Name webatrice
2023-09-11 22:13:52 -04:00
transifex-integration[bot]
a8ba8b6ab5 Updates for project Cockatrice and lanuage de on branch master (#4867)
* Translate cockatrice/cockatrice_en@source.ts in de

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

* Translate cockatrice/cockatrice_en@source.ts in de

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

* Translate cockatrice/cockatrice_en@source.ts in de

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-09-11 21:24:57 +02:00
dependabot[bot]
e850f6c2a5 Bump actions/checkout from 3 to 4 (#4866) 2023-09-07 23:11:19 +02:00
github-actions[bot]
e9eb7d6db1 Update translation source strings (#4865)
Co-authored-by: github-actions <github-actions@github.com>
2023-09-01 20:20:19 -04:00
tooomm
56d21321d0 remove translation string (#4860) 2023-08-18 12:34:54 -04:00
transifex-integration[bot]
3888a74212 Translate oracle/oracle_en@source.ts in de (#4862)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-08-18 12:34:39 -04:00
transifex-integration[bot]
0035e29f9e Translate webclient/src/i18n-default.json in pt_BR (#4863)
100% translated source file: 'webclient/src/i18n-default.json'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-08-18 12:34:30 -04:00
ebbit1q
90679d5669 fix issues with #4648 (#4864) 2023-08-18 12:34:17 -04:00
transifex-integration[bot]
ac5dc2578a Translate cockatrice/cockatrice_en@source.ts in de (#4861)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-08-13 20:51:02 +02:00
tooomm
671e6823be cleanup vcpkg.json (#4859) 2023-08-11 13:35:59 +02:00
github-actions[bot]
0d76662311 Update translation source strings (#4843)
Co-authored-by: github-actions <github-actions@github.com>
2023-08-10 22:37:17 +02:00
tooomm
8dd59cf3cf CI: Bump GitHub actions + submodule (#4852)
* Bump used actions

* Update vcpkg submodule (#4857)

* Pause npm updates for webclient (#4853)

* Bump peter-evans/create-pull-request from 4 to 5 (#4846)

Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4 to 5.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v4...v5)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update vcpkg

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vcpkg action to v11

* Update vcpkg cache setting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 12:28:16 +02:00
dependabot[bot]
332d25dc00 Bump peter-evans/create-pull-request from 4 to 5 (#4846)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4 to 5.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v4...v5)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 23:21:26 +02:00
tooomm
0fa81a77dc Pause npm updates for webclient (#4853) 2023-08-08 13:17:28 +02:00
tooomm
9a74d8f72d update link (#4845) 2023-08-06 22:46:02 -04:00
Zach H
8c539351e3 Fix Mac Builds (#4844) 2023-08-06 22:45:45 -04:00
ebbit1q
e3552fc0ae add more default shortcuts (#4349)
* add more default shortcuts

replace the ctrl a look at top of library shortcut with ctrl shift n
use ctl a for draw arrow
replace ctrl shift b for toggle sideboard lock
use ctrl b for move card to bottom of library
use ctrl shift l for start local game
add keyboard shortcuts for all 3 counter colors using , . / keys
use ctrl [ ] \ for the "other" counter
add ctrl = as an easy alternative to ctrl + for people without keypads
( on linux ctrl alt keypad + is a special key that is reserved in x
  it produces the XF86_Next_VMode keyboard event which isn't bindable )
use alt u for toggling untapping
use alt l for peeking at cards
use ctrl alt u for unattaching cards
use alt n for set annotation
use alt y for milling one card

* use alt f for flipping cards
2023-08-06 17:56:24 -04:00
tooomm
ca308636c3 CI: Add automatic PR creation for source string updates (#4544)
* wording

* add pr creation

* Update translations.yml

* Update translations.yml

* update translation workflow

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* skip ci update

* skip ci update

* update conditions

* remove empty line

* typo

* tee test

* cleanup

* pass data between steps

* opt for step output over env variable

* remove space

* create script

* wording

* fix fork protection, re-add pr run

* updates

* Update translations.yml

* adjust for new source paths

* update comment

* wording

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* wording

* reorder

* reorder

* fix deprecation of set-output

* fix version

---------

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2023-08-06 17:55:50 -04:00
ebbit1q
244cb847fb replace trayicon activation with menu actions (#4632) 2023-08-06 17:55:02 -04:00
tooomm
176c52daf2 Enable Dependabot (#4795)
* add dependabot file

* disable submodules for now
2023-08-06 17:54:17 -04:00
tooomm
ee3525ec64 Webclient: Brazilian translations are doubled (#4809)
* cleanup old brazilian translations

* pt-br --> pt_br

* pt-br --> pt_br

* pt-br --> pt_br
2023-08-06 17:53:55 -04:00
dependabot[bot]
adce921be7 Bump protobufjs from 7.1.2 to 7.2.4 in /webclient (#4827)
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.1.2 to 7.2.4.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.1.2...protobufjs-v7.2.4)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-06 17:53:41 -04:00
dependabot[bot]
20ceb1c284 Bump semver from 6.3.0 to 6.3.1 in /webclient (#4829)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-06 17:53:32 -04:00
dependabot[bot]
db4364b8f8 Bump tough-cookie from 4.1.2 to 4.1.3 in /webclient (#4828)
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-06 17:53:25 -04:00
dependabot[bot]
48d6435e09 Bump word-wrap from 1.2.3 to 1.2.4 in /webclient (#4831)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-06 17:53:18 -04:00
ebbit1q
7c20e9ab34 add move cards from top of library until dialog (#4648)
a bit of a hack, the client will use the play top card action and then
compare it with the propmpted expression, as if you were cascading
normally but really fast

the new keybind for this is ctrl shift y

I have ratelimited the action to 10 cards a second
2023-08-06 17:53:07 -04:00
ebbit1q
cb52605928 use a regex to remove all reserved characters from file names (#4804) 2023-08-06 17:46:22 -04:00
Guangcong Luo
bd3100dcda Update macOS Monterey app icon (#4805) 2023-08-06 17:46:03 -04:00
ebbit1q
afb7c35cfd add a way to replace the user facing list of disallowed words (#4807) 2023-08-06 17:45:37 -04:00
tooomm
5b694a55d2 CI: Remove fedora 36 (#4799)
* remove fedora 36

* remove fedora 36

* remove fedora 36
2023-08-04 02:02:44 +02:00
SlightlyCircuitous
f750a4cd72 Remove Ubuntu 22.10 Kinetic Kudu Build (#4826) 2023-07-25 21:34:18 -04:00
SlightlyCircuitous
eddeaaf52a Add Debian 12 "Bookworm" Build (#4812) 2023-06-14 20:28:12 -04:00
tooomm
2b42bee424 Webclient: lint (#4810)
* lint

* lint
2023-05-14 00:09:40 +02:00
SlightlyCircuitous
b9706c0cc1 Add indentation (#4806)
Improves readability
2023-05-09 17:08:06 -04:00
transifex-integration[bot]
800b21b000 Apply translations in pt_BR (#4801)
100% translated for the source file 'cockatrice/cockatrice_en@source.ts'
on the 'pt_BR' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-05-09 17:07:23 -04:00
transifex-integration[bot]
d1736a25bb Translate webclient/src/i18n-default.json in pt_BR (#4800)
100% translated for the source file 'webclient/src/i18n-default.json'
on the 'pt_BR' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-05-09 17:06:40 -04:00
ebbit1q
f269e5fe58 add fedora 38, scheduled to release next week (#4785) 2023-04-30 14:21:13 +02:00
tooomm
45a5296013 CI: Fix versions before deprecation (#4798)
* fix deprecation warning

* fix deprecation warning
2023-04-30 13:51:09 +02:00
SlightlyCircuitous
5f0ab2a177 CPack DMG Installer with Background Image (#4787)
* Set some CPack variables

WIP for DMG background image

* Use a .tif for background

* Add Background image and DS_Store script

Script is from https://www.kitware.com//creating-mac-os-x-packages-with-cmake/ with cmake.app changed to cockatrice.app

* Add position for all icons

* Adjust background size and icon position

This draws dbconverter off the screen as a hack to hide it, so hopefully it doesn't break.

* Add files via upload

* Change Icon Position

Icon position is probably relative to the window edge, not the edge of the screen so the numbers should be lower.

* Adjust Icon Position and Window Boundaries

Applescript seems to use the center of the icon rather than the left corner so the coordinates need to be adjusted by 64 px. 

The finder window counts the 22 px of the title bar in the window size so 22 must be added to the fourth coord of position to fit the entire image.

* Fix spelling of Servatrice

* Satifsfy Code Style

* Use vector format (eps)

* Delete background.tif

* Use vector format (eps)

* Use the right file extention in the script

* Point to svg

* Use svg

* Add svg for background image

* Delete background.eps

* Use plain SVG, adjust text

* Move applescript to /cmake

* Move background to /cmake

* Point CPack to /cmake

background and applescript now reside there

* Revert to .tif

* Use compressed .tif

* Use more specific file name

* Script expects .background:background.tif
2023-04-29 23:13:01 -04:00
ebbit1q
70ab02987a save sets dialog size (#4791)
* save sets dialog size

* reset sorting when restoring

* add to gitignore
2023-04-29 23:10:59 -04:00
ebbit1q
421da882d8 qt 6.5 compatibility (#4796)
* remove metatypes definitions

* deprecation of QApplication::setActiveWindow
2023-04-29 23:09:26 -04:00
SlightlyCircuitous
1a40102f71 Remove Debian 10 "Buster" Build (#4789)
* Drop Debian 10 Support

EOL September 10 2022

* Drop Debian 10 Support

EOL September 10, 2022

* Drop Debian 10 Support

EOL September 10, 2022
2023-04-19 23:04:35 +02:00
SlightlyCircuitous
1fbc10cd77 Add Ubuntu 23.04 Lunar Lobster Build (#4784)
* Create Lunar Dockerfile

Note that qt6-svg-dev and qt6-websockets-dev are renamed replacements for libqt6svg6-dev and libqt6websockets6-dev, respectively.

* Add Ubuntu Lunar

* Add Ubuntu Lunar to Template
2023-04-12 22:31:39 +02:00
skwerlman
87462398d8 show deck hash even when its invalid (#4595)
* show deck hash even when its invalid

* remove invalid deck hashes entirely

---------

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2023-04-10 22:29:29 +02:00
dependabot[bot]
b33246b29f Bump loader-utils from 2.0.3 to 2.0.4 in /webclient (#4707)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-01 22:31:44 -04:00
transifex-integration[bot]
dbffe30f63 Translate /webclient/src/i18n-default.json in es (#4657)
translation completed for the source file '/webclient/src/i18n-default.json'
on the 'es' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-04-01 22:30:59 -04:00
ebbit1q
9ce450d0b0 add _substr_[pos]_[len] to picture download templates (#4762) 2023-04-01 22:29:57 -04:00
ebbit1q
f5f8acf1fd save downloaded xmls (#4736) 2023-04-01 22:19:57 -04:00
tooomm
304ed3cd60 UI: User info dialog updates (#4533) 2023-04-01 21:50:49 -04:00
dependabot[bot]
07248692ce Bump webpack from 5.74.0 to 5.76.1 in /webclient (#4774)
Bumps [webpack](https://github.com/webpack/webpack) from 5.74.0 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.74.0...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 23:46:50 -04:00
Brent Clark
cef99cba71 Add left nav (#4705)
* Automated translation update ( bf08a04cda )

* Add Layout component wip

* finish layout implementation

* convert header to left nav

* better nav item spacing

* return source files to original glory

* lint fix

* Remove height limit on login screen

* fix top spacing on 3-panel layout

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Brent Clark <brent@backboneiq.com>
2023-03-15 23:45:55 -04:00
SlightlyCircuitous
cab5f29b57 Add 'persistent' as valid attribute of related (#4771) 2023-03-10 02:36:17 +01:00
Basile Clement
55a2f75d16 Make cards rounded (#4765)
* Make cards rounded

Magic cards have rounded corners, and playing cards tend to have rounded
corners as well, but Cockatrice currently displays rectangular cards.

This can cause visual glitches when using image scans where the border
does not extend in the corner, and for this reason Cockatrice always
draws a (rectangular) border around the card to try and make it look a
bit better.

In this patch I take a different approach: rather than try to make
rounded pegs, er, cards, go into a square hole, the hole is now rounded.
More precisely, the AbstractCardItem now has a rounded rectangular shape
(with a corner of 5% of the width of the card, identical to that of
modern M:TG physical cards).

As a side effect, the card drawing gets a bit simplified by getting rid
of transformPainter() when drawing the card outline and using the
QPainter::drawPixmap overloads that takes a target QRectF instead.  This
means we no longer have to bother about card rotation when painting
since that's taken care of by the Graphics View framework (which
transformPainter() undoes).

* format

* Also give PileZone rounded corners

* Forgot untap status + bits of CardDragItem

* fix deckviewcard calculations

* Rounded CardInfoPicture
2023-03-07 01:41:08 +01:00
ebbit1q
a416ee8f2b set target to sha in release creation (#4763) 2023-03-03 11:40:16 -05:00
Basile Clement
c14936c63c PictureLoader: Replace downloadedPics cache with QNetworkCache (#4756)
* PictureLoader: Replace downloadedPics cache with QNetworkCache

Currently when the "Download card pictures on the fly" option is
enabled, Cockatrice stores downloaded pictures into a downloadedPics
sub-folder, keyed on set and card name. If a picture is found in that
folder, we never try to download a picture for that card ever again
(until it is reprinted in a more recent set, I guess).

This has the unfortunate consequence that if you change the URLs for
downloading card images, the changes are not applied to cards that
already have their picture downloaded. In particular, if you use
localized card pictures (through !sflang!), you get a mix of cards in
different languages depending on the currently configured language at
the time each card was downloaded.

This patch removes that mechanism in favor of setting a
QNetworkDiskCache on the QNetworkAccessManager used by the PictureLoader
to download pictures. The QNetworkDiskCache caches the picture keyed on
their URL: if the URL changes, a new request will be made. In
particular, if you use picture URLs with !sflang! and change the
language, pictures for the current language will be downloaded even for
cards that already have a picture. The QNetworkDiskCache is configured
with a maximum size of 4GB, which should be enough to hold one
high-quality JPEG for each M:TG card in existence.

Note that this does not affect the existing mechanism for defining
custom card art, either through the CUSTOM directory or the set-based
one.  Cockatrice will still read existing cards in the downloadedPics
directory as before, it will just no longer write into that directory
(since pictures are cached by the QNetworkDiskCache instead). To fully
switch to the new cache, users should use the "Delete Downloaded Images"
button in the settings: it will clear the QNetworkDiskCache but also
remove the downloadedPics directory.

* Do not use system cache dir for portable installs

* Add settings for network cache size

* Delete corrupted cache entries

* Use old-style connect() syntax (Qt5 build failure)

* Add setNetworkCacheSizeInMB to test mocks

* setTransferTimeout was added in Qt 5.15

* Improve logging messages

We now have the following messages

 - "Trying to download picture from url: URL" before loading a picture
   when picture download is enabled
 - "Trying to load picture from cache: URL" before loading a picture
   when picture download is disabled (i.e. cache-only offline mode)
 - "Removing corrupted cache file for url URL and retrying (ERR)" when
   when we fail to load a picture from the cache. Usually, this should
   be due to the timeout, in which case ERR will be "Operation
   Canceled".
 - "Download failed for url URL (ERR)" when there was an error
   downloading a picture from the network (ERR is the error message)
 - "Following redirect to URL" and "Following cached redirect to URL"
   when following a redirect (from network/from cache)
 - "Image successfully downloaded from URL" and "Image successfully
   loaded from cached url at URL" on success
 - "Possible cached/downloaded picture at URL could not be loaded" on
   ImageReader error

* Clarify that network cache is on disk

Also migrate "Delete Downloaded Image" to a "Clear" button right next to
the network cache size.

* Remove qPrintable

* Move pixmap cache settings to card sources

* qDebug().nospace()

* some formatting on debug messages

* format

* inverted condition

---------

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2023-03-03 16:55:17 +01:00
Basile Clement
42e7a8b423 Better support Double-Faced Cards (#4753)
* Better support Double-Faced Cards

This patch allows cards to be (virtually) transformed into other cards
while preserving their state, essentially implemeting the MTG mechanic
of the same name.

On the server side, this is implemented by allowing cards to be "stashed
away". A card that is stashed away is not in any zone, but is instead
owned by another card. When a token is destroyed due to a zone change,
if it had a card stashed away, that card is placed in the target zone
instead of the token.

On the database side, `attach="transform"` is used on `<reverse>` and
`<reverse-related>` to indicate that the created token should be
transformed this way.

Old servers ignore the new field in `Command_CreateToken` and will
perform a regular attachment, as currently.

* Address review comments

* Prevent tokens from being stashed

* format.sh
2023-03-03 16:54:51 +01:00
ebbit1q
4558b1c7ef set the target in the created release (#4758)
the target needs to be the current short commit hash because it is being
compared to by the updater, the default is "master" which breaks the
updater.
2023-02-23 01:11:41 +01:00
SlightlyCircuitous
f444ba9665 Corrected edition search syntax (#4752)
* Replaced "e:lea,leb" with "e:lea or e:leb"
* Removed "e:lea,leb -(e:lea e:leb) (Cards that appear in Alpha or Beta but not in both editions)" as this does not produce results in Cockatrice (even when using "or" instead of "," as above)
2023-02-16 12:08:00 +01:00
ebbit1q
787c8d740b replace github release actions with the gh tool in bash (#4746)
* replace github release actions with the gh tool in bash

* set macos 10.15 qt version to 6.2 LTS
2023-02-10 03:33:48 -05:00
Basile Clement
ef38a8bb2b Re-add missing '/' separator in <pt> after b282df2e27 (#4747)
In b282df2e27 (#4728) the logic for
creating <pt> values was updated to avoid adding a final slash after an
existing power value and missing toughness value. This works by setting
the ptSeparator to an empty string when either the power or the
toughness is undefined. However, due to the ptSeparator variable being
scoped out of the `for` loop, this causes all remaining cards to have an
empty string as a separator, ending up with <pt> values of e.g. 21
instead of 2/1.

Moreover, the implementation from #4728 is ambiguous in the case of a
card having a toughness value but no power value: in that situation, it
creates a <pt> entry with the toughness value and no separator, which is
not a good idea since it is not possible to know if <pt>2</pt> means
power 2 and no toughness, or no power and toughness 2 (Cockatrice takes
the first interpretation).

To avoid ambiguities, the <pt> value is now one of:

 1. A regular P/T value when the card has power and toughness
 2. A simplified P value when the card has power but no toughness
 3. A simplified /T value when the card has toughness but no power
 4. Absent when the card has neither power nor toughness

Note that, as far as I can tell, Cockatrice seems to (incorrectly, IMO)
ignore the initial slash if present in Player::parsePT, and treat /T as
a power value. However that is a separate issue: this patch is concerned
with Oracle and ensuring proper values in cards.xml, not with how
Cockatrice interprets those values.
2023-02-08 19:59:14 +01:00
Jeremy Letto
b5d35d346a Add architecture image to webclient README (#4745) 2023-02-08 18:04:23 +01:00
Basile Clement
9a7b15d19b Allow revealing specific cards from hand and library (#4743)
Currently Cockatrice allows revealing the whole hand, or one card at
random from the hand. Sometimes, a player needs to reveal a specific
card from their hand instead, which is not supported. To achieve a
similar effect, players usually move the corresponding card (or cards)
to a public zone, then back to their hand. While this works, it is
unsatisfactory (compared to a regular reveal, you can't keep the
"revealed" window around, for one) and somewhat unintuitive.

This patch adds a "Reveal to..." menu to cards and card selections in
the player's hand or in custom zones (this includes looking at the
player's library). This menu allows revealing a card or set of cards to
any given player, or to all players.

To implement this functionality at the protocol level, the existing
RevealCards command is extended to support revealing multiple specific
cards. This is done by making `card_id` a non-packed repeated field in
the `Command_RevealCards` and `Event_RevealCards` protobufs.  Using a
non-packed repeated fields allows maintaining backwards compatibility:
an empty optional field is encoded the same way as an empty non-packed
list, an optional field with a value is encoded the same way as a
one-element non-packed list, and when decoding a multi-elements
non-packed list as an optional, only the last item in the list is read.

Since the RevealCards command already exists, and due to the compatible
encodings, a new client connecting to an old server can reveal a single
specific card from their hand. When trying to reveal multiple cards at
once, the old server will only see the request for one of the cards to
be revealed, and the player will have to reveal each card separately.

On the other hand, `Event_RevealedCards` already has an explicit list of
cards revealed by the server, and the `card_id` field is only used when
exactly one card has been revealed: thus, old and new clients will
behave identically when receiving a new `Event_RevealedCards`. In
particular, if a player using a new client reveals multiple cards from
their hand on a new server, another player using an old client will
correctly see all the revealed cards.

The approach used to build the "Reveal to..." menu is slightly different
from the approach used to build other player selection menus. Because
the "Reveal to..." menu is specific to each card, but must also be
updated whenever a player is added to or removed from the game, I chose
to re-create it on the fly whenever a card is clicked, as that seemed
the safest way to avoid both memory leaks and inconsistent state given
my understanding of the code.
2023-02-07 17:12:04 -05:00
Zach H
ba35a11e82 Find OpenSSL on Windows (#4730) 2023-02-07 16:47:50 -05:00
Basile Clement
00c9efe541 Enable buttons for current game when receiving server response (#4737)
* Enable buttons for current game when receiving server response

Previously, upon joining a game, we were unconditionally re-enabling the
"Join" button in the lobby, even if it was not enabled in the first
place, causing #4698. This could also lead to issues where if the user
selects a different game after joining (which they can do in case of
e.g. network connectivity issues), the "Join as spectator" button could
get incorrectly disabled.

This fixes #4698 by re-enabling the buttons based on the state of the
currently selected game at the time the response is received. This also
avoids inconsistencies if a different game has been selected in between
joining and receiving a response from the server.

* Typo: enable gameButton in enableButtons

The "create game" button was incorrectly being disabled in enableButtons
whereas (as the name indicates) it should have been enabled

* Remove misleading comment about race conditions
2023-02-06 13:49:45 +01:00
cajun
44d1ab348b Add Oracle support for persistent & Fix persistent on reverse-related (#4742)
* fix persistent reverse-related

* create relations from spellbook property

* run format.sh
2023-02-06 07:00:54 -05:00
Zach H
f25e4785ae FIX #4665: Address missing sound on Qt5 Builds (#4733)
* FIX #4665: Address missing sound on Qt5 Builds

* FIX #4665: Address missing sound on Qt5 Builds

* Include both engines
2023-02-05 22:05:47 -05:00
Zach H
4c290aec57 Fix #4706: don't replace ampersands when loading from plain text (#4734)
* Fix #4706: Exit linting early if a card with the exact name is found first

* Remove ampersand conversion

* put back

* Update tests

* Format

* don't use qsizetype

---------

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2023-01-30 00:37:28 +01:00
tooomm
42d1d66d9b CI: macOS-10.15 environment is deprecated (#4664)
* macOS-10.15 environment is deprecated

Build for 10.14 has to be dropped.
Build for 10.15 can be preserved via 11.

* update xcode versions

* Xcode 13.0 doesn't work for us on Big Sur

* [skip ci] update list of binaries
2023-01-29 12:47:42 -05:00
ebbit1q
06c25301a5 update build dockerfiles (#4732) 2023-01-23 18:14:35 -05:00
transifex-integration[bot]
43dbb45cc6 Translate /webclient/src/i18n-default.json in it (#4718)
translation completed updated for the source file '/webclient/src/i18n-default.json'
on the 'it' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2023-01-23 02:26:24 -05:00
dependabot[bot]
9fb62de5cb Bump json5 from 1.0.1 to 1.0.2 in /webclient (#4729)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 02:26:12 -05:00
PakhomCh
b282df2e27 Fixed ptSeparation oracle issue (#4728)
* Fixed psTeparation oracle issue

* Update oracle/src/oracleimporter.cpp

Co-authored-by: PakhomCh <pakhomch@gmail.com>
2023-01-16 13:30:19 -05:00
ebbit1q
da8f57f397 remove link to google doc roadmap from readme (#4727) 2023-01-02 22:07:18 -05:00
SlightlyCircuitous
e9f1992c7f Add URL to explain message macros (#4712)
* Add URL Link to Explain Message Macros

* Add URL Link to Explain Message Macros

* Revert custom shortcuts wiki link

* Conform to formatting guidelines
2022-12-11 23:54:06 +01:00
transifex-integration[bot]
2c94a6a64e Apply translations in it (#4714)
translation completed for the source file '/cockatrice/cockatrice_en@source.ts'
on the 'it' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2022-12-11 23:42:51 +01:00
SlightlyCircuitous
6a5e0a8501 Display Welcome Message as Most Recent Message (#4720)
* Move Join Message Block

- Moves Join Message code block to after the for loop that gets old chat message, which makes the Join Message the most recent message in the chat box instead of the oldest
-Only the rc.enqueuePostResponseItem() line really needs to move for functionality, but I have moved the whole block for readability

* Comply with formatting guide

-Remove offending white space
2022-12-11 23:40:47 +01:00
Jeremy Letto
26d7fe2ff0 Webatrice: update deps (#4700)
* save work

* fix reset styling

* fix toast reducer

* update non-react deps

* update react libraries

* remove jquery, use sanitize-html instead

* add missing change

* fix deps and dev deps

* update workflow to target Node 16

* run @mui/codemod to remove @mui/styles

* add default body font size

* update react 17 to 18

* declare enum before use

* add rel attr to links

* fix font sizing issue

* trailing commas

* refactor deep destructuring

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
2022-11-01 12:41:42 -05:00
ebbit1q
5854a635ca fix deprecated usage of set-output (#4699) 2022-10-31 23:26:26 +01:00
ebbit1q
3d4858b840 use qt6 in arch builds (#4691)
* use qt6 in arch builds

* fix 6.4.0 deprecations
2022-10-31 23:26:13 +01:00
ebbit1q
dec2a252fa remove dependency on deprecated qt5 libraries for qt6 (#4692)
* remove dependency on deprecated qt5 libraries for qt6

removes the use of qt6-5compat for builds
replaces use of QRegExp with QRegularExpression
fixes incorrect usage of QRegExp
removes use of QTextCodec
fixes incorrect usage of QTextCodec
sets qtlinguist as a required component for qt6

* fix anchoredPattern not existing in qt 5.11
2022-10-31 23:24:11 +01:00
Jeremy Letto
f619ef23fd Upgrade to MUI 5 (#4606)
* save work

* fix perf issue on i18n rollup

* fix reset styling

* move body line-height from reset

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
2022-10-29 20:17:03 -05:00
Antoine Dahan
72743e834e Selecting game already open in a tab brings user to that tab. (#4653)
* When trying to join a game from GameSelector that's already been joined by you, navigate to its game tab.

* return immediately, do not change button states

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-10-29 15:46:50 +02:00
Tobyclark
8e4ddf366c Added hint when drawing 0 cards (#4697)
* Logging a player drawing 0 cards will now result in the message "player had no cards left to draw."

* Added hint when drawing when deck is empty

* Added hint when drawing when deck is empty

* Added hint when drawing when deck is empty

* Update cockatrice/src/messagelogwidget.cpp

update log message to present tense

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* added deckIsEmpty parameter to messagelogwidget::logDrawCards

* run format

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-10-29 15:46:29 +02:00
ebbit1q
b99bd0176a update deprecated workflow actions (#4690) 2022-10-17 23:55:07 -04:00
ebbit1q
a68b98b245 update vcpkg submodule (#4689) 2022-10-17 18:23:39 -04:00
transifex-integration[bot]
a69d6ff1b4 Translate /oracle/oracle_en@source.ts in it (#4688)
translation completed for the source file '/oracle/oracle_en@source.ts'
on the 'it' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2022-10-17 16:43:31 -04:00
transifex-integration[bot]
ec679e95fd Translate /webclient/src/i18n-default.json in fr (#4678)
translation completed updated for the source file '/webclient/src/i18n-default.json'
on the 'fr' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2022-10-17 16:43:14 -04:00
ebbit1q
3f78235a74 fix updater with changes in release name (#4666)
* fix updater with changes in release name

* clangify
2022-10-17 16:42:08 -04:00
ebbit1q
c8a2fd78b0 fix crash when right clicking a user's name in a replay (#4681)
this happened when viewing a replay with the "view replay" option in the
top menu, instead of using the replays tab while connected to a server.
this uses the local game player instead of the online one which does not
initialize the player info of the local spectating player, this causes a
crash when opening the context menu on another player in the replay from
one of their chat messages as it tries to check if you're a registered
user and could add them as a friend etc.
it now regards the uninitialized player info as an unregistered user and
will not show these options.
2022-10-17 16:40:27 -04:00
ebbit1q
45cf08111a fix crash when a cardmenu becomes an orphan (#4682)
* fix crash when a cardmenu becomes an orphan

when a cardmenu is closed the cursor on that card reverts to the open
hand, this crashed the client when that card would be destroyed or moved
the act of reverting to the open hand now happens as an emitted signal,
this way it just doesn't exist anymore when the card is deleted.

* simplify fix
2022-10-17 16:38:44 -04:00
ebbit1q
527ac36129 update card menu immediately on card counter event (#4686)
fixes #4658
2022-10-17 16:37:32 -04:00
ebbit1q
a7232513a7 remove cards being looked at from the count on drawing (#4671) 2022-10-17 16:35:54 -04:00
ebbit1q
90f187e885 fix 4679 (#4680) 2022-10-02 13:23:35 -04:00
ebbit1q
235adbbdf1 fix sound slider on qt6 (#4642) 2022-09-01 19:01:20 +02:00
cajun
40c88fe385 Conjured tokens xml attribute (#4646)
* Conjured xml attr

Add conjured attribute to related xml tags that makes those cards not be destroyed when they leave the battlefield.

* fix build errors, add sarkhan to test

* update oracle importer to support spellbooks from json

* debugging

* fix weird spacing

* fix oracle spacing too

* simplify if/else

Co-authored-by: Zach H <zahalpern+github@gmail.com>

* rename, remove oracle update

* remove extra linebreak

* run format.sh again
2022-09-01 08:45:04 +02:00
tooomm
54b7943d17 CI: Update Qt setup on Windows (#4654)
* use new internal caching

* Update desktop-build.yml

* Update desktop-build.yml

* Update desktop-build.yml

* use newest patch version

jurplel/install-qt-action#version

* python not needed

* Update desktop-build.yml

* Update desktop-build.yml

* Update desktop-build.yml

* Update desktop-build.yml

* Update desktop-build.yml

* install openssl via tools

* add $RUNNER_WORKSPACE location

Source: https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/environment-variables-full-list-github-actions

* Update FindWin32SslRuntime.cmake

* Update FindWin32SslRuntime.cmake

* Update FindWin32SslRuntime.cmake

* Update FindWin32SslRuntime.cmake

* Delete download_openssl.sh

* cleanup

* [skip ci] improve short-circuit evaluation comment

* restructure
2022-09-01 02:38:25 +02:00
ebbit1q
2f100f2ba3 fix keepalive being multiplied in server timeout (#4663)
* fix keepalive being multiplied in server timeout

a timeout happened after the client not receiving anything for
keepalive * keepalive * maxtimeout (5 * 5 * 10) seconds instead of what
you'd expect, it now only uses keepalive once instead of twice this
means it should now take 50 seconds to time out when disconnected

* change timeout to 15 seconds instead

change time between pings to 3 from 5 seconds
change timout to 5 from 10 repeats
2022-09-01 02:38:10 +02:00
cajun
b5305aa5e4 Attach and Unattach apply to entire selection (#4651)
* (un)attach applies to entire selection

* additional code formatting, just because it's nicer

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-08-25 21:26:29 -04:00
Gian Furrer
a2624e36f3 fix broken link in readme (#4659) 2022-08-11 23:21:30 +02:00
transifex-integration[bot]
540511befd Apply translations in es (#4656)
translation completed for the source file '/cockatrice/cockatrice_en@source.ts'
on the 'es' language.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2022-08-10 16:35:09 +02:00
tooomm
014e73d569 CI: Remove EOL builds (Fedora 34 and Ubuntu 21.10) (#4628)
* Fedora 34 EOL

* Delete .ci/Fedora34 directory

* update fedora

* Ubuntu 21.10 EOL

* Ubuntu 21.10 EOL

* Delete .ci/UbuntuImpish directory
2022-08-09 20:56:27 +02:00
ebbit1q
e2c256db5b fix typo in format.sh (#4647) 2022-07-05 15:49:19 -04:00
ebbit1q
28aa473362 rework formatting with cmake-format (#4627)
* merge clangify and cmakify into format.sh

update desktop lint workflow to 22.04

print cmake-format version as well

um, rename things?

add extra examples to format.sh --help
add option to not run clang-format
fix version display in .ci/lint_cpp.sh
fix relative paths in format.sh

fix formatting dirs

* run ./format.sh --cmake --branch ""

* revert formatting of cmake comments
2022-06-08 21:14:26 -04:00
ebbit1q
b79506fbcf add a windows 7 specific build to ci (#4639) 2022-06-08 21:09:35 -04:00
ebbit1q
afbd7252ac remove stopping sounds from interrupting each other (#4640) 2022-06-08 21:06:44 -04:00
ebbit1q
3e5b7cd392 remove unused variables (#4636) 2022-06-08 00:32:11 +02:00
Dawid Skórzewski
77622095d5 Fixed typos in Qt6_FOUND function reference (#4638) 2022-06-04 22:33:02 -04:00
dependabot[bot]
8ee71300a2 Bump protobufjs from 6.11.2 to 6.11.3 in /webclient (#4637)
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 6.11.2 to 6.11.3.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/v6.11.3/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/v6.11.2...v6.11.3)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-03 01:21:37 -04:00
dependabot[bot]
d79971edbc Bump dexie from 3.2.1 to 3.2.2 in /webclient (#4629)
Bumps [dexie](https://github.com/dfahlander/Dexie.js) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/dfahlander/Dexie.js/releases)
- [Commits](https://github.com/dfahlander/Dexie.js/compare/v3.2.1...v3.2.2)

---
updated-dependencies:
- dependency-name: dexie
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-23 17:32:23 -04:00
Impyrical
273ebb22e4 Tackling #4041 (#4625)
Copy contents of selected cell from card database when ctrl-c is
pressed, mimicking the behavior of ctrl-c in the deck editor.
2022-05-21 01:22:08 +02:00
Zach H
6b86e4d463 Update configuration path to be backwards compatible (#4620)
* Update configuration path to be backwards compatible
Windows users have used AppData/Local/Cockatrice, whereas the new system was using AppData/Roaming/Cockatrice. This reverts the behavior in a Qt5/6 way.
2022-05-12 18:13:49 -04:00
ZeldaZach
a8e1dc3b18 Re-Run cmakeify 2022-05-09 18:01:30 -04:00
827 changed files with 143933 additions and 61253 deletions

View File

@@ -8,9 +8,11 @@ RUN pacman --sync --refresh --sysupgrade --needed --noconfirm \
gtest \
mariadb-libs \
protobuf \
qt5-base \
qt5-multimedia \
qt5-svg \
qt5-tools \
qt5-websockets \
qt6-base \
qt6-imageformats \
qt6-multimedia \
qt6-svg \
qt6-tools \
qt6-translations \
qt6-websockets \
&& pacman --sync --clean --clean --noconfirm

View File

@@ -1,25 +0,0 @@
FROM debian:10
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ccache \
clang-format \
cmake \
file \
g++ \
git \
liblzma-dev \
libmariadb-dev-compat \
libprotobuf-dev \
libqt5multimedia5-plugins \
libqt5sql5-mysql \
libqt5svg5-dev \
libqt5websockets5-dev \
protobuf-compiler \
qt5-default \
qtbase5-dev \
qtmultimedia5-dev \
qttools5-dev \
qttools5-dev-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -17,6 +17,7 @@ RUN apt-get update && \
libqt5svg5-dev \
libqt5websockets5-dev \
protobuf-compiler \
qt5-image-formats-plugins \
qtmultimedia5-dev \
qttools5-dev \
qttools5-dev-tools \

View File

@@ -1,4 +1,4 @@
FROM ubuntu:impish
FROM debian:12
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -9,16 +9,19 @@ RUN apt-get update && \
file \
g++ \
git \
libgl-dev \
liblzma-dev \
libmariadb-dev-compat \
libprotobuf-dev \
libqt5multimedia5-plugins \
libqt5sql5-mysql \
libqt5svg5-dev \
libqt5websockets5-dev \
libqt6multimedia6 \
libqt6sql6-mysql \
qt6-svg-dev \
qt6-websockets-dev \
protobuf-compiler \
qtmultimedia5-dev \
qttools5-dev \
qttools5-dev-tools \
qt6-image-formats-plugins \
qt6-l10n-tools \
qt6-multimedia-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -1,21 +0,0 @@
FROM fedora:34
RUN dnf install -y \
@development-tools \
ccache \
cmake \
desktop-file-utils \
file \
gcc-c++ \
git \
hicolor-icon-theme \
libappstream-glib \
mariadb-devel \
protobuf-devel \
qt5-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \
rpm-build \
sqlite-devel \
wget \
xz-devel \
zlib-devel \
&& dnf clean all

View File

@@ -1,21 +0,0 @@
FROM fedora:35
RUN dnf install -y \
@development-tools \
ccache \
cmake \
desktop-file-utils \
file \
gcc-c++ \
git \
hicolor-icon-theme \
libappstream-glib \
mariadb-devel \
protobuf-devel \
qt5-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \
rpm-build \
sqlite-devel \
wget \
xz-devel \
zlib-devel \
&& dnf clean all

View File

@@ -1,4 +1,4 @@
FROM fedora:36
FROM fedora:40
RUN dnf install -y \
ccache \
@@ -7,7 +7,8 @@ RUN dnf install -y \
git \
mariadb-devel \
protobuf-devel \
qt6-{qttools,qtsvg,qtmultimedia,qtwebsockets,qt5compat}-devel \
qt6-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \
qt6-qtimageformats \
rpm-build \
xz-devel \
zlib-devel \

15
.ci/Fedora41/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM fedora:41
RUN dnf install -y \
ccache \
cmake \
gcc-c++ \
git \
mariadb-devel \
protobuf-devel \
qt6-{qttools,qtsvg,qtmultimedia,qtwebsockets}-devel \
qt6-qtimageformats \
rpm-build \
xz-devel \
zlib-devel \
&& dnf clean all

View File

@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:20.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -18,6 +18,7 @@ RUN apt-get update && \
libqt5websockets5-dev \
protobuf-compiler \
qt5-default \
qt5-image-formats-plugins \
qtmultimedia5-dev \
qttools5-dev \
qttools5-dev-tools \

View File

@@ -1,4 +1,4 @@
FROM ubuntu:jammy
FROM ubuntu:22.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@@ -13,12 +13,12 @@ RUN apt-get update && \
liblzma-dev \
libmariadb-dev-compat \
libprotobuf-dev \
libqt6core5compat6-dev \
libqt6multimedia6 \
libqt6sql6-mysql \
libqt6svg6-dev \
libqt6websockets6-dev \
protobuf-compiler \
qt6-image-formats-plugins \
qt6-l10n-tools \
qt6-multimedia-dev \
qt6-tools-dev \

View File

@@ -0,0 +1,27 @@
FROM ubuntu:24.04
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ccache \
clang-format \
cmake \
file \
g++ \
git \
libgl-dev \
liblzma-dev \
libmariadb-dev-compat \
libprotobuf-dev \
libqt6multimedia6 \
libqt6sql6-mysql \
qt6-svg-dev \
qt6-websockets-dev \
protobuf-compiler \
qt6-image-formats-plugins \
qt6-l10n-tools \
qt6-multimedia-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -1,24 +0,0 @@
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ccache \
clang-format \
cmake \
file \
g++ \
git \
liblzma-dev \
libmariadb-dev-compat \
libprotobuf-dev \
libqt5multimedia5-plugins \
libqt5sql5-mysql \
libqt5svg5-dev \
libqt5websockets5-dev \
protobuf-compiler \
qt5-default \
qtmultimedia5-dev \
qttools5-dev \
qttools5-dev-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -127,7 +127,7 @@ fi
# Add cmake --build flags
buildflags=(--config "$BUILDTYPE")
if [[ $PARALLEL_COUNT ]]; then
if [[ $(cmake --build /not_a_dir --parallel |& head -1) =~ parallel ]]; then
if [[ $(cmake --build /not_a_dir --parallel 2>&1 | head -1) =~ parallel ]]; then
# workaround for bionic having an old cmake
echo "this version of cmake does not support --parallel, using native build tool -j instead"
buildflags+=(-- -j "$PARALLEL_COUNT")
@@ -160,7 +160,13 @@ cmake .. "${flags[@]}"
echo "::endgroup::"
echo "::group::Build project"
cmake --build . "${buildflags[@]}"
if [[ $RUNNER_OS == Windows ]]; then
# Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
# and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt
cmake --build . "${buildflags[@]}" -- -p:UseMultiToolTask=true -p:EnableClServerMode=true
else
cmake --build . "${buildflags[@]}"
fi
echo "::endgroup::"
if [[ $USE_CCACHE ]]; then
@@ -171,7 +177,7 @@ fi
if [[ $MAKE_TEST ]]; then
echo "::group::Run tests"
ctest -C "$BUILDTYPE"
ctest -C "$BUILDTYPE" --output-on-failure
echo "::endgroup::"
fi
@@ -183,6 +189,12 @@ fi
if [[ $MAKE_PACKAGE ]]; then
echo "::group::Create package"
if [[ $RUNNER_OS == macOS ]]; then
# Workaround https://github.com/actions/runner-images/issues/7522
echo "killing XProtectBehaviorService"; sudo pkill -9 XProtect >/dev/null || true;
echo "waiting for XProtectBehaviorService kill"; while pgrep "XProtect"; do sleep 3; done;
fi
cmake --build . --target package --config "$BUILDTYPE"
echo "::endgroup::"

View File

@@ -1,35 +0,0 @@
#!/bin/bash
# Read arguments
while [[ $# != 0 ]]; do
case "$1" in
'--')
shift
;;
'--arch')
shift
if [[ $# == 0 ]]; then
echo "::error file=$0::--arch expects an argument"
exit 3
fi
OS_ARCH="$1"
shift
;;
*)
echo "::error file=$0::unrecognized option: $1"
exit 3
;;
esac
done
set -e
OPEN_SSL_VERSION="1.1.1n"
DEST_PATH="C:\OpenSSL-Win$OS_ARCH"
curl -JLSs "https://github.com/CristiFati/Prebuilt-Binaries/raw/master/OpenSSL/v1.1.1/OpenSSL-$OPEN_SSL_VERSION-Win-pc0$OS_ARCH.zip" -o OpenSSL.zip
unzip -q "OpenSSL.zip"
rm "OpenSSL.zip"
mv "OpenSSL\OpenSSL\\$OPEN_SSL_VERSION" "$DEST_PATH"
rm -r "OpenSSL"
echo "Installed OpenSSL v$OPEN_SSL_VERSION to $DEST_PATH"

View File

@@ -10,10 +10,10 @@ if ! git merge-base origin/master HEAD; then
git fetch --unshallow
fi
# Check formatting using clangify
echo "Checking your code using clang-format..."
# Check formatting using format.sh
echo "Checking your code using clang-format/cmake-format..."
diff="$(./clangify.sh --diff --cf-version --branch origin/master)"
diff="$(./format.sh --diff --cmake --cf-version --branch origin/master)"
err=$?
case $err in
@@ -24,7 +24,7 @@ case $err in
*** ***
*** Your code does not comply with our style guide. ***
*** ***
*** Please correct it or run the "clangify.sh" script. ***
*** Please correct it or run the "format.sh" script. ***
*** Then commit and push those changes to this branch. ***
*** Check our CONTRIBUTING.md file for more details. ***
*** ***
@@ -32,12 +32,14 @@ case $err in
*** ***
***********************************************************
Used clang-format version:
Used version:
${diff%%
----------
*}
The following changes should be made:
${diff#*
----------
}
Exiting...
@@ -62,8 +64,6 @@ EOM
;;
*)
echo ""
echo "Something went wrong in our formatting checks: clangify returned $err" >&2
echo ""
echo "Something went wrong in our formatting checks: format.sh returned $err" >&2
;;
esac

17
.ci/macos.entitlements Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>

View File

@@ -4,6 +4,7 @@
# where SUFFIX is either available in the environment or as the first arg
# if MAKE_ZIP is set instead a zip is made
# expected to be run in the build directory unless BUILD_DIR is set
# adds output to GITHUB_OUTPUT
builddir="${BUILD_DIR:=.}"
findrx="Cockatrice-*.*"
@@ -50,5 +51,5 @@ fi
cd "$oldpwd"
relative_path="$path/$filename"
ls -l "$relative_path"
echo "::set-output name=path::$relative_path"
echo "::set-output name=name::$filename"
echo "path=$relative_path" >>"$GITHUB_OUTPUT"
echo "name=$filename" >>"$GITHUB_OUTPUT"

View File

@@ -4,6 +4,7 @@
# the releases are first made as drafts and will be vetted by a human
# it just has to provide a template
# this requires the repo to be unshallowed
# adds output to GITHUB_OUTPUT
template_path=".ci/release_template.md"
body_path="/tmp/release.md"
beta_regex='beta'
@@ -22,22 +23,22 @@ fi
# create title
if [[ $TAG =~ $beta_regex ]]; then
echo "::set-output name=is_beta::yes"
echo "is_beta=yes" >>"$GITHUB_OUTPUT"
title="$TAG"
echo "creating beta release '$title'"
elif [[ ! $(cat CMakeLists.txt) =~ $name_regex ]]; then
echo "::error file=$0::could not find releasename in CMakeLists.txt"
exit 1
else
echo "::set-output name=is_beta::no"
echo "is_beta=no" >>"$GITHUB_OUTPUT"
name="${BASH_REMATCH[1]}"
version="${TAG##*-}"
title="Cockatrice $version: $name"
no_beta=1
echo "::set-output name=friendly_name::$name"
echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
echo "creating full release '$title'"
fi
echo "::set-output name=title::$title"
echo "title=$title" >>"$GITHUB_OUTPUT"
# add release notes template
if [[ $no_beta ]]; then
@@ -60,9 +61,9 @@ fi
all_tags="
$(git tag)" # tags are ordered alphabetically
before="${all_tags%%
$TAG*}" # strip line with current tag an all lines after it
"$TAG"*}" # strip line with current tag an all lines after it
# note the extra newlines are needed to always have a last line
if [[ $all_tags == $before ]]; then
if [[ $all_tags == "$before" ]]; then
echo "::warning file=$0::could not find current tag"
else
while
@@ -74,7 +75,7 @@ else
beta_list+=" $previous" # add to list of skipped betas
next_before="${before%
*}" # strip the last line
if [[ $next_before == $before ]]; then
if [[ $next_before == "$before" ]]; then
unset previous
break
fi
@@ -108,5 +109,5 @@ else
fi
# write to file
echo "::set-output name=body_path::$body_path"
echo "body_path=$body_path" >>"$GITHUB_OUTPUT"
echo "$body" >"$body_path"

View File

@@ -4,50 +4,49 @@
git push -d origin --REPLACE-WITH-BETA-LIST--
-->
<!-- This list of binaries should be updated every time the ci is changed to
<!-- This list of binaries should be updated every time the CI is changed to
include different targets -->
<pre>
<b>Pre-compiled binaries we serve:</b>
- <kbd>Windows 7/8/10/11 (32-bit)</kbd>
- <kbd>Windows 7/8/10/11 (64-bit)</kbd>
- <kbd>macOS 10.14</kbd> ("Mojave")
- <kbd>macOS 10.15</kbd> ("Catalina")
- <kbd>macOS 11.0</kbd> ("Big Sur")
- <kbd>Ubuntu 18.04</kbd> ("Bionic Beaver")
- <kbd>Ubuntu 20.04</kbd> ("Focal Fossa")
- <kbd>Ubuntu 21.10</kbd> ("Impish Indri")
- <kbd>Ubuntu 22.04</kbd> ("Jammy Jellyfish")
- <kbd>Debian 10</kbd> ("Buster")
- <kbd>Windows 10+</kbd>
- <kbd>Windows 7+</kbd>
- <kbd>macOS 14+</kbd> ("Sonoma") / Apple M
- <kbd>macOS 13+</kbd> ("Ventura") / Intel
- <kbd>Ubuntu 24.04 LTS</kbd> ("Noble Numbat")
- <kbd>Ubuntu 22.04 LTS</kbd> ("Jammy Jellyfish")
- <kbd>Ubuntu 20.04 LTS</kbd> ("Focal Fossa")
- <kbd>Debian 12</kbd> ("Bookworm")
- <kbd>Debian 11</kbd> ("Bullseye")
- <kbd>Fedora 34</kbd>
- <kbd>Fedora 35</kbd>
- <kbd>Fedora 36</kbd>
<kbd>We are also packaged in Arch Linux's official community repository, courtesy of @FFY00</kbd></i>
<kbd>General linux support is available via a flatpak package (Flathub)</kbd></i>
- <kbd>Fedora 41</kbd>
- <kbd>Fedora 40</kbd>
<i>We are also packaged in <kbd>Arch Linux</kbd>'s official "extra" repository, courtesy of @FFY00</i>
<i>General Linux support is available via a <kbd>flatpak</kbd> package (Flathub)</i>
</pre>
## General Notes
<!-- --REPLACE-WITH-RELEASE-TITLE-- should be placed here by the ci -->
We're pleased to announce the newest official release: <kbd>--REPLACE-WITH-RELEASE-TITLE--</kbd>
We hope you enjoy the changes made and we have listed all changes, with their corresponding tickets, since the last version of Cockatrice was released for your convenience.
We hope you enjoy the changes made! All improvements with their corresponding tickets since the last version of Cockatrice are listed in the changelog below.
If you ever encounter a bug, have a suggestion or idea, or feel a need for a developer to look into something, please feel free to [open a ticket](https://github.com/Cockatrice/Cockatrice/issues). ([How to create a GitHub Ticket for Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))
If you ever encounter a bug, have a suggestion or idea, or feel a need for a developer to look into something, please feel free to [open a ticket](https://github.com/Cockatrice/Cockatrice/issues). ([How to create a Ticket for Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))
For any information relating to Cockatrice, please take a look at our official site: **https://cockatrice.github.io**
For basic information related to the app and getting started, please take a look at our official site: **https://cockatrice.github.io**
If you'd like to help contribute to Cockatrice in any way, check out our [README](https://github.com/Cockatrice/Cockatrice#get-involved-). We're always available to answer questions you may have on how the program works and how you can provide a meaningful contribution.
If you'd like to help and contribute to Cockatrice in any way, check out our [README](https://github.com/Cockatrice/Cockatrice#get-involved-).
We're always available to answer questions you may have on how the program works and how you can provide a meaningful contribution.
## Upgrading Cockatrice
<!-- this optional section puts a warning banner for problems with updating
> ⚠️ **With this release, we no longer provide a ready-to-install binary for:**
> [!IMPORTANT]
> **With this release, we no longer provide a ready-to-install binary for:**
> --DEPRECATED-OS-HERE--
-->
- Run the internal software updater: <kbd>Help → Check for Client Updates</kbd>
Run the internal software updater: <kbd>Help → Check for Client Updates</kbd>
Don't forget to update your card database right after! (<kbd>Help → Check for Card Updates...</kbd>)
@@ -64,14 +63,14 @@ Remove empty headers when done.
-->
<!-- Highlights of the release -->
### ⚠️ Important:
### 🔖 Highlights:
### ✨ New Features:
### 🐛 Fixed Bugs / Resolved issues:
### 🐛 Fixed Bugs / Resolved Issues:
<!-- Complete list of changes (foldable) -->
<details>
<summary>
📘 <b>Show all changes</b> (--REPLACE-WITH-COMMIT-COUNT-- commits)
<b>Show all changes</b> (--REPLACE-WITH-COMMIT-COUNT-- commits)
</summary>
### User Interface
@@ -92,5 +91,6 @@ Remove empty headers when done.
## Special Thanks
<!-- Personalise this a bit! -->
We continue to find it amazing that so many people contribute their time, knowledge, code, testing and more to the project. We'd like to thank the entire Cockatrice community for their efforts.
It's amazing that so many people contribute their time, knowledge, code, testing and more to the project.
We'd like to thank the entire Cockatrice community for their efforts! 🙏
<!-- We'd like to especially recognize @ZeldaZach, --ADD-CONTRIBUTORS-HERE-- for their help in preparing so many amazing new features for the user base. -->

View File

@@ -0,0 +1,58 @@
#!/bin/bash
# ci script to update translation files
# usage:
# $0 cockatrice/cockatrice_en@source.ts cockatrice/src common
# or
# FILE="cockatrice/cockatrice_en@source.ts"
# DIRS="cockatrice/src common"
# $0
# note: directories can't contain spaces
# check parameters
if [[ ! $FILE ]]; then
FILE="$1"
shift
fi
if [[ ! $FILE ]]; then
echo "no output file selected" >&2
exit 2;
fi
if [[ ! $DIRS ]]; then
DIRS="$*"
fi
if [[ ! $DIRS ]]; then
echo "no source directories selected to translate" >&2
exit 2;
fi
if [[ ! -e $FILE ]]; then
echo "output file does not exist at: $FILE" >&2
exit 3;
fi
# print version
if ! lupdate -version; then
echo "failed to run lupdate" >&2
exit 4;
fi
# run lupdate, duplicating the output in stderr and saving it
# for convenience we ignore that $DIRS will be split on spaces
# shellcheck disable=SC2086
if ! got="$(lupdate $DIRS -ts "$FILE" | tee /dev/stderr)"; then
echo "failed to update $FILE with $DIRS" >&2
exit 4;
fi
# trim output
# the line we are interested in is:
# Found xxx source text(s) (x new and xxx already existing)
output="${got##* source text(s) (}" # get stuff in between brackets
output="${output%%)*}" # trim everything after first )
if [[ $output == "$got" ]]; then
echo "could not parse generated output" >&2
exit 4;
fi
# write output to ci environment file
echo "output=$output" >> "$GITHUB_OUTPUT"

View File

@@ -0,0 +1,14 @@
Updated source strings for translations:
- {{ .cockatrice_output }} (Cockatrice)
- {{ .oracle_output }} (Oracle)
<br>
Last changes are based on commit {{ .commit }}.
---
*This PR is automatically generated and updated by the workflow at `.github/workflows/translations-push.yml`. Review [action runs][2].*<br>
*After merging, all changes to the source language are available for translation at [Transifex][1] shortly.*
[1]: https://app.transifex.com/cockatrice/cockatrice/
[2]: https://github.com/Cockatrice/Cockatrice/actions/workflows/translations-push.yml?query=branch%3Amaster

View File

@@ -102,5 +102,8 @@
"decisions. See the documentation for more information."
],
"layout_passes": {}
},
"markup": {
"enable_markup": false
}
}
}

View File

@@ -41,8 +41,8 @@ albeit slightly less active.
We use a separate job on the CI to check your code for formatting issues. If
your pull request failed the test, you can check the output on the checks tab.
It's the first job called "linter", you can click the "Run clangify" step to
see the output of the test.
It's the first job called "linter", you can click the "Check code formatting"
step to see the output of the test.
The message will look like this:
```
@@ -50,7 +50,7 @@ The message will look like this:
*** ***
*** Your code does not comply with our style guide. ***
*** ***
*** Please correct it or run the "clangify.sh" script. ***
*** Please correct it or run the "format.sh" script. ***
*** Then commit and push those changes to this branch. ***
*** Check our CONTRIBUTING.md file for more details. ***
*** ***
@@ -81,9 +81,9 @@ The handy tool `clang-format` can format your code for you, it is available for
almost any environment. A special `.clang-format` configuration file is
included in the project and is used to format your code.
We've also included a bash script, `clangify.sh`, that will use clang-format to
format all files in your pr in one go. Use `./clangify.sh --help` to show a
full help page.
We've also included a bash script, `format.sh`, that will use clang-format to
format all files in your pr in one go. Use `./format.sh --help` to show a full
help page.
To run clang-format on a single source file simply use the command
`clang-format -i <filename>` to format it in place. (Some systems install
@@ -290,20 +290,21 @@ be included in the next release 👍
Basic workflow for translations:
1. Developer adds a `tr("foo")` string in the code;
2. Every few days, a maintainer updates the `*_en@source.ts files` with the new strings;
3. Transifex picks up the new files from GitHub every 24 hours;
4. Translators translate the new untranslated strings on Transifex;
5. Before a release, a maintainer fetches the updated translations from Transifex.
2. CI updates the `*_en@source.ts files` regularly and creates a PR automatically;
3. Maintainer verifies and merges the change;
4. Transifex picks up the new files from GitHub automatically;
5. Translators translate the new untranslated strings on Transifex;
6. Before a release, a maintainer fetches the updated translations from Transifex.
### Using Translations (for developers) ###
All the user-interface strings inside Cockatrice's source code must be written
in English(US).
All user interface strings inside Cockatrice's source code must be written
in English (US).
Translations to other languages are managed using [Transifex](
https://www.transifex.com/projects/p/cockatrice/).
Adding a new string to translate is as easy as adding the string in the
'tr("")' function, the string will be picked up as translatable automatically
`tr("")` function, the string will be picked up as translatable automatically
and translated as needed.
For example, setting the text of a label in the way that the string
`"My name is:"` can be translated:
@@ -312,7 +313,7 @@ nameLabel.setText(tr("My name is:"));
```
To translate a string that would have plural forms you can add the amount to
the tr call, also you can add an extra string as a hint for translators:
the tr() call, also you can add an extra string as a hint for translators:
```c++
QString message = tr("Everyone draws %n cards", "pop up message", amount);
```
@@ -321,20 +322,46 @@ https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals)
If you're about to propose a change that adds or modifies any translatable
string in the code, you don't need to take care of adding the new strings to
the translation files.
Every few days, or when a lot of new strings have been added, someone from the
development team will take care of extracting all the new strings and adding
them to the english translation files and making them available to translators
on Transifex.
the translation files.<br>
We have an automated process to update our language source files on a schedule
and provide the translators on Transifex with the new contents.<br>
Maintainers can also manually trigger this on demand.
### Maintaining Translations (for maintainers) ###
When new translatable strings have been added to the code, a maintainer should
make them available to translators on Transifex. Every few days, or when a lot
of new strings have been added, a maintainer should take care of extracting all
the new strings and add them to the english translation files.
When new translatable strings have been added to the code, a maintainer has to
make them available to translators on Transifex.
To update the english translation files, re-run cmake enabling the appropriate
To help with that, we have an automated CI workflow, that regularly looks at the
code in the master branch, extracts all strings and updates dedicated source string
files with any changes. These updates are not commited right away, the CI creates a
PR for reviewing instead.<br>
After approval, our translation tool automatically picks the changes up and deploys
them to our translators. Be mindful when merging only a few changes!
Once a release is planned, or when a lot of strings have been added or changed, a
maintainer can manually trigger a CI run to extract all strings on demand.
<details>
<summary><b>Manually trigger CI run (Workflow Dispatch)</b></summary>
Maintainers can always request the CI to run on demand if it's required.
Go to the `Actions` tab and select our dedicated translation workflow:
https://github.com/Cockatrice/Cockatrice/actions/workflows/translations.yml
You see a "This workflow has a workflow_dispatch event trigger." hint at the top of
the list.<br>
Select `Run workflow` on the right and trigger a run from master branch.
The CI will now check for changed strings and create a PR if there are any updates.
</details>
<details>
<summary><b>Manually update source strings locally</b></summary>
To update the english source files for translation, re-run cmake enabling the appropriate
parameter and then run make:
```sh
cd cockatrice/build
@@ -357,11 +384,13 @@ It is recommended to disable the parameter afterwards using:
```sh
cmake .. -DUPDATE_TRANSLATIONS=OFF
```
Now you are ready to propose your change.
Now you are ready to commit your changes and open a PR.
Once your change gets merged, Transifex will pick up the modified files
automatically (checked every 24 hours) and update the interface where
translators will be able to translate the new strings.
</details>
Once the changes get merged, Transifex will pick up the modified files
automatically (checked every few hours) and update their online editor where
translators will be able to translate the new strings right in the browser.
### Releasing Translations (for maintainers) ###

49
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
# Configuration options: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# # Enable version updates for git submodules
# Not yet possible to bump only on tags or releases, see:
# https://github.com/dependabot/dependabot-core/issues/1639
# https://github.com/dependabot/dependabot-core/issues/2192
# Alternative: Action that updates submodule and can be manually run on demand (workflow_dispatch)
# - package-ecosystem: "gitsubmodule"
# # Look for `.gitmodules` in the `root` directory
# directory: "/"
# # Check for updates once a month
# schedule:
# interval: "monthly"
# # Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted)
# open-pull-requests-limit: 1
# # Enable version updates for Docker
# Not yet possible to bump from one LTS version to the next and skip others, see:
# https://github.com/dependabot/dependabot-core/issues/2247
# - package-ecosystem: "docker"
# # Look for a `Dockerfile` in the `root` directory
# directory: "/"
# # Check for updates once a week
# schedule:
# interval: "weekly"
# # Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted)
# open-pull-requests-limit: 1
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
# Directory must be set to "/" to check for workflow files in .github/workflows
directory: "/"
# Check for updates to GitHub Actions once a week
schedule:
interval: "weekly"
# Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted)
open-pull-requests-limit: 2
# # Enable version updates for npm
# - package-ecosystem: "npm"
# # Look for `package.json` and `lock` files in the `webclient` subdirectory
# directory: "/webclient"
# # Check the npm registry for updates once a week
# schedule:
# interval: "weekly"
# # Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted)
# open-pull-requests-limit: 5

View File

@@ -8,6 +8,7 @@ on:
- '**.md'
- 'webclient/**'
- '.github/workflows/web-*.yml'
- '.github/workflows/translations-*.yml'
tags:
- '*'
pull_request:
@@ -15,6 +16,12 @@ on:
- '**.md'
- 'webclient/**'
- '.github/workflows/web-*.yml'
- '.github/workflows/translations-*.yml'
# Cancel earlier, unfinished runs of this workflow on the same branch (unless on master)
concurrency:
group: "${{ github.workflow }} @ ${{ github.ref_name }}"
cancel-in-progress: ${{ github.ref_name != 'master' }}
jobs:
configure:
@@ -23,33 +30,27 @@ jobs:
outputs:
tag: ${{steps.configure.outputs.tag}}
sha: ${{steps.configure.outputs.sha}}
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{github.token}} # needs other token https://github.com/styfle/cancel-workflow-action/issues/7
steps:
- name: Configure
id: configure
shell: bash
run: |
tag_regex='^refs/tags/'
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
sha="${{github.event.pull_request.head.sha}}"
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
sha="$GITHUB_SHA"
tag="${GITHUB_REF/refs\/tags\//}"
echo "::set-output name=tag::$tag"
else # push to branch
echo "tag=$tag" >>"$GITHUB_OUTPUT"
else # push to branch
sha="$GITHUB_SHA"
fi
echo "::set-output name=sha::$sha"
echo "sha=$sha" >>"$GITHUB_OUTPUT"
- name: Checkout
if: steps.configure.outputs.tag != null
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -64,178 +65,174 @@ jobs:
- name: Create release
if: steps.configure.outputs.tag != null
id: create_release
uses: actions/create-release@v1
shell: bash
env:
GITHUB_TOKEN: ${{github.token}}
with:
tag_name: ${{github.ref}}
GH_TOKEN: ${{github.token}}
tag_name: ${{steps.configure.outputs.tag}}
target: ${{steps.configure.outputs.sha}}
release_name: ${{steps.prepare.outputs.title}}
body_path: ${{steps.prepare.outputs.body_path}}
draft: true
prerelease: ${{steps.prepare.outputs.is_beta == 'yes'}}
prerelease: ${{steps.prepare.outputs.is_beta}}
run: |
if [[ $prerelease == yes ]]; then
args="--prerelease"
fi
gh release create "$tag_name" --draft --verify-tag $args \
--target "$target" --title "$release_name" \
--notes-file "$body_path"
build-linux:
strategy:
fail-fast: false
matrix:
# these names correspond to the files in .ci/$distro
# These names correspond to the files in ".ci/$distro$version"
include:
- distro: ArchLinux
package: skip # we are packaged in arch already
- distro: Arch
package: skip # We are packaged in Arch already
allow-failure: yes
- distro: Debian10
- distro: Debian
version: 11
package: DEB
test: skip # running tests on all distros is superfluous
test: skip # Running tests on all distros is superfluous
- distro: Debian11
- distro: Debian
version: 12
package: DEB
- distro: Fedora34
- distro: Fedora
version: 40
package: RPM
test: skip # gtest does not compile for some reason
test: skip # Running tests on all distros is superfluous
- distro: Fedora35
package: RPM
test: skip
- distro: Fedora36
- distro: Fedora
version: 41
package: RPM
- distro: UbuntuBionic
- distro: Ubuntu
version: 20.04
package: DEB
test: skip # Ubuntu 20.04 has a broken Qt for debug builds
- distro: Ubuntu
version: 22.04
package: DEB
test: skip # Running tests on all distros is superfluous
- distro: Ubuntu
version: 24.04
package: DEB
- distro: UbuntuFocal
package: DEB
test: skip # UbuntuFocal has a broken qt for debug builds
- distro: UbuntuImpish
package: DEB
test: skip
- distro: UbuntuJammy
package: DEB
name: ${{matrix.distro}}
name: ${{matrix.distro}} ${{matrix.version}}
needs: configure
runs-on: ubuntu-latest
continue-on-error: ${{matrix.allow-failure == 'yes'}}
env:
NAME: ${{matrix.distro}}
CACHE: /tmp/${{matrix.distro}}-cache # ${{runner.temp}} does not work?
# cache size over the entire repo is 10Gi link:
NAME: ${{matrix.distro}}${{matrix.version}}
CACHE: /tmp/${{matrix.distro}}${{matrix.version}}-cache # ${{runner.temp}} does not work?
# Cache size over the entire repo is 10Gi:
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
CCACHE_SIZE: 200M
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get cache timestamp
- name: Generate cache timestamp
id: cache_timestamp
shell: bash
run: echo "::set-output name=timestamp::$(date -u '+%Y%m%d%H%M%S')"
run: echo "timestamp=$(date -u '+%Y%m%d%H%M%S')" >>"$GITHUB_OUTPUT"
- name: Restore cache
uses: actions/cache@v2
uses: actions/cache@v4
env:
timestamp: ${{steps.cache_timestamp.outputs.timestamp}}
with:
path: ${{env.CACHE}}
key: docker-${{matrix.distro}}-cache-${{env.timestamp}}
key: docker-${{matrix.distro}}${{matrix.version}}-cache-${{env.timestamp}}
restore-keys: |
docker-${{matrix.distro}}-cache-
docker-${{matrix.distro}}${{matrix.version}}-cache-
- name: Build ${{matrix.distro}} Docker image
- name: Build ${{matrix.distro}} ${{matrix.version}} Docker image
shell: bash
run: source .ci/docker.sh --build
- name: Build debug and test
if: matrix.test != 'skip'
shell: bash
env:
distro: '${{matrix.distro}}'
run: |
source .ci/docker.sh
RUN --server --debug --test --ccache "$CCACHE_SIZE" --parallel 2
RUN --server --debug --test --ccache "$CCACHE_SIZE" --parallel 4
- name: Build release package
id: package
id: build
if: matrix.package != 'skip'
shell: bash
env:
suffix: '-${{matrix.distro}}'
BUILD_DIR: build
SUFFIX: '-${{matrix.distro}}${{matrix.version}}'
type: '${{matrix.package}}'
distro: '${{matrix.distro}}'
run: |
source .ci/docker.sh
RUN --server --release --package "$type" --suffix "$suffix" \
--ccache "$CCACHE_SIZE" --parallel 2
RUN --server --release --package "$type" --dir "$BUILD_DIR" \
--ccache "$CCACHE_SIZE" --parallel 4
.ci/name_build.sh
- name: Upload artifact
if: matrix.package != 'skip'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{matrix.distro}}-package
path: ${{steps.package.outputs.path}}
name: ${{matrix.distro}}${{matrix.version}}-package
path: ${{steps.build.outputs.path}}
if-no-files-found: error
- name: Upload to release
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
uses: actions/upload-release-asset@v1
shell: bash
env:
GITHUB_TOKEN: ${{github.token}}
with:
upload_url: ${{needs.configure.outputs.upload_url}}
asset_path: ${{steps.package.outputs.path}}
asset_name: ${{steps.package.outputs.name}}
asset_content_type: application/octet-stream
GH_TOKEN: ${{github.token}}
tag_name: ${{needs.configure.outputs.tag}}
asset_path: ${{steps.build.outputs.path}}
asset_name: ${{steps.build.outputs.name}}
run: gh release upload "$tag_name" "$asset_path#$asset_name"
build-macos:
strategy:
fail-fast: false
matrix:
include:
- target: Debug # tests only
os: macos-latest
xcode: 12.5.1
qt_version: 6
- target: 13
soc: Intel
os: macos-13
xcode: "14.3.1"
type: Release
core_count: 4
make_package: 1
- target: 14
soc: Apple
os: macos-14
xcode: "15.4"
type: Release
core_count: 3
make_package: 1
- target: 15
soc: Apple
os: macos-15
xcode: "16.2"
type: Release
core_count: 3
make_package: 1
- target: 15
soc: Apple
os: macos-15
xcode: "16.2"
type: Debug
do_tests: 1
core_count: 3
- target: 10.14_Mojave
os: macos-10.15 # runs on Catalina
xcode: 10.3 # allows compatibility with macOS 10.14
qt_version: 5
type: Release
# do_tests: 1 # tests do not work on qt5?
make_package: 1
- target: 10.15_Catalina
os: macos-10.15
xcode: 12.4
qt_version: 6
type: Release
do_tests: 1
make_package: 1
- target: 11_Big_Sur
os: macos-11
xcode: 13.2
qt_version: 6
type: Release
do_tests: 1
make_package: 1
# - target: 12_Monterey
# os: macos-12
# xcode: 13.3
# qt_version: 6
# type: Release
# do_tests: 1
# make_package: 1
name: macOS ${{matrix.target}}
name: macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
needs: configure
runs-on: ${{matrix.os}}
continue-on-error: ${{matrix.allow-failure == 'yes'}}
@@ -245,140 +242,193 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install dependencies using homebrew
- name: Install dependencies using Homebrew
shell: bash
# cmake cannot find the mysql connector
# neither of these works: mariadb-connector-c mysql-connector-c++
# CMake cannot find the MySQL connector
# Neither of these works: mariadb-connector-c mysql-connector-c++
env:
qt_version: 'qt@${{matrix.qt_version}}'
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew update
brew install protobuf
brew install "$qt_version" --force-bottle
brew install protobuf qt --force-bottle
- name: Build on Xcode ${{matrix.xcode}}
- name: Build & Sign on Xcode ${{matrix.xcode}}
shell: bash
id: build
env:
BUILDTYPE: '${{matrix.type}}'
MAKE_TEST: '${{matrix.do_tests}}'
MAKE_TEST: 1
MAKE_PACKAGE: '${{matrix.make_package}}'
PACKAGE_SUFFIX: '-macOS-${{matrix.target}}'
# set QTDIR to find qt5, qt6 can be found without this
QTDIR: '/usr/local/opt/qt5'
# Mac machines actually have 3 cores
run: .ci/compile.sh --server --parallel 3
PACKAGE_SUFFIX: '-macOS${{matrix.target}}_${{matrix.soc}}'
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
# macOS runner have 3 cores usually - only the macos-13 image has 4:
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
run: |
if [[ -n "$MACOS_CERTIFICATE_NAME" ]]
then
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security set-keychain-settings -t 3600 -l build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
fi
.ci/compile.sh --server --parallel ${{matrix.core_count}}
- name: Sign app bundle
if: matrix.make_package
env:
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
run: |
if [[ -n "$MACOS_CERTIFICATE_NAME" ]]
then
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
/usr/bin/codesign --sign="$MACOS_CERTIFICATE_NAME" --entitlements=".ci/macos.entitlements" --options=runtime --force --deep --timestamp --verbose ${{steps.build.outputs.path}}
fi
- name: Notarize app bundle
if: matrix.make_package
env:
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
run: |
if [[ -n "$MACOS_NOTARIZATION_APPLE_ID" ]]
then
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
echo "Create keychain profile"
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD"
# We can't notarize an app bundle directly, but we need to compress it as an archive.
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
# notarization service
echo "Creating temp notarization archive"
ditto -c -k --keepParent ${{steps.build.outputs.path}} "notarization.zip"
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious
echo "Notarize app"
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available.
echo "Attach staple"
xcrun stapler staple ${{steps.build.outputs.path}}
fi
- name: Upload artifact
if: matrix.make_package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: macOS-${{matrix.target}}-dmg
name: macOS${{matrix.target}}${{ matrix.soc == 'Intel' && '_Intel' || '' }}${{ matrix.type == 'Debug' && '_Debug' || '' }}-dmg
path: ${{steps.build.outputs.path}}
if-no-files-found: error
- name: Upload to release
if: matrix.make_package && needs.configure.outputs.tag != null
uses: actions/upload-release-asset@v1
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
shell: bash
env:
GITHUB_TOKEN: ${{github.token}}
with:
upload_url: ${{needs.configure.outputs.upload_url}}
GH_TOKEN: ${{github.token}}
tag_name: ${{needs.configure.outputs.tag}}
asset_path: ${{steps.build.outputs.path}}
asset_name: ${{steps.build.outputs.name}}
asset_content_type: application/octet-stream
run: gh release upload "$tag_name" "$asset_path#$asset_name"
build-windows:
strategy:
fail-fast: false
matrix:
include:
- arch: 32
vcpkg_default_triplet: x86
qt_version: '5.15.2'
cmake_generator_platform: Win32
qt_arch: msvc2019
- arch: 64
vcpkg_default_triplet: x64
qt_version: '6.3.0'
cmake_generator_platform: x64
- target: 7
qt_version: 5.15.*
qt_arch: msvc2019_64
qt_modules: "qt5compat qtmultimedia qtwebsockets"
name: Windows (${{matrix.arch}}-bit)
- target: 10
qt_version: 6.6.*
qt_arch: msvc2019_64
qt_modules: "qtimageformats qtmultimedia qtwebsockets"
name: Windows ${{matrix.target}}
needs: configure
runs-on: windows-2019
runs-on: windows-2022
env:
CMAKE_GENERATOR: 'Visual Studio 16 2019'
CMAKE_GENERATOR: 'Visual Studio 17 2022'
steps:
- name: Add msbuild to PATH
id: add-msbuild
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore Qt ${{matrix.qt_version}} (${{matrix.arch}}-bit) from cache
id: cache-qt
uses: actions/cache@v1 # Intentionally v1, based on jurplel documentation
- name: Install Qt ${{matrix.qt_version}}
uses: jurplel/install-qt-action@v4
with:
key: ${{runner.os}}-QtCache-${{matrix.qt_version}}-${{matrix.arch}}
path: '${{github.workspace}}/../Qt'
- name: Install Qt ${{matrix.qt_version}} (${{matrix.arch}}-bit)
uses: jurplel/install-qt-action@v3
with:
cached: ${{steps.cache-qt.outputs.cache-hit}}
cache: true
setup-python: false
version: ${{matrix.qt_version}}
arch: win${{matrix.arch}}_${{matrix.qt_arch}}
arch: win64_${{matrix.qt_arch}}
tools: ${{matrix.qt_tools}}
modules: ${{matrix.qt_modules}}
- name: Run vcpkg
uses: lukka/run-vcpkg@v10.2
uses: lukka/run-vcpkg@v11
with:
runVcpkgInstall: true
appendedCacheKey: ${{matrix.arch}}-bit
doNotCache: false
env:
VCPKG_DEFAULT_TRIPLET: '${{matrix.vcpkg_default_triplet}}-windows'
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
VCPKG_DISABLE_METRICS: 1
- name: Install OpenSSL (${{matrix.arch}}-bit)
shell: bash
run: .ci/download_openssl.sh --arch ${{matrix.arch}}
- name: Build Cockatrice (${{matrix.arch}}-bit)
- name: Build Cockatrice
id: build
shell: bash
env:
PACKAGE_SUFFIX: '-win${{matrix.arch}}'
PACKAGE_SUFFIX: '-Win${{matrix.target}}'
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
CMAKE_GENERATOR_PLATFORM: '${{matrix.cmake_generator_platform}}'
QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win${{matrix.arch}}_${{matrix.qt_arch}}'
run: .ci/compile.sh --server --release --test --package --parallel 2
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
CMAKE_GENERATOR_PLATFORM: 'x64'
QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win64_${{matrix.qt_arch}}'
# No need for --parallel flag, MTT is added in the compile script to let cmake/msbuild manage core count,
# project and process parallelism: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
run: .ci/compile.sh --server --release --test --package
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Windows-${{matrix.arch}}bit-installer
name: Windows${{matrix.target}}-installer
path: ${{steps.build.outputs.path}}
if-no-files-found: error
- name: Upload to release
if: needs.configure.outputs.tag != null
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{github.token}}
- name: Upload pdb database
uses: actions/upload-artifact@v4
with:
upload_url: ${{needs.configure.outputs.upload_url}}
name: Windows${{matrix.target}}-debug-pdbs
path: |
build/cockatrice/Release/*.pdb
build/servatrice/Release/*.pdb
if-no-files-found: error
- name: Upload to release
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
shell: bash
env:
GH_TOKEN: ${{github.token}}
tag_name: ${{needs.configure.outputs.tag}}
asset_path: ${{steps.build.outputs.path}}
asset_name: ${{steps.build.outputs.name}}
asset_content_type: application/octet-stream
run: gh release upload "$tag_name" "$asset_path#$asset_name"

View File

@@ -6,23 +6,24 @@ on:
- '**.md'
- 'webclient/**'
- '.github/workflows/web-*.yml'
- '.github/workflows/translations-*.yml'
jobs:
clang-format:
runs-on: ubuntu-latest
format:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 20 # should be enough to find merge base
- name: Install clang-format
- name: Install dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-format
sudo apt-get install -y --no-install-recommends clang-format cmake-format
- name: Run clangify
- name: Check code formatting
shell: bash
run: ./.ci/lint_cpp.sh

72
.github/workflows/translations-pull.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
name: Update Translations
on:
workflow_dispatch:
schedule:
# runs in the middle of each month starting a quarter (UTC) = two weeks after new strings are built
- cron: '0 0 15 1,4,7,10 *'
pull_request:
paths:
- '.github/workflows/translations-pull.yml'
jobs:
translations:
# Do not run the scheduled workflow on forks
if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice'
name: Pull languages
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Pull translated strings from Transifex
uses: transifex/cli-action@v2
with:
# used config file: https://github.com/Cockatrice/Cockatrice/blob/master/.tx/config
# https://github.com/transifex/cli#pulling-files-from-transifex
token: ${{ secrets.TX_TOKEN }}
args: pull --force --all
- name: Create pull request
if: github.event_name != 'pull_request'
id: create_pr
uses: peter-evans/create-pull-request@v7
with:
add-paths: |
cockatrice/translations/*.ts
oracle/translations/*.ts
webclient/public/locales/*/translation.json
commit-message: Update translation files
# author is the owner of the commit
author: github-actions <github-actions@github.com>
branch: ci-update_translations
delete-branch: true
title: 'Update translations'
body: |
Pulled all translated strings from [Transifex][1].
---
*This PR is automatically generated and updated by the workflow at `.github/workflows/translations-pull.yml`. Review [action runs][2].*<br>
*After merging, all new languages and translations are available in the next build.*
[1]: https://app.transifex.com/cockatrice/cockatrice/
[2]: https://github.com/Cockatrice/Cockatrice/actions/workflows/translations-pull.yml?query=branch%3Amaster
labels: |
CI
Translation
draft: false
- name: PR Status
if: github.event_name != 'pull_request'
shell: bash
env:
STATUS: ${{ steps.create_pr.outputs.pull-request-operation }}
run: |
if [[ "$STATUS" == "none" ]]; then
echo "PR #${{ steps.create_pr.outputs.pull-request-number }} unchanged!" >> $GITHUB_STEP_SUMMARY
else
echo "PR #${{ steps.create_pr.outputs.pull-request-number }} $STATUS!" >> $GITHUB_STEP_SUMMARY
fi
echo "URL: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY

87
.github/workflows/translations-push.yml vendored Normal file
View File

@@ -0,0 +1,87 @@
name: Update Translation Source
on:
workflow_dispatch:
schedule:
# runs at the start of each quarter (UTC)
- cron: '0 0 1 1,4,7,10 *'
pull_request:
paths:
- '.github/workflows/translations-push.yml'
jobs:
translations:
# Do not run the scheduled workflow on forks
if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice'
name: Push strings
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install lupdate
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends qttools5-dev-tools
- name: Update Cockatrice translation source
id: cockatrice
shell: bash
env:
FILE: 'cockatrice/cockatrice_en@source.ts'
DIRS: 'cockatrice/src common'
run: .ci/update_translation_source_strings.sh
- name: Update Oracle translation source
id: oracle
shell: bash
env:
FILE: 'oracle/oracle_en@source.ts'
DIRS: 'oracle/src'
run: .ci/update_translation_source_strings.sh
- name: Render template
id: template
uses: chuhlomin/render-template@v1
with:
template: .ci/update_translation_source_strings_template.md
vars: |
cockatrice_output: ${{ steps.cockatrice.outputs.output }}
oracle_output: ${{ steps.oracle.outputs.output }}
commit: ${{ github.sha }}
- name: Create pull request
if: github.event_name != 'pull_request'
id: create_pr
uses: peter-evans/create-pull-request@v7
with:
add-paths: |
cockatrice/cockatrice_en@source.ts
oracle/oracle_en@source.ts
commit-message: Update translation source strings
# author is the owner of the commit
author: github-actions <github-actions@github.com>
branch: ci-update_translation_source
delete-branch: true
title: 'Update source strings'
body: ${{ steps.template.outputs.result }}
labels: |
CI
Translation
draft: false
- name: PR Status
if: github.event_name != 'pull_request'
shell: bash
env:
STATUS: ${{ steps.create_pr.outputs.pull-request-operation }}
run: |
if [[ "$STATUS" == "none" ]]; then
echo "PR #${{ steps.create_pr.outputs.pull-request-number }} unchanged!" >> $GITHUB_STEP_SUMMARY
else
echo "PR #${{ steps.create_pr.outputs.pull-request-number }} $STATUS!" >> $GITHUB_STEP_SUMMARY
fi
echo "URL: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY

View File

@@ -1,66 +0,0 @@
name: Update translation source
on:
workflow_dispatch:
schedule:
# runs once per month
- cron: '0 0 1 * *'
jobs:
translations:
# Do not run the scheduled workflow on forks
if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice'
runs-on: ubuntu-latest
steps:
- name: Install lupdate
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends qttools5-dev-tools
- name: Checkout repo
uses: actions/checkout@v2
- name: Update cockatrice translations
shell: bash
run: |
shopt -s globstar # globstar is needed for recursive **
lupdate -version
echo "reading the following source files:"
# note: there are three strings to translate in common right now
echo {cockatrice,common}/**/*.{cpp,h}
echo "$(echo {cockatrice,common}/**/*.{cpp,h} | wc -w) files total"
lupdate {cockatrice,common}/**/*.{cpp,h} -ts cockatrice/translations/cockatrice_en@source.ts
- name: Update oracle translations
shell: bash
run: |
shopt -s globstar # globstar is needed for recursive **
lupdate -version
echo "reading the following source files:"
echo oracle/**/*.{cpp,h}
echo "$(echo oracle/**/*.{cpp,h} | wc -w) files total"
lupdate oracle/**/*.{cpp,h} -ts oracle/translations/oracle_en@source.ts
- name: Check for updates
id: check
shell: bash
run: |
set +e # do not fail, just save the exit state
git diff --exit-code
echo "::set-output name=deploy::$?"
- name: Commit changes
if: steps.check.outputs.deploy == '1'
shell: bash
working-directory: ${{env.OUTPUT_PATH}}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add cockatrice/translations/cockatrice_en@source.ts oracle/translations/oracle_en@source.ts
git commit -m "Automated translation update ( $GITHUB_SHA )"
git push
deploy_commit=$(git rev-parse HEAD)
echo "Created commit: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/commit/$deploy_commit"

View File

@@ -28,15 +28,15 @@ jobs:
fail-fast: false
matrix:
node_version:
- 12
- 16
- lts/*
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{matrix.node_version}}
cache: 'npm'
@@ -50,4 +50,3 @@ jobs:
- name: Test app
run: npm run test

View File

@@ -17,10 +17,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: 'webclient/package-lock.json'

5
.gitignore vendored
View File

@@ -6,8 +6,11 @@ mysql.cnf
.DS_Store
.idea/
*.aps
cmake-build-debug*
cmake-build*
preferences
compile_commands.json
.vs/
.vscode/
.cache
.gdb_history
cockatrice/resources/config/qtlogging.ini

View File

@@ -1,13 +1,26 @@
[main]
host = https://www.transifex.com
host = https://app.transifex.com
[cockatrice.cockatrice-translations-cockatrice-en-source-ts--master]
[o:cockatrice:p:cockatrice:r:cockatrice-cockatrice-en-source-ts--master]
resource_name = Cockatrice
source_lang = en
source_file = cockatrice/cockatrice_en@source.ts
file_filter = cockatrice/translations/cockatrice_<lang>.ts
source_file = cockatrice/translations/cockatrice_en@source.ts
source_lang = en
type = QT
minimum_perc = 10
[cockatrice.oracle-translations-oracle-en-source-ts--master]
[o:cockatrice:p:cockatrice:r:oracle-oracle-en-source-ts--master]
resource_name = Oracle
source_lang = en
source_file = oracle/oracle_en@source.ts
file_filter = oracle/translations/oracle_<lang>.ts
source_file = oracle/translations/oracle_en@source.ts
source_lang = en
type = QT
minimum_perc = 10
[o:cockatrice:p:cockatrice:r:webclient-src-i18n-default-json--master]
resource_name = Webclient
source_lang = en
source_file = webclient/src/i18n-default.json
file_filter = webclient/public/locales/<lang>/translation.json
type = KEYVALUEJSON
minimum_perc = 10

View File

@@ -27,44 +27,65 @@ option(TEST "build tests" OFF)
# Default to "Release" build type
# User-provided value for CMAKE_BUILD_TYPE must be checked before the PROJECT() call
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Type of build")
ELSE()
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build")
ENDIF()
if(DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
${CMAKE_BUILD_TYPE}
CACHE STRING "Type of build"
)
else()
set(CMAKE_BUILD_TYPE
Release
CACHE STRING "Type of build"
)
endif()
if(USE_CCACHE)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
# Support Unix Makefiles and Ninja
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
MESSAGE(STATUS "Found CCache ${CCACHE_PROGRAM}")
endif()
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
# Support Unix Makefiles and Ninja
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
message(STATUS "Found CCache ${CCACHE_PROGRAM}")
endif()
endif()
if(WIN32)
# Use vcpkg toolchain on Windows
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")
# Qt path set by user or env var
if (QTDIR OR DEFINED ENV{QTDIR} OR DEFINED ENV{QTDIR32} OR DEFINED ENV{QTDIR64})
else()
set(QTDIR "" CACHE PATH "Path to Qt (e.g. C:/Qt/5.7/msvc2015_64)")
message(WARNING "QTDIR variable is missing. Please set this variable to specify path to Qt (e.g. C:/Qt/5.7/msvc2015_64)")
endif()
# Use vcpkg toolchain on Windows
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file"
)
# Qt path set by user or env var
if(QTDIR
OR DEFINED ENV{QTDIR}
OR DEFINED ENV{QTDIR32}
OR DEFINED ENV{QTDIR64}
)
else()
set(QTDIR
""
CACHE PATH "Path to Qt (e.g. C:/Qt/5.7/msvc2015_64)"
)
message(
WARNING "QTDIR variable is missing. Please set this variable to specify path to Qt (e.g. C:/Qt/5.7/msvc2015_64)"
)
endif()
endif()
# A project name is needed for CPack
# Version can be overriden by git tags, see cmake/getversion.cmake
project("Cockatrice" VERSION 2.8.1)
project("Cockatrice" VERSION 2.10.0)
# Set release name if not provided via env/cmake var
if(NOT DEFINED GIT_TAG_RELEASENAME)
set(GIT_TAG_RELEASENAME "Prismatic Bridge")
set(GIT_TAG_RELEASENAME "Rings of the Wild")
endif()
# Use c++17 for all targets
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ ISO Standard")
# Use c++20 for all targets
set(CMAKE_CXX_STANDARD
20
CACHE STRING "C++ ISO Standard"
)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set conventional loops
@@ -81,130 +102,153 @@ include(createversionfile)
# Define a proper install path
if(UNIX)
if(APPLE)
# macOS
# Due to the special bundle structure ignore
# the prefix eventually set by the user.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
if(APPLE)
# macOS
# Due to the special bundle structure ignore
# the prefix eventually set by the user.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
# Force ccache usage if available
get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
if(RULE_LAUNCH_COMPILE)
MESSAGE(STATUS "Force enabling CCache usage under macOS")
# Set up wrapper scripts
configure_file("${COCKATRICE_CMAKE_PATH}/launch-c.in" launch-c)
configure_file("${COCKATRICE_CMAKE_PATH}/launch-cxx.in" launch-cxx)
execute_process(COMMAND chmod a+rx
"${CMAKE_BINARY_DIR}/launch-c"
"${CMAKE_BINARY_DIR}/launch-cxx")
# Force ccache usage if available
get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
if(RULE_LAUNCH_COMPILE)
message(STATUS "Force enabling CCache usage under macOS")
# Set up wrapper scripts
configure_file("${COCKATRICE_CMAKE_PATH}/launch-c.in" launch-c)
configure_file("${COCKATRICE_CMAKE_PATH}/launch-cxx.in" launch-cxx)
execute_process(COMMAND chmod a+rx "${CMAKE_BINARY_DIR}/launch-c" "${CMAKE_BINARY_DIR}/launch-cxx")
# Set Xcode project attributes to route compilation through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx")
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx")
endif()
else()
# Linux / BSD
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#fix package build
if(PREFIX)
set(CMAKE_INSTALL_PREFIX ${PREFIX})
else()
set(CMAKE_INSTALL_PREFIX /usr/local)
endif()
endif()
# Set Xcode project attributes to route compilation through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx")
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx")
endif()
else()
# Linux / BSD
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#fix package build
if(PREFIX)
set(CMAKE_INSTALL_PREFIX ${PREFIX})
else()
set(CMAKE_INSTALL_PREFIX /usr/local)
endif()
endif()
endif()
elseif(WIN32)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE})
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/rundir/${CMAKE_BUILD_TYPE})
endif()
# Define proper compilation flags
IF(MSVC)
# Visual Studio: Maximum optimization, disable warning C4251, establish C++17 compatibility
SET(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD /wd4251 /Zc:__cplusplus /std:c++17 /permissive-")
# Generate complete debugging information
#set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
# linux/gcc, bsd/gcc, windows/mingw
include(CheckCXXCompilerFlag)
if(MSVC)
# Disable Warning C4251, C++20 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics, Debug Symbols
set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc /Zi")
# Visual Studio: Maximum Optimization, Multi-threaded DLL
set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD")
# Visual Studio: No Optimization, Multi-threaded Debug DLL
set(CMAKE_CXX_FLAGS_DEBUG "/Od /MDd")
set(CMAKE_CXX_FLAGS_RELEASE "-s -O2")
if(WARNING_AS_ERROR)
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -Wall -Wextra -Werror")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -Wall -Wextra")
# Generate PDB, even when in release (So developers can better analyze crash logs)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
elseif(CMAKE_COMPILER_IS_GNUCXX)
# linux/gcc, bsd/gcc, windows/mingw
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_FLAGS_RELEASE "-s -O2")
if(WARNING_AS_ERROR)
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -Wall -Wextra -Werror")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0 -Wall -Wextra")
endif()
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++20")
endif()
set(ADDITIONAL_DEBUG_FLAGS
-Wcast-align
-Wmissing-declarations
-Wno-long-long
-Wno-error=extra
-Wno-error=delete-non-virtual-dtor
-Wno-error=sign-compare
-Wno-error=missing-declarations
)
foreach(FLAG ${ADDITIONAL_DEBUG_FLAGS})
check_cxx_compiler_flag("${FLAG}" CXX_HAS_WARNING_${FLAG})
if(CXX_HAS_WARNING_${FLAG})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
endif()
IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
ENDIF()
set(ADDITIONAL_DEBUG_FLAGS -Wcast-align -Wmissing-declarations -Wno-long-long -Wno-error=extra -Wno-error=delete-non-virtual-dtor -Wno-error=sign-compare -Wno-error=missing-declarations)
FOREACH(FLAG ${ADDITIONAL_DEBUG_FLAGS})
CHECK_CXX_COMPILER_FLAG("${FLAG}" CXX_HAS_WARNING_${FLAG})
IF(CXX_HAS_WARNING_${FLAG})
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}")
ENDIF()
ENDFOREACH()
ELSE()
# other: osx/llvm, bsd/llvm
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
if(WARNING_AS_ERROR)
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
endif()
ENDIF()
endforeach()
else()
# other: osx/llvm, bsd/llvm
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
if(WARNING_AS_ERROR)
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra -Werror -Wno-unused-parameter")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
endif()
endif()
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
ADD_DEFINITIONS("-DSFMT_MEXP=19937")
ENDIF()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_definitions("-DSFMT_MEXP=19937")
endif()
FIND_PACKAGE(Threads REQUIRED)
find_package(Threads REQUIRED)
# Determine 32 or 64 bit build
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_lib_suffix 64)
set(_lib_suffix 64)
else()
set(_lib_suffix 32)
set(_lib_suffix 32)
endif()
if(DEFINED QTDIR${_lib_suffix})
list(APPEND CMAKE_PREFIX_PATH "${QTDIR${_lib_suffix}}")
list(APPEND CMAKE_PREFIX_PATH "${QTDIR${_lib_suffix}}")
elseif(DEFINED QTDIR)
list(APPEND CMAKE_PREFIX_PATH "${QTDIR}")
list(APPEND CMAKE_PREFIX_PATH "${QTDIR}")
elseif(DEFINED ENV{QTDIR${_lib_suffix}})
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR${_lib_suffix}}")
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR${_lib_suffix}}")
elseif(DEFINED ENV{QTDIR})
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}")
endif()
MESSAGE(STATUS "Update Translations: ${UPDATE_TRANSLATIONS}")
message(STATUS "Update Translations: ${UPDATE_TRANSLATIONS}")
include(FindQtRuntime)
set(CMAKE_AUTOMOC TRUE)
# Find other needed libraries
FIND_PACKAGE(Protobuf REQUIRED)
IF(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
MESSAGE(FATAL_ERROR "No protoc command found!")
ELSE()
MESSAGE(STATUS "Found Protobuf ${Protobuf_VERSION} at: ${Protobuf_LIBRARIES}")
ENDIF()
find_package(Protobuf CONFIG)
if(NOT Protobuf_FOUND)
find_package(Protobuf REQUIRED)
endif()
if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0" AND NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
message(FATAL_ERROR "No protoc command found!")
endif()
#Find OpenSSL
IF(WIN32)
FIND_PACKAGE(Win32SslRuntime)
ENDIF()
if(WIN32)
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIRS})
else()
message(
WARNING
"Could not find OpenSSL runtime libraries. They are not required for compiling, but needs to be available at runtime."
)
endif()
endif()
#Find VCredist
IF(MSVC)
FIND_PACKAGE(VCredistRuntime)
ENDIF()
if(MSVC)
find_package(VCredistRuntime)
endif()
# Package builder
set(CPACK_PACKAGE_CONTACT "Zach Halpern <zach@cockatrice.us>")
@@ -218,95 +262,96 @@ set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_VERSION_FILENAME}")
if(UNIX)
if(APPLE)
set(CPACK_GENERATOR DragNDrop ${CPACK_GENERATOR})
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME}")
set(CPACK_SYSTEM_NAME "OSX")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cockatrice/resources/appicon.icns")
if(APPLE)
set(CPACK_GENERATOR DragNDrop ${CPACK_GENERATOR})
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_FORMAT "UDBZ")
set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME}")
set(CPACK_SYSTEM_NAME "OSX")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cockatrice/resources/appicon.icns")
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeDMGSetup.script")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/dmgBackground.tif")
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SignMacApplications.cmake")
else()
# linux
if(CPACK_GENERATOR STREQUAL "RPM")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set(CPACK_RPM_MAIN_COMPONENT "cockatrice")
if(Qt6_FOUND)
set(CPACK_RPM_PACKAGE_REQUIRES "protobuf, qt6-qttools, qt6-qtsvg, qt6-qtmultimedia, qt6-qtimageformats")
elseif(Qt5_FOUND)
set(CPACK_RPM_PACKAGE_REQUIRES "protobuf, qt5-qttools, qt5-qtsvg, qt5-qtmultimedia")
endif()
set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games")
set(CPACK_RPM_PACKAGE_URL "http://github.com/Cockatrice/Cockatrice")
# stop directories from making package conflicts
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
/usr/share/applications
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/48x48
/usr/share/icons/hicolor/48x48/apps
/usr/share/icons/hicolor/scalable
/usr/share/icons/hicolor/scalable/apps
)
else()
# linux
IF(CPACK_GENERATOR STREQUAL "RPM")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set(CPACK_RPM_MAIN_COMPONENT "cockatrice")
IF(Qt6_FOUND)
SET(CPACK_RPM_PACKAGE_REQUIRES "protobuf, qt6-qttools, qt6-qtsvg, qt6-qtmultimedia")
ELSEIF(Qt5_FOUND)
SET(CPACK_RPM_PACKAGE_REQUIRES "protobuf, qt5-qttools, qt5-qtsvg, qt5-qtmultimedia")
ENDIF()
set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games")
set(CPACK_RPM_PACKAGE_URL "http://github.com/Cockatrice/Cockatrice")
# stop directories from making package conflicts
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
/usr/share/applications
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/48x48
/usr/share/icons/hicolor/48x48/apps
/usr/share/icons/hicolor/scalable
/usr/share/icons/hicolor/scalable/apps)
ELSE()
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://github.com/Cockatrice/Cockatrice")
IF(Qt6_FOUND)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt6multimedia6, libqt6svg6, qt6-qpa-plugins")
ELSEIF(Qt5_FOUND)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5multimedia5-plugins, libqt5svg5")
ENDIF()
ENDIF()
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://github.com/Cockatrice/Cockatrice")
if(Qt6_FOUND)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt6multimedia6, libqt6svg6, qt6-qpa-plugins, qt6-image-formats-plugins")
elseif(Qt5_FOUND)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5multimedia5-plugins, libqt5svg5")
endif()
endif()
endif()
elseif(WIN32)
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "(x64)")
set(TRICE_IS_64_BIT 1)
else()
set(TRICE_IS_64_BIT 0)
endif()
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "(x64)")
set(TRICE_IS_64_BIT 1)
else()
set(TRICE_IS_64_BIT 0)
endif()
# Configure file with custom definitions for NSIS.
configure_file(
"${COCKATRICE_CMAKE_PATH}/NSIS.definitions.nsh.in"
"${PROJECT_BINARY_DIR}/NSIS.definitions.nsh"
)
# Configure file with custom definitions for NSIS.
configure_file("${COCKATRICE_CMAKE_PATH}/NSIS.definitions.nsh.in" "${PROJECT_BINARY_DIR}/NSIS.definitions.nsh")
# include vcredist into the package; NSIS will take care of running it
if(VCREDISTRUNTIME_FOUND)
INSTALL(FILES "${VCREDISTRUNTIME_FILE}" DESTINATION ./)
endif()
# include vcredist into the package; NSIS will take care of running it
if(VCREDISTRUNTIME_FOUND)
install(FILES "${VCREDISTRUNTIME_FILE}" DESTINATION ./)
endif()
endif()
include(CPack)
add_subdirectory(common)
if(WITH_SERVER)
add_subdirectory(servatrice)
SET(CPACK_INSTALL_CMAKE_PROJECTS "Servatrice;Servatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
add_subdirectory(servatrice)
set(CPACK_INSTALL_CMAKE_PROJECTS "Servatrice;Servatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
endif()
if(WITH_CLIENT)
add_subdirectory(cockatrice)
SET(CPACK_INSTALL_CMAKE_PROJECTS "Cockatrice;Cockatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
add_subdirectory(cockatrice)
set(CPACK_INSTALL_CMAKE_PROJECTS "Cockatrice;Cockatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
endif()
if(WITH_ORACLE)
add_subdirectory(oracle)
SET(CPACK_INSTALL_CMAKE_PROJECTS "Oracle;Oracle;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
add_subdirectory(oracle)
set(CPACK_INSTALL_CMAKE_PROJECTS "Oracle;Oracle;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
endif()
if(WITH_DBCONVERTER)
add_subdirectory(dbconverter)
SET(CPACK_INSTALL_CMAKE_PROJECTS "Dbconverter;Dbconverter;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
add_subdirectory(dbconverter)
set(CPACK_INSTALL_CMAKE_PROJECTS "Dbconverter;Dbconverter;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
endif()
if(TEST)
include(CTest)
add_subdirectory(tests)
include(CTest)
add_subdirectory(tests)
endif()
if(Qt6Found AND Qt6_VERSION_MINOR GREATER_EQUAL 3)
# Qt6.3+ requires project finalization to support translations
qt6_finalize_project()
if(Qt6_FOUND AND Qt6_VERSION_MINOR GREATER_EQUAL 3)
# Qt6.3+ requires project finalization to support translations
qt6_finalize_project()
endif()

View File

@@ -1,19 +1,20 @@
FROM ubuntu:bionic
MAINTAINER Zach Halpern <zahalpern+github@gmail.com>
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y\
build-essential\
cmake\
git\
libprotobuf-dev\
libqt5sql5-mysql\
libmysqlclient-dev\
libqt5websockets5-dev\
protobuf-compiler\
qt5-default\
qtbase5-dev\
qttools5-dev-tools\
qttools5-dev
build-essential \
cmake \
file \
g++ \
git \
libmariadb-dev-compat \
libprotobuf-dev \
libqt6sql6-mysql \
qt6-websockets-dev \
protobuf-compiler \
qt6-tools-dev \
qt6-tools-dev-tools
COPY . /home/servatrice/code/
WORKDIR /home/servatrice/code
@@ -25,7 +26,6 @@ RUN cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 -DWITH_DBCONVERTER=
WORKDIR /home/servatrice
EXPOSE 4747
EXPOSE 4747 4748
ENTRYPOINT [ "servatrice", "--log-to-console" ]

View File

@@ -5,7 +5,7 @@
<p align='center'>
<a href="#cockatrice"><b>Cockatrice</b></a> <b>|</b>
<a href="#download-">Download</a> <b>|</b>
<a href="#get-involved--">Get Involved</a> <b>|</b>
<a href="#get-involved-">Get Involved</a> <b>|</b>
<a href="#community-resources">Community</a> <b>|</b>
<a href="#translations-">Translations</a> <b>|</b>
<a href="#build--">Build</a> <b>|</b>
@@ -40,9 +40,9 @@ Downloads are available for full releases and the current beta version in develo
- To be a Cockatrice Beta Tester, use this version. Find more information [here](https://github.com/Cockatrice/Cockatrice/wiki/Release-Channels)!
# Get Involved [![Discord](https://img.shields.io/discord/314987288398659595?label=Discord&logo=discord&logoColor=white)](https://discord.gg/3Z9yzmA) [![Gitter Chat](https://img.shields.io/gitter/room/Cockatrice/Cockatrice)](https://gitter.im/Cockatrice/Cockatrice)
# Get Involved [![Discord](https://img.shields.io/discord/314987288398659595?label=Discord&logo=discord&logoColor=white)](https://discord.gg/3Z9yzmA)
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with the project or fellow users of the app. The Cockatrice developers are also available on [Gitter](https://gitter.im/Cockatrice/Cockatrice). Come here to talk about the application, features, or just to hang out.<br>
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with the project, contributors or fellow users of the app. Come here to talk about the application, features, or just to hang out.<br>
For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
To contribute code to the project, please review [the guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md).
@@ -52,8 +52,6 @@ We maintain two tags for contributors to find issues to work on:
For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code review for changes they submit.
Read the long-term project **roadmap** to see planned edits and milestones [here](https://docs.google.com/document/d/1Ewe5uSaRE2nR2pNPMaGmP6gVZdqgFbBgwSscGqIr4W0/edit).
We try to be responsive to new issues. We'll provide advice on how best to implement a feature; alternately, we can show you where the codebase is doing something similar before you get too far along.
Cockatrice uses the [Google Developer Documentation Style Guide](https://developers.google.com/style/) to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
@@ -67,13 +65,9 @@ Cockatrice uses the [Google Developer Documentation Style Guide](https://develop
- [reddit r/Cockatrice](https://reddit.com/r/cockatrice)
# Translations [![Transifex Project](https://img.shields.io/badge/translate-on%20transifex-brightgreen)](https://www.transifex.com/projects/p/cockatrice/)
# Translations [![Transifex Project](https://img.shields.io/badge/translate-on%20transifex-brightgreen)](https://transifex.com/cockatrice/cockatrice/)
Cockatrice uses Transifex for translations. You can help us bring Cockatrice and Oracle to your language or just edit single wordings right from within your browser by visiting our [Transifex project page](https://www.transifex.com/projects/p/cockatrice/).<br>
| Cockatrice | Oracle |
|:-:|:-:|
| [![Cockatrice Translation Status](https://www.transifex.com/projects/p/cockatrice/resource/cockatrice/chart/image_png/)](https://www.transifex.com/projects/p/cockatrice/) | [![Oracle Translation Status](https://www.transifex.com/projects/p/cockatrice/resource/oracle/chart/image_png/)](https://www.transifex.com/projects/p/cockatrice/) |
Cockatrice uses Transifex for translations. You can help us bring Cockatrice, Oracle and Webatrice to your language or just adjust single wordings right from within your browser by visiting our [Transifex project page](https://transifex.com/cockatrice/cockatrice/).<br>
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about contributing!<br>

View File

@@ -0,0 +1,55 @@
on run argv
set image_name to item 1 of argv
tell application "Finder"
tell disk image_name
-- wait for the image to finish mounting
set open_attempts to 0
repeat while open_attempts < 4
try
open
delay 1
set open_attempts to 5
close
on error errStr number errorNumber
set open_attempts to open_attempts + 1
delay 10
end try
end repeat
delay 5
-- open the image the first time and save a DS_Store with just
-- background and icon setup
open
set current view of container window to icon view
set theViewOptions to the icon view options of container window
set background picture of theViewOptions to file ".background:background.tif"
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 128
delay 5
close
-- next setup the position of the app and Applications symlink
-- plus hide all the window decoration
open
update without registering applications
tell container window
set sidebar width to 0
set statusbar visible to false
set toolbar visible to false
set the bounds to { 400, 100, 1400, 922 }
set position of item "Cockatrice.app" to { 139, 214 }
set position of item "Oracle.app" to { 139, 414 }
set position of item "Servatrice.app" to { 139, 614 }
set position of item "dbconverter.app" to { 1400, 1400 }
set position of item "Applications" to { 861, 414 }
end tell
update without registering applications
delay 5
close
end tell
delay 1
end tell
end run

View File

@@ -1,7 +1,13 @@
# Find a compatible Qt version Inputs: WITH_SERVER, WITH_CLIENT, WITH_ORACLE, WITH_DBCONVERTER, FORCE_USE_QT5 Optional
# Input: QT6_DIR -- Hint as to where Qt6 lives on the system Optional Input: QT5_DIR -- Hint as to where Qt5 lives on
# the system Output: COCKATRICE_QT_VERSION_NAME -- Example values: Qt5, Qt6 Outputs: SERVATRICE_QT_MODULES,
# COCKATRICE_QT_MODULES, ORACLE_QT_MODULES, DBCONVERTER_QT_MODULES, TEST_QT_MODULES
# Find a compatible Qt version
# Inputs: WITH_SERVER, WITH_CLIENT, WITH_ORACLE, WITH_DBCONVERTER, FORCE_USE_QT5
# Optional Input: QT6_DIR -- Hint as to where Qt6 lives on the system
# Optional Input: QT5_DIR -- Hint as to where Qt5 lives on the system
# Output: COCKATRICE_QT_VERSION_NAME -- Example values: Qt5, Qt6
# Output: SERVATRICE_QT_MODULES
# Output: COCKATRICE_QT_MODULES
# Output: ORACLE_QT_MODULES
# Output: DBCONVERTER_QT_MODULES
# Output: TEST_QT_MODULES
set(REQUIRED_QT_COMPONENTS Core)
if(WITH_SERVER)
@@ -15,8 +21,9 @@ if(WITH_CLIENT)
Network
PrintSupport
Svg
Widgets
WebSockets
Widgets
Xml
)
endif()
if(WITH_ORACLE)
@@ -35,27 +42,24 @@ set(REQUIRED_QT_COMPONENTS ${REQUIRED_QT_COMPONENTS} ${_SERVATRICE_NEEDED} ${_CO
list(REMOVE_DUPLICATES REQUIRED_QT_COMPONENTS)
if(NOT FORCE_USE_QT5)
# Core5Compat is Qt6 Only, Linguist is now a component in Qt6 instead of an external package
# Linguist is now a component in Qt6 instead of an external package
find_package(
Qt6 6.2.3
COMPONENTS Core5Compat ${REQUIRED_QT_COMPONENTS}
OPTIONAL_COMPONENTS Linguist
COMPONENTS ${REQUIRED_QT_COMPONENTS} Linguist
QUIET HINTS ${Qt6_DIR}
)
endif()
if(Qt6_FOUND)
set(COCKATRICE_QT_VERSION_NAME Qt6)
if(Qt6LinguistTools_FOUND)
list(FIND Qt6LinguistTools_TARGETS Qt6::lrelease QT6_LRELEASE_INDEX)
if(QT6_LRELEASE_INDEX EQUAL -1)
message(WARNING "Qt6 lrelease not found.")
endif()
list(FIND Qt6LinguistTools_TARGETS Qt6::lrelease QT6_LRELEASE_INDEX)
if(QT6_LRELEASE_INDEX EQUAL -1)
message(WARNING "Qt6 lrelease not found.")
endif()
list(FIND Qt6LinguistTools_TARGETS Qt6::lupdate QT6_LUPDATE_INDEX)
if(QT6_LUPDATE_INDEX EQUAL -1)
message(WARNING "Qt6 lupdate not found.")
endif()
list(FIND Qt6LinguistTools_TARGETS Qt6::lupdate QT6_LUPDATE_INDEX)
if(QT6_LUPDATE_INDEX EQUAL -1)
message(WARNING "Qt6 lupdate not found.")
endif()
else()
find_package(
@@ -110,10 +114,5 @@ string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" COCKATRICE_Q
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" ORACLE_QT_MODULES "${_ORACLE_NEEDED}")
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" DB_CONVERTER_QT_MODULES "${_DBCONVERTER_NEEDED}")
string(REGEX REPLACE "([^;]+)" "${COCKATRICE_QT_VERSION_NAME}::\\1" TEST_QT_MODULES "${_TEST_NEEDED}")
if(Qt6_FOUND)
list(APPEND SERVATRICE_QT_MODULES ${COCKATRICE_QT_VERSION_NAME}::Core5Compat)
list(APPEND COCKATRICE_QT_MODULES ${COCKATRICE_QT_VERSION_NAME}::Core5Compat)
list(APPEND ORACLE_QT_MODULES ${COCKATRICE_QT_VERSION_NAME}::Core5Compat)
endif()
message(STATUS "Found Qt ${${COCKATRICE_QT_VERSION_NAME}_VERSION} at: ${${COCKATRICE_QT_VERSION_NAME}_DIR}")

View File

@@ -9,7 +9,8 @@ if(WIN32)
set(REDIST_ARCH x86)
endif()
set(REDIST_FILE vcredist_${REDIST_ARCH}.exe)
# VS 2017 uses vcredist_ARCH.exe, VS 2022 uses vc_redist.ARCH.exe
set(REDIST_FILE_NAMES vcredist_${REDIST_ARCH}.exe vcredist.${REDIST_ARCH}.exe vc_redist.${REDIST_ARCH}.exe)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)
@@ -22,10 +23,13 @@ if(WIN32)
get_filename_component(_path ${_path} DIRECTORY)
get_filename_component(_path ${_path}/../../ ABSOLUTE)
if(EXISTS "${_path}/${REDIST_FILE}") # VS 2017
set(VCREDISTRUNTIME_FOUND "YES")
set(VCREDISTRUNTIME_FILE ${_path}/${REDIST_FILE})
endif()
foreach(redist_file ${REDIST_FILE_NAMES})
if(EXISTS "${_path}/${redist_file}")
set(VCREDISTRUNTIME_FOUND "YES")
set(VCREDISTRUNTIME_FILE ${_path}/${redist_file})
break()
endif()
endforeach()
endif()
if(VCREDISTRUNTIME_FOUND)

View File

@@ -1,70 +0,0 @@
# Find the OpenSSL runtime libraries (.dll) for Windows that will be needed by Qt in order to access https urls.
if(NOT DEFINED WIN32 OR NOT ${WIN32})
message(STATUS "Non-Windows device trying to execute FindWin32SslRuntime, skipping")
return()
endif()
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64")
message(STATUS "Looking for OpenSSL for ${CMAKE_GENERATOR_PLATFORM}")
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
set(_OPENSSL_ROOT_PATHS "$ENV{VCPKG_PACKAGES_DIR}/x64-windows/bin" "C:/OpenSSL-Win64/bin" "C:/OpenSSL-Win64"
"C:/Tools/vcpkg/installed/x64-windows/bin" "${_programfiles}/OpenSSL-Win64"
)
unset(_programfiles)
elseif("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32")
message(STATUS "Looking for OpenSSL for ${CMAKE_GENERATOR_PLATFORM}")
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
set(_OPENSSL_ROOT_PATHS
"$ENV{VCPKG_PACKAGES_DIR}/x86-windows/bin"
"C:/OpenSSL-Win32/bin"
"C:/OpenSSL-Win32"
"C:/OpenSSL"
"C:/Tools/vcpkg/installed/x86-windows/bin"
"${_programfiles}/OpenSSL"
"${_programfiles}/OpenSSL-Win32"
)
unset(_programfiles)
endif()
message(STATUS "Looking for OpenSSL @ $ENV{CMAKE_GENERATOR_PLATFORM} in ${_OPENSSL_ROOT_PATHS}")
if("$ENV{CMAKE_GENERATOR_PLATFORM}" STREQUAL "x64")
find_file(
WIN32SSLRUNTIME_LIBEAY
NAMES libcrypto-1_1-x64.dll libcrypto.dll
PATHS ${_OPENSSL_ROOT_PATHS}
NO_DEFAULT_PATH
)
find_file(
WIN32SSLRUNTIME_SSLEAY
NAMES libssl-1_1-x64.dll libssl.dll
PATHS ${_OPENSSL_ROOT_PATHS}
NO_DEFAULT_PATH
)
elseif("$ENV{CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32")
find_file(
WIN32SSLRUNTIME_LIBEAY
NAMES libcrypto-1_1.dll libcrypto.dll
PATHS ${_OPENSSL_ROOT_PATHS}
NO_DEFAULT_PATH
)
find_file(
WIN32SSLRUNTIME_SSLEAY
NAMES libssl-1_1.dll libssl.dll
PATHS ${_OPENSSL_ROOT_PATHS}
NO_DEFAULT_PATH
)
endif()
if(WIN32SSLRUNTIME_LIBEAY AND WIN32SSLRUNTIME_SSLEAY)
set(WIN32SSLRUNTIME_LIBRARIES "${WIN32SSLRUNTIME_LIBEAY}" "${WIN32SSLRUNTIME_SSLEAY}")
set(WIN32SSLRUNTIME_FOUND "YES")
message(STATUS "Found OpenSSL ${WIN32SSLRUNTIME_LIBRARIES}")
else()
set(WIN32SSLRUNTIME_FOUND "NO")
message(
WARNING
"Could not find OpenSSL runtime libraries. They are not required for compiling, but needs to be available at runtime."
)
endif()
mark_as_advanced(WIN32SSLRUNTIME_LIBEAY WIN32SSLRUNTIME_SSLEAY)

View File

@@ -5,7 +5,7 @@ OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
!define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"
RequestExecutionlevel highest
RequestExecutionlevel admin
SetCompressor LZMA
Var NormalDestDir
@@ -235,6 +235,13 @@ ${If} $PortableMode = 0
WriteUninstaller "$INSTDIR\uninstall.exe"
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
; Enable Windows User-Mode Dumps
; https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps
WriteRegExpandStr HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpFolder" "%LOCALAPPDATA%\CrashDumps\Cockatrice"
WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpCount" "5"
WriteRegDWORD HKLM "Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\cockatrice.exe" "DumpType" "2"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayName" "Cockatrice"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayVersion" "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@"
@@ -248,20 +255,20 @@ ${If} $PortableMode = 0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMajor" "@CPACK_PACKAGE_VERSION_MAJOR@"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMinor" "@CPACK_PACKAGE_VERSION_MINOR@"
IfFileExists "$INSTDIR\vcredist_x86.exe" VcRedist86Exists PastVcRedist86Check
IfFileExists "$INSTDIR\vc_redist.x86.exe" VcRedist86Exists PastVcRedist86Check
VcRedist86Exists:
ExecWait '"$INSTDIR\vcredist_x86.exe" /passive /norestart'
ExecWait '"$INSTDIR\vc_redist.x86.exe" /passive /norestart'
DetailPrint "Wait to ensure unlock of vc_redist file after installation..."
Sleep 3000
Delete "$INSTDIR\vcredist_x86.exe"
Delete "$INSTDIR\vc_redist.x86.exe"
PastVcRedist86Check:
IfFileExists "$INSTDIR\vcredist_x64.exe" VcRedist64Exists PastVcRedist64Check
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
VcRedist64Exists:
ExecWait '"$INSTDIR\vcredist_x64.exe" /passive /norestart'
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart'
DetailPrint "Sleep to ensure unlock of vc_redist file after installation..."
Sleep 3000
Delete "$INSTDIR\vcredist_x64.exe"
Delete "$INSTDIR\vc_redist.x64.exe"
PastVcRedist64Check:
${Else}

View File

@@ -0,0 +1,27 @@
# This script re-signs all apps after CPack packages them. This is necessary because CPack modifies
# the library references used by Cockatrice to App relative paths, invalidating the code signature.
string(LENGTH "$ENV{MACOS_CERTIFICATE_NAME}" MACOS_CERTIFICATE_NAME_LEN)
if(APPLE AND MACOS_CERTIFICATE_NAME_LEN GREATER 0)
set(APPLICATIONS "cockatrice" "servatrice" "oracle" "dbconverter")
foreach(app_name IN LISTS APPLICATIONS)
set(FULL_APP_PATH "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${app_name}.app")
message(STATUS "Signing Interior Dynamically Loaded Libraries for ${app_name}.app")
execute_process(COMMAND "find" "${FULL_APP_PATH}" "-name" "*.dylib" OUTPUT_VARIABLE INTERIOR_DLLS)
string(REPLACE "\n" ";" INTERIOR_DLLS_LIST ${INTERIOR_DLLS})
foreach(INTERIOR_DLL IN LISTS INTERIOR_DLLS_LIST)
execute_process(
COMMAND "codesign" "--sign" "$ENV{MACOS_CERTIFICATE_NAME}" "--entitlements" "../.ci/macos.entitlements"
"--options" "runtime" "--force" "--deep" "--timestamp" "--verbose" "${INTERIOR_DLL}"
)
endforeach()
message(STATUS "Signing Exterior Applications ${app_name}.app")
execute_process(
COMMAND "codesign" "--sign" "$ENV{MACOS_CERTIFICATE_NAME}" "--entitlements" "../.ci/macos.entitlements"
"--options" "runtime" "--force" "--deep" "--timestamp" "--verbose" "${FULL_APP_PATH}"
)
endforeach()
endif()

BIN
cmake/dmgBackground.tif Normal file

Binary file not shown.

View File

@@ -19,7 +19,7 @@ function(get_commit_id)
PARENT_SCOPE
)
set(PROJECT_VERSION_LABEL
"custom(${GIT_COM_ID})"
"custom-${GIT_COM_ID}"
PARENT_SCOPE
)
endfunction()
@@ -71,7 +71,9 @@ function(get_tag_name commit)
string(REPLACE "\n" "" GIT_TAG "${GIT_TAG}")
message(STATUS "Commit is a release or prerelease, git tag: ${GIT_TAG}")
# Extract information from tag: YYYY-MM-DD-Release-MAJ.MIN.PATCH YYYY-MM-DD-Development-MAJ.MIN.PATCH-beta.X
# Extract information from tag:
# YYYY-MM-DD-Release-MAJ.MIN.PATCH
# YYYY-MM-DD-Development-MAJ.MIN.PATCH-beta.X
string(REPLACE "-" ";" GIT_TAG_EXPLODED "${GIT_TAG}")
string(REPLACE "." ";" GIT_TAG_EXPLODED "${GIT_TAG_EXPLODED}")
@@ -131,8 +133,10 @@ function(get_tag_name commit)
return()
endif()
# Label 7 = Stable release 8 = Dev release, first beta so only "beta" attached 9 = Dev release, subsequent beta so
# "beta.N" attached (N>=2)
# Label
# 7 = Stable release
# 8 = Dev release, first beta so only "beta" attached
# 9 = Dev release, subsequent beta so "beta.N" attached (N>=2)
if(${GIT_TAG_LISTCOUNT} EQUAL 8)
list(GET GIT_TAG_EXPLODED 7 GIT_TAG_LABEL)
elseif(${GIT_TAG_LISTCOUNT} EQUAL 9)

View File

@@ -1,14 +0,0 @@
#!/bin/bash
# go to the project root directory, this file should be located in the project root directory
cd "${BASH_SOURCE%/*}/" || exit 2 # could not find path, this could happen with special links etc.
# CMake-Format
cmake_format_cmd="cmake-format"
if ! hash $cmake_format_cmd 2>/dev/null; then
echo "could not find $cmake_format_cmd, skipping" >&2
return
fi
$cmake_format_cmd -i cmake/*.cmake */CMakeLists.txt CMakeLists.txt

View File

@@ -5,132 +5,201 @@
project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(cockatrice_SOURCES
src/abstractcarddragitem.cpp
src/abstractcarditem.cpp
src/abstractclient.cpp
src/abstractcounter.cpp
src/abstractgraphicsitem.cpp
src/arrowitem.cpp
src/arrowtarget.cpp
src/carddatabase.cpp
src/carddatabasemodel.cpp
src/carddbparser/carddatabaseparser.cpp
src/carddbparser/cockatricexml3.cpp
src/carddbparser/cockatricexml4.cpp
src/carddragitem.cpp
src/cardfilter.cpp
src/cardframe.cpp
src/cardinfopicture.cpp
src/cardinfotext.cpp
src/cardinfowidget.cpp
src/carditem.cpp
src/cardlist.cpp
src/cardzone.cpp
src/chatview/chatview.cpp
src/counter_general.cpp
src/customlineedit.cpp
src/deck_loader.cpp
src/decklistmodel.cpp
src/deckstats_interface.cpp
src/deckview.cpp
src/dlg_connect.cpp
src/dlg_create_token.cpp
src/dlg_creategame.cpp
src/dlg_edit_avatar.cpp
src/dlg_edit_password.cpp
src/dlg_edit_tokens.cpp
src/dlg_edit_user.cpp
src/dlg_filter_games.cpp
src/dlg_forgotpasswordchallenge.cpp
src/dlg_forgotpasswordrequest.cpp
src/dlg_forgotpasswordreset.cpp
src/dlg_load_deck_from_clipboard.cpp
src/dlg_load_remote_deck.cpp
src/dlg_manage_sets.cpp
src/dlg_register.cpp
src/dlg_settings.cpp
src/dlg_tip_of_the_day.cpp
src/dlg_update.cpp
src/dlg_viewlog.cpp
src/filter_string.cpp
src/filterbuilder.cpp
src/filtertree.cpp
src/filtertreemodel.cpp
src/gamescene.cpp
src/gameselector.cpp
src/gamesmodel.cpp
src/gameview.cpp
src/gettextwithmax.cpp
src/handcounter.cpp
src/handle_public_servers.cpp
src/handzone.cpp
src/keysignals.cpp
src/lineeditcompleter.cpp
src/localclient.cpp
src/localserver.cpp
src/localserverinterface.cpp
src/logger.cpp
src/game/cards/abstract_card_drag_item.cpp
src/game/cards/abstract_card_item.cpp
src/client/game_logic/abstract_client.cpp
src/game/board/abstract_counter.cpp
src/game/board/abstract_graphics_item.cpp
src/game/board/arrow_item.cpp
src/game/board/arrow_target.cpp
src/game/cards/card_database.cpp
src/game/cards/card_database_manager.cpp
src/game/cards/card_database_model.cpp
src/game/cards/card_database_parser/card_database_parser.cpp
src/game/cards/card_database_parser/cockatrice_xml_3.cpp
src/game/cards/card_database_parser/cockatrice_xml_4.cpp
src/game/cards/card_drag_item.cpp
src/game/filters/filter_card.cpp
src/client/ui/widgets/cards/card_info_frame_widget.cpp
src/client/ui/widgets/cards/card_info_picture_widget.cpp
src/client/ui/widgets/cards/card_info_text_widget.cpp
src/client/ui/widgets/cards/card_info_display_widget.cpp
src/client/ui/widgets/cards/card_size_widget.cpp
src/game/cards/card_item.cpp
src/game/cards/card_list.cpp
src/game/zones/card_zone.cpp
src/server/chat_view/chat_view.cpp
src/game/board/counter_general.cpp
src/deck/custom_line_edit.cpp
src/deck/deck_loader.cpp
src/deck/deck_list_model.cpp
src/deck/deck_stats_interface.cpp
src/dialogs/dlg_connect.cpp
src/dialogs/dlg_convert_deck_to_cod_format.cpp
src/dialogs/dlg_create_token.cpp
src/dialogs/dlg_create_game.cpp
src/dialogs/dlg_edit_avatar.cpp
src/dialogs/dlg_edit_password.cpp
src/dialogs/dlg_edit_tokens.cpp
src/dialogs/dlg_edit_user.cpp
src/dialogs/dlg_filter_games.cpp
src/dialogs/dlg_forgot_password_challenge.cpp
src/dialogs/dlg_forgot_password_request.cpp
src/dialogs/dlg_forgot_password_reset.cpp
src/dialogs/dlg_load_deck_from_clipboard.cpp
src/dialogs/dlg_load_remote_deck.cpp
src/dialogs/dlg_manage_sets.cpp
src/dialogs/dlg_move_top_cards_until.cpp
src/dialogs/dlg_register.cpp
src/dialogs/dlg_roll_dice.cpp
src/dialogs/dlg_settings.cpp
src/dialogs/dlg_tip_of_the_day.cpp
src/dialogs/dlg_update.cpp
src/dialogs/dlg_view_log.cpp
src/dialogs/dlg_load_deck.cpp
src/game/deckview/deck_view.cpp
src/game/deckview/deck_view_container.cpp
src/game/filters/filter_string.cpp
src/game/filters/filter_builder.cpp
src/game/filters/filter_tree.cpp
src/game/filters/filter_tree_model.cpp
src/client/ui/layouts/flow_layout.cpp
src/client/ui/widgets/general/layout_containers/flow_widget.cpp
src/game/game_scene.cpp
src/game/game_selector.cpp
src/game/games_model.cpp
src/game/game_view.cpp
src/client/get_text_with_max.cpp
src/game/hand_counter.cpp
src/server/handle_public_servers.cpp
src/game/zones/hand_zone.cpp
src/client/game_logic/key_signals.cpp
src/client/ui/line_edit_completer.cpp
src/server/local_client.cpp
src/server/local_server.cpp
src/server/local_server_interface.cpp
src/utility/logger.cpp
src/client/ui/widgets/cards/card_info_picture_enlarged_widget.cpp
src/client/ui/widgets/cards/card_info_picture_with_text_overlay_widget.cpp
src/client/ui/widgets/general/display/banner_widget.cpp
src/client/ui/widgets/general/display/labeled_input.cpp
src/client/ui/widgets/general/display/dynamic_font_size_label.cpp
src/client/ui/widgets/general/display/dynamic_font_size_push_button.cpp
src/client/ui/widgets/general/display/shadow_background_label.cpp
src/main.cpp
src/messagelogwidget.cpp
src/pending_command.cpp
src/phase.cpp
src/phasestoolbar.cpp
src/pictureloader.cpp
src/pilezone.cpp
src/pixmapgenerator.cpp
src/player.cpp
src/playerlistwidget.cpp
src/playertarget.cpp
src/releasechannel.cpp
src/remoteclient.cpp
src/remotedecklist_treewidget.cpp
src/remotereplaylist_treewidget.cpp
src/replay_timeline_widget.cpp
src/selectzone.cpp
src/sequenceEdit/sequenceedit.cpp
src/setsmodel.cpp
src/settings/carddatabasesettings.cpp
src/settings/downloadsettings.cpp
src/settings/gamefilterssettings.cpp
src/settings/layoutssettings.cpp
src/settings/messagesettings.cpp
src/settings/serverssettings.cpp
src/settings/settingsmanager.cpp
src/settingscache.cpp
src/shortcutssettings.cpp
src/soundengine.cpp
src/spoilerbackgroundupdater.cpp
src/stackzone.cpp
src/tab.cpp
src/tab_account.cpp
src/tab_admin.cpp
src/tab_deck_editor.cpp
src/tab_deck_storage.cpp
src/tab_game.cpp
src/tab_logs.cpp
src/tab_message.cpp
src/tab_replays.cpp
src/tab_room.cpp
src/tab_server.cpp
src/tab_supervisor.cpp
src/tablezone.cpp
src/tappedout_interface.cpp
src/thememanager.cpp
src/tip_of_the_day.cpp
src/translatecountername.cpp
src/update_downloader.cpp
src/user_context_menu.cpp
src/userconnection_information.cpp
src/userinfobox.cpp
src/userlist.cpp
src/window_main.cpp
src/zoneviewwidget.cpp
src/zoneviewzone.cpp
src/server/message_log_widget.cpp
src/client/ui/layouts/overlap_layout.cpp
src/client/ui/widgets/general/layout_containers/overlap_widget.cpp
src/client/ui/widgets/general/layout_containers/overlap_control_widget.cpp
src/server/pending_command.cpp
src/game/phase.cpp
src/client/ui/phases_toolbar.cpp
src/client/ui/picture_loader/picture_loader.cpp
src/client/ui/picture_loader/picture_loader_worker.cpp
src/client/ui/picture_loader/picture_to_load.cpp
src/game/zones/pile_zone.cpp
src/client/ui/pixel_map_generator.cpp
src/game/player/player.cpp
src/game/player/player_list_widget.cpp
src/game/player/player_target.cpp
src/client/ui/widgets/printing_selector/all_zones_card_amount_widget.cpp
src/client/ui/widgets/printing_selector/card_amount_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector.cpp
src/client/ui/widgets/printing_selector/printing_selector_card_display_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector_card_overlay_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector_card_search_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector_card_selection_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector_card_sorting_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector_view_options_toolbar_widget.cpp
src/client/ui/widgets/printing_selector/printing_selector_view_options_widget.cpp
src/client/ui/widgets/printing_selector/set_name_and_collectors_number_display_widget.cpp
src/client/network/release_channel.cpp
src/client/network/client_update_checker.cpp
src/server/remote/remote_client.cpp
src/server/remote/remote_decklist_tree_widget.cpp
src/server/remote/remote_replay_list_tree_widget.cpp
src/client/network/replay_timeline_widget.cpp
src/game/zones/select_zone.cpp
src/utility/sequence_edit.cpp
src/client/network/sets_model.cpp
src/settings/card_database_settings.cpp
src/settings/download_settings.cpp
src/settings/game_filters_settings.cpp
src/settings/layouts_settings.cpp
src/settings/message_settings.cpp
src/settings/recents_settings.cpp
src/settings/servers_settings.cpp
src/settings/settings_manager.cpp
src/settings/cache_settings.cpp
src/settings/shortcuts_settings.cpp
src/settings/shortcut_treeview.cpp
src/settings/card_override_settings.cpp
src/settings/debug_settings.cpp
src/client/sound_engine.cpp
src/client/network/spoiler_background_updater.cpp
src/game/zones/stack_zone.cpp
src/client/tabs/tab.cpp
src/client/tabs/tab_account.cpp
src/client/tabs/tab_admin.cpp
src/client/tabs/tab_deck_editor.cpp
src/client/tabs/tab_deck_storage.cpp
src/client/tabs/tab_game.cpp
src/client/tabs/tab_logs.cpp
src/client/tabs/tab_message.cpp
src/client/tabs/tab_replays.cpp
src/client/tabs/tab_room.cpp
src/client/tabs/tab_server.cpp
src/client/tabs/tab_supervisor.cpp
src/client/tabs/api/edhrec/tab_edhrec.cpp
src/client/tabs/api/edhrec/edhrec_commander_api_response_display_widget.cpp
src/client/tabs/api/edhrec/edhrec_commander_api_response_card_details_display_widget.cpp
src/client/tabs/api/edhrec/edhrec_commander_api_response_card_list_display_widget.cpp
src/client/tabs/api/edhrec/edhrec_commander_api_response_commander_details_display_widget.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_archidekt_links.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_average_deck_statistics.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_details.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_list.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_container.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_prices.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_commander_details.cpp
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response.cpp
src/game/zones/table_zone.cpp
src/client/tapped_out_interface.cpp
src/client/ui/theme_manager.cpp
src/client/ui/tip_of_the_day.cpp
src/client/translate_counter_name.cpp
src/client/update_downloader.cpp
src/server/user/user_context_menu.cpp
src/server/user/user_info_connection.cpp
src/server/user/user_info_box.cpp
src/server/user/user_list_manager.cpp
src/server/user/user_list_widget.cpp
src/client/ui/window_main.cpp
src/game/zones/view_zone_widget.cpp
src/game/zones/view_zone.cpp
src/client/tabs/visual_deck_storage/tab_deck_storage_visual.cpp
src/client/ui/widgets/cards/deck_preview_card_picture_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_color_identity_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_color_identity_filter_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_display_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_item_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.cpp
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_widget.cpp
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_tag_filter_widget.cpp
${VERSION_STRING_CPP}
)
add_subdirectory(sounds)
add_subdirectory(themes)
configure_file(
${CMAKE_SOURCE_DIR}/cockatrice/resources/config/qtlogging.ini ${CMAKE_BINARY_DIR}/cockatrice/qtlogging.ini COPYONLY
)
set(cockatrice_RESOURCES cockatrice.qrc)
@@ -251,7 +320,7 @@ if(APPLE)
set(plugin_dest_dir cockatrice.app/Contents/Plugins)
set(qtconf_dest_dir cockatrice.app/Contents/Resources)
# Qt plugins: audio (Qt5), iconengines, imageformats, platforms, printsupport (Qt5), styles, tls (Qt6)
# Qt plugins: audio (Qt5), iconengines, imageformats, multimedia (Qt6), platforms, printsupport (Qt5), styles, tls (Qt6)
install(
DIRECTORY "${QT_PLUGINS_DIR}/"
DESTINATION ${plugin_dest_dir}
@@ -262,6 +331,7 @@ if(APPLE)
PATTERN "audio/*.dylib"
PATTERN "iconengines/*.dylib"
PATTERN "imageformats/*.dylib"
PATTERN "multimedia/*.dylib"
PATTERN "platforms/*.dylib"
PATTERN "printsupport/*.dylib"
PATTERN "styles/*.dylib"
@@ -302,7 +372,7 @@ if(WIN32)
PATTERN "*.dll"
)
# Qt plugins: audio (Qt5), iconengines, imageformats, platforms, printsupport (Qt5), styles, tls (Qt6)
# Qt plugins: audio (Qt5), iconengines, imageformats, multimedia (Qt6) platforms, printsupport (Qt5), styles, tls (Qt6)
install(
DIRECTORY "${QT_PLUGINS_DIR}/"
DESTINATION ${plugin_dest_dir}
@@ -311,15 +381,10 @@ if(WIN32)
PATTERN "audio/qtaudio_wasapi.dll"
PATTERN "audio/qtaudio_windows.dll"
PATTERN "iconengines/qsvgicon.dll"
PATTERN "imageformats/qgif.dll"
PATTERN "imageformats/qicns.dll"
PATTERN "imageformats/qico.dll"
PATTERN "imageformats/qjpeg.dll"
PATTERN "imageformats/qsvg.dll"
PATTERN "imageformats/qtga.dll"
PATTERN "imageformats/qtiff.dll"
PATTERN "imageformats/qwbmp.dll"
PATTERN "imageformats/qwebp.dll"
PATTERN "imageformats/*.dll"
PATTERN "mediaservice/dsengine.dll"
PATTERN "mediaservice/wmfengine.dll"
PATTERN "multimedia/*.dll"
PATTERN "platforms/qdirect2d.dll"
PATTERN "platforms/qminimal.dll"
PATTERN "platforms/qoffscreen.dll"
@@ -355,13 +420,13 @@ Data = Resources\")
COMPONENT Runtime
)
if(WIN32SSLRUNTIME_FOUND)
install(FILES ${WIN32SSLRUNTIME_LIBRARIES} DESTINATION ./)
if(OPENSSL_FOUND)
install(FILES ${OPENSSL_INCLUDE_DIRS} DESTINATION ./)
endif()
endif()
if(Qt6LinguistTools_FOUND)
# Qt6 Translations happen after the executable is built up
if(Qt6_FOUND AND Qt6LinguistTools_FOUND)
#Qt6 Translations happen after the executable is built up
if(UPDATE_TRANSLATIONS)
qt6_add_translations(
cockatrice

View File

@@ -29,6 +29,7 @@
<file>resources/icons/search.svg</file>
<file>resources/icons/settings.svg</file>
<file>resources/icons/spectator.svg</file>
<file>resources/icons/swap.svg</file>
<file>resources/icons/sync.svg</file>
<file>resources/icons/tab_changed.svg</file>
<file>resources/icons/update.png</file>
@@ -41,6 +42,8 @@
<file>resources/config/deckeditor.svg</file>
<file>resources/config/shorcuts.svg</file>
<file>resources/config/sound.svg</file>
<file>resources/config/debug.ini</file>
<file>resources/config/qtlogging.ini</file>
<file>resources/counters/w.svg</file>
<file>resources/counters/w_highlight.svg</file>
@@ -326,6 +329,13 @@
<file>resources/replay/fastforward.svg</file>
<file>resources/replay/pause.svg</file>
<file>resources/usericons/pawn_single.svg</file>
<file>resources/usericons/pawn_double.svg</file>
<file>resources/usericons/pawn_vip_single.svg</file>
<file>resources/usericons/pawn_vip_double.svg</file>
<file>resources/usericons/star_single.svg</file>
<file>resources/usericons/star_double.svg</file>
<file>resources/userlevels/normal.svg</file>
<file>resources/userlevels/registered.svg</file>
<file>resources/userlevels/registered_buddy.svg</file>
@@ -351,10 +361,10 @@
<file>resources/tips/images/cockatrice_wiki.png</file>
<file>resources/tips/images/coin_flip.png</file>
<file>resources/tips/images/counter_expression.png</file>
<file>resources/tips/images/discord.png</file>
<file>resources/tips/images/face_down.png</file>
<file>resources/tips/images/filter_games.png</file>
<file>resources/tips/images/github_logo.png</file>
<file>resources/tips/images/gitter.png</file>
<file>resources/tips/images/setpt.png</file>
<file>resources/tips/images/shortcuts.png</file>
<file>resources/tips/images/themes.png</file>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,11 @@
[debug]
showCardId=false
[localgame]
onStartup=false
playerCount=1
;deck\Player 1=path/to/deck
;deck\Player 2=path/to/deck
; Fun Fact: You can assign a deck to your username and it will auto load and ready when you join a server game
;deck\Your Username Here=path/to/deck

View File

@@ -0,0 +1,49 @@
[Rules]
# Uncomment a rule to disable logging for that category
# main = false
# qt_translator = false
# window_main.* = false
# release_channel = false
# spoiler_background_updater = false
# theme_manager = false
# sound_engine = false
# tapped_out_interface = false
# tab_game = false
# tab_message = false
# tab_supervisor = false
# dlg_edit_avatar = false
# dlg_settings = false
# dlg_tip_of_the_day = false
# dlg_update = false
# settings_cache = false
# servers_settings = false
# shortcuts_settings = false
# player = false
# game_scene = false
# game_scene.player_addition_removal = false
# card_zone = false
# view_zone = false
# user_info_connection = false
# picture_loader = false
# picture_loader.worker = false
# picture_loader.card_back_cache_fail = false
# picture_loader.picture_to_load = false
# deck_loader = false
# card_database = false
# card_database.loading = false
# card_database.loading.success_or_failure = false
# cockatrice_xml.* = false
# cockatrice_xml.xml_3_parser = false
# cockatrice_xml.xml_4_parser = false
# card_list = false
# pixel_map_generator = false
# filter_string = false

View File

@@ -1,6 +1,7 @@
## Syntax Help
## Search Syntax Help
-----
The search bar recognizes a set of special commands similar to some other card databases. Here is a list with examples. Each entry can be clicked to test the query and has a small explanation. Note that all searches are case insensitive.
The search bar recognizes a set of special commands similar to some other card databases.<br>
In this list of examples below, each entry has an explanation and can be clicked to test the query. Note that all searches are case insensitive.
<dl>
<dt>Name:</dt>
<dd>[birds of paradise](#birds of paradise) <small>(Any card name containing the words birds, of, and paradise)</small></dd>
@@ -46,8 +47,7 @@ The search bar recognizes a set of special commands similar to some other card d
<dt><u>E</u>dition:</dt>
<dd>[set:lea](#set:lea) <small>(Cards that appear in Alpha, which has the set code LEA)</small></dd>
<dd>[e:lea,leb](#e:lea,leb) <small>(Cards that appear in Alpha or Beta)</small></dd>
<dd><a href="#e:lea,leb -(e:lea e:leb)">e:lea,leb -(e:lea e:leb)</a> <small>(Cards that appear in Alpha or Beta but not in both editions)</small></dd>
<dd>[e:lea or e:leb](#e:lea or e:leb) <small>(Cards that appear in Alpha or Beta)</small></dd>
<dt>Negate:</dt>
<dd>[c:wu -c:m](#c:wu -c:m) <small>(Any card that is white or blue, but not multicolored)</small></dd>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" version="1.1" id="Capa_1"
xmlns="http://www.w3.org/2000/svg"
width="800px" height="800px" viewBox="0 0 71.753 71.753"
xml:space="preserve">
<g>
<path d="M39.798,20.736H28.172v20.738L11.625,41.47V20.736H0L19.899,0.839L39.798,20.736z M51.855,70.914l19.897-19.896H60.129
V30.282l-16.547-0.004v20.74H31.957L51.855,70.914z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -7,9 +7,9 @@
</tip>
<tip>
<title>Suggesting New Tips</title>
<text>You can suggest new Tips of the Day by reaching out to the development team on &lt;a href="https://gitter.im/cockatrice/cockatrice"&gt;Gitter&lt;/a&gt;!</text>
<image>gitter.png</image>
<date>2018-03-01</date>
<text>You can suggest new Tips of the Day by reaching out to the development team on &lt;a href="https://discord.gg/3Z9yzmA"&gt;Discord&lt;/a&gt;!</text>
<image>discord.png</image>
<date>2023-10-18</date>
</tip>
<tip>
<title>Reporting Bugs</title>

View File

@@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
id="svg5322"
version="1.1"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
sodipodi:docname="pawn_double.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective5328" />
<inkscape:perspective
id="perspective5305"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5181">
<stop
style="stop-color:#0fbb00;stop-opacity:1;"
offset="0"
id="stop5183" />
<stop
style="stop-color:#064400;stop-opacity:1;"
offset="1"
id="stop5185" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-2"
id="radialGradient3606-7"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-2">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-4" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-9" />
</linearGradient>
<inkscape:perspective
id="perspective5478"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5189">
<stop
style="stop-color:#000ec9;stop-opacity:1;"
offset="0"
id="stop5191" />
<stop
style="stop-color:#000657;stop-opacity:1;"
offset="1"
id="stop5193" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-4"
id="radialGradient3606-1"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-4">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-3" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-5" />
</linearGradient>
<inkscape:perspective
id="perspective5559"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5173"
id="linearGradient5179"
x1="167.33386"
y1="178.83276"
x2="244.78181"
y2="178.83276"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient5173">
<stop
style="stop-color:#f50000;stop-opacity:1;"
offset="0"
id="stop5175" />
<stop
style="stop-color:#950000;stop-opacity:1;"
offset="1"
id="stop5177" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600"
id="radialGradient5169"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276" />
<linearGradient
id="linearGradient3600">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604" />
</linearGradient>
<radialGradient
r="25.501276"
fy="131.40274"
fx="324.32715"
cy="131.40274"
cx="324.32715"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
gradientUnits="userSpaceOnUse"
id="radialGradient5574"
xlink:href="#linearGradient3600"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5663"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-7"
id="radialGradient3606-8"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-7">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602-7" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-6" />
</linearGradient>
<radialGradient
r="25.501276"
fy="131.40274"
fx="324.32715"
cy="131.40274"
cx="324.32715"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
gradientUnits="userSpaceOnUse"
id="radialGradient5676"
xlink:href="#linearGradient3600-7"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
inkscape:document-units="mm"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="63.214286"
inkscape:cy="46.160714"
inkscape:current-layer="g5249"
showgrid="false"
inkscape:window-width="1147"
inkscape:window-height="1211"
inkscape:window-x="2842"
inkscape:window-y="58"
inkscape:window-maximized="0"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-952.36218)">
<g
id="g5249"
transform="translate(0.53874115,0.90502985)">
<path
style="stroke:#000000;stroke-width:4.45809746000000030;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;fill-opacity:1"
d="m 49.582319,954.34642 c -12.850034,0 -23.284789,10.43476 -23.284789,23.28479 0,7.32135 3.403263,13.81811 8.689724,18.08319 -10.278401,5.8502 -16.663073,17.8469 -20.19443,31.0259 -5.1178053,19.1 15.207096,22.0401 34.269334,22.0915 l 0,0.031 c 0.290839,0 0.566498,0.031 0.856734,0.031 19.210152,0 39.855802,-3.1837 34.789494,-22.0914 -3.636192,-13.5705 -10.027831,-25.4711 -20.378015,-31.17899 5.208701,-4.26694 8.506139,-10.73278 8.506139,-17.9914 0,-12.85003 -10.404159,-23.28479 -23.254191,-23.28479 z"
id="left"
inkscape:connector-curvature="0" />
<path
fill="none"
style="stroke:#000000;stroke-width:1.97203517px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 50.522358,952.70715 0,95.71425"
id="center"
inkscape:connector-curvature="0" />
<path
style="opacity:1;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.71966;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 51.054254,1001.4773 v -45.77683 l 1.097241,0.005 c 3.642211,0.0172 9.170661,2.46935 12.395732,5.49816 4.897489,4.59945 7.421654,10.97001 6.981907,17.62114 -0.389167,5.88609 -2.631878,10.66609 -6.951818,14.81672 l -2.05562,1.97506 2.959813,2.0746 c 3.467097,2.43015 7.403677,6.55065 9.666109,10.11765 3.325898,5.2437 6.79289,13.8355 8.153827,20.2065 2.584451,12.0989 -5.997953,18.2384 -26.592174,19.0232 l -5.655017,0.2154 v -45.7768 z"
id="right"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100"
height="100"
id="svg5322"
version="1.1"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
sodipodi:docname="pawn_single.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective5328" />
<inkscape:perspective
id="perspective5305"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5181">
<stop
style="stop-color:#0fbb00;stop-opacity:1;"
offset="0"
id="stop5183" />
<stop
style="stop-color:#064400;stop-opacity:1;"
offset="1"
id="stop5185" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-2"
id="radialGradient3606-7"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-2">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-4" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-9" />
</linearGradient>
<inkscape:perspective
id="perspective5478"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5189">
<stop
style="stop-color:#000ec9;stop-opacity:1;"
offset="0"
id="stop5191" />
<stop
style="stop-color:#000657;stop-opacity:1;"
offset="1"
id="stop5193" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-4"
id="radialGradient3606-1"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-4">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-3" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-5" />
</linearGradient>
<inkscape:perspective
id="perspective5559"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5173"
id="linearGradient5179"
x1="167.33386"
y1="178.83276"
x2="244.78181"
y2="178.83276"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient5173">
<stop
style="stop-color:#f50000;stop-opacity:1;"
offset="0"
id="stop5175" />
<stop
style="stop-color:#950000;stop-opacity:1;"
offset="1"
id="stop5177" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600"
id="radialGradient5169"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276" />
<linearGradient
id="linearGradient3600">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604" />
</linearGradient>
<radialGradient
r="25.501276"
fy="131.40274"
fx="324.32715"
cy="131.40274"
cx="324.32715"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
gradientUnits="userSpaceOnUse"
id="radialGradient5574"
xlink:href="#linearGradient3600"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5663"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-7"
id="radialGradient3606-8"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-7">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602-7" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-6" />
</linearGradient>
<radialGradient
r="25.501276"
fy="131.40274"
fx="324.32715"
cy="131.40274"
cx="324.32715"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
gradientUnits="userSpaceOnUse"
id="radialGradient5676"
xlink:href="#linearGradient3600-7"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
inkscape:document-units="mm"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="63.214286"
inkscape:cy="46.160714"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1147"
inkscape:window-height="1211"
inkscape:window-x="3185"
inkscape:window-y="44"
inkscape:window-maximized="0"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-952.36218)">
<path
style="fill-opacity:1;stroke:black;stroke-width:2.78220296;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;opacity:1"
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
id="left"
transform="translate(0,952.36218)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -0,0 +1,368 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="100"
height="100"
id="svg5322"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="moderator_vip.svg">
<defs
id="defs3">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective5328" />
<inkscape:perspective
id="perspective5305"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5181">
<stop
style="stop-color:#0fbb00;stop-opacity:1;"
offset="0"
id="stop5183" />
<stop
style="stop-color:#064400;stop-opacity:1;"
offset="1"
id="stop5185" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-2"
id="radialGradient3606-7"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-2">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-4" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-9" />
</linearGradient>
<inkscape:perspective
id="perspective5478"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5189">
<stop
style="stop-color:#000ec9;stop-opacity:1;"
offset="0"
id="stop5191" />
<stop
style="stop-color:#000657;stop-opacity:1;"
offset="1"
id="stop5193" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-4"
id="radialGradient3606-1"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-4">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-3" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-5" />
</linearGradient>
<inkscape:perspective
id="perspective5559"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5173"
id="linearGradient5179"
x1="167.33386"
y1="178.83276"
x2="244.78181"
y2="178.83276"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient5173">
<stop
style="stop-color:#f50000;stop-opacity:1;"
offset="0"
id="stop5175" />
<stop
style="stop-color:#950000;stop-opacity:1;"
offset="1"
id="stop5177" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600"
id="radialGradient5169"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276" />
<linearGradient
id="linearGradient3600">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604" />
</linearGradient>
<radialGradient
r="25.501276"
fy="131.40274"
fx="324.32715"
cy="131.40274"
cx="324.32715"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
gradientUnits="userSpaceOnUse"
id="radialGradient5574"
xlink:href="#linearGradient3600"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5663"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-7"
id="radialGradient3606-8"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-7">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602-7" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-6" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-7"
id="radialGradient5254"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5189-1"
id="linearGradient5394"
gradientUnits="userSpaceOnUse"
x1="385.03503"
y1="180.09546"
x2="462.48297"
y2="180.09546"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-360.365,847.52359)" />
<linearGradient
id="linearGradient5189-1">
<stop
style="stop-color:#000ec9;stop-opacity:1;"
offset="0"
id="stop5191-0" />
<stop
style="stop-color:#000657;stop-opacity:1;"
offset="1"
id="stop5193-4" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5173-1"
id="linearGradient5581"
gradientUnits="userSpaceOnUse"
x1="167.33386"
y1="178.83276"
x2="244.78181"
y2="178.83276"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-149.54484,848.74636)" />
<linearGradient
id="linearGradient5173-1">
<stop
style="stop-color:#f50000;stop-opacity:1;"
offset="0"
id="stop5175-5" />
<stop
style="stop-color:#950000;stop-opacity:1;"
offset="1"
id="stop5177-3" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5181-9"
id="linearGradient5782"
gradientUnits="userSpaceOnUse"
x1="282.50455"
y1="181.61069"
x2="359.95248"
y2="181.61069"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-261.07526,846.05625)" />
<linearGradient
id="linearGradient5181-9">
<stop
style="stop-color:#80d600;stop-opacity:1;"
offset="0"
id="stop5183-3" />
<stop
style="stop-color:#80d600;stop-opacity:1;"
offset="1"
id="stop5185-0" />
</linearGradient>
<linearGradient
y2="181.61069"
x2="359.95248"
y1="181.61069"
x1="282.50455"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-175.71812,893.2775)"
gradientUnits="userSpaceOnUse"
id="linearGradient5799"
xlink:href="#linearGradient5181-9"
inkscape:collect="always" />
<linearGradient
inkscape:collect="always"
id="linearGradient3419">
<stop
style="stop-color:#ffec79;stop-opacity:1"
offset="0"
id="stop3421" />
<stop
style="stop-color:#f2c15b;stop-opacity:1"
offset="1"
id="stop3423" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3419"
id="linearGradient3425-5"
x1="-126.90256"
y1="941.52618"
x2="-125.73831"
y2="984.13751"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(154.2532,0.90556908)" />
</defs>
<sodipodi:namedview
inkscape:document-units="mm"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="4.2946338"
inkscape:cx="34.155294"
inkscape:cy="65.175571"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1440"
inkscape:window-height="792"
inkscape:window-x="11"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-952.36218)">
<path
style="fill-opacity:1;stroke:black;stroke-width:2.78220296;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
transform="translate(0,952.36218)"
id="right" />
<path
style="opacity:1;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.73577702;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 51.28696,1001.834 0,-46.98372 1.434151,0.16768 c 5.155008,0.60274 9.462857,2.72154 12.938257,6.36366 4.74393,4.9715 6.87913,11.35611 6.16464,18.43328 -0.53702,5.31935 -3.09008,10.59498 -6.83833,14.13074 l -1.94072,1.83069 3.04083,2.20427 c 3.58084,2.5957 7.18975,6.4912 9.55296,10.3116 4.89572,7.9144 9.23593,21.4918 8.50487,26.6055 -0.81312,5.6877 -5.43872,9.6977 -13.62216,11.8093 -3.80822,0.9826 -7.68056,1.4713 -14.763321,1.8633 l -4.471177,0.2474 0,-46.9837 z"
id="left"
inkscape:connector-curvature="0" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient3425-5);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="star"
sodipodi:sides="5"
sodipodi:cx="27.80283"
sodipodi:cy="970.9433"
sodipodi:r1="17.189852"
sodipodi:r2="8.5949249"
sodipodi:arg1="0.9349579"
sodipodi:arg2="1.5632764"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 38.011063,984.77381 -10.143601,-5.23583 -10.063711,5.38779 1.845023,-11.2651 -8.233948,-7.90624 11.283888,-1.72639 4.974851,-10.27411 5.128803,10.19813 11.308575,1.55649 -8.114112,8.02918 z"
inkscape:transform-center-x="0.094945927"
inkscape:transform-center-y="-3.9764964"
transform="matrix(2.3768784,0,0,2.4799382,-15.920285,-1400.1716)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,363 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="100"
height="100"
id="svg5322"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="admin_vip.svg">
<defs
id="defs3">
<linearGradient
inkscape:collect="always"
id="linearGradient3419">
<stop
style="stop-color:#ffec79;stop-opacity:1"
offset="0"
id="stop3421" />
<stop
style="stop-color:#f2c15b;stop-opacity:1"
offset="1"
id="stop3423" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective5328" />
<inkscape:perspective
id="perspective5305"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5181">
<stop
style="stop-color:#0fbb00;stop-opacity:1;"
offset="0"
id="stop5183" />
<stop
style="stop-color:#064400;stop-opacity:1;"
offset="1"
id="stop5185" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-2"
id="radialGradient3606-7"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-2">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-4" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-9" />
</linearGradient>
<inkscape:perspective
id="perspective5478"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5189">
<stop
style="stop-color:#000ec9;stop-opacity:1;"
offset="0"
id="stop5191" />
<stop
style="stop-color:#000657;stop-opacity:1;"
offset="1"
id="stop5193" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-4"
id="radialGradient3606-1"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-4">
<stop
style="stop-color:#ffc33d;stop-opacity:1;"
offset="0"
id="stop3602-3" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-5" />
</linearGradient>
<inkscape:perspective
id="perspective5559"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5173"
id="linearGradient5179"
x1="167.33386"
y1="178.83276"
x2="244.78181"
y2="178.83276"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient5173">
<stop
style="stop-color:#f50000;stop-opacity:1;"
offset="0"
id="stop5175" />
<stop
style="stop-color:#950000;stop-opacity:1;"
offset="1"
id="stop5177" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600"
id="radialGradient5169"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276" />
<linearGradient
id="linearGradient3600">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604" />
</linearGradient>
<radialGradient
r="25.501276"
fy="131.40274"
fx="324.32715"
cy="131.40274"
cx="324.32715"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
gradientUnits="userSpaceOnUse"
id="radialGradient5574"
xlink:href="#linearGradient3600"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5663"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-7"
id="radialGradient3606-8"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
<linearGradient
id="linearGradient3600-7">
<stop
style="stop-color:#ffc13d;stop-opacity:1;"
offset="0"
id="stop3602-7" />
<stop
style="stop-color:#e09900;stop-opacity:1;"
offset="1"
id="stop3604-6" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3600-7"
id="radialGradient5254"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
cx="324.32715"
cy="131.40274"
fx="324.32715"
fy="131.40274"
r="25.501276" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5189-1"
id="linearGradient5394"
gradientUnits="userSpaceOnUse"
x1="385.03503"
y1="180.09546"
x2="462.48297"
y2="180.09546"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-360.365,847.52359)" />
<linearGradient
id="linearGradient5189-1">
<stop
style="stop-color:#000ec9;stop-opacity:1;"
offset="0"
id="stop5191-0" />
<stop
style="stop-color:#000657;stop-opacity:1;"
offset="1"
id="stop5193-4" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5173-1"
id="linearGradient5581"
gradientUnits="userSpaceOnUse"
x1="167.33386"
y1="178.83276"
x2="244.78181"
y2="178.83276"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-149.54484,848.74636)" />
<linearGradient
id="linearGradient5173-1">
<stop
style="stop-color:#f50000;stop-opacity:1;"
offset="0"
id="stop5175-5" />
<stop
style="stop-color:#950000;stop-opacity:1;"
offset="1"
id="stop5177-3" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5181-9"
id="linearGradient5782"
gradientUnits="userSpaceOnUse"
x1="282.50455"
y1="181.61069"
x2="359.95248"
y2="181.61069"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-261.07526,846.05625)" />
<linearGradient
id="linearGradient5181-9">
<stop
style="stop-color:#80d600;stop-opacity:1;"
offset="0"
id="stop5183-3" />
<stop
style="stop-color:#80d600;stop-opacity:1;"
offset="1"
id="stop5185-0" />
</linearGradient>
<linearGradient
y2="181.61069"
x2="359.95248"
y1="181.61069"
x1="282.50455"
gradientTransform="matrix(0.96839241,0,0,0.96839241,-175.71812,893.2775)"
gradientUnits="userSpaceOnUse"
id="linearGradient5799"
xlink:href="#linearGradient5181-9"
inkscape:collect="always" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3419"
id="linearGradient3425"
x1="-126.90256"
y1="941.52618"
x2="-125.73831"
y2="984.13751"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(154.2532,0.90556908)" />
</defs>
<sodipodi:namedview
inkscape:document-units="mm"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="4.2946338"
inkscape:cx="0.39222903"
inkscape:cy="65.175571"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1440"
inkscape:window-height="792"
inkscape:window-x="11"
inkscape:window-y="0"
inkscape:window-maximized="0" />
<metadata
id="metadata4">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-952.36218)">
<path
style="fill-opacity:1;stroke:black;stroke-width:2.78220296;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
transform="translate(0,952.36218)"
id="left" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient3425);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="star"
sodipodi:sides="5"
sodipodi:cx="27.80283"
sodipodi:cy="970.9433"
sodipodi:r1="17.189852"
sodipodi:r2="8.5949249"
sodipodi:arg1="0.9349579"
sodipodi:arg2="1.5632764"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 38.011063,984.77381 -10.143601,-5.23583 -10.063711,5.38779 1.845023,-11.2651 -8.233948,-7.90624 11.283888,-1.72639 4.974851,-10.27411 5.128803,10.19813 11.308575,1.55649 -8.114112,8.02918 z"
inkscape:transform-center-x="0.094945927"
inkscape:transform-center-y="-3.9764964"
transform="matrix(2.3768784,0,0,2.4799382,-16.393468,-1400.3733)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 64 64"
enable-background="new 0 0 64 64"
id="svg2"
version="1.1"
inkscape:version="0.48.5 r10040"
width="100%"
height="100%"
sodipodi:docname="moderator_buddy.svg">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10">
<linearGradient
id="linearGradient5225">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop5227" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop5229" />
</linearGradient>
<linearGradient
id="linearGradient5219"
osb:paint="solid">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop5221" />
</linearGradient>
<linearGradient
id="linearGradient3758">
<stop
id="stop3760"
offset="0"
style="stop-color:#0fbb00;stop-opacity:1;" />
<stop
id="stop3762"
offset="1"
style="stop-color:#064400;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3750">
<stop
style="stop-color:#ece400;stop-opacity:1;"
offset="0"
id="stop3752" />
<stop
style="stop-color:#ece400;stop-opacity:0;"
offset="1"
id="stop3754" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3758-7"
id="linearGradient3756-1"
x1="1.960216"
y1="31.261461"
x2="60.456024"
y2="31.261461"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3758-7">
<stop
id="stop3760-4"
offset="0"
style="stop-color:#ece400;stop-opacity:1;" />
<stop
id="stop3762-0"
offset="1"
style="stop-color:#ec8b00;stop-opacity:1;" />
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1028"
id="namedview8"
showgrid="false"
inkscape:zoom="5.2149125"
inkscape:cx="-26.445493"
inkscape:cy="31.598459"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
d="M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
id="outline"
style="fill:#000000;fill-opacity:1"
inkscape:connector-curvature="0" />
<path
d="M 55.041981,25.814432 36.921945,25.730432 31.404334,7.3935963 25.885923,25.730432 7.7650846,25.814434 22.476316,37.520057 15.0387,57.488097 31.404334,44.800071 47.777965,57.488097 40.331551,37.520057 z"
id="left"
style="fill-opacity:1;fill-rule:nonzero"
inkscape:connector-curvature="0" />
<path
d="M 56.276895,25.211993 37.3433,24.856806 31.486705,5.7742084 c 0.04705,37.4359336 -0.01851,2.6744908 -0.0678,40.1841446 L 48.19932,58.580578 40.956295,37.527792 z"
id="right"
style="fill-opacity:1;fill-rule:nonzero"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 64 64"
enable-background="new 0 0 64 64"
id="svg2"
version="1.1"
inkscape:version="0.48.5 r10040"
width="100%"
height="100%"
sodipodi:docname="registered_buddy.svg">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10">
<linearGradient
id="linearGradient3758">
<stop
id="stop3760"
offset="0"
style="stop-color:#80d600;stop-opacity:1;" />
<stop
id="stop3762"
offset="1"
style="stop-color:#80d600;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3750">
<stop
style="stop-color:#ece400;stop-opacity:1;"
offset="0"
id="stop3752" />
<stop
style="stop-color:#ece400;stop-opacity:0;"
offset="1"
id="stop3754" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3758"
id="linearGradient3756"
x1="1.960216"
y1="31.261461"
x2="60.456024"
y2="31.261461"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.87626222,0,0,0.87626222,4.174756,4.8555263)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3758-7"
id="linearGradient3756-1"
x1="1.960216"
y1="31.261461"
x2="60.456024"
y2="31.261461"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3758-7">
<stop
id="stop3760-4"
offset="0"
style="stop-color:#ece400;stop-opacity:1;" />
<stop
id="stop3762-0"
offset="1"
style="stop-color:#ec8b00;stop-opacity:1;" />
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="1178"
id="namedview8"
showgrid="false"
inkscape:zoom="7.375"
inkscape:cx="-11.596718"
inkscape:cy="34.975297"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
d="M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
id="path4-9"
style="fill:#000000;fill-opacity:1"
inkscape:connector-curvature="0" />
<path
d="M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
id="left"
style="fill-opacity:1"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -1,123 +0,0 @@
#include "cardframe.h"
#include "cardinfopicture.h"
#include "cardinfotext.h"
#include "carditem.h"
#include "main.h"
#include "settingscache.h"
#include <QSplitter>
#include <QVBoxLayout>
#include <utility>
CardFrame::CardFrame(const QString &cardName, QWidget *parent) : QTabWidget(parent), info(nullptr), cardTextOnly(false)
{
setContentsMargins(3, 3, 3, 3);
pic = new CardInfoPicture();
pic->setObjectName("pic");
text = new CardInfoText();
text->setObjectName("text");
connect(text, SIGNAL(linkActivated(const QString &)), this, SLOT(setCard(const QString &)));
tab1 = new QWidget(this);
tab2 = new QWidget(this);
tab3 = new QWidget(this);
tab1->setObjectName("tab1");
tab2->setObjectName("tab2");
tab3->setObjectName("tab3");
insertTab(ImageOnlyView, tab1, QString());
insertTab(TextOnlyView, tab2, QString());
insertTab(ImageAndTextView, tab3, QString());
connect(this, SIGNAL(currentChanged(int)), this, SLOT(setViewMode(int)));
tab1Layout = new QVBoxLayout();
tab1Layout->setObjectName("tab1Layout");
tab1Layout->setContentsMargins(0, 0, 0, 0);
tab1Layout->setSpacing(0);
tab1->setLayout(tab1Layout);
tab2Layout = new QVBoxLayout();
tab2Layout->setObjectName("tab2Layout");
tab2Layout->setContentsMargins(0, 0, 0, 0);
tab2Layout->setSpacing(0);
tab2->setLayout(tab2Layout);
splitter = new QSplitter();
splitter->setObjectName("splitter");
splitter->setOrientation(Qt::Vertical);
tab3Layout = new QVBoxLayout();
tab3Layout->setObjectName("tab3Layout");
tab3Layout->setContentsMargins(0, 0, 0, 0);
tab3Layout->setSpacing(0);
tab3Layout->addWidget(splitter);
tab3->setLayout(tab3Layout);
setViewMode(SettingsCache::instance().getCardInfoViewMode());
setCard(db->getCard(cardName));
}
void CardFrame::retranslateUi()
{
setTabText(ImageOnlyView, tr("Image"));
setTabText(TextOnlyView, tr("Description"));
setTabText(ImageAndTextView, tr("Both"));
}
void CardFrame::setViewMode(int mode)
{
if (currentIndex() != mode)
setCurrentIndex(mode);
switch (mode) {
case ImageOnlyView:
case TextOnlyView:
tab1Layout->addWidget(pic);
tab2Layout->addWidget(text);
break;
case ImageAndTextView:
splitter->addWidget(pic);
splitter->addWidget(text);
break;
default:
break;
}
SettingsCache::instance().setCardInfoViewMode(mode);
}
void CardFrame::setCard(CardInfoPtr card)
{
if (info) {
disconnect(info.data(), nullptr, this, nullptr);
}
info = std::move(card);
if (info) {
connect(info.data(), SIGNAL(destroyed()), this, SLOT(clearCard()));
}
text->setCard(info);
pic->setCard(info);
}
void CardFrame::setCard(const QString &cardName)
{
setCard(db->guessCard(cardName));
}
void CardFrame::setCard(AbstractCardItem *card)
{
if (card) {
setCard(card->getInfo());
}
}
void CardFrame::clearCard()
{
setCard((CardInfoPtr) nullptr);
}

View File

@@ -1,60 +0,0 @@
#include "cardinfopicture.h"
#include "carditem.h"
#include "main.h"
#include "pictureloader.h"
#include <QPainter>
#include <QStyle>
#include <QWidget>
CardInfoPicture::CardInfoPicture(QWidget *parent) : QWidget(parent), info(nullptr), pixmapDirty(true)
{
setMinimumHeight(100);
}
void CardInfoPicture::setCard(CardInfoPtr card)
{
if (info) {
disconnect(info.data(), nullptr, this, nullptr);
}
info = card;
if (info) {
connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
}
updatePixmap();
}
void CardInfoPicture::resizeEvent(QResizeEvent *)
{
updatePixmap();
}
void CardInfoPicture::updatePixmap()
{
pixmapDirty = true;
update();
}
void CardInfoPicture::loadPixmap()
{
if (info)
PictureLoader::getPixmap(resizedPixmap, info, size());
else
PictureLoader::getCardBackPixmap(resizedPixmap, size());
}
void CardInfoPicture::paintEvent(QPaintEvent *)
{
if (width() == 0 || height() == 0)
return;
if (pixmapDirty)
loadPixmap();
QPainter painter(this);
style()->drawItemPixmap(&painter, rect(), Qt::AlignHCenter, resizedPixmap);
}

View File

@@ -1,31 +0,0 @@
#ifndef CARDINFOPICTURE_H
#define CARDINFOPICTURE_H
#include "carddatabase.h"
#include <QWidget>
class AbstractCardItem;
class CardInfoPicture : public QWidget
{
Q_OBJECT
private:
CardInfoPtr info;
QPixmap resizedPixmap;
bool pixmapDirty;
public:
CardInfoPicture(QWidget *parent = nullptr);
protected:
void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *);
void loadPixmap();
public slots:
void setCard(CardInfoPtr card);
void updatePixmap();
};
#endif

View File

@@ -1,36 +0,0 @@
#ifndef CARDINFOWIDGET_H
#define CARDINFOWIDGET_H
#include "carddatabase.h"
#include <QComboBox>
#include <QFrame>
#include <QStringList>
class CardInfoPicture;
class CardInfoText;
class AbstractCardItem;
class CardInfoWidget : public QFrame
{
Q_OBJECT
private:
qreal aspectRatio;
CardInfoPtr info;
CardInfoPicture *pic;
CardInfoText *text;
public:
explicit CardInfoWidget(const QString &cardName, QWidget *parent = nullptr, Qt::WindowFlags f = {});
public slots:
void setCard(CardInfoPtr card);
void setCard(const QString &cardName);
void setCard(AbstractCardItem *card);
private slots:
void clear();
};
#endif

View File

@@ -1,63 +0,0 @@
#include "cardlist.h"
#include "carddatabase.h"
#include "carditem.h"
#include <algorithm>
CardList::CardList(bool _contentsKnown) : QList<CardItem *>(), contentsKnown(_contentsKnown)
{
}
CardItem *CardList::findCard(const int id, const bool remove, int *position)
{
if (!contentsKnown) {
if (empty())
return 0;
CardItem *temp = at(0);
if (remove)
removeAt(0);
if (position)
*position = id;
return temp;
} else
for (int i = 0; i < size(); i++) {
CardItem *temp = at(i);
if (temp->getId() == id) {
if (remove)
removeAt(i);
if (position)
*position = i;
return temp;
}
}
return 0;
}
class CardList::compareFunctor
{
private:
int flags;
public:
explicit compareFunctor(int _flags) : flags(_flags)
{
}
inline bool operator()(CardItem *a, CardItem *b) const
{
if (flags & SortByType) {
QString t1 = a->getInfo() ? a->getInfo()->getMainCardType() : QString();
QString t2 = b->getInfo() ? b->getInfo()->getMainCardType() : QString();
if ((t1 == t2) && (flags & SortByName))
return a->getName() < b->getName();
return t1 < t2;
} else
return a->getName() < b->getName();
}
};
void CardList::sort(int flags)
{
compareFunctor cf(flags);
std::sort(begin(), end(), cf);
}

View File

@@ -1,31 +0,0 @@
#ifndef CARDLIST_H
#define CARDLIST_H
#include <QList>
class CardItem;
class CardList : public QList<CardItem *>
{
private:
class compareFunctor;
protected:
bool contentsKnown;
public:
enum SortFlags
{
SortByName = 1,
SortByType = 2
};
CardList(bool _contentsKnown);
CardItem *findCard(const int id, const bool remove, int *position = NULL);
bool getContentsKnown() const
{
return contentsKnown;
}
void sort(int flags = SortByName);
};
#endif

View File

@@ -1,6 +1,6 @@
#include "abstractclient.h"
#include "abstract_client.h"
#include "client_metatypes.h"
#include "../../server/pending_command.h"
#include "featureset.h"
#include "get_pb_extension.h"
#include "pb/commands.pb.h"
@@ -18,7 +18,6 @@
#include "pb/event_user_left.pb.h"
#include "pb/event_user_message.pb.h"
#include "pb/server_message.pb.h"
#include "pending_command.h"
#include <google/protobuf/descriptor.h>
@@ -53,7 +52,7 @@ AbstractClient::AbstractClient(QObject *parent)
FeatureSet features;
features.initalizeFeatureList(clientFeatures);
connect(this, SIGNAL(sigQueuePendingCommand(PendingCommand *)), this, SLOT(queuePendingCommand(PendingCommand *)));
connect(this, &AbstractClient::sigQueuePendingCommand, this, &AbstractClient::queuePendingCommand);
}
AbstractClient::~AbstractClient()

View File

@@ -48,6 +48,7 @@ class AbstractClient : public QObject
Q_OBJECT
signals:
void statusChanged(ClientStatus _status);
void maxPingTime(int seconds, int maxSeconds);
// Room events
void roomEventReceived(const RoomEvent &event);
@@ -97,8 +98,8 @@ protected:
virtual void sendCommandContainer(const CommandContainer &cont) = 0;
public:
AbstractClient(QObject *parent = nullptr);
~AbstractClient();
explicit AbstractClient(QObject *parent = nullptr);
~AbstractClient() override;
ClientStatus getStatus() const
{

View File

@@ -1,4 +1,4 @@
#include "keysignals.h"
#include "key_signals.h"
#include <QKeyEvent>
@@ -60,6 +60,11 @@ bool KeySignals::eventFilter(QObject * /*object*/, QEvent *event)
if (kevent->modifiers() & Qt::ShiftModifier)
emit onShiftS();
break;
case Qt::Key_C:
if (kevent->modifiers() & Qt::ControlModifier)
emit onCtrlC();
break;
default:
return false;

View File

@@ -20,9 +20,10 @@ signals:
void onCtrlAltLBracket();
void onCtrlAltRBracket();
void onShiftS();
void onCtrlC();
protected:
virtual bool eventFilter(QObject *, QEvent *event);
bool eventFilter(QObject *, QEvent *event) override;
};
#endif

View File

@@ -1,4 +1,4 @@
#include "gettextwithmax.h"
#include "get_text_with_max.h"
QString getTextWithMax(QWidget *parent,
const QString &title,

View File

@@ -2,7 +2,7 @@
#ifndef GETTEXTWITHMAX_H
#define GETTEXTWITHMAX_H
#include "stringsizes.h"
#include "trice_limits.h"
#include <QInputDialog>

View File

@@ -0,0 +1,35 @@
#include "client_update_checker.h"
#include "../../settings/cache_settings.h"
#include "release_channel.h"
ClientUpdateChecker::ClientUpdateChecker(QObject *parent) : QObject(parent)
{
}
void ClientUpdateChecker::check()
{
auto releaseChannel = SettingsCache::instance().getUpdateReleaseChannel();
finishedCheckConnection =
connect(releaseChannel, &ReleaseChannel::finishedCheck, this, &ClientUpdateChecker::actFinishedCheck);
errorConnection = connect(releaseChannel, &ReleaseChannel::error, this, &ClientUpdateChecker::actError);
releaseChannel->checkForUpdates();
}
void ClientUpdateChecker::actFinishedCheck(bool needToUpdate, bool isCompatible, Release *release)
{
disconnect(finishedCheckConnection);
disconnect(errorConnection);
emit finishedCheck(needToUpdate, isCompatible, release);
}
void ClientUpdateChecker::actError(const QString &errorString)
{
disconnect(finishedCheckConnection);
disconnect(errorConnection);
emit error(errorString);
}

View File

@@ -0,0 +1,45 @@
#ifndef CLIENT_UPDATE_CHECKER_H
#define CLIENT_UPDATE_CHECKER_H
#include <QObject>
class Release;
/**
* We use a singleton instance of UpdateChannel, which can cause interference and feedback loops when multiple objects
* connect to it.
*
* This class encapsulates the usage of that UpdateChannel to ensure that the check only happens once per connection and
* the connection is destroyed after it's been used.
*/
class ClientUpdateChecker : public QObject
{
Q_OBJECT
QMetaObject::Connection finishedCheckConnection;
QMetaObject::Connection errorConnection;
void actFinishedCheck(bool needToUpdate, bool isCompatible, Release *release);
void actError(const QString &errorString);
public:
explicit ClientUpdateChecker(QObject *parent = nullptr);
/**
* Actually performs the check, using the currently selected update channel in the settings.
* Any resulting signals will only be sent once.
* This method should only be called ONCE per instance.
*/
void check();
signals:
/**
* Forwarded from UpdateChannel::finishedCheck
*/
void finishedCheck(bool needToUpdate, bool isCompatible, Release *release);
/**
* Forwarded from UpdateChannel::error
*/
void error(const QString &errorString);
};
#endif // CLIENT_UPDATE_CHECKER_H

View File

@@ -1,4 +1,4 @@
#include "releasechannel.h"
#include "release_channel.h"
#include "version_string.h"
@@ -21,11 +21,8 @@
#define GIT_SHORT_HASH_LEN 7
int ReleaseChannel::sharedIndex = 0;
ReleaseChannel::ReleaseChannel() : netMan(new QNetworkAccessManager(this)), response(nullptr), lastRelease(nullptr)
{
index = sharedIndex++;
}
ReleaseChannel::~ReleaseChannel()
@@ -36,13 +33,13 @@ ReleaseChannel::~ReleaseChannel()
void ReleaseChannel::checkForUpdates()
{
QString releaseChannelUrl = getReleaseChannelUrl();
qDebug() << "Searching for updates on the channel: " << releaseChannelUrl;
qCDebug(ReleaseChannelLog) << "Searching for updates on the channel: " << releaseChannelUrl;
response = netMan->get(QNetworkRequest(releaseChannelUrl));
connect(response, SIGNAL(finished()), this, SLOT(releaseListFinished()));
connect(response, &QNetworkReply::finished, this, &ReleaseChannel::releaseListFinished);
}
// Different release channel checking functions for different operating systems
#if defined(Q_OS_OSX)
#if defined(Q_OS_MACOS)
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
{
static QRegularExpression version_regex("macOS-(\\d+)\\.(\\d+)");
@@ -62,9 +59,14 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
{
#if Q_PROCESSOR_WORDSIZE == 4
return fileName.contains("win32");
return fileName.contains("32bit");
#elif Q_PROCESSOR_WORDSIZE == 8
return fileName.contains("win64");
const QString &version = QSysInfo::productVersion();
if (version.startsWith("7") || version.startsWith("8")) {
return fileName.contains("Win7");
} else {
return fileName.contains("Win10");
}
#else
return false;
#endif
@@ -84,7 +86,7 @@ QString StableReleaseChannel::getManualDownloadUrl() const
QString StableReleaseChannel::getName() const
{
return tr("Stable Releases");
return tr("Default");
}
QString StableReleaseChannel::getReleaseChannelUrl() const
@@ -107,7 +109,7 @@ void StableReleaseChannel::releaseListFinished()
QVariantMap resultMap = jsonResponse.toVariant().toMap();
if (!(resultMap.contains("name") && resultMap.contains("html_url") && resultMap.contains("tag_name") &&
resultMap.contains("published_at"))) {
qWarning() << "Invalid received from the release update server.";
qWarning() << "Invalid received from the release update server:" << resultMap;
emit error(tr("Invalid reply received from the release update server."));
return;
}
@@ -143,17 +145,17 @@ void StableReleaseChannel::releaseListFinished()
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
QString myHash = QString(VERSION_COMMIT);
qDebug() << "Current hash=" << myHash << "update hash=" << shortHash;
qCDebug(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
qDebug() << "Got reply from release server, name=" << lastRelease->getName()
<< "desc=" << lastRelease->getDescriptionUrl() << "date=" << lastRelease->getPublishDate()
<< "url=" << lastRelease->getDownloadUrl();
qCDebug(ReleaseChannelLog) << "Got reply from release server, name=" << lastRelease->getName()
<< "desc=" << lastRelease->getDescriptionUrl()
<< "date=" << lastRelease->getPublishDate() << "url=" << lastRelease->getDownloadUrl();
const QString &tagName = resultMap["tag_name"].toString();
QString url = QString(STABLETAG_URL) + tagName;
qDebug() << "Searching for commit hash corresponding to stable channel tag: " << tagName;
qCDebug(ReleaseChannelLog) << "Searching for commit hash corresponding to stable channel tag: " << tagName;
response = netMan->get(QNetworkRequest(url));
connect(response, SIGNAL(finished()), this, SLOT(tagListFinished()));
connect(response, &QNetworkReply::finished, this, &StableReleaseChannel::tagListFinished);
}
void StableReleaseChannel::tagListFinished()
@@ -176,11 +178,11 @@ void StableReleaseChannel::tagListFinished()
}
lastRelease->setCommitHash(resultMap["object"].toMap()["sha"].toString());
qDebug() << "Got reply from tag server, commit=" << lastRelease->getCommitHash();
qCDebug(ReleaseChannelLog) << "Got reply from tag server, commit=" << lastRelease->getCommitHash();
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
QString myHash = QString(VERSION_COMMIT);
qDebug() << "Current hash=" << myHash << "update hash=" << shortHash;
qCDebug(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
const bool needToUpdate = (QString::compare(shortHash, myHash, Qt::CaseInsensitive) != 0);
emit finishedCheck(needToUpdate, lastRelease->isCompatibleVersionFound(), lastRelease);
@@ -198,7 +200,7 @@ QString BetaReleaseChannel::getManualDownloadUrl() const
QString BetaReleaseChannel::getName() const
{
return tr("Beta Releases");
return tr("Beta");
}
QString BetaReleaseChannel::getReleaseChannelUrl() const
@@ -247,15 +249,15 @@ void BetaReleaseChannel::releaseListFinished()
lastRelease->setName(QString("%1 (%2)").arg(resultMap["tag_name"].toString()).arg(shortHash));
lastRelease->setDescriptionUrl(QString(BETARELEASE_CHANGESURL).arg(VERSION_COMMIT, shortHash));
qDebug() << "Got reply from release server, size=" << resultMap.size() << "name=" << lastRelease->getName()
<< "desc=" << lastRelease->getDescriptionUrl() << "commit=" << lastRelease->getCommitHash()
<< "date=" << lastRelease->getPublishDate();
qCDebug(ReleaseChannelLog) << "Got reply from release server, size=" << resultMap.size()
<< "name=" << lastRelease->getName() << "desc=" << lastRelease->getDescriptionUrl()
<< "commit=" << lastRelease->getCommitHash() << "date=" << lastRelease->getPublishDate();
QString betaBuildDownloadUrl = resultMap["assets_url"].toString();
qDebug() << "Searching for a corresponding file on the beta channel: " << betaBuildDownloadUrl;
qCDebug(ReleaseChannelLog) << "Searching for a corresponding file on the beta channel: " << betaBuildDownloadUrl;
response = netMan->get(QNetworkRequest(betaBuildDownloadUrl));
connect(response, SIGNAL(finished()), this, SLOT(fileListFinished()));
connect(response, &QNetworkReply::finished, this, &BetaReleaseChannel::fileListFinished);
}
void BetaReleaseChannel::fileListFinished()
@@ -273,7 +275,7 @@ void BetaReleaseChannel::fileListFinished()
QVariantList resultList = jsonResponse.toVariant().toList();
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
QString myHash = QString(VERSION_COMMIT);
qDebug() << "Current hash=" << myHash << "update hash=" << shortHash;
qCDebug(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
bool needToUpdate = (QString::compare(shortHash, myHash, Qt::CaseInsensitive) != 0);
bool compatibleVersion = false;
@@ -290,7 +292,7 @@ void BetaReleaseChannel::fileListFinished()
if (downloadMatchesCurrentOS(*url)) {
compatibleVersion = true;
lastRelease->setDownloadUrl(*url);
qDebug() << "Found compatible version url=" << *url;
qCDebug(ReleaseChannelLog) << "Found compatible version url=" << *url;
break;
}
}

View File

@@ -2,11 +2,14 @@
#define RELEASECHANNEL_H
#include <QDate>
#include <QLoggingCategory>
#include <QObject>
#include <QString>
#include <QVariantMap>
#include <utility>
inline Q_LOGGING_CATEGORY(ReleaseChannelLog, "release_channel");
class QNetworkReply;
class QNetworkAccessManager;
@@ -82,9 +85,6 @@ public:
~ReleaseChannel() override;
protected:
// shared by all instances
static int sharedIndex;
int index;
QNetworkAccessManager *netMan;
QNetworkReply *response;
Release *lastRelease;
@@ -94,10 +94,6 @@ protected:
virtual QString getReleaseChannelUrl() const = 0;
public:
int getIndex() const
{
return index;
}
Release *getLastRelease()
{
return lastRelease;

View File

@@ -0,0 +1,193 @@
#include "replay_timeline_widget.h"
#include <QPainter>
#include <QPainterPath>
#include <QPalette>
#include <QTimer>
ReplayTimelineWidget::ReplayTimelineWidget(QWidget *parent)
: QWidget(parent), maxBinValue(1), maxTime(1), timeScaleFactor(1.0), currentVisualTime(0), currentProcessedTime(0),
currentEvent(0)
{
replayTimer = new QTimer(this);
connect(replayTimer, &QTimer::timeout, this, &ReplayTimelineWidget::replayTimerTimeout);
rewindBufferingTimer = new QTimer(this);
rewindBufferingTimer->setSingleShot(true);
connect(rewindBufferingTimer, &QTimer::timeout, this, &ReplayTimelineWidget::processRewind);
}
void ReplayTimelineWidget::setTimeline(const QList<int> &_replayTimeline)
{
replayTimeline = _replayTimeline;
histogram.clear();
int binEndTime = BIN_LENGTH - 1;
int binValue = 0;
for (int i : replayTimeline) {
if (i > binEndTime) {
histogram.append(binValue);
if (binValue > maxBinValue)
maxBinValue = binValue;
while (i > binEndTime + BIN_LENGTH) {
histogram.append(0);
binEndTime += BIN_LENGTH;
}
binValue = 1;
binEndTime += BIN_LENGTH;
} else
++binValue;
}
histogram.append(binValue);
if (!replayTimeline.isEmpty())
maxTime = replayTimeline.last();
update();
}
void ReplayTimelineWidget::paintEvent(QPaintEvent * /* event */)
{
QPainter painter(this);
painter.drawRect(0, 0, width() - 1, height() - 1);
qreal binWidth = (qreal)width() / histogram.size();
QPainterPath path;
path.moveTo(0, height() - 1);
for (int i = 0; i < histogram.size(); ++i)
path.lineTo(qRound(i * binWidth), (height() - 1) * (1.0 - (qreal)histogram[i] / maxBinValue));
path.lineTo(width() - 1, height() - 1);
path.lineTo(0, height() - 1);
painter.fillPath(path, Qt::black);
const QColor barColor = QColor::fromHsv(120, 255, 255, 100);
quint64 w = (quint64)(width() - 1) * (quint64)currentVisualTime / maxTime;
painter.fillRect(0, 0, static_cast<int>(w), height() - 1, barColor);
}
void ReplayTimelineWidget::mousePressEvent(QMouseEvent *event)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
int newTime = static_cast<int>((qint64)maxTime * (qint64)event->position().x() / width());
#else
int newTime = static_cast<int>((qint64)maxTime * (qint64)event->x() / width());
#endif
// don't buffer rewinds from clicks, since clicks usually don't happen fast enough to require buffering
skipToTime(newTime, false);
}
void ReplayTimelineWidget::skipToTime(int newTime, bool doRewindBuffering)
{
// check boundary conditions
if (newTime < 0) {
newTime = 0;
}
if (newTime > maxTime) {
newTime = maxTime;
}
newTime -= newTime % TIMER_INTERVAL_MS; // Time should always be a multiple of the interval
const bool isBackwardsSkip = newTime < currentProcessedTime;
currentVisualTime = newTime;
if (isBackwardsSkip) {
handleBackwardsSkip(doRewindBuffering);
} else {
processNewEvents(FORWARD_SKIP);
}
update();
}
/// @param doRewindBuffering When true, if multiple backward skips are made in quick succession, only a single rewind
/// is processed at the end. When false, the backwards skip will always cause an immediate rewind
void ReplayTimelineWidget::handleBackwardsSkip(bool doRewindBuffering)
{
if (doRewindBuffering) {
// We use a one-shot timer to implement the rewind buffering.
// The rewind only happens once the timer runs out.
// If another backwards skip happens, the timer will just get reset instead of rewinding.
rewindBufferingTimer->stop();
rewindBufferingTimer->start(SettingsCache::instance().getRewindBufferingMs());
} else {
// otherwise, process the rewind immediately
processRewind();
}
}
void ReplayTimelineWidget::processRewind()
{
// stop any queued-up rewinds
rewindBufferingTimer->stop();
// process the rewind
currentEvent = 0;
emit rewound();
processNewEvents(BACKWARD_SKIP);
}
QSize ReplayTimelineWidget::sizeHint() const
{
return {-1, 50};
}
QSize ReplayTimelineWidget::minimumSizeHint() const
{
return {400, 50};
}
void ReplayTimelineWidget::replayTimerTimeout()
{
currentVisualTime += TIMER_INTERVAL_MS;
processNewEvents(NORMAL_PLAYBACK);
if (!(currentVisualTime % 1000))
update();
}
/// Processes all unprocessed events up to the current time.
void ReplayTimelineWidget::processNewEvents(PlaybackMode playbackMode)
{
currentProcessedTime = currentVisualTime;
while ((currentEvent < replayTimeline.size()) && (replayTimeline[currentEvent] < currentProcessedTime)) {
Player::EventProcessingOptions options;
// backwards skip => always skip reveal windows
// forwards skip => skip reveal windows that don't happen within a big skip of the target
if (playbackMode == BACKWARD_SKIP || currentProcessedTime - replayTimeline[currentEvent] > BIG_SKIP_MS)
options |= Player::EventProcessingOption::SKIP_REVEAL_WINDOW;
// backwards skip => always skip tap animation
if (playbackMode == BACKWARD_SKIP)
options |= Player::EventProcessingOption::SKIP_TAP_ANIMATION;
emit processNextEvent(options);
++currentEvent;
}
if (currentEvent == replayTimeline.size()) {
emit replayFinished();
replayTimer->stop();
}
}
void ReplayTimelineWidget::setTimeScaleFactor(qreal _timeScaleFactor)
{
timeScaleFactor = _timeScaleFactor;
replayTimer->setInterval(static_cast<int>(TIMER_INTERVAL_MS / timeScaleFactor));
}
void ReplayTimelineWidget::startReplay()
{
replayTimer->start(static_cast<int>(TIMER_INTERVAL_MS / timeScaleFactor));
}
void ReplayTimelineWidget::stopReplay()
{
replayTimer->stop();
}
void ReplayTimelineWidget::skipByAmount(int amount)
{
skipToTime(currentVisualTime + amount, amount < 0);
}

View File

@@ -1,6 +1,8 @@
#ifndef REPLAY_TIMELINE_WIDGET
#define REPLAY_TIMELINE_WIDGET
#include "../../game/player/player.h"
#include <QList>
#include <QMouseEvent>
#include <QWidget>
@@ -12,23 +14,44 @@ class ReplayTimelineWidget : public QWidget
{
Q_OBJECT
signals:
void processNextEvent();
void processNextEvent(Player::EventProcessingOptions options);
void replayFinished();
void rewound();
private:
enum PlaybackMode
{
NORMAL_PLAYBACK,
FORWARD_SKIP,
BACKWARD_SKIP
};
static constexpr int TIMER_INTERVAL_MS = 200;
static constexpr int BIN_LENGTH = 5000;
QTimer *replayTimer;
QTimer *rewindBufferingTimer;
QList<int> replayTimeline;
QList<int> histogram;
static const int binLength;
int maxBinValue, maxTime;
qreal timeScaleFactor;
int currentTime;
int currentVisualTime; // time currently displayed by the timeline
int currentProcessedTime; // time that events are currently processed up to. Could differ from visual time due to
// rewind buffering
int currentEvent;
void skipToTime(int newTime, bool doRewindBuffering);
void handleBackwardsSkip(bool doRewindBuffering);
void processRewind();
void processNewEvents(PlaybackMode playbackMode);
private slots:
void replayTimerTimeout();
public:
static constexpr int SMALL_SKIP_MS = 1000;
static constexpr int BIG_SKIP_MS = 10000;
static constexpr qreal FAST_FORWARD_SCALE_FACTOR = 10.0;
explicit ReplayTimelineWidget(QWidget *parent = nullptr);
void setTimeline(const QList<int> &_replayTimeline);
QSize sizeHint() const override;
@@ -41,6 +64,7 @@ public:
public slots:
void startReplay();
void stopReplay();
void skipByAmount(int amount); // use a negative amount to skip backwards
protected:
void paintEvent(QPaintEvent *event) override;

View File

@@ -1,4 +1,4 @@
#include "setsmodel.h"
#include "sets_model.h"
#include <QSortFilterProxyModel>
@@ -195,6 +195,13 @@ void SetsModel::swapRows(int oldRow, int newRow)
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
}
void SetsModel::restoreOriginalOrder()
{
int numRows = rowCount();
sets.defaultSort();
emit dataChanged(index(0, 0), index(numRows - 1, columnCount() - 1));
}
void SetsModel::sort(int column, Qt::SortOrder order)
{
QMultiMap<QString, CardSetPtr> setMap;

View File

@@ -1,7 +1,7 @@
#ifndef SETSMODEL_H
#define SETSMODEL_H
#include "carddatabase.h"
#include "../../game/cards/card_database.h"
#include <QAbstractTableModel>
#include <QMimeData>
@@ -49,44 +49,47 @@ public:
LongNameCol,
ShortNameCol,
SetTypeCol,
ReleaseDateCol
ReleaseDateCol,
PriorityCol
};
enum Role
{
SortRole = Qt::UserRole
};
SetsModel(CardDatabase *_db, QObject *parent = nullptr);
~SetsModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const
explicit SetsModel(CardDatabase *_db, QObject *parent = nullptr);
~SetsModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override
{
Q_UNUSED(parent);
return NUM_COLS;
}
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
Qt::DropActions supportedDropActions() const;
QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
Qt::DropActions supportedDropActions() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
QStringList mimeTypes() const;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool
dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
QStringList mimeTypes() const override;
void swapRows(int oldRow, int newRow);
void toggleRow(int row, bool enable);
void toggleRow(int row);
void toggleAll(bool);
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
void save(CardDatabase *db);
void restore(CardDatabase *db);
void restoreOriginalOrder();
};
class SetsDisplayModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
SetsDisplayModel(QObject *parent = NULL);
explicit SetsDisplayModel(QObject *parent = nullptr);
protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;

View File

@@ -1,9 +1,10 @@
#include "spoilerbackgroundupdater.h"
#include "spoiler_background_updater.h"
#include "carddatabase.h"
#include "main.h"
#include "settingscache.h"
#include "window_main.h"
#include "../../game/cards/card_database.h"
#include "../../game/cards/card_database_manager.h"
#include "../../main.h"
#include "../../settings/cache_settings.h"
#include "../ui/window_main.h"
#include <QApplication>
#include <QCryptographicHash>
@@ -27,7 +28,7 @@ SpoilerBackgroundUpdater::SpoilerBackgroundUpdater(QObject *apParent) : QObject(
// File exists means we're in spoiler season
startSpoilerDownloadProcess(SPOILERS_STATUS_URL, false);
} else {
qDebug() << "Spoilers Disabled";
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoilers Disabled";
}
}
@@ -44,10 +45,10 @@ void SpoilerBackgroundUpdater::downloadFromURL(QUrl url, bool saveResults)
if (saveResults) {
// This will write out to the file (used for spoiler.xml)
connect(reply, SIGNAL(finished()), this, SLOT(actDownloadFinishedSpoilersFile()));
connect(reply, &QNetworkReply::finished, this, &SpoilerBackgroundUpdater::actDownloadFinishedSpoilersFile);
} else {
// This will check the status (used to see if we're in spoiler season or not)
connect(reply, SIGNAL(finished()), this, SLOT(actCheckIfSpoilerSeasonEnabled()));
connect(reply, &QNetworkReply::finished, this, &SpoilerBackgroundUpdater::actCheckIfSpoilerSeasonEnabled);
}
}
@@ -66,7 +67,7 @@ void SpoilerBackgroundUpdater::actDownloadFinishedSpoilersFile()
reply->deleteLater();
emit spoilerCheckerDone();
} else {
qDebug() << "Error downloading spoilers file" << errorCode;
qCDebug(SpoilerBackgroundUpdaterLog) << "Error downloading spoilers file" << errorCode;
emit spoilerCheckerDone();
}
}
@@ -80,11 +81,11 @@ bool SpoilerBackgroundUpdater::deleteSpoilerFile()
// Delete the spoiler.xml file
if (file.exists() && file.remove()) {
qDebug() << "Deleting spoiler.xml";
qCDebug(SpoilerBackgroundUpdaterLog) << "Deleting spoiler.xml";
return true;
}
qDebug() << "Error: Spoiler.xml not found or not deleted";
qCDebug(SpoilerBackgroundUpdaterLog) << "Error: Spoiler.xml not found or not deleted";
return false;
}
@@ -100,24 +101,24 @@ void SpoilerBackgroundUpdater::actCheckIfSpoilerSeasonEnabled()
trayIcon->showMessage(tr("Spoilers season has ended"), tr("Deleting spoiler.xml. Please run Oracle"));
}
qDebug() << "Spoiler Season Offline";
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Season Offline";
emit spoilerCheckerDone();
} else if (errorCode == QNetworkReply::NoError) {
qDebug() << "Spoiler Service Online";
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Online";
startSpoilerDownloadProcess(SPOILERS_URL, true);
} else if (errorCode == QNetworkReply::HostNotFoundError) {
if (trayIcon) {
trayIcon->showMessage(tr("Spoilers download failed"), tr("No internet connection"));
}
qDebug() << "Spoiler download failed due to no internet connection";
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler download failed due to no internet connection";
emit spoilerCheckerDone();
} else {
if (trayIcon) {
trayIcon->showMessage(tr("Spoilers download failed"), tr("Error") + " " + (short)errorCode);
}
qDebug() << "Spoiler download failed with reason" << errorCode;
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler download failed with reason" << errorCode;
emit spoilerCheckerDone();
}
}
@@ -138,19 +139,19 @@ bool SpoilerBackgroundUpdater::saveDownloadedFile(QByteArray data)
trayIcon->showMessage(tr("Spoilers already up to date"), tr("No new spoilers added"));
}
qDebug() << "Spoilers Up to Date";
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoilers Up to Date";
return false;
}
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly)) {
qDebug() << "Spoiler Service Error: File open (w) failed for" << fileName;
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Error: File open (w) failed for" << fileName;
file.close();
return false;
}
if (file.write(data) == -1) {
qDebug() << "Spoiler Service Error: File write (w) failed for" << fileName;
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Error: File write (w) failed for" << fileName;
file.close();
return false;
}
@@ -158,21 +159,25 @@ bool SpoilerBackgroundUpdater::saveDownloadedFile(QByteArray data)
file.close();
// Data written, so reload the card database
qDebug() << "Spoiler Service Data Written";
const auto reloadOk = QtConcurrent::run([] { db->loadCardDatabases(); });
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Data Written";
const auto reloadOk = QtConcurrent::run([] { CardDatabaseManager::getInstance()->loadCardDatabases(); });
// If the user has notifications enabled, let them know
// when the database was last updated
if (trayIcon) {
QList<QByteArray> lines = data.split('\n');
foreach (QByteArray line, lines) {
for (const QByteArray &line : lines) {
if (line.contains("Created At:")) {
QString timeStamp = QString(line).replace("Created At:", "").trimmed();
timeStamp.chop(6); // Remove " (UTC)"
auto utcTime = QLocale().toDateTime(timeStamp, "ddd, MMM dd yyyy, hh:mm:ss");
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
utcTime.setTimeZone(QTimeZone::UTC);
#else
utcTime.setTimeSpec(Qt::UTC);
#endif
QString localTime = utcTime.toLocalTime().toString("MMM d, hh:mm");
@@ -197,12 +202,12 @@ QByteArray SpoilerBackgroundUpdater::getHash(const QString fileName)
QCryptographicHash hash(QCryptographicHash::Algorithm::Md5);
hash.addData(bytes);
qDebug() << "File Hash =" << hash.result();
qCDebug(SpoilerBackgroundUpdaterLog) << "File Hash =" << hash.result();
file.close();
return hash.result();
} else {
qDebug() << "getHash ReadOnly failed!";
qCDebug(SpoilerBackgroundUpdaterLog) << "getHash ReadOnly failed!";
file.close();
return QByteArray();
}
@@ -216,7 +221,7 @@ QByteArray SpoilerBackgroundUpdater::getHash(QByteArray data)
QCryptographicHash hash(QCryptographicHash::Algorithm::Md5);
hash.addData(bytes);
qDebug() << "Data Hash =" << hash.result();
qCDebug(SpoilerBackgroundUpdaterLog) << "Data Hash =" << hash.result();
return hash.result();
}

View File

@@ -2,9 +2,12 @@
#define COCKATRICE_SPOILER_DOWNLOADER_H
#include <QByteArray>
#include <QLoggingCategory>
#include <QObject>
#include <QProcess>
inline Q_LOGGING_CATEGORY(SpoilerBackgroundUpdaterLog, "spoiler_background_updater");
class SpoilerBackgroundUpdater : public QObject
{
Q_OBJECT

View File

@@ -0,0 +1,166 @@
#include "sound_engine.h"
#include "../settings/cache_settings.h"
#include <QDir>
#include <QMediaPlayer>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QAudioOutput>
#endif
#define DEFAULT_THEME_NAME "Default"
#define TEST_SOUND_FILENAME "player_join"
SoundEngine::SoundEngine(QObject *parent) : QObject(parent), audioOutput(nullptr), player(nullptr)
{
ensureThemeDirectoryExists();
connect(&SettingsCache::instance(), &SettingsCache::soundThemeChanged, this, &SoundEngine::themeChangedSlot);
connect(&SettingsCache::instance(), &SettingsCache::soundEnabledChanged, this, &SoundEngine::soundEnabledChanged);
soundEnabledChanged();
themeChangedSlot();
}
SoundEngine::~SoundEngine()
{
if (player) {
player->deleteLater();
player = nullptr;
}
if (audioOutput) {
audioOutput->deleteLater();
audioOutput = nullptr;
}
}
void SoundEngine::soundEnabledChanged()
{
if (SettingsCache::instance().getSoundEnabled()) {
qCDebug(SoundEngineLog) << "SoundEngine: enabling sound with" << audioData.size() << "sounds";
if (!player) {
player = new QMediaPlayer;
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
audioOutput = new QAudioOutput(player);
player->setAudioOutput(audioOutput);
#endif
}
} else {
qCDebug(SoundEngineLog) << "SoundEngine: disabling sound";
if (player) {
player->stop();
player->deleteLater();
player = nullptr;
}
if (audioOutput) {
audioOutput->deleteLater();
audioOutput = nullptr;
}
}
}
void SoundEngine::playSound(const QString &fileName)
{
if (!player) {
return;
}
if (!audioData.contains(fileName)) {
return;
}
player->stop();
int volumeSliderValue = SettingsCache::instance().getMasterVolume();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
player->audioOutput()->setVolume(qreal(volumeSliderValue) / 100);
player->setSource(QUrl::fromLocalFile(audioData[fileName]));
#else
player->setVolume(volumeSliderValue);
player->setMedia(QUrl::fromLocalFile(audioData[fileName]));
#endif
player->play();
}
void SoundEngine::testSound()
{
playSound(TEST_SOUND_FILENAME);
}
void SoundEngine::ensureThemeDirectoryExists()
{
if (SettingsCache::instance().getSoundThemeName().isEmpty() ||
!getAvailableThemes().contains(SettingsCache::instance().getSoundThemeName())) {
qCDebug(SoundEngineLog) << "Sounds theme name not set, setting default value";
SettingsCache::instance().setSoundThemeName(DEFAULT_THEME_NAME);
}
}
QStringMap &SoundEngine::getAvailableThemes()
{
QDir dir;
availableThemes.clear();
// load themes from user profile dir
dir.setPath(SettingsCache::instance().getDataPath() + "/sounds");
for (const QString &themeName : dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name)) {
if (!availableThemes.contains(themeName))
availableThemes.insert(themeName, dir.absoluteFilePath(themeName));
}
// load themes from cockatrice system dir
dir.setPath(qApp->applicationDirPath() +
#ifdef Q_OS_MAC
"/../Resources/sounds"
#elif defined(Q_OS_WIN)
"/sounds"
#else // linux
"/../share/cockatrice/sounds"
#endif
);
for (const QString &themeName : dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name)) {
if (!availableThemes.contains(themeName))
availableThemes.insert(themeName, dir.absoluteFilePath(themeName));
}
return availableThemes;
}
void SoundEngine::themeChangedSlot()
{
QString themeName = SettingsCache::instance().getSoundThemeName();
qCDebug(SoundEngineLog) << "Sound theme changed:" << themeName;
QDir dir = getAvailableThemes().value(themeName);
audioData.clear();
static const QStringList extensions = {".wav", ".mp3", ".ogg"};
static const QStringList fileNames = {
// Phases
"untap_step", "upkeep_step", "draw_step", "main_1", "start_combat", "attack_step", "block_step", "damage_step",
"end_combat", "main_2", "end_step",
// Game Actions
"draw_card", "play_card", "tap_card", "untap_card", "shuffle", "roll_dice", "life_change",
// Player
"player_join", "player_leave", "player_disconnect", "player_reconnect", "player_concede",
// Spectator
"spectator_join", "spectator_leave",
// Buddy
"buddy_join", "buddy_leave",
// Chat & UI
"chat_mention", "all_mention", "private_message"};
for (const QString &extension : extensions) {
for (const QString &name : fileNames) {
QFile file(dir.filePath(name + extension));
if (file.exists()) {
audioData.insert(name, file.fileName());
}
}
}
soundEnabledChanged();
}

View File

@@ -1,12 +1,15 @@
#ifndef SOUNDENGINE_H
#define SOUNDENGINE_H
#include <QAudioOutput>
#include <QLoggingCategory>
#include <QMap>
#include <QMediaPlayer>
#include <QObject>
#include <QString>
class QAudioOutput;
inline Q_LOGGING_CATEGORY(SoundEngineLog, "sound_engine");
class QBuffer;
typedef QMap<QString, QString> QStringMap;
@@ -15,14 +18,15 @@ class SoundEngine : public QObject
{
Q_OBJECT
public:
SoundEngine(QObject *parent = nullptr);
~SoundEngine();
void playSound(QString fileName);
explicit SoundEngine(QObject *parent = nullptr);
~SoundEngine() override;
void playSound(const QString &fileName);
QStringMap &getAvailableThemes();
private:
QStringMap availableThemes;
QMap<QString, QString> audioData;
QAudioOutput *audioOutput;
QMediaPlayer *player;
protected:

View File

@@ -0,0 +1,45 @@
#include "edhrec_commander_api_response.h"
#include <QDebug>
#include <QJsonArray>
void EdhrecCommanderApiResponse::fromJson(const QJsonObject &json)
{
// Parse the collapsed DeckStatistics
deckStats.fromJson(json);
// Parse Archidekt section
QJsonArray archidektJson = json.value("archidekt").toArray();
archidekt.fromJson(archidektJson);
// Parse other fields
similar = json.value("similar").toObject();
header = json.value("header").toString();
panels = json.value("panels").toObject();
description = json.value("description").toString();
QJsonObject containerJson = json.value("container").toObject();
container.fromJson(containerJson);
}
void EdhrecCommanderApiResponse::debugPrint() const
{
qDebug() << "Deck Statistics:";
qDebug() << " Creature:" << deckStats.creature;
qDebug() << " Instant:" << deckStats.instant;
qDebug() << " Sorcery:" << deckStats.sorcery;
qDebug() << " Artifact:" << deckStats.artifact;
qDebug() << " Enchantment:" << deckStats.enchantment;
qDebug() << " Battle:" << deckStats.battle;
qDebug() << " Planeswalker:" << deckStats.planeswalker;
qDebug() << " Land:" << deckStats.land;
qDebug() << " Basic:" << deckStats.basic;
qDebug() << " Nonbasic:" << deckStats.nonbasic;
archidekt.debugPrint();
qDebug() << "Similar:" << similar;
qDebug() << "Header:" << header;
qDebug() << "Panels:" << panels;
qDebug() << "Description:" << description;
container.debugPrint();
}

View File

@@ -0,0 +1,28 @@
#ifndef DECKDATA_H
#define DECKDATA_H
#include "edhrec_commander_api_response_archidekt_links.h"
#include "edhrec_commander_api_response_average_deck_statistics.h"
#include "edhrec_commander_api_response_card_container.h"
#include <QDebug>
#include <QJsonObject>
#include <QString>
// Represents the main structure of the JSON
class EdhrecCommanderApiResponse
{
public:
EdhrecCommanderApiResponseAverageDeckStatistics deckStats;
EdhrecCommanderApiResponseArchidektLinks archidekt;
QJsonObject similar;
QString header;
QJsonObject panels;
QString description;
EdhrecCommanderApiResponseCardContainer container;
void fromJson(const QJsonObject &json);
void debugPrint() const;
};
#endif // DECKDATA_H

View File

@@ -0,0 +1,43 @@
#include "edhrec_commander_api_response_archidekt_links.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
void EdhrecCommanderApiResponseArchidektLink::fromJson(const QJsonObject &json)
{
c = json.value("c").toString();
f = json.value("f").toInt(0);
q = json.value("q").toInt(0);
u = json.value("u").toString();
}
void EdhrecCommanderApiResponseArchidektLink::debugPrint() const
{
qDebug() << " C:" << c;
qDebug() << " F:" << f;
qDebug() << " Q:" << q;
qDebug() << " U:" << u;
}
void EdhrecCommanderApiResponseArchidektLinks::fromJson(const QJsonArray &json)
{
entries.clear();
for (const QJsonValue &value : json) {
if (value.isObject()) {
QJsonObject entryJson = value.toObject();
EdhrecCommanderApiResponseArchidektLink entry;
entry.fromJson(entryJson);
entries.append(entry);
}
}
}
void EdhrecCommanderApiResponseArchidektLinks::debugPrint() const
{
qDebug() << "Archidekt Entries:";
for (const auto &entry : entries) {
entry.debugPrint();
}
}

View File

@@ -0,0 +1,32 @@
#ifndef ARCHIDEKTENTRY_H
#define ARCHIDEKTENTRY_H
#include <QDebug>
#include <QJsonObject>
#include <QString>
#include <QVector>
// Represents a single Archidekt entry
class EdhrecCommanderApiResponseArchidektLink
{
public:
QString c;
int f = 0;
int q = 0;
QString u;
void fromJson(const QJsonObject &json);
void debugPrint() const;
};
// Represents the Archidekt section as a list of entries
class EdhrecCommanderApiResponseArchidektLinks
{
public:
QVector<EdhrecCommanderApiResponseArchidektLink> entries;
void fromJson(const QJsonArray &json);
void debugPrint() const;
};
#endif // ARCHIDEKTENTRY_H

View File

@@ -0,0 +1,15 @@
#include "edhrec_commander_api_response_average_deck_statistics.h"
void EdhrecCommanderApiResponseAverageDeckStatistics::fromJson(const QJsonObject &json)
{
creature = json.value("creature").toInt(0);
instant = json.value("instant").toInt(0);
sorcery = json.value("sorcery").toInt(0);
artifact = json.value("artifact").toInt(0);
enchantment = json.value("enchantment").toInt(0);
battle = json.value("battle").toInt(0);
planeswalker = json.value("planeswalker").toInt(0);
land = json.value("land").toInt(0);
basic = json.value("basic").toInt(0);
nonbasic = json.value("nonbasic").toInt(0);
}

View File

@@ -0,0 +1,22 @@
#ifndef AVERAGE_DECK_STATISTICS_H
#define AVERAGE_DECK_STATISTICS_H
#include <QJsonObject>
// Represents the typical deck statistics (collapsed section)
struct EdhrecCommanderApiResponseAverageDeckStatistics
{
int creature = 0;
int instant = 0;
int sorcery = 0;
int artifact = 0;
int enchantment = 0;
int battle = 0;
int planeswalker = 0;
int land = 0;
int basic = 0;
int nonbasic = 0;
void fromJson(const QJsonObject &json);
};
#endif // AVERAGE_DECK_STATISTICS_H

View File

@@ -0,0 +1,49 @@
#include "edhrec_commander_api_response_card_container.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonObject>
void EdhrecCommanderApiResponseCardContainer::fromJson(const QJsonObject &json)
{
// Parse breadcrumb
QJsonArray breadcrumbArray = json.value("breadcrumb").toArray();
for (const QJsonValue &breadcrumbValue : breadcrumbArray) {
breadcrumb.push_back(breadcrumbValue.toObject());
}
description = json.value("description").toString();
QJsonObject jsonDict = json.value("json_dict").toObject();
card.fromJson(jsonDict.value("card").toObject());
QJsonArray cardlistsArray = jsonDict.value("cardlists").toArray();
for (const QJsonValue &cardlistValue : cardlistsArray) {
QJsonObject cardlistObj = cardlistValue.toObject();
QJsonArray cardviewsArray = cardlistObj.value("cardviews").toArray();
EdhrecCommanderApiResponseCardList cardView;
cardView.fromJson(cardlistValue.toObject());
cardlists.push_back(cardView);
}
keywords = json.value("keywords").toString();
title = json.value("title").toString();
}
void EdhrecCommanderApiResponseCardContainer::debugPrint() const
{
qDebug() << "Breadcrumb:";
for (const auto &breadcrumbEntry : breadcrumb) {
qDebug() << breadcrumbEntry;
}
qDebug() << "Description:" << description;
card.debugPrint();
qDebug() << "Cardlists:";
for (const auto &cardlist : cardlists) {
cardlist.debugPrint();
}
qDebug() << "Keywords:" << keywords;
qDebug() << "Title:" << title;
}

View File

@@ -0,0 +1,60 @@
#ifndef CONTAINER_ENTRY_H
#define CONTAINER_ENTRY_H
#include "edhrec_commander_api_response_card_list.h"
#include "edhrec_commander_api_response_commander_details.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonObject>
#include <QString>
#include <QVector>
class EdhrecCommanderApiResponseCardContainer
{
public:
// Constructor
EdhrecCommanderApiResponseCardContainer() = default;
// Parse deck-related data from JSON
void fromJson(const QJsonObject &json);
// Debug method for logging
void debugPrint() const;
// Getter methods for deck container
const QString &getDescription() const
{
return description;
}
const QVector<QJsonObject> &getBreadcrumb() const
{
return breadcrumb;
}
const EdhrecCommanderApiResponseCommanderDetails &getCommanderDetails() const
{
return card;
}
const QVector<EdhrecCommanderApiResponseCardList> &getCardlists() const
{
return cardlists;
}
const QString &getKeywords() const
{
return keywords;
}
const QString &getTitle() const
{
return title;
}
private:
QString description;
QVector<QJsonObject> breadcrumb;
EdhrecCommanderApiResponseCommanderDetails card;
QVector<EdhrecCommanderApiResponseCardList> cardlists;
QString keywords;
QString title;
};
#endif // CONTAINER_ENTRY_H

View File

@@ -0,0 +1,36 @@
#include "edhrec_commander_api_response_card_details.h"
#include <QDebug>
EdhrecCommanderApiResponseCardDetails::EdhrecCommanderApiResponseCardDetails()
: synergy(0.0), inclusion(0), numDecks(0), potentialDecks(0)
{
}
void EdhrecCommanderApiResponseCardDetails::fromJson(const QJsonObject &json)
{
// Parse the fields from the JSON object
name = json.value("name").toString();
sanitized = json.value("sanitized").toString();
sanitizedWo = json.value("sanitized_wo").toString();
url = json.value("url").toString();
synergy = json.value("synergy").toDouble(0.0);
inclusion = json.value("inclusion").toInt(0);
label = json.value("label").toString();
numDecks = json.value("num_decks").toInt(0);
potentialDecks = json.value("potential_decks").toInt(0);
}
void EdhrecCommanderApiResponseCardDetails::debugPrint() const
{
// Print out all the fields for debugging
qDebug() << "Name:" << name;
qDebug() << "Sanitized:" << sanitized;
qDebug() << "Sanitized Wo:" << sanitizedWo;
qDebug() << "URL:" << url;
qDebug() << "Synergy:" << synergy;
qDebug() << "Inclusion:" << inclusion;
qDebug() << "Label:" << label;
qDebug() << "Num Decks:" << numDecks;
qDebug() << "Potential Decks:" << potentialDecks;
}

View File

@@ -0,0 +1,29 @@
#ifndef CARD_VIEW_H
#define CARD_VIEW_H
#include <QJsonObject>
#include <QString>
class EdhrecCommanderApiResponseCardDetails
{
public:
QString name;
QString sanitized;
QString sanitizedWo;
QString url;
double synergy;
int inclusion;
QString label;
int numDecks;
int potentialDecks;
EdhrecCommanderApiResponseCardDetails();
// Method to populate the object from a JSON object
void fromJson(const QJsonObject &json);
// Debug method to print out the data
void debugPrint() const;
};
#endif // CARD_VIEW_H

View File

@@ -0,0 +1,33 @@
#include "edhrec_commander_api_response_card_list.h"
#include <QDebug>
EdhrecCommanderApiResponseCardList::EdhrecCommanderApiResponseCardList()
{
}
void EdhrecCommanderApiResponseCardList::fromJson(const QJsonObject &json)
{
// Parse the header from the JSON object
header = json.value("header").toString();
// Parse the cardviews array and populate cardViews
QJsonArray cardviewsArray = json.value("cardviews").toArray();
for (const QJsonValue &value : cardviewsArray) {
QJsonObject cardviewObj = value.toObject();
EdhrecCommanderApiResponseCardDetails cardView;
cardView.fromJson(cardviewObj);
cardViews.append(cardView);
}
}
void EdhrecCommanderApiResponseCardList::debugPrint() const
{
// Print out the header
qDebug() << "Header:" << header;
// Print out all the CardView objects
for (const EdhrecCommanderApiResponseCardDetails &cardView : cardViews) {
cardView.debugPrint();
}
}

View File

@@ -0,0 +1,27 @@
#ifndef CARD_LIST_H
#define CARD_LIST_H
#include "edhrec_commander_api_response_card_details.h"
#include <QJsonArray>
#include <QJsonObject>
#include <QList>
#include <QString>
class EdhrecCommanderApiResponseCardList
{
public:
QString header;
QList<EdhrecCommanderApiResponseCardDetails> cardViews;
// Default constructor
EdhrecCommanderApiResponseCardList();
// Method to populate the object from a JSON object
void fromJson(const QJsonObject &json);
// Debug method to print out the data
void debugPrint() const;
};
#endif // CARD_LIST_H

View File

@@ -0,0 +1,31 @@
#include "edhrec_commander_api_response_card_prices.h"
#include <QDebug>
void CardPrices::fromJson(const QJsonObject &json)
{
// Parse prices from various sources
cardhoarder = json.value("cardhoarder").toObject();
cardkingdom = json.value("cardkingdom").toObject();
cardmarket = json.value("cardmarket").toObject();
face2face = json.value("face2face").toObject();
manapool = json.value("manapool").toObject();
mtgstocks = json.value("mtgstocks").toObject();
scg = json.value("scg").toObject();
tcgl = json.value("tcgl").toObject();
tcgplayer = json.value("tcgplayer").toObject();
}
void CardPrices::debugPrint() const
{
qDebug() << "Card Prices:";
qDebug() << "Cardhoarder:" << cardhoarder;
qDebug() << "Cardkingdom:" << cardkingdom;
qDebug() << "Cardmarket:" << cardmarket;
qDebug() << "Face2Face:" << face2face;
qDebug() << "Manapool:" << manapool;
qDebug() << "Mtgstocks:" << mtgstocks;
qDebug() << "SCG:" << scg;
qDebug() << "TCGL:" << tcgl;
qDebug() << "Tcgplayer:" << tcgplayer;
}

View File

@@ -0,0 +1,66 @@
#ifndef EDHREC_COMMANDER_API_RESPONSE_CARD_PRICES_H
#define EDHREC_COMMANDER_API_RESPONSE_CARD_PRICES_H
#include <QJsonObject>
class CardPrices
{
public:
// Constructor
CardPrices() = default;
// Parse prices from JSON
void fromJson(const QJsonObject &json);
void debugPrint() const;
// Getter methods for card prices
const QJsonObject &getCardhoarder() const
{
return cardhoarder;
}
const QJsonObject &getCardkingdom() const
{
return cardkingdom;
}
const QJsonObject &getCardmarket() const
{
return cardmarket;
}
const QJsonObject &getFace2face() const
{
return face2face;
}
const QJsonObject &getManapool() const
{
return manapool;
}
const QJsonObject &getMtgstocks() const
{
return mtgstocks;
}
const QJsonObject &getScg() const
{
return scg;
}
const QJsonObject &getTcgl() const
{
return tcgl;
}
const QJsonObject &getTcgplayer() const
{
return tcgplayer;
}
private:
QJsonObject cardhoarder;
QJsonObject cardkingdom;
QJsonObject cardmarket;
QJsonObject face2face;
QJsonObject manapool;
QJsonObject mtgstocks;
QJsonObject scg;
QJsonObject tcgl;
QJsonObject tcgplayer;
};
#endif // EDHREC_COMMANDER_API_RESPONSE_CARD_PRICES_H

Some files were not shown because too many files have changed in this diff Show More