Add lobby sounds for leave, join and option change

This commit is contained in:
Matthias Mailänder
2023-06-14 19:10:52 +02:00
committed by Gustas
parent d217ab39c2
commit a1efb28f0b
8 changed files with 73 additions and 11 deletions

View File

@@ -20,6 +20,12 @@ namespace OpenRA.Network
{
public const int ChatMessageMaxLength = 2500;
[TranslationReference("player")]
const string Joined = "notification-joined";
[TranslationReference("player")]
const string Left = "notification-lobby-disconnected";
static Player FindPlayerByClient(this World world, Session.Client c)
{
return world.Players.FirstOrDefault(p => p.ClientIndex == c.Index && p.PlayerReference.Playable);
@@ -44,7 +50,12 @@ namespace OpenRA.Network
foreach (var node in yaml)
{
var localizedMessage = new LocalizedMessage(node.Value);
TextNotificationsManager.AddSystemLine(localizedMessage.TranslatedText);
if (localizedMessage.Key == Joined)
TextNotificationsManager.AddPlayerJoinedLine(localizedMessage.TranslatedText);
else if (localizedMessage.Key == Left)
TextNotificationsManager.AddPlayerLeftLine(localizedMessage.TranslatedText);
else
TextNotificationsManager.AddSystemLine(localizedMessage.TranslatedText);
}
break;