some minor refactor and comments improvement

This commit is contained in:
Md. Touhidur Rahman 2025-09-12 01:13:24 +06:00
parent a822fda6ac
commit 1433ba1a8d
No known key found for this signature in database
GPG Key ID: 431978882FE25058

View File

@ -90,7 +90,7 @@ object ChatStore {
return@postRunnable
}
val chat = (chatPopup?.chat ?: getChatByGameId(gameId))
val chat = chatPopup?.chat ?: getChatByGameId(gameId)
chat.addMessage(incomingChatMsg.civName, incomingChatMsg.message)
if (gameId.equals(chatPopup?.chat?.gameId)) {
chatPopup?.addMessage(incomingChatMsg.civName, incomingChatMsg.message)
@ -98,6 +98,7 @@ object ChatStore {
if (chatPopup == null && incomingChatMsg.civName != "System") {
if (gameId.equals(UncivGame.Current.worldScreen?.gameInfo?.gameId?.toUUIDOrNull())) {
// ensures that you are not getting notified for your own messages
if (UncivGame.Current.worldScreen?.gameInfo?.currentPlayer != incomingChatMsg.civName) {
UncivGame.Current.worldScreen?.chatButton?.chat?.read = false
UncivGame.Current.worldScreen?.chatButton?.startFlashing()
@ -127,12 +128,8 @@ object ChatStore {
if (hasGlobalMessage) UncivGame.Current.worldScreen?.chatButton?.startFlashing()
}
chatPopup?.addMessage(civName, message, suffix = "one time") ?: globalMessages.add(
Pair(
civName,
message
)
)
chatPopup?.addMessage(civName, message, suffix = "one time")
?: globalMessages.add(Pair(civName, message))
}
}
}