mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
Remove unnecessary View command zone action
This commit is contained in:
parent
4aa430abd0
commit
1f5df5b0e1
4 changed files with 2 additions and 29 deletions
|
|
@ -597,8 +597,6 @@ private:
|
||||||
{"Player/aViewBottomCards", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Bottom Cards of Library"),
|
{"Player/aViewBottomCards", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Bottom Cards of Library"),
|
||||||
parseSequenceString("Ctrl+Shift+W"),
|
parseSequenceString("Ctrl+Shift+W"),
|
||||||
ShortcutGroup::View)},
|
ShortcutGroup::View)},
|
||||||
{"Player/aViewCommandZone",
|
|
||||||
ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Command Zone"), parseSequenceString(""), ShortcutGroup::View)},
|
|
||||||
{"Player/aAddCommanderTax", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Increase Commander Tax"),
|
{"Player/aAddCommanderTax", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Increase Commander Tax"),
|
||||||
parseSequenceString(""),
|
parseSequenceString(""),
|
||||||
ShortcutGroup::Player_Counters)},
|
ShortcutGroup::Player_Counters)},
|
||||||
|
|
|
||||||
|
|
@ -11,28 +11,16 @@
|
||||||
|
|
||||||
#include <libcockatrice/utility/counter_ids.h>
|
#include <libcockatrice/utility/counter_ids.h>
|
||||||
#include <libcockatrice/utility/counter_limits.h>
|
#include <libcockatrice/utility/counter_limits.h>
|
||||||
#include <libcockatrice/utility/zone_names.h>
|
|
||||||
|
|
||||||
CommandZoneMenu::CommandZoneMenu(PlayerGraphicsItem *_player, QMenu *playerMenu) : QMenu(playerMenu), player(_player)
|
CommandZoneMenu::CommandZoneMenu(PlayerGraphicsItem *_player, QMenu *playerMenu) : QMenu(playerMenu), player(_player)
|
||||||
{
|
{
|
||||||
viewZoneShortcutKey = QStringLiteral("Player/aViewCommandZone");
|
|
||||||
incTaxShortcutKey = QStringLiteral("Player/aAddCommanderTax");
|
incTaxShortcutKey = QStringLiteral("Player/aAddCommanderTax");
|
||||||
decTaxShortcutKey = QStringLiteral("Player/aRemoveCommanderTax");
|
decTaxShortcutKey = QStringLiteral("Player/aRemoveCommanderTax");
|
||||||
incPartnerTaxShortcutKey = QStringLiteral("Player/aAddPartnerTax");
|
incPartnerTaxShortcutKey = QStringLiteral("Player/aAddPartnerTax");
|
||||||
decPartnerTaxShortcutKey = QStringLiteral("Player/aRemovePartnerTax");
|
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();
|
PlayerLogic *logic = player->getLogic();
|
||||||
if (logic && logic->getPlayerInfo()->getLocalOrJudge()) {
|
if (logic && logic->getPlayerInfo()->getLocalOrJudge()) {
|
||||||
addAction(aViewZone);
|
|
||||||
addSeparator();
|
|
||||||
|
|
||||||
aIncreaseCommanderTax = new QAction(this);
|
aIncreaseCommanderTax = new QAction(this);
|
||||||
connect(aIncreaseCommanderTax, &QAction::triggered, this, [this]() {
|
connect(aIncreaseCommanderTax, &QAction::triggered, this, [this]() {
|
||||||
if (auto *logic = player->getLogic()) {
|
if (auto *logic = player->getLogic()) {
|
||||||
|
|
@ -100,9 +88,6 @@ CommandZoneMenu::CommandZoneMenu(PlayerGraphicsItem *_player, QMenu *playerMenu)
|
||||||
void CommandZoneMenu::retranslateUi()
|
void CommandZoneMenu::retranslateUi()
|
||||||
{
|
{
|
||||||
setTitle(tr("Co&mmander"));
|
setTitle(tr("Co&mmander"));
|
||||||
if (aViewZone) {
|
|
||||||
aViewZone->setText(tr("&View command zone"));
|
|
||||||
}
|
|
||||||
if (aIncreaseCommanderTax) {
|
if (aIncreaseCommanderTax) {
|
||||||
aIncreaseCommanderTax->setText(tr("&Increase Commander Tax (+1)"));
|
aIncreaseCommanderTax->setText(tr("&Increase Commander Tax (+1)"));
|
||||||
}
|
}
|
||||||
|
|
@ -166,9 +151,6 @@ void CommandZoneMenu::setShortcutsActive()
|
||||||
{
|
{
|
||||||
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
||||||
|
|
||||||
if (aViewZone) {
|
|
||||||
aViewZone->setShortcuts(shortcuts.getShortcut(viewZoneShortcutKey));
|
|
||||||
}
|
|
||||||
if (aIncreaseCommanderTax) {
|
if (aIncreaseCommanderTax) {
|
||||||
aIncreaseCommanderTax->setShortcuts(shortcuts.getShortcut(incTaxShortcutKey));
|
aIncreaseCommanderTax->setShortcuts(shortcuts.getShortcut(incTaxShortcutKey));
|
||||||
}
|
}
|
||||||
|
|
@ -185,9 +167,6 @@ void CommandZoneMenu::setShortcutsActive()
|
||||||
|
|
||||||
void CommandZoneMenu::setShortcutsInactive()
|
void CommandZoneMenu::setShortcutsInactive()
|
||||||
{
|
{
|
||||||
if (aViewZone) {
|
|
||||||
aViewZone->setShortcut(QKeySequence());
|
|
||||||
}
|
|
||||||
if (aIncreaseCommanderTax) {
|
if (aIncreaseCommanderTax) {
|
||||||
aIncreaseCommanderTax->setShortcut(QKeySequence());
|
aIncreaseCommanderTax->setShortcut(QKeySequence());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@ class PlayerGraphicsItem;
|
||||||
* @brief Context menu for the command zone.
|
* @brief Context menu for the command zone.
|
||||||
*
|
*
|
||||||
* Appears when right-clicking on the command zone. Provides actions for
|
* Appears when right-clicking on the command zone. Provides actions for
|
||||||
* viewing zone contents, adjusting the commander tax counter, and
|
* adjusting the commander tax counter and toggling minimized state.
|
||||||
* toggling minimized state.
|
|
||||||
*
|
*
|
||||||
* @see PlayerMenu
|
* @see PlayerMenu
|
||||||
* @see CommandZone
|
* @see CommandZone
|
||||||
|
|
@ -34,8 +33,6 @@ public:
|
||||||
void setShortcutsActive() override;
|
void setShortcutsActive() override;
|
||||||
void setShortcutsInactive() override;
|
void setShortcutsInactive() override;
|
||||||
|
|
||||||
QAction *aViewZone = nullptr; ///< Opens a zone viewer for the command zone
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QAction *aIncreaseCommanderTax = nullptr; ///< Increments the primary commander tax counter
|
QAction *aIncreaseCommanderTax = nullptr; ///< Increments the primary commander tax counter
|
||||||
QAction *aDecreaseCommanderTax = nullptr; ///< Decrements the primary commander tax counter
|
QAction *aDecreaseCommanderTax = nullptr; ///< Decrements the primary commander tax counter
|
||||||
|
|
@ -52,7 +49,6 @@ private:
|
||||||
void updateTaxCounterActionStates();
|
void updateTaxCounterActionStates();
|
||||||
PlayerGraphicsItem *player;
|
PlayerGraphicsItem *player;
|
||||||
|
|
||||||
QString viewZoneShortcutKey;
|
|
||||||
QString incTaxShortcutKey;
|
QString incTaxShortcutKey;
|
||||||
QString decTaxShortcutKey;
|
QString decTaxShortcutKey;
|
||||||
QString incPartnerTaxShortcutKey;
|
QString incPartnerTaxShortcutKey;
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ void PlayerMenu::setMenusForGraphicItems()
|
||||||
player->getSideboardZoneGraphicsItem()->setMenu(sideboardMenu);
|
player->getSideboardZoneGraphicsItem()->setMenu(sideboardMenu);
|
||||||
|
|
||||||
if (auto *commandZone = player->getCommandZoneGraphicsItem()) {
|
if (auto *commandZone = player->getCommandZoneGraphicsItem()) {
|
||||||
commandZone->setMenu(commandZoneMenu, commandZoneMenu->aViewZone);
|
commandZone->setMenu(commandZoneMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue