add player numbers to in game (#2435)
This commit is contained in:
parent
12539026c5
commit
c850ae98d8
2 changed files with 10 additions and 1 deletions
|
@ -430,6 +430,7 @@ void TabGame::addMentionTag(QString value) {
|
|||
void TabGame::emitUserEvent() {
|
||||
bool globalEvent = !spectator || settingsCache->getSpectatorNotificationsEnabled();
|
||||
emit userEvent(globalEvent);
|
||||
updatePlayerListDockTitle();
|
||||
}
|
||||
|
||||
TabGame::~TabGame()
|
||||
|
@ -445,12 +446,19 @@ TabGame::~TabGame()
|
|||
emit gameClosing(this);
|
||||
}
|
||||
|
||||
void TabGame::updatePlayerListDockTitle()
|
||||
{
|
||||
QString tabText = " | " + (replay ? tr("Replay") : tr("Game")) + " #" + QString::number(gameInfo.game_id());
|
||||
QString userCountInfo = QString(" %1/%2").arg(players.size()).arg(gameInfo.max_players());
|
||||
playerListDock->setWindowTitle(tr("Player List") + userCountInfo + (playerListDock->isWindow() ? tabText : QString()));
|
||||
}
|
||||
|
||||
void TabGame::retranslateUi()
|
||||
{
|
||||
QString tabText = " | " + (replay ? tr("Replay") : tr("Game")) + " #" + QString::number(gameInfo.game_id());
|
||||
|
||||
updatePlayerListDockTitle();
|
||||
cardInfoDock->setWindowTitle(tr("Card Info") + (cardInfoDock->isWindow() ? tabText : QString()));
|
||||
playerListDock->setWindowTitle(tr("Player List") + (playerListDock->isWindow() ? tabText : QString()));
|
||||
messageLayoutDock->setWindowTitle(tr("Messages") + (messageLayoutDock->isWindow() ? tabText : QString()));
|
||||
if(replayDock)
|
||||
replayDock->setWindowTitle(tr("Replay Timeline") + (replayDock->isWindow() ? tabText : QString()));
|
||||
|
|
|
@ -237,6 +237,7 @@ public:
|
|||
TabGame(TabSupervisor *_tabSupervisor, GameReplay *replay);
|
||||
~TabGame();
|
||||
void retranslateUi();
|
||||
void updatePlayerListDockTitle();
|
||||
void closeRequest();
|
||||
const QMap<int, Player *> &getPlayers() const { return players; }
|
||||
CardItem *getCard(int playerId, const QString &zoneName, int cardId) const;
|
||||
|
|
Loading…
Reference in a new issue