mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 06:22:15 -07:00
Fix Command Zone graphics/logic layers separation
1. CommandZoneMenu: Changed to take PlayerGraphicsItem* instead of
PlayerLogic*, accessing logic via player->getLogic()
2. Removed getCounterWidget() from PlayerLogic;
method already exists correctly in PlayerGraphicsItem
3. PlayerMenu: CommandZoneMenu, fixed signal
connection to use player->getLogic() for commandZoneSupportChanged
4. AbstractCounter: Connects to CounterState::activeChanged signal,
removing direct graphics calls from PlayerEventHandler
5. CommandZone: Explicit tax counter registration via registerTaxCounter()
with auto-cleanup, replacing childItems()/dynamic_cast iteration
Also fixed PlayerActions to query CounterState instead of AbstractCounter
for proper layer separation.
This commit is contained in:
parent
cbee3726c9
commit
928b0a1483
11 changed files with 55 additions and 56 deletions
|
|
@ -33,6 +33,11 @@ AbstractCounter::AbstractCounter(CounterState *state,
|
|||
update();
|
||||
});
|
||||
|
||||
connect(state, &CounterState::activeChanged, this, [this](bool newActive) {
|
||||
setActive(newActive);
|
||||
emit player->rearrangeCounters();
|
||||
});
|
||||
|
||||
if (player->getPlayerInfo()->getLocalOrJudge()) {
|
||||
menu = new TearOffMenu(TranslateCounterName::getDisplayName(state->getName()));
|
||||
aSet = new QAction(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue