Fix showing unread messages count on active lobby chat button

The lobby chat button text would change to include the unread messages count for a split second, even when the lobby chat was the current panel, leading to the button text sort of 'blinking' in an ugly way.
This commit is contained in:
Oliver Brakmann
2015-12-06 14:27:40 +01:00
parent 310f0cbea5
commit 16dd2a3323

View File

@@ -590,7 +590,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var globalChatLabel = globalChatTab.Text; var globalChatLabel = globalChatTab.Text;
globalChatTab.GetText = () => globalChatTab.GetText = () =>
{ {
if (globalChatUnreadMessages == 0) if (globalChatUnreadMessages == 0 || chatPanel == ChatPanelType.Global)
return globalChatLabel; return globalChatLabel;
return globalChatLabel + " ({0})".F(globalChatUnreadMessages); return globalChatLabel + " ({0})".F(globalChatUnreadMessages);
@@ -642,7 +642,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var lobbyChatLabel = lobbyChatTab.Text; var lobbyChatLabel = lobbyChatTab.Text;
lobbyChatTab.GetText = () => lobbyChatTab.GetText = () =>
{ {
if (lobbyChatUnreadMessages == 0) if (lobbyChatUnreadMessages == 0 || chatPanel == ChatPanelType.Lobby)
return lobbyChatLabel; return lobbyChatLabel;
return lobbyChatLabel + " ({0})".F(lobbyChatUnreadMessages); return lobbyChatLabel + " ({0})".F(lobbyChatUnreadMessages);