[Game] Use in-game menu for tally setting (#7036)

* [Game] Use in-game menu for tally setting

* pluralize name

* fix includes

* clean up TallyMenu

* update settings

* fix guard
This commit is contained in:
RickyRister 2026-07-26 15:26:02 -07:00 committed by GitHub
parent b70f770633
commit 3f9dbdb33b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 126 additions and 19 deletions

View file

@ -313,7 +313,7 @@ SettingsCache::SettingsCache()
showDragSelectionCount = settings->value("interface/showlassoselectioncount", true).toBool();
showTotalSelectionCount = settings->value("interface/showpersistentselectioncount", true).toBool();
showSubtypeSelectionTally = settings->value("interface/showsubtypeselectiontally", true).toBool();
tallyType = settings->value("interface/tallyType", 0).toInt();
showShortcuts = settings->value("menu/showshortcuts", true).toBool();
showGameSelectorFilterToolbar = settings->value("menu/showgameselectorfiltertoolbar", true).toBool();
@ -1403,10 +1403,15 @@ void SettingsCache::setShowTotalSelectionCount(QT_STATE_CHANGED_T _showTotalSele
settings->setValue("interface/showpersistentselectioncount", showTotalSelectionCount);
}
void SettingsCache::setShowSubtypeSelectionTally(QT_STATE_CHANGED_T _showSubtypeSelectionTally)
void SettingsCache::setTallyType(int value)
{
showSubtypeSelectionTally = static_cast<bool>(_showSubtypeSelectionTally);
settings->setValue("interface/showsubtypeselectiontally", showSubtypeSelectionTally);
if (tallyType == value) {
return;
}
tallyType = value;
settings->setValue("interface/tallyType", value);
emit tallyTypeChanged(value);
}
void SettingsCache::loadPaths()

View file

@ -197,6 +197,7 @@ signals:
void useTearOffMenusChanged(bool state);
void roundCardCornersChanged(bool roundCardCorners);
void keepGameChatFocusChanged(bool value);
void tallyTypeChanged(int type);
private:
QSettings *settings;
@ -356,7 +357,7 @@ private:
bool showStatusBar;
bool showDragSelectionCount;
bool showTotalSelectionCount;
bool showSubtypeSelectionTally;
int tallyType;
public:
SettingsCache();
@ -480,9 +481,9 @@ public:
{
return showTotalSelectionCount;
}
[[nodiscard]] bool getShowSubtypeSelectionTally() const
[[nodiscard]] int getTallyType() const
{
return showSubtypeSelectionTally;
return tallyType;
}
[[nodiscard]] bool getNotificationsEnabled() const
{
@ -1187,6 +1188,6 @@ public slots:
void setRoundCardCorners(bool _roundCardCorners);
void setShowDragSelectionCount(QT_STATE_CHANGED_T _showDragSelectionCount);
void setShowTotalSelectionCount(QT_STATE_CHANGED_T _showTotalSelectionCount);
void setShowSubtypeSelectionTally(QT_STATE_CHANGED_T _showSubtypeSelectionTally);
void setTallyType(int value);
};
#endif