mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 15:43:54 -07:00
[Feature] TabArchidekt and Archidekt API integration (#6348)
* TabArchidekt and Archidekt API integration. Took 37 seconds Took 4 minutes Took 40 seconds Took 4 minutes * Lint. * Lont. * Search bar, fancier display, resolve providerId * Delegate click to base. * Be explicit for pedantic compilers. * Liiint. * Leave them default I guess * Leave them default I guess * Small fixes. * New utility display widgets. * New style for deck listing. * Lint. * Lont. * Scale things. * Delegate paint to base. * Use default Archidekt preview image for decks without featured. * Consistent sizes. * Increase font size, qt version guard. * More version guards. * Clean up filter layout, use mana symbols. * Set content margins. * Refresh on filter change. * Lint. * Better elision. * Query actual new endpoints, new query parameters. * Doxygen, reorder fields in constructor, readability. * Update page size doc to min size. * Update initial min deck size value. * Add label to page selection. * Okay, so, people upload a lot of 1 card decks frequently. * Whoops. * Add a selection combobox for sorting logic. * Debounce and limit searches. * Include. * Lint. * Don't imply that Archidekt supports multiple cards/commander names. * Let's not lambda it and slot it instead. * Overload. * Add button to home tab. Took 8 minutes * Adjust to selection model change. Took 5 minutes * Cleanup auto-generated comments. Took 8 minutes * Remember card sizes. Took 1 minute * Initialize with correct size. Took 3 minutes * Use correct placeholders. Took 2 minutes * Style lint. Took 16 minutes * Parse double-faced cards correctly. * Parse double-faced cards correctly. * Allow TabArchidekt to use VDE group/sort/display buttons * Lint. * Indicate that things are clickable. * Min treshold for nicer display. * Lint. * We have good labels at home. * We do a little linting. * Qt version guards. * Qt5 is the devil. * Update comments. * Lint comments. * More doxys. * One more doxy. * Lint. * Update. * Small fixes. Took 7 minutes Took 13 seconds --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
de13c22552
commit
eab4d435f8
43 changed files with 3285 additions and 141 deletions
|
|
@ -74,6 +74,29 @@ enum Type
|
|||
MANA_COST, /**< Group cards by their total mana cost. */
|
||||
COLOR /**< Group cards by their color identity. */
|
||||
};
|
||||
static inline QString toString(Type t)
|
||||
{
|
||||
switch (t) {
|
||||
case MAIN_TYPE:
|
||||
return "Main Type";
|
||||
case MANA_COST:
|
||||
return "Mana Cost";
|
||||
case COLOR:
|
||||
return "Colors";
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
static inline Type fromString(const QString &s)
|
||||
{
|
||||
if (s == "Main Type")
|
||||
return MAIN_TYPE;
|
||||
if (s == "Mana Cost")
|
||||
return MANA_COST;
|
||||
if (s == "Colors")
|
||||
return COLOR;
|
||||
return MAIN_TYPE; // default
|
||||
}
|
||||
} // namespace DeckListModelGroupCriteria
|
||||
|
||||
/**
|
||||
|
|
@ -234,8 +257,8 @@ public:
|
|||
*/
|
||||
[[nodiscard]] QModelIndex findCard(const QString &cardName,
|
||||
const QString &zoneName,
|
||||
const QString &providerId = "",
|
||||
const QString &cardNumber = "") const;
|
||||
const QString &providerId = "",
|
||||
const QString &cardNumber = "") const;
|
||||
|
||||
/**
|
||||
* @brief Adds a card using the preferred printing if available.
|
||||
|
|
@ -296,8 +319,8 @@ private:
|
|||
QModelIndex nodeToIndex(AbstractDecklistNode *node) const;
|
||||
[[nodiscard]] DecklistModelCardNode *findCardNode(const QString &cardName,
|
||||
const QString &zoneName,
|
||||
const QString &providerId = "",
|
||||
const QString &cardNumber = "") const;
|
||||
const QString &providerId = "",
|
||||
const QString &cardNumber = "") const;
|
||||
void emitRecursiveUpdates(const QModelIndex &index);
|
||||
void sortHelper(InnerDecklistNode *node, Qt::SortOrder order);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue