Skip to content

Commit

Permalink
Let all lobby sounds be optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Dec 26, 2022
1 parent 2e84236 commit d07bb66
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
13 changes: 9 additions & 4 deletions OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs
Expand Up @@ -105,10 +105,10 @@ enum PanelType { Players, Options, Music, Servers, Kick, ForceStart }
bool updateDiscordStatus = true;
Dictionary<int, SpawnOccupant> spawnOccupants = new Dictionary<int, SpawnOccupant>();

readonly string chatLineSound = ChromeMetrics.Get<string>("ChatLineSound");
readonly string playerJoinedSound = ChromeMetrics.Get<string>("PlayerJoinedSound");
readonly string playerLeftSound = ChromeMetrics.Get<string>("PlayerLeftSound");
readonly string lobbyOptionChangedSound = ChromeMetrics.Get<string>("LobbyOptionChangedSound");
readonly string chatLineSound;
readonly string playerJoinedSound;
readonly string playerLeftSound;
readonly string lobbyOptionChangedSound;

bool MapIsPlayable => (mapStatus & Session.MapStatus.Playable) == Session.MapStatus.Playable;

Expand Down Expand Up @@ -169,6 +169,11 @@ void ConnectionStateChanged(OrderManager om, string password, NetworkConnection
Game.BeforeGameStart += OnGameStart;
Game.ConnectionStateChanged += ConnectionStateChanged;

ChromeMetrics.TryGet<string>("ChatLineSound", out chatLineSound);
ChromeMetrics.TryGet<string>("PlayerJoinedSound", out playerJoinedSound);
ChromeMetrics.TryGet<string>("PlayerLeftSound", out playerLeftSound);
ChromeMetrics.TryGet<string>("LobbyOptionChangedSound", out lobbyOptionChangedSound);

var name = lobby.GetOrNull<LabelWidget>("SERVER_NAME");
if (name != null)
name.GetText = () => orderManager.LobbyInfo.GlobalSettings.ServerName;
Expand Down
3 changes: 3 additions & 0 deletions mods/cnc/metrics.yaml
Expand Up @@ -4,3 +4,6 @@ Metrics:
ButtonDepth: 0
ButtonFont: Bold
TextfieldColorHighlight: 800000
PlayerJoinedSound: PlayerJoined
LobbyOptionChangedSound: LobbyOptionChanged
PlayerLeftSound: PlayerLeft
3 changes: 0 additions & 3 deletions mods/common/metrics.yaml
Expand Up @@ -46,10 +46,7 @@ Metrics:
NoticeWarningColor: FFA500
NoticeSuccessColor: 00FF00
NoticeErrorColor: FF0000
PlayerJoinedSound: PlayerJoined
ChatLineSound: ChatLine
LobbyOptionChangedSound: LobbyOptionChanged
PlayerLeftSound: PlayerLeft
ClickDisabledSound: ClickDisabledSound
ClickSound: ClickSound
NormalSelectionColor: FFFFFF
Expand Down
3 changes: 3 additions & 0 deletions mods/d2k/metrics.yaml
Expand Up @@ -6,3 +6,6 @@ Metrics:
FactionSuffix-mercenary: ordos
TextfieldColorHighlight: 7f4d29
SystemMessageLabel: Mentat
PlayerJoinedSound: PlayerJoined
LobbyOptionChangedSound: LobbyOptionChanged
PlayerLeftSound: PlayerLeft
3 changes: 3 additions & 0 deletions mods/ra/metrics.yaml
Expand Up @@ -14,3 +14,6 @@ Metrics:
IncompatibleProtectedGameColor: B22222
IncompatibleVersionColor: D3D3D3
TextfieldColorHighlight: 562020
PlayerJoinedSound: PlayerJoined
LobbyOptionChangedSound: LobbyOptionChanged
PlayerLeftSound: PlayerLeft

0 comments on commit d07bb66

Please sign in to comment.