mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52:19 -07:00
Connect tax counter state signals to menu
This commit is contained in:
parent
314b56d176
commit
876a14758e
3 changed files with 13 additions and 1 deletions
|
|
@ -42,11 +42,13 @@ private:
|
||||||
QAction *aTogglePartnerTaxCounter = nullptr; ///< Toggles partner commander tax counter visibility
|
QAction *aTogglePartnerTaxCounter = nullptr; ///< Toggles partner commander tax counter visibility
|
||||||
QAction *aToggleMinimized = nullptr; ///< Toggles command zone minimized state
|
QAction *aToggleMinimized = nullptr; ///< Toggles command zone minimized state
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void updateTaxCounterActionStates();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void actToggleMinimized();
|
void actToggleMinimized();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateTaxCounterActionStates();
|
|
||||||
PlayerGraphicsItem *player;
|
PlayerGraphicsItem *player;
|
||||||
|
|
||||||
QString incTaxShortcutKey;
|
QString incTaxShortcutKey;
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,11 @@ public:
|
||||||
return utilityMenu;
|
return utilityMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] CommandZoneMenu *getCommandZoneMenu() const
|
||||||
|
{
|
||||||
|
return commandZoneMenu;
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool getShortcutsActive() const
|
[[nodiscard]] bool getShortcutsActive() const
|
||||||
{
|
{
|
||||||
return shortcutsActive;
|
return shortcutsActive;
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,11 @@ void PlayerGraphicsItem::onCounterAdded(CounterState *state)
|
||||||
widget = new CommanderTaxCounter(state, player, commandZoneGraphicsItem);
|
widget = new CommanderTaxCounter(state, player, commandZoneGraphicsItem);
|
||||||
widget->setActive(state->isActive());
|
widget->setActive(state->isActive());
|
||||||
commandZoneGraphicsItem->registerTaxCounter(widget);
|
commandZoneGraphicsItem->registerTaxCounter(widget);
|
||||||
|
|
||||||
|
if (auto *menu = playerMenu->getCommandZoneMenu()) {
|
||||||
|
connect(state, &CounterState::activeChanged, menu, &CommandZoneMenu::updateTaxCounterActionStates);
|
||||||
|
connect(state, &CounterState::valueChanged, menu, &CommandZoneMenu::updateTaxCounterActionStates);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
widget = new GeneralCounter(state, player, true, this);
|
widget = new GeneralCounter(state, player, true, this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue