Signals/callbacks when spectators join or leave.

This commit is contained in:
lotodore
2013-08-19 22:50:56 +02:00
parent ffafa23efc
commit 1d0b9fc5f2
15 changed files with 176 additions and 11 deletions
+24
View File
@@ -373,6 +373,22 @@ void GuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &play
if (!playerName.empty() && playerName[0] != '#' && myW->isVisible())
myGuiLog->signalLogPlayerLeftMsg(tmpName, removeReason == NTF_NET_REMOVED_KICKED);
}
void GuiWrapper::SignalNetClientSpectatorJoined(unsigned playerId, const string &playerName)
{
myStartWindow->signalNetClientSpectatorJoined(playerId, QString::fromUtf8(playerName.c_str()));
if (!playerName.empty() && playerName[0] != '#' && myW->isVisible()) {
QString tmpName(QString::fromUtf8(playerName.c_str()));
myGuiLog->signalLogSpectatorJoinedMsg(tmpName);
}
}
void GuiWrapper::SignalNetClientSpectatorLeft(unsigned playerId, const string &playerName, int removeReason)
{
QString tmpName(QString::fromUtf8(playerName.c_str()));
myStartWindow->signalNetClientSpectatorLeft(playerId, tmpName);
myW->signalNetClientSpectatorLeft(playerId);
if (!playerName.empty() && playerName[0] != '#' && myW->isVisible())
myGuiLog->signalLogSpectatorLeftMsg(tmpName, removeReason == NTF_NET_REMOVED_KICKED);
}
void GuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName)
{
@@ -405,6 +421,14 @@ void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned pla
{
myStartWindow->signalNetClientGameListPlayerLeft(gameId, playerId);
}
void GuiWrapper::SignalNetClientGameListSpectatorJoined(unsigned gameId, unsigned playerId)
{
myStartWindow->signalNetClientGameListSpectatorJoined(gameId, playerId);
}
void GuiWrapper::SignalNetClientGameListSpectatorLeft(unsigned gameId, unsigned playerId)
{
myStartWindow->signalNetClientGameListSpectatorLeft(gameId, playerId);
}
void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game)
{
myStartWindow->signalNetClientGameStart(game);