mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 21:13:55 -07:00
Took 18 minutes Took 6 seconds Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
/**
|
|
* @file utility_menu.h
|
|
* @ingroup GameMenusPlayers
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef COCKATRICE_UTILITY_MENU_H
|
|
#define COCKATRICE_UTILITY_MENU_H
|
|
|
|
#include "abstract_player_component.h"
|
|
|
|
#include <QMenu>
|
|
|
|
class Player;
|
|
class UtilityMenu : public QMenu, public AbstractPlayerComponent
|
|
{
|
|
Q_OBJECT
|
|
public slots:
|
|
void populatePredefinedTokensMenu();
|
|
void retranslateUi() override;
|
|
void setShortcutsActive() override;
|
|
void setShortcutsInactive() override;
|
|
|
|
public:
|
|
explicit UtilityMenu(Player *player, QMenu *playerMenu);
|
|
|
|
[[nodiscard]] bool createAnotherTokenActionExists() const
|
|
{
|
|
return aCreateAnotherToken != nullptr;
|
|
}
|
|
|
|
void setAndEnableCreateAnotherTokenAction(QString text)
|
|
{
|
|
aCreateAnotherToken->setText(text);
|
|
aCreateAnotherToken->setEnabled(true);
|
|
}
|
|
|
|
QStringList getPredefinedTokens() const
|
|
{
|
|
return predefinedTokens;
|
|
}
|
|
|
|
private:
|
|
Player *player;
|
|
QStringList predefinedTokens;
|
|
|
|
QMenu *createPredefinedTokenMenu;
|
|
|
|
QAction *aIncrementAllCardCounters;
|
|
QAction *aUntapAll, *aRollDie, *aFlipCoin;
|
|
QAction *aCreateToken, *aCreateAnotherToken;
|
|
};
|
|
|
|
#endif // COCKATRICE_UTILITY_MENU_H
|