Merge pull request #2199 from wincinderith/load-remote-fix
Disable "Load remote deck..." button in local game
This commit is contained in:
commit
e4127fead3
2 changed files with 6 additions and 0 deletions
|
@ -100,6 +100,8 @@ DeckViewContainer::DeckViewContainer(int _playerId, TabGame *parent)
|
||||||
{
|
{
|
||||||
loadLocalButton = new QPushButton;
|
loadLocalButton = new QPushButton;
|
||||||
loadRemoteButton = new QPushButton;
|
loadRemoteButton = new QPushButton;
|
||||||
|
if (parentGame->getIsLocalGame())
|
||||||
|
loadRemoteButton->setEnabled(false);
|
||||||
readyStartButton = new ToggleButton;
|
readyStartButton = new ToggleButton;
|
||||||
readyStartButton->setEnabled(false);
|
readyStartButton->setEnabled(false);
|
||||||
sideboardLockButton = new ToggleButton;
|
sideboardLockButton = new ToggleButton;
|
||||||
|
@ -307,6 +309,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
|
||||||
secondsElapsed(0),
|
secondsElapsed(0),
|
||||||
hostId(-1),
|
hostId(-1),
|
||||||
localPlayerId(-1),
|
localPlayerId(-1),
|
||||||
|
isLocalGame(_tabSupervisor->getIsLocalGame()),
|
||||||
spectator(true),
|
spectator(true),
|
||||||
gameStateKnown(false),
|
gameStateKnown(false),
|
||||||
resuming(false),
|
resuming(false),
|
||||||
|
@ -375,6 +378,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, QList<AbstractClient *> &_client
|
||||||
roomGameTypes(_roomGameTypes),
|
roomGameTypes(_roomGameTypes),
|
||||||
hostId(event.host_id()),
|
hostId(event.host_id()),
|
||||||
localPlayerId(event.player_id()),
|
localPlayerId(event.player_id()),
|
||||||
|
isLocalGame(_tabSupervisor->getIsLocalGame()),
|
||||||
spectator(event.spectator()),
|
spectator(event.spectator()),
|
||||||
gameStateKnown(false),
|
gameStateKnown(false),
|
||||||
resuming(event.resuming()),
|
resuming(event.resuming()),
|
||||||
|
|
|
@ -111,6 +111,7 @@ private:
|
||||||
QMap<int, QString> roomGameTypes;
|
QMap<int, QString> roomGameTypes;
|
||||||
int hostId;
|
int hostId;
|
||||||
int localPlayerId;
|
int localPlayerId;
|
||||||
|
const bool isLocalGame;
|
||||||
bool spectator;
|
bool spectator;
|
||||||
QMap<int, Player *> players;
|
QMap<int, Player *> players;
|
||||||
QMap<int, ServerInfo_User> spectators;
|
QMap<int, ServerInfo_User> spectators;
|
||||||
|
@ -238,6 +239,7 @@ public:
|
||||||
const QMap<int, Player *> &getPlayers() const { return players; }
|
const QMap<int, Player *> &getPlayers() const { return players; }
|
||||||
CardItem *getCard(int playerId, const QString &zoneName, int cardId) const;
|
CardItem *getCard(int playerId, const QString &zoneName, int cardId) const;
|
||||||
bool isHost() const { return hostId == localPlayerId; }
|
bool isHost() const { return hostId == localPlayerId; }
|
||||||
|
bool getIsLocalGame() const { return isLocalGame; }
|
||||||
int getGameId() const { return gameInfo.game_id(); }
|
int getGameId() const { return gameInfo.game_id(); }
|
||||||
QString getTabText() const;
|
QString getTabText() const;
|
||||||
bool getSpectator() const { return spectator; }
|
bool getSpectator() const { return spectator; }
|
||||||
|
|
Loading…
Reference in a new issue