mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
* [Refactor] Move game logic into libcockatrice_game * [Refactor] Include card_state.h in player_actions.h * [Game] Inject settings providers into libcockatrice_game, drop Widgets * [Game] Follow base rename to createCardRequested after rebase * [Game] Drop unused CardItem forward declaration * [Game] Fix includes after moving game logic into libcockatrice_game --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
42 lines
No EOL
1.2 KiB
C++
42 lines
No EOL
1.2 KiB
C++
#include "sideboard_menu.h"
|
|
|
|
#include "../../../client/settings/cache_settings.h"
|
|
#include "../../../client/settings/shortcuts_settings.h"
|
|
#include "../player_graphics_item.h"
|
|
|
|
#include <QAction>
|
|
#include <QKeySequence>
|
|
#include <libcockatrice/game/player/player_actions.h>
|
|
#include <libcockatrice/game/player/player_info.h>
|
|
#include <libcockatrice/game/player/player_logic.h>
|
|
|
|
SideboardMenu::SideboardMenu(PlayerGraphicsItem *player, QMenu *playerMenu) : QMenu(playerMenu)
|
|
{
|
|
aViewSideboard = new QAction(this);
|
|
connect(aViewSideboard, &QAction::triggered, player->getLogic()->getPlayerActions(),
|
|
&PlayerActions::actViewSideboard);
|
|
|
|
if (player->getLogic()->getPlayerInfo()->getLocalOrJudge()) {
|
|
addAction(aViewSideboard);
|
|
}
|
|
|
|
retranslateUi();
|
|
}
|
|
|
|
void SideboardMenu::retranslateUi()
|
|
{
|
|
setTitle(tr("&Sideboard"));
|
|
aViewSideboard->setText(tr("&View sideboard"));
|
|
}
|
|
|
|
void SideboardMenu::setShortcutsActive()
|
|
{
|
|
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
|
|
|
aViewSideboard->setShortcuts(shortcuts.getShortcut("Player/aViewSideboard"));
|
|
}
|
|
|
|
void SideboardMenu::setShortcutsInactive()
|
|
{
|
|
aViewSideboard->setShortcut(QKeySequence());
|
|
} |