mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 00:12:15 -07:00
Lint.
Took 6 minutes Took 22 seconds
This commit is contained in:
parent
cce6a9d663
commit
5401efe245
8 changed files with 97 additions and 79 deletions
|
|
@ -7,27 +7,28 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
class GraveyardMenu : public TearOffMenu {
|
class GraveyardMenu : public TearOffMenu
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit GraveyardMenu(Player* player, QWidget* parent = nullptr);
|
explicit GraveyardMenu(Player *player, QWidget *parent = nullptr);
|
||||||
void createMoveActions();
|
void createMoveActions();
|
||||||
void createViewActions();
|
void createViewActions();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void setShortcutsActive();
|
void setShortcutsActive();
|
||||||
void setShortcutsInactive();
|
void setShortcutsInactive();
|
||||||
|
|
||||||
QMenu * mRevealRandomGraveyardCard = nullptr;
|
QMenu *mRevealRandomGraveyardCard = nullptr;
|
||||||
QMenu* moveGraveMenu = nullptr;
|
QMenu *moveGraveMenu = nullptr;
|
||||||
|
|
||||||
QAction* aViewGraveyard = nullptr;
|
QAction *aViewGraveyard = nullptr;
|
||||||
QAction* aMoveGraveToTopLibrary = nullptr;
|
QAction *aMoveGraveToTopLibrary = nullptr;
|
||||||
QAction* aMoveGraveToBottomLibrary = nullptr;
|
QAction *aMoveGraveToBottomLibrary = nullptr;
|
||||||
QAction* aMoveGraveToHand = nullptr;
|
QAction *aMoveGraveToHand = nullptr;
|
||||||
QAction* aMoveGraveToRfg = nullptr;
|
QAction *aMoveGraveToRfg = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Player* player;
|
Player *player;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COCKATRICE_GRAVE_MENU_H
|
#endif // COCKATRICE_GRAVE_MENU_H
|
||||||
|
|
|
||||||
|
|
@ -13,32 +13,40 @@ class HandMenu : public TearOffMenu
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit HandMenu(Player* player, PlayerActions* actions, QWidget* parent = nullptr);
|
explicit HandMenu(Player *player, PlayerActions *actions, QWidget *parent = nullptr);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void setShortcutsActive();
|
void setShortcutsActive();
|
||||||
void setShortcutsInactive();
|
void setShortcutsInactive();
|
||||||
|
|
||||||
// expose useful actions/menus if PlayerMenu needs them
|
// expose useful actions/menus if PlayerMenu needs them
|
||||||
QMenu* revealHandMenu() const { return mRevealHand; }
|
QMenu *revealHandMenu() const
|
||||||
QMenu* revealRandomHandCardMenu() const { return mRevealRandomHandCard; }
|
{
|
||||||
QMenu* moveHandMenu() const { return mMoveHandMenu; }
|
return mRevealHand;
|
||||||
|
}
|
||||||
|
QMenu *revealRandomHandCardMenu() const
|
||||||
|
{
|
||||||
|
return mRevealRandomHandCard;
|
||||||
|
}
|
||||||
|
QMenu *moveHandMenu() const
|
||||||
|
{
|
||||||
|
return mMoveHandMenu;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Player *player;
|
Player *player;
|
||||||
|
|
||||||
QAction* aViewHand = nullptr;
|
QAction *aViewHand = nullptr;
|
||||||
QAction* aSortHand = nullptr;
|
QAction *aSortHand = nullptr;
|
||||||
QAction* aMulligan = nullptr;
|
QAction *aMulligan = nullptr;
|
||||||
|
|
||||||
QMenu* mRevealHand = nullptr;
|
QMenu *mRevealHand = nullptr;
|
||||||
QMenu* mRevealRandomHandCard = nullptr;
|
QMenu *mRevealRandomHandCard = nullptr;
|
||||||
QMenu* mMoveHandMenu = nullptr;
|
QMenu *mMoveHandMenu = nullptr;
|
||||||
|
|
||||||
QAction* aMoveHandToTopLibrary = nullptr;
|
QAction *aMoveHandToTopLibrary = nullptr;
|
||||||
QAction* aMoveHandToBottomLibrary = nullptr;
|
QAction *aMoveHandToBottomLibrary = nullptr;
|
||||||
QAction* aMoveHandToGrave = nullptr;
|
QAction *aMoveHandToGrave = nullptr;
|
||||||
QAction* aMoveHandToRfg = nullptr;
|
QAction *aMoveHandToRfg = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // COCKATRICE_HAND_MENU_H
|
#endif // COCKATRICE_HAND_MENU_H
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,18 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// expose useful actions/menus if PlayerMenu needs them
|
// expose useful actions/menus if PlayerMenu needs them
|
||||||
QMenu* revealLibrary() const { return mRevealLibrary; }
|
QMenu *revealLibrary() const
|
||||||
QMenu* lendLibraryMenu() const { return mLendLibrary; }
|
{
|
||||||
QMenu* revealTopCardMenu() const { return mRevealTopCard; }
|
return mRevealLibrary;
|
||||||
|
}
|
||||||
|
QMenu *lendLibraryMenu() const
|
||||||
|
{
|
||||||
|
return mLendLibrary;
|
||||||
|
}
|
||||||
|
QMenu *revealTopCardMenu() const
|
||||||
|
{
|
||||||
|
return mRevealTopCard;
|
||||||
|
}
|
||||||
|
|
||||||
QMenu *topLibraryMenu = nullptr;
|
QMenu *topLibraryMenu = nullptr;
|
||||||
QMenu *bottomLibraryMenu = nullptr;
|
QMenu *bottomLibraryMenu = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -211,8 +211,8 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
||||||
void PlayerMenu::setMenusForGraphicItems()
|
void PlayerMenu::setMenusForGraphicItems()
|
||||||
{
|
{
|
||||||
player->getGraphicsItem()->getTableZoneGraphicsItem()->setMenu(playerMenu);
|
player->getGraphicsItem()->getTableZoneGraphicsItem()->setMenu(playerMenu);
|
||||||
//player->getGraphicsItem()->getGraveyardZoneGraphicsItem()->setMenu(graveMenu, aViewGraveyard);
|
// player->getGraphicsItem()->getGraveyardZoneGraphicsItem()->setMenu(graveMenu, aViewGraveyard);
|
||||||
//player->getGraphicsItem()->getRfgZoneGraphicsItem()->setMenu(rfgMenu, aViewRfg);
|
// player->getGraphicsItem()->getRfgZoneGraphicsItem()->setMenu(rfgMenu, aViewRfg);
|
||||||
if (player->getPlayerInfo()->local || player->getPlayerInfo()->judge) {
|
if (player->getPlayerInfo()->local || player->getPlayerInfo()->judge) {
|
||||||
player->getGraphicsItem()->getHandZoneGraphicsItem()->setMenu(handMenu);
|
player->getGraphicsItem()->getHandZoneGraphicsItem()->setMenu(handMenu);
|
||||||
// player->getGraphicsItem()->getDeckZoneGraphicsItem()->setMenu(libraryMenu, aDrawCard);
|
// player->getGraphicsItem()->getDeckZoneGraphicsItem()->setMenu(libraryMenu, aDrawCard);
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Player *player;
|
Player *player;
|
||||||
QMenu *sbMenu, *countersMenu, *sayMenu, *createPredefinedTokenMenu, *mCustomZones,
|
QMenu *sbMenu, *countersMenu, *sayMenu, *createPredefinedTokenMenu, *mCustomZones, *mCardCounters;
|
||||||
*mCardCounters;
|
|
||||||
HandMenu *handMenu;
|
HandMenu *handMenu;
|
||||||
LibraryMenu *libraryMenu;
|
LibraryMenu *libraryMenu;
|
||||||
GraveyardMenu *graveMenu;
|
GraveyardMenu *graveMenu;
|
||||||
|
|
@ -98,9 +97,9 @@ private:
|
||||||
QAction *aViewSideboard, *aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken;
|
QAction *aViewSideboard, *aUntapAll, *aRollDie, *aCreateToken, *aCreateAnotherToken;
|
||||||
|
|
||||||
QList<QAction *> aAddCounter, aSetCounter, aRemoveCounter;
|
QList<QAction *> aAddCounter, aSetCounter, aRemoveCounter;
|
||||||
QAction *aPlay, *aPlayFacedown, *aHide, *aTap, *aDoesntUntap, *aAttach, *aUnattach, *aDrawArrow, *aSetAnnotation, *aFlip, *aPeek, *aClone,
|
QAction *aPlay, *aPlayFacedown, *aHide, *aTap, *aDoesntUntap, *aAttach, *aUnattach, *aDrawArrow, *aSetAnnotation,
|
||||||
*aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToHand, *aMoveToGraveyard, *aMoveToExile,
|
*aFlip, *aPeek, *aClone, *aMoveToTopLibrary, *aMoveToBottomLibrary, *aMoveToHand, *aMoveToGraveyard,
|
||||||
*aMoveToXfromTopOfLibrary, *aSelectAll, *aSelectRow, *aSelectColumn, *aIncrementAllCardCounters;
|
*aMoveToExile, *aMoveToXfromTopOfLibrary, *aSelectAll, *aSelectRow, *aSelectColumn, *aIncrementAllCardCounters;
|
||||||
|
|
||||||
bool shortcutsActive;
|
bool shortcutsActive;
|
||||||
QStringList predefinedTokens;
|
QStringList predefinedTokens;
|
||||||
|
|
|
||||||
|
|
@ -7,40 +7,40 @@ PtMenu::PtMenu(Player *player) : QMenu(tr("Power / toughness"))
|
||||||
{
|
{
|
||||||
PlayerActions *playerActions = player->getPlayerActions();
|
PlayerActions *playerActions = player->getPlayerActions();
|
||||||
|
|
||||||
aIncP = new QAction(this);
|
aIncP = new QAction(this);
|
||||||
connect(aIncP, &QAction::triggered, playerActions, &PlayerActions::actIncP);
|
connect(aIncP, &QAction::triggered, playerActions, &PlayerActions::actIncP);
|
||||||
aDecP = new QAction(this);
|
aDecP = new QAction(this);
|
||||||
connect(aDecP, &QAction::triggered, playerActions, &PlayerActions::actDecP);
|
connect(aDecP, &QAction::triggered, playerActions, &PlayerActions::actDecP);
|
||||||
aIncT = new QAction(this);
|
aIncT = new QAction(this);
|
||||||
connect(aIncT, &QAction::triggered, playerActions, &PlayerActions::actIncT);
|
connect(aIncT, &QAction::triggered, playerActions, &PlayerActions::actIncT);
|
||||||
aDecT = new QAction(this);
|
aDecT = new QAction(this);
|
||||||
connect(aDecT, &QAction::triggered, playerActions, &PlayerActions::actDecT);
|
connect(aDecT, &QAction::triggered, playerActions, &PlayerActions::actDecT);
|
||||||
aIncPT = new QAction(this);
|
aIncPT = new QAction(this);
|
||||||
connect(aIncPT, &QAction::triggered, playerActions, [playerActions] { playerActions->actIncPT(); });
|
connect(aIncPT, &QAction::triggered, playerActions, [playerActions] { playerActions->actIncPT(); });
|
||||||
aDecPT = new QAction(this);
|
aDecPT = new QAction(this);
|
||||||
connect(aDecPT, &QAction::triggered, playerActions, &PlayerActions::actDecPT);
|
connect(aDecPT, &QAction::triggered, playerActions, &PlayerActions::actDecPT);
|
||||||
aFlowP = new QAction(this);
|
aFlowP = new QAction(this);
|
||||||
connect(aFlowP, &QAction::triggered, playerActions, &PlayerActions::actFlowP);
|
connect(aFlowP, &QAction::triggered, playerActions, &PlayerActions::actFlowP);
|
||||||
aFlowT = new QAction(this);
|
aFlowT = new QAction(this);
|
||||||
connect(aFlowT, &QAction::triggered, playerActions, &PlayerActions::actFlowT);
|
connect(aFlowT, &QAction::triggered, playerActions, &PlayerActions::actFlowT);
|
||||||
aSetPT = new QAction(this);
|
aSetPT = new QAction(this);
|
||||||
connect(aSetPT, &QAction::triggered, playerActions, &PlayerActions::actSetPT);
|
connect(aSetPT, &QAction::triggered, playerActions, &PlayerActions::actSetPT);
|
||||||
aResetPT = new QAction(this);
|
aResetPT = new QAction(this);
|
||||||
connect(aResetPT, &QAction::triggered, playerActions, &PlayerActions::actResetPT);
|
connect(aResetPT, &QAction::triggered, playerActions, &PlayerActions::actResetPT);
|
||||||
|
|
||||||
addAction(aIncP);
|
addAction(aIncP);
|
||||||
addAction(aDecP);
|
addAction(aDecP);
|
||||||
addAction(aFlowP);
|
addAction(aFlowP);
|
||||||
addSeparator();
|
addSeparator();
|
||||||
addAction(aIncT);
|
addAction(aIncT);
|
||||||
addAction(aDecT);
|
addAction(aDecT);
|
||||||
addAction(aFlowT);
|
addAction(aFlowT);
|
||||||
addSeparator();
|
addSeparator();
|
||||||
addAction(aIncPT);
|
addAction(aIncPT);
|
||||||
addAction(aDecPT);
|
addAction(aDecPT);
|
||||||
addSeparator();
|
addSeparator();
|
||||||
addAction(aSetPT);
|
addAction(aSetPT);
|
||||||
addAction(aResetPT);
|
addAction(aResetPT);
|
||||||
|
|
||||||
retranslateUi();
|
retranslateUi();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
class PtMenu : public QMenu {
|
class PtMenu : public QMenu
|
||||||
|
{
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
@ -23,7 +24,6 @@ public:
|
||||||
QAction *aDecPT = nullptr;
|
QAction *aDecPT = nullptr;
|
||||||
QAction *aSetPT = nullptr;
|
QAction *aSetPT = nullptr;
|
||||||
QAction *aResetPT = nullptr;
|
QAction *aResetPT = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COCKATRICE_PT_MENU_H
|
#endif // COCKATRICE_PT_MENU_H
|
||||||
|
|
|
||||||
|
|
@ -7,24 +7,25 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
class RfgMenu : public TearOffMenu {
|
class RfgMenu : public TearOffMenu
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit RfgMenu(Player* player, QWidget* parent = nullptr);
|
explicit RfgMenu(Player *player, QWidget *parent = nullptr);
|
||||||
void createMoveActions();
|
void createMoveActions();
|
||||||
void createViewActions();
|
void createViewActions();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
||||||
QMenu * moveRfgMenu = nullptr;
|
QMenu *moveRfgMenu = nullptr;
|
||||||
|
|
||||||
QAction* aViewRfg = nullptr;
|
QAction *aViewRfg = nullptr;
|
||||||
QAction* aMoveRfgToTopLibrary = nullptr;
|
QAction *aMoveRfgToTopLibrary = nullptr;
|
||||||
QAction* aMoveRfgToBottomLibrary = nullptr;
|
QAction *aMoveRfgToBottomLibrary = nullptr;
|
||||||
QAction* aMoveRfgToHand = nullptr;
|
QAction *aMoveRfgToHand = nullptr;
|
||||||
QAction* aMoveRfgToGrave = nullptr;
|
QAction *aMoveRfgToGrave = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Player* player;
|
Player *player;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COCKATRICE_RFG_MENU_H
|
#endif // COCKATRICE_RFG_MENU_H
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue