mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-16 20:17:45 -07:00
[Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem (#6944)
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem Took 4 minutes Took 48 seconds * Drop early return. Took 1 hour 13 minutes Took 2 minutes Took 1 minute * Delete player view. Took 37 seconds * Restore card counter color in menu. Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
e674a39b87
commit
9e03f82616
28 changed files with 538 additions and 368 deletions
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
#include "../player_logic.h"
|
||||
|
||||
CustomZoneMenu::CustomZoneMenu(PlayerLogic *_player) : player(_player)
|
||||
CustomZoneMenu::CustomZoneMenu(PlayerGraphicsItem *_player) : player(_player)
|
||||
{
|
||||
menuAction()->setVisible(false);
|
||||
|
||||
connect(player, &PlayerLogic::clearCustomZonesMenu, this, &CustomZoneMenu::clearCustomZonesMenu);
|
||||
connect(player, &PlayerLogic::addViewCustomZoneActionToCustomZoneMenu, this,
|
||||
connect(player->getLogic(), &PlayerLogic::clearCustomZonesMenu, this, &CustomZoneMenu::clearCustomZonesMenu);
|
||||
connect(player->getLogic(), &PlayerLogic::addViewCustomZoneActionToCustomZoneMenu, this,
|
||||
&CustomZoneMenu::addViewCustomZoneActionToCustomZoneMenu);
|
||||
|
||||
retranslateUi();
|
||||
|
|
@ -17,7 +17,7 @@ void CustomZoneMenu::retranslateUi()
|
|||
{
|
||||
setTitle(tr("C&ustom Zones"));
|
||||
|
||||
if (player->getPlayerInfo()->getLocalOrJudge()) {
|
||||
if (player->getLogic()->getPlayerInfo()->getLocalOrJudge()) {
|
||||
|
||||
for (auto aViewZone : actions()) {
|
||||
aViewZone->setText(tr("View custom zone '%1'").arg(aViewZone->data().toString()));
|
||||
|
|
@ -37,5 +37,5 @@ void CustomZoneMenu::addViewCustomZoneActionToCustomZoneMenu(QString zoneName)
|
|||
QAction *aViewZone = addAction(tr("View custom zone '%1'").arg(zoneName));
|
||||
aViewZone->setData(zoneName);
|
||||
connect(aViewZone, &QAction::triggered, this,
|
||||
[zoneName, this]() { player->getGameScene()->toggleZoneView(player, zoneName, -1); });
|
||||
[zoneName, this]() { player->getGameScene()->toggleZoneView(player->getLogic(), zoneName, -1); });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue