mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 04:53:54 -07:00
[Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem (#6944)
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem Took 4 minutes Took 48 seconds * Drop early return. Took 1 hour 13 minutes Took 2 minutes Took 1 minute * Delete player view. Took 37 seconds * Restore card counter color in menu. Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
e674a39b87
commit
9e03f82616
28 changed files with 538 additions and 368 deletions
|
|
@ -10,19 +10,21 @@
|
|||
#include "abstract_player_component.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <libcockatrice/card/card_info.h>
|
||||
|
||||
class PlayerLogic;
|
||||
class PlayerGraphicsItem;
|
||||
class UtilityMenu : public QMenu, public AbstractPlayerComponent
|
||||
{
|
||||
Q_OBJECT
|
||||
public slots:
|
||||
void populatePredefinedTokensMenu();
|
||||
void setLastToken(CardInfoPtr lastToken);
|
||||
void retranslateUi() override;
|
||||
void setShortcutsActive() override;
|
||||
void setShortcutsInactive() override;
|
||||
|
||||
public:
|
||||
explicit UtilityMenu(PlayerLogic *player, QMenu *playerMenu);
|
||||
explicit UtilityMenu(PlayerGraphicsItem *player, QMenu *playerMenu);
|
||||
|
||||
[[nodiscard]] bool createAnotherTokenActionExists() const
|
||||
{
|
||||
|
|
@ -31,7 +33,7 @@ public:
|
|||
|
||||
void setAndEnableCreateAnotherTokenAction(QString text)
|
||||
{
|
||||
aCreateAnotherToken->setText(text);
|
||||
aCreateAnotherToken->setText(tr("C&reate another %1 token").arg(text));
|
||||
aCreateAnotherToken->setEnabled(true);
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +43,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
PlayerLogic *player;
|
||||
PlayerGraphicsItem *player;
|
||||
QStringList predefinedTokens;
|
||||
|
||||
QMenu *createPredefinedTokenMenu;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue