From 0e586651e783ab7e53ad9a0c062bee8498e33775 Mon Sep 17 00:00:00 2001 From: Alex Noir Date: Tue, 5 Dec 2017 18:50:36 +0300 Subject: [PATCH] Adds a [PM] tag Fixes .Private message type colors being silly --- .../BarotraumaClient/Source/Networking/NetworkMember.cs | 5 ++++- Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs | 2 +- Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs | 2 +- .../BarotraumaShared/Source/Networking/NetworkMember.cs | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Networking/NetworkMember.cs b/Barotrauma/BarotraumaClient/Source/Networking/NetworkMember.cs index 2048aad88..a97c14567 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/NetworkMember.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/NetworkMember.cs @@ -69,7 +69,10 @@ namespace Barotrauma.Networking textBox.TextColor = ChatMessage.MessageColor[(int)ChatMessageType.Dead]; break; default: - textBox.TextColor = ChatMessage.MessageColor[(int)ChatMessageType.Default]; + if (command != "") //PMing + textBox.TextColor = ChatMessage.MessageColor[(int)ChatMessageType.Private]; + else + textBox.TextColor = ChatMessage.MessageColor[(int)ChatMessageType.Default]; break; } diff --git a/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs index 9a92fb9ce..16d515bc2 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/NetLobbyScreen.cs @@ -1099,7 +1099,7 @@ namespace Barotrauma } GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width - 20, 0), - message.TextWithSender, + (message.Type == ChatMessageType.Private ? "[PM] " : "") + message.TextWithSender, ((chatBox.CountChildren % 2) == 0) ? Color.Transparent : Color.Black * 0.1f, message.Color, Alignment.Left, Alignment.TopLeft, "", null, true, GUI.SmallFont); msg.UserData = message; diff --git a/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs b/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs index b908e54c5..6b7a2333f 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/ChatMessage.cs @@ -25,7 +25,7 @@ namespace Barotrauma.Networking new Color(63, 72, 204), //dead new Color(157, 225, 160), //server new Color(238, 208, 0), //radio - new Color(228, 199, 27) //private + new Color(64, 240, 89) //private }; public readonly string Text; diff --git a/Barotrauma/BarotraumaShared/Source/Networking/NetworkMember.cs b/Barotrauma/BarotraumaShared/Source/Networking/NetworkMember.cs index 7a59f1f05..f033ea8d8 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/NetworkMember.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/NetworkMember.cs @@ -167,7 +167,7 @@ namespace Barotrauma.Networking if (!string.IsNullOrWhiteSpace(message.SenderName)) { - displayedText = message.SenderName + ": " + displayedText; + displayedText = (message.Type == ChatMessageType.Private ? "[PM] " : "" ) + message.SenderName + ": " + displayedText; } GUITextBlock msg = new GUITextBlock(new Rectangle(0, 0, chatBox.Rect.Width - 40, 0), displayedText,