1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Only play sound in lobby for global channels if lobby UI is active

This commit is contained in:
Ivan Savenko
2025-01-26 11:19:14 +00:00
parent a4052d0cf4
commit 029a5699c3

View File

@@ -171,7 +171,7 @@ void GlobalLobbyClient::receiveChatMessage(const JsonNode & json)
lobbyWindowPtr->onGameChatMessage(message.displayName, message.messageText, message.timeFormatted, channelType, channelName); lobbyWindowPtr->onGameChatMessage(message.displayName, message.messageText, message.timeFormatted, channelType, channelName);
lobbyWindowPtr->refreshChatText(); lobbyWindowPtr->refreshChatText();
if(channelType == "player" || lobbyWindowPtr->isChannelOpen(channelType, channelName)) if(channelType == "player" || (lobbyWindowPtr->isChannelOpen(channelType, channelName) && lobbyWindowPtr->isActive()))
CCS->soundh->playSound(AudioPath::builtin("CHAT")); CCS->soundh->playSound(AudioPath::builtin("CHAT"));
} }
} }