(1bd090dc7) Show the audio icon next to characters that are speaking in the single player crew menu

This commit is contained in:
Joonas Rikkonen
2019-04-23 15:38:06 +03:00
parent 544cc7ec08
commit 5f3e23f75f
6 changed files with 15 additions and 11 deletions
@@ -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
/// <summary>