Commit graph

4772 commits

Author SHA1 Message Date
Lukas Brübach
a5a4e335a5 Linter. 2024-11-19 03:39:49 +01:00
Lukas Brübach
8b1284d799 Pull Parent argument up for CardItem. 2024-11-19 03:39:49 +01:00
Lukas Brübach
ddd1bd57c3 Pull Parent argument up for CardItem. 2024-11-19 03:39:49 +01:00
Lukas Brübach
750b75a3d4 Change parent to be the first argument. 2024-11-19 03:39:49 +01:00
Lukas Brübach
3c397a6677 Update translations. 2024-11-19 03:39:49 +01:00
Lukas Brübach
a958a126a5 Refactor UUID to be providerId and change QString comparisons with empty string to isEmpty(). 2024-11-19 03:39:49 +01:00
ZeldaZach
472186b4a0 Override 2024-11-19 03:39:49 +01:00
Lukas Brübach
ff3e6796cf Refactor setCode to cardUUID and introduce new cardSetShortName field. 2024-11-19 03:39:48 +01:00
Lukas Brübach
89daa0ec4a Include cardName in the PixmapCacheKey in order to not break double-faced cards. 2024-11-19 03:39:48 +01:00
Lukas Brübach
018c57b7fa Remove unused imports. 2024-11-19 03:39:48 +01:00
Lukas Brübach
7f492f9e4b Remove unnecessary new uuid field from event_move_card. 2024-11-19 03:39:48 +01:00
Lukas Brübach
c06800590a Re-order uuid to visually align with its field number. 2024-11-19 03:39:48 +01:00
Lukas Brübach
54e22858e2 Combine if-statement. 2024-11-19 03:39:48 +01:00
Lukas Brübach
b02074a37b Address PR comments (AbstractCardItem). 2024-11-19 03:39:48 +01:00
Lukas Brübach
4f2f205018 Revert blindly setting uuid for testing. 2024-11-19 03:39:48 +01:00
Lukas Brübach
819c24683f Don't inline setUUID and mimic setName for AbstractCardItem. 2024-11-19 03:39:48 +01:00
Lukas Brübach
fe7aae8534 [TEST/RevertMe] Set the uuid everywhere to test. 2024-11-19 03:39:48 +01:00
Lukas Brübach
870c072b6d Set the uuid when we set the cardName, in terms of hidden zones. 2024-11-19 03:39:48 +01:00
Lukas Brübach
dfb34b86a6 Update Player::MoveCard to include the card UUID. 2024-11-19 03:39:48 +01:00
Lukas Brübach
121e789716 Update Event_MoveCard to include the card UUID. 2024-11-19 03:39:48 +01:00
Lukas Brübach
b81035e63b DeckList no longer pre-populates uuids. 2024-11-19 03:39:48 +01:00
Lukas Brübach
d6035cec56 Reformat code so the linter will stop yelling at me. 2024-11-19 03:39:48 +01:00
Lukas Brübach
e70533a9bc Address pull request comments (nullptr checks and additional comments, mostly.) 2024-11-19 03:39:48 +01:00
Lukas Brübach
7f48d4e676 Check if the uuid starts with card_ when comparing. 2024-11-19 03:39:48 +01:00
Lukas Brübach
e0f9031ee5 Convenience method to fetch a specific CardInfoPerSet instance for a cardName and a UUID. 2024-11-19 03:39:48 +01:00
Lukas Brübach
db042a4190 Don't define methods twice. 2024-11-19 03:39:48 +01:00
Lukas Brübach
58af3cdce8 If the card info is null, there's no point in trying to look for the sets. 2024-11-19 03:39:48 +01:00
Lukas Brübach
f7fa8521b7 Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting. 2024-11-19 03:39:48 +01:00
Lukas Brübach
9d1f0e6067 Properly update and set the DeckEditor's CardFrame to fetch by name and UUID if a card was selected from the decklist. 2024-11-19 03:39:48 +01:00
Lukas Brübach
4ee71e6a70 Change getPreferredPrintingForCard to getPreferredSetForCard to reflect refactor. 2024-11-19 03:39:48 +01:00
luna
1d61b2bee8 canibalized zach work and added it to the decklist builder 2024-11-19 03:39:48 +01:00
Lukas Brübach
edbc57edc7 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.
2024-11-19 03:39:48 +01:00
Lukas Brübach
963ff64cb6 Correct some calls to default to preferred printing. 2024-11-19 03:39:48 +01:00
Lukas Brübach
c9690d790c Have various game events respect the new UUID attribute on instantiation. 2024-11-19 03:39:48 +01:00
Lukas Brübach
90c4b223dd Introduce UUID attribute to abstract_card_item, card_item, deck_view_card, server_card and serverinfo_card. 2024-11-19 03:39:48 +01:00
Lukas Brübach
c6a7b17d22 Reintroduce some changes lost in the merge. 2024-11-19 03:39:48 +01:00
LunaticCat
502c901c06 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>
2024-11-19 03:39:48 +01:00
Lukas Brübach
c2ae31b3b8 Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure. 2024-11-19 03:39:48 +01: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