mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 03:53:56 -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
1416ef0ea5
commit
90a49936d7
28 changed files with 538 additions and 368 deletions
|
|
@ -8,7 +8,6 @@
|
|||
#define COCKATRICE_PLAYER_MENU_H
|
||||
|
||||
#include "../../../interface/widgets/menus/tearoff_menu.h"
|
||||
#include "../player_logic.h"
|
||||
#include "custom_zone_menu.h"
|
||||
#include "grave_menu.h"
|
||||
#include "hand_menu.h"
|
||||
|
|
@ -23,29 +22,31 @@
|
|||
#include <QObject>
|
||||
|
||||
class CardItem;
|
||||
class CardMenu;
|
||||
class PlayerGraphicsItem;
|
||||
class PlayerMenu : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void cardMenuUpdated(QMenu *cardMenu);
|
||||
void cardMenuUpdated(CardMenu *cardMenu);
|
||||
void cardInfoRequested(const CardRef &cardRef);
|
||||
void shortcutsActivated();
|
||||
void shortcutsDeactivated();
|
||||
void retranslateRequested();
|
||||
|
||||
public slots:
|
||||
void setMenusForGraphicItems();
|
||||
QMenu *updateCardMenu(const CardItem *card);
|
||||
|
||||
private slots:
|
||||
void refreshShortcuts();
|
||||
|
||||
public:
|
||||
explicit PlayerMenu(PlayerLogic *player);
|
||||
explicit PlayerMenu(PlayerGraphicsItem *player);
|
||||
/** @brief Retranslate all user-visible strings. Called on language change. */
|
||||
void retranslateUi();
|
||||
|
||||
QMenu *updateCardMenu(const CardItem *card);
|
||||
|
||||
[[nodiscard]] QMenu *getPlayerMenu() const
|
||||
{
|
||||
return playerMenu;
|
||||
|
|
@ -77,7 +78,7 @@ public:
|
|||
void setShortcutsInactive();
|
||||
|
||||
private:
|
||||
PlayerLogic *player;
|
||||
PlayerGraphicsItem *player;
|
||||
TearOffMenu *playerMenu;
|
||||
QMenu *countersMenu;
|
||||
HandMenu *handMenu;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue