add player numbers to in game (#2435)

This commit is contained in:
Zach H 2017-03-04 11:03:39 -05:00 committed by GitHub
parent 12539026c5
commit c850ae98d8
2 changed files with 10 additions and 1 deletions

View file

@ -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()));