mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Rename folder.
Took 24 minutes Took 6 minutes
This commit is contained in:
parent
6c7871af5b
commit
33dfbdb50f
24 changed files with 83 additions and 50 deletions
|
|
@ -233,16 +233,17 @@ set(cockatrice_SOURCES
|
|||
src/game/player/player_list_widget.cpp
|
||||
src/game/player/player_manager.cpp
|
||||
src/game/player/player_target.cpp
|
||||
src/game/player/player_menu/card_menu.cpp
|
||||
src/game/player/player_menu/grave_menu.cpp
|
||||
src/game/player/player_menu/hand_menu.cpp
|
||||
src/game/player/player_menu/library_menu.cpp
|
||||
src/game/player/player_menu/move_menu.cpp
|
||||
src/game/player/player_menu/player_menu.cpp
|
||||
src/game/player/player_menu/pt_menu.cpp
|
||||
src/game/player/player_menu/rfg_menu.cpp
|
||||
src/game/player/player_menu/say_menu.cpp
|
||||
src/game/player/player_menu/utility_menu.cpp
|
||||
src/game/player/menu/card_menu.cpp
|
||||
src/game/player/menu/custom_zone_menu.cpp
|
||||
src/game/player/menu/grave_menu.cpp
|
||||
src/game/player/menu/hand_menu.cpp
|
||||
src/game/player/menu/library_menu.cpp
|
||||
src/game/player/menu/move_menu.cpp
|
||||
src/game/player/menu/player_menu.cpp
|
||||
src/game/player/menu/pt_menu.cpp
|
||||
src/game/player/menu/rfg_menu.cpp
|
||||
src/game/player/menu/say_menu.cpp
|
||||
src/game/player/menu/utility_menu.cpp
|
||||
src/game/replay.cpp
|
||||
src/game/zones/card_zone.cpp
|
||||
src/game/zones/hand_zone.cpp
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ class CardMenu : public QMenu
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CardMenu(Player *player,
|
||||
const CardItem *card,
|
||||
bool shortcutsActive);
|
||||
explicit CardMenu(Player *player, const CardItem *card, bool shortcutsActive);
|
||||
void removePlayer(Player *playerToRemove);
|
||||
void createTableMenu();
|
||||
void createStackMenu();
|
||||
41
cockatrice/src/game/player/menu/custom_zone_menu.cpp
Normal file
41
cockatrice/src/game/player/menu/custom_zone_menu.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include "custom_zone_menu.h"
|
||||
|
||||
#include "../player.h"
|
||||
|
||||
CustomZoneMenu::CustomZoneMenu(Player *_player) : player(_player)
|
||||
{
|
||||
menuAction()->setVisible(false);
|
||||
|
||||
connect(player, &Player::clearCustomZonesMenu, this, &CustomZoneMenu::clearCustomZonesMenu);
|
||||
connect(player, &Player::addViewCustomZoneActionToCustomZoneMenu, this,
|
||||
&CustomZoneMenu::addViewCustomZoneActionToCustomZoneMenu);
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void CustomZoneMenu::retranslateUi()
|
||||
{
|
||||
setTitle(tr("C&ustom Zones"));
|
||||
|
||||
if (player->getPlayerInfo()->getLocalOrJudge()) {
|
||||
|
||||
for (auto aViewZone : actions()) {
|
||||
aViewZone->setText(tr("View custom zone '%1'").arg(aViewZone->data().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CustomZoneMenu::clearCustomZonesMenu()
|
||||
{
|
||||
clear();
|
||||
menuAction()->setVisible(false);
|
||||
}
|
||||
|
||||
void CustomZoneMenu::addViewCustomZoneActionToCustomZoneMenu(QString zoneName)
|
||||
{
|
||||
menuAction()->setVisible(true);
|
||||
QAction *aViewZone = addAction(tr("View custom zone '%1'").arg(zoneName));
|
||||
aViewZone->setData(zoneName);
|
||||
connect(aViewZone, &QAction::triggered, this,
|
||||
[zoneName, this]() { player->getGameScene()->toggleZoneView(player, zoneName, -1); });
|
||||
}
|
||||
21
cockatrice/src/game/player/menu/custom_zone_menu.h
Normal file
21
cockatrice/src/game/player/menu/custom_zone_menu.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef COCKATRICE_CUSTOM_ZONE_MENU_H
|
||||
#define COCKATRICE_CUSTOM_ZONE_MENU_H
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
class Player;
|
||||
class CustomZoneMenu : public QMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CustomZoneMenu(Player *player);
|
||||
void retranslateUi();
|
||||
|
||||
private:
|
||||
Player *player;
|
||||
private slots:
|
||||
void clearCustomZonesMenu();
|
||||
void addViewCustomZoneActionToCustomZoneMenu(QString zoneName);
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_CUSTOM_ZONE_MENU_H
|
||||
|
|
@ -54,17 +54,16 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
|||
|
||||
sbMenu->addAction(aViewSideboard);
|
||||
|
||||
mCustomZones = playerMenu->addMenu(QString());
|
||||
mCustomZones->menuAction()->setVisible(false);
|
||||
|
||||
customZonesMenu = new CustomZoneMenu(player);
|
||||
playerMenu->addSeparator();
|
||||
|
||||
countersMenu = playerMenu->addMenu(QString());
|
||||
|
||||
utilityMenu = new UtilityMenu(player, playerMenu);
|
||||
} else {
|
||||
countersMenu = nullptr;
|
||||
sbMenu = nullptr;
|
||||
mCustomZones = nullptr;
|
||||
customZonesMenu = nullptr;
|
||||
aViewSideboard = nullptr;
|
||||
utilityMenu = nullptr;
|
||||
}
|
||||
|
|
@ -89,10 +88,6 @@ PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
|||
&PlayerMenu::refreshShortcuts);
|
||||
refreshShortcuts();
|
||||
|
||||
connect(player, &Player::clearCustomZonesMenu, this, &PlayerMenu::clearCustomZonesMenu);
|
||||
connect(player, &Player::addViewCustomZoneActionToCustomZoneMenu, this,
|
||||
&PlayerMenu::addViewCustomZoneActionToCustomZoneMenu);
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
|
|
@ -213,26 +208,6 @@ QMenu *PlayerMenu::updateCardMenu(const CardItem *card)
|
|||
return menu;
|
||||
}
|
||||
|
||||
void PlayerMenu::clearCustomZonesMenu()
|
||||
{
|
||||
// Can be null if we are not the local player!
|
||||
if (mCustomZones) {
|
||||
mCustomZones->clear();
|
||||
mCustomZones->menuAction()->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerMenu::addViewCustomZoneActionToCustomZoneMenu(QString zoneName)
|
||||
{
|
||||
if (mCustomZones) {
|
||||
mCustomZones->menuAction()->setVisible(true);
|
||||
QAction *aViewZone = mCustomZones->addAction(tr("View custom zone '%1'").arg(zoneName));
|
||||
aViewZone->setData(zoneName);
|
||||
connect(aViewZone, &QAction::triggered, this,
|
||||
[zoneName, this]() { player->getGameScene()->toggleZoneView(player, zoneName, -1); });
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerMenu::retranslateUi()
|
||||
{
|
||||
playerMenu->setTitle(tr("Player \"%1\"").arg(player->getPlayerInfo()->getName()));
|
||||
|
|
@ -247,11 +222,7 @@ void PlayerMenu::retranslateUi()
|
|||
libraryMenu->retranslateUi();
|
||||
utilityMenu->retranslateUi();
|
||||
countersMenu->setTitle(tr("&Counters"));
|
||||
mCustomZones->setTitle(tr("C&ustom Zones"));
|
||||
|
||||
for (auto aViewZone : mCustomZones->actions()) {
|
||||
aViewZone->setText(tr("View custom zone '%1'").arg(aViewZone->data().toString()));
|
||||
}
|
||||
customZonesMenu->retranslateUi();
|
||||
|
||||
for (auto &allPlayersAction : allPlayersActions) {
|
||||
allPlayersAction->setText(tr("&All players"));
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "../../../client/tearoff_menu.h"
|
||||
#include "../player.h"
|
||||
#include "custom_zone_menu.h"
|
||||
#include "grave_menu.h"
|
||||
#include "hand_menu.h"
|
||||
#include "library_menu.h"
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
#include <QMenu>
|
||||
#include <QObject>
|
||||
|
||||
class CardItem;
|
||||
class PlayerMenu : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -28,8 +30,6 @@ private slots:
|
|||
void removePlayer(Player *playerToRemove);
|
||||
void playerListActionTriggered();
|
||||
void refreshShortcuts();
|
||||
void clearCustomZonesMenu();
|
||||
void addViewCustomZoneActionToCustomZoneMenu(QString zoneName);
|
||||
|
||||
public:
|
||||
PlayerMenu(Player *player);
|
||||
|
|
@ -73,13 +73,14 @@ public:
|
|||
private:
|
||||
Player *player;
|
||||
TearOffMenu *playerMenu;
|
||||
QMenu *sbMenu, *countersMenu, *mCustomZones;
|
||||
QMenu *sbMenu, *countersMenu;
|
||||
HandMenu *handMenu;
|
||||
LibraryMenu *libraryMenu;
|
||||
GraveyardMenu *graveMenu;
|
||||
RfgMenu *rfgMenu;
|
||||
UtilityMenu *utilityMenu;
|
||||
SayMenu *sayMenu;
|
||||
CustomZoneMenu *customZonesMenu;
|
||||
QList<QMenu *> playerLists;
|
||||
QList<QAction *> allPlayersActions;
|
||||
QAction *aViewSideboard;
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
#include "../board/abstract_graphics_item.h"
|
||||
#include "../cards/card_info.h"
|
||||
#include "../filters/filter_string.h"
|
||||
#include "menu/player_menu.h"
|
||||
#include "pb/card_attributes.pb.h"
|
||||
#include "pb/game_event.pb.h"
|
||||
#include "player_actions.h"
|
||||
|
|
@ -13,7 +14,6 @@
|
|||
#include "player_event_handler.h"
|
||||
#include "player_graphics_item.h"
|
||||
#include "player_info.h"
|
||||
#include "player_menu/player_menu.h"
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QLoggingCategory>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue