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:
DawnFire42 2026-06-09 14:29:20 -04:00
parent 8ca693ef70
commit b0ed79d9c3
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
11 changed files with 55 additions and 56 deletions

View file

@ -285,13 +285,6 @@ void PlayerEventHandler::eventSetCounterActive(const Event_SetCounterActive &eve
return;
}
state->setActive(event.active());
// TODO: The counters data should emit this and the widget hook up to it. Don't reach into graphics like this.
/*AbstractCounter *widget = player->getGraphicsItem()->getCounterWidget(event.counter_id());
if (widget) {
widget->setActive(event.active());
emit player->rearrangeCounters();
}*/
}
void PlayerEventHandler::eventDelCounter(const Event_DelCounter &event)