Remove unnecessary View command zone action

This commit is contained in:
DawnFire42 2026-08-10 15:36:35 -04:00
parent 4aa430abd0
commit 1f5df5b0e1
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
4 changed files with 2 additions and 29 deletions

View file

@ -597,8 +597,6 @@ private:
{"Player/aViewBottomCards", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Bottom Cards of Library"),
parseSequenceString("Ctrl+Shift+W"),
ShortcutGroup::View)},
{"Player/aViewCommandZone",
ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Command Zone"), parseSequenceString(""), ShortcutGroup::View)},
{"Player/aAddCommanderTax", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Increase Commander Tax"),
parseSequenceString(""),
ShortcutGroup::Player_Counters)},

View file

@ -11,28 +11,16 @@
#include <libcockatrice/utility/counter_ids.h>
#include <libcockatrice/utility/counter_limits.h>
#include <libcockatrice/utility/zone_names.h>
CommandZoneMenu::CommandZoneMenu(PlayerGraphicsItem *_player, QMenu *playerMenu) : QMenu(playerMenu), player(_player)
{
viewZoneShortcutKey = QStringLiteral("Player/aViewCommandZone");
incTaxShortcutKey = QStringLiteral("Player/aAddCommanderTax");
decTaxShortcutKey = QStringLiteral("Player/aRemoveCommanderTax");
incPartnerTaxShortcutKey = QStringLiteral("Player/aAddPartnerTax");
decPartnerTaxShortcutKey = QStringLiteral("Player/aRemovePartnerTax");
aViewZone = new QAction(this);
connect(aViewZone, &QAction::triggered, this, [this]() {
if (PlayerLogic *logic = player->getLogic()) {
emit logic->requestZoneViewToggle(logic, ZoneNames::COMMAND, -1, false);
}
});
PlayerLogic *logic = player->getLogic();
if (logic && logic->getPlayerInfo()->getLocalOrJudge()) {
addAction(aViewZone);
addSeparator();
aIncreaseCommanderTax = new QAction(this);
connect(aIncreaseCommanderTax, &QAction::triggered, this, [this]() {
if (auto *logic = player->getLogic()) {
@ -100,9 +88,6 @@ CommandZoneMenu::CommandZoneMenu(PlayerGraphicsItem *_player, QMenu *playerMenu)
void CommandZoneMenu::retranslateUi()
{
setTitle(tr("Co&mmander"));
if (aViewZone) {
aViewZone->setText(tr("&View command zone"));
}
if (aIncreaseCommanderTax) {
aIncreaseCommanderTax->setText(tr("&Increase Commander Tax (+1)"));
}
@ -166,9 +151,6 @@ void CommandZoneMenu::setShortcutsActive()
{
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
if (aViewZone) {
aViewZone->setShortcuts(shortcuts.getShortcut(viewZoneShortcutKey));
}
if (aIncreaseCommanderTax) {
aIncreaseCommanderTax->setShortcuts(shortcuts.getShortcut(incTaxShortcutKey));
}
@ -185,9 +167,6 @@ void CommandZoneMenu::setShortcutsActive()
void CommandZoneMenu::setShortcutsInactive()
{
if (aViewZone) {
aViewZone->setShortcut(QKeySequence());
}
if (aIncreaseCommanderTax) {
aIncreaseCommanderTax->setShortcut(QKeySequence());
}

View file

@ -18,8 +18,7 @@ class PlayerGraphicsItem;
* @brief Context menu for the command zone.
*
* Appears when right-clicking on the command zone. Provides actions for
* viewing zone contents, adjusting the commander tax counter, and
* toggling minimized state.
* adjusting the commander tax counter and toggling minimized state.
*
* @see PlayerMenu
* @see CommandZone
@ -34,8 +33,6 @@ public:
void setShortcutsActive() override;
void setShortcutsInactive() override;
QAction *aViewZone = nullptr; ///< Opens a zone viewer for the command zone
private:
QAction *aIncreaseCommanderTax = nullptr; ///< Increments the primary commander tax counter
QAction *aDecreaseCommanderTax = nullptr; ///< Decrements the primary commander tax counter
@ -52,7 +49,6 @@ private:
void updateTaxCounterActionStates();
PlayerGraphicsItem *player;
QString viewZoneShortcutKey;
QString incTaxShortcutKey;
QString decTaxShortcutKey;
QString incPartnerTaxShortcutKey;

View file

@ -83,7 +83,7 @@ void PlayerMenu::setMenusForGraphicItems()
player->getSideboardZoneGraphicsItem()->setMenu(sideboardMenu);
if (auto *commandZone = player->getCommandZoneGraphicsItem()) {
commandZone->setMenu(commandZoneMenu, commandZoneMenu->aViewZone);
commandZone->setMenu(commandZoneMenu);
}
}
}