mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 07:40:30 -08:00
Display a system tray notification when a player joins your game (#4194)
* Display a system tray notification when a player joins your game * Display game ID in join message
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include "replay_timeline_widget.h"
|
||||
#include "settingscache.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "window_main.h"
|
||||
#include "zoneviewwidget.h"
|
||||
#include "zoneviewzone.h"
|
||||
|
||||
@@ -1192,6 +1193,11 @@ void TabGame::eventJoin(const Event_Join &event, int /*eventPlayerId*/, const Ga
|
||||
} else {
|
||||
Player *newPlayer = addPlayer(playerId, playerInfo.user_info());
|
||||
messageLog->logJoin(newPlayer);
|
||||
if (trayIcon) {
|
||||
QString gameId(QString::number(gameInfo.game_id()));
|
||||
trayIcon->showMessage(tr("A player has joined game #%1").arg(gameId),
|
||||
tr("%1 has joined the game").arg(newPlayer->getName()));
|
||||
}
|
||||
}
|
||||
playerListWidget->addPlayer(playerInfo);
|
||||
emitUserEvent();
|
||||
|
||||
Reference in New Issue
Block a user