mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 19:47:46 -07:00
Some checks are pending
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 15 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker Image / amd64 & arm64 (push) Waiting to run
* [Game][Player] Pull out graphics_items out of player_logic Took 25 seconds Took 9 minutes * [Game] Move graphics files into game_graphics Took 1 minute Took 2 minutes Took 23 seconds Took 1 minute Took 2 seconds * Include. Took 4 minutes Took 3 minutes Took 4 minutes Took 1 minute Took 3 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
42 lines
No EOL
1.3 KiB
C++
42 lines
No EOL
1.3 KiB
C++
#include "custom_zone_menu.h"
|
|
|
|
#include "../../game/player/player_logic.h"
|
|
#include "../player_graphics_item.h"
|
|
|
|
CustomZoneMenu::CustomZoneMenu(PlayerGraphicsItem *_player) : player(_player)
|
|
{
|
|
menuAction()->setVisible(false);
|
|
|
|
connect(player->getLogic(), &PlayerLogic::clearCustomZonesMenu, this, &CustomZoneMenu::clearCustomZonesMenu);
|
|
connect(player->getLogic(), &PlayerLogic::addViewCustomZoneActionToCustomZoneMenu, this,
|
|
&CustomZoneMenu::addViewCustomZoneActionToCustomZoneMenu);
|
|
|
|
retranslateUi();
|
|
}
|
|
|
|
void CustomZoneMenu::retranslateUi()
|
|
{
|
|
setTitle(tr("C&ustom Zones"));
|
|
|
|
if (player->getLogic()->getPlayerInfo()->getLocalOrJudge()) {
|
|
|
|
for (auto aViewZone : actions()) {
|
|
aViewZone->setText(tr("View custom zone '%1'").arg(aViewZone->data().toString()));
|
|
}
|
|
}
|
|
}
|
|
|
|
void CustomZoneMenu::clearCustomZonesMenu()
|
|
{
|
|
clear();
|
|
menuAction()->setVisible(false);
|
|
}
|
|
|
|
void CustomZoneMenu::addViewCustomZoneActionToCustomZoneMenu(QString zoneName)
|
|
{
|
|
menuAction()->setVisible(true);
|
|
QAction *aViewZone = addAction(tr("View custom zone '%1'").arg(zoneName));
|
|
aViewZone->setData(zoneName);
|
|
connect(aViewZone, &QAction::triggered, this,
|
|
[zoneName, this]() { player->getGameScene()->toggleZoneView(player->getLogic(), zoneName, -1); });
|
|
} |