diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs index cf7bebf10..62060b55d 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs @@ -654,6 +654,10 @@ namespace Barotrauma } if (string.IsNullOrEmpty(text)) { return; } + if (sender != null) + { + GameMain.GameSession.CrewManager.SetCharacterSpeaking(sender); + } ChatBox.AddMessage(ChatMessage.Create(senderName, text, messageType, sender)); } @@ -705,15 +709,19 @@ namespace Barotrauma soundIconDisabled.ToolTip = TextManager.Get(mutedLocally ? "MutedLocally" : "MutedGlobally"); } - public void SetPlayerSpeaking(Client client) + public void SetClientSpeaking(Client client) { - if (client?.Character == null) { return; } + if (client?.Character != null) { SetCharacterSpeaking(client.Character); } + } - var playerFrame = characterListBox.Content.FindChild(client.Character)?.FindChild(client.Character); + public void SetCharacterSpeaking(Character character) + { + var playerFrame = characterListBox.Content.FindChild(character)?.FindChild(character); if (playerFrame == null) { return; } var soundIcon = playerFrame.FindChild("soundicon"); soundIcon.Color = new Color(soundIcon.Color, 1.0f); } + #endregion /// diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs index bc973ba5e..e0e35f159 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs @@ -631,7 +631,7 @@ namespace Barotrauma.Networking } else { - GameMain.GameSession?.CrewManager?.SetPlayerSpeaking(myClient); + GameMain.GameSession?.CrewManager?.SetClientSpeaking(myClient); } } } diff --git a/Barotrauma/BarotraumaClient/Source/Networking/Voip/VoipClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/Voip/VoipClient.cs index b1da9bde6..1ad61e4cd 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/Voip/VoipClient.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/Voip/VoipClient.cs @@ -115,7 +115,7 @@ namespace Barotrauma.Networking } } GameMain.NetLobbyScreen.SetPlayerSpeaking(client); - GameMain.GameSession?.CrewManager?.SetPlayerSpeaking(client); + GameMain.GameSession?.CrewManager?.SetClientSpeaking(client); } } diff --git a/Barotrauma/BarotraumaClient/Source/Screens/CharacterEditorScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/CharacterEditorScreen.cs index 67aa1ec7b..0801b0b21 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/CharacterEditorScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/CharacterEditorScreen.cs @@ -132,9 +132,6 @@ namespace Barotrauma { GameMain.Instance.ShowEditorDisclaimer(); } - OpenDoors(); - GameMain.Instance.OnResolutionChanged += OnResolutionChanged; - instance = this; } private void ResetVariables() diff --git a/Barotrauma/BarotraumaClient/Source/Sounds/SoundPlayer.cs b/Barotrauma/BarotraumaClient/Source/Sounds/SoundPlayer.cs index 9753a9f4b..b40c8945d 100644 --- a/Barotrauma/BarotraumaClient/Source/Sounds/SoundPlayer.cs +++ b/Barotrauma/BarotraumaClient/Source/Sounds/SoundPlayer.cs @@ -279,7 +279,6 @@ namespace Barotrauma movementSoundVolume = 0.0f; } } - } if (waterAmbiences.Count > 1) { diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index 9032c5e8c..29a014669 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -2130,7 +2130,8 @@ namespace Barotrauma public void Speak(string message, ChatMessageType? messageType = null, float delay = 0.0f, string identifier = "", float minDurationBetweenSimilar = 0.0f) { - if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) return; + if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return; } + if (string.IsNullOrEmpty(message)) { return; } //already sent a similar message a moment ago if (!string.IsNullOrEmpty(identifier) && minDurationBetweenSimilar > 0.0f && @@ -2139,7 +2140,6 @@ namespace Barotrauma { return; } - aiChatMessageQueue.Add(new AIChatMessage(message, messageType, identifier, delay)); }