diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerResources.cs b/OpenRA.Mods.Common/Traits/Player/PlayerResources.cs index 5f288e500e..f336354937 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerResources.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerResources.cs @@ -47,6 +47,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Delay (in ticks) during which warnings will be muted.")] public readonly int InsufficientFundsNotificationDelay = 750; + public readonly string CashTickUpNotification = null; + public readonly string CashTickDownNotification = null; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { var startingCash = SelectableCash.ToDictionary(c => c.ToString(), c => "$" + c.ToString()); @@ -61,12 +64,12 @@ namespace OpenRA.Mods.Common.Traits public class PlayerResources : ITick, ISync { - readonly PlayerResourcesInfo info; + public readonly PlayerResourcesInfo Info; readonly Player owner; public PlayerResources(Actor self, PlayerResourcesInfo info) { - this.info = info; + Info = info; owner = self.Owner; var startingCash = self.World.LobbyInfo.GlobalSettings @@ -164,11 +167,11 @@ namespace OpenRA.Mods.Common.Traits { if (Cash + Resources < num) { - if (notifyLowFunds && !string.IsNullOrEmpty(info.InsufficientFundsNotification) && - owner.World.WorldTick - lastNotificationTick >= info.InsufficientFundsNotificationDelay) + if (notifyLowFunds && !string.IsNullOrEmpty(Info.InsufficientFundsNotification) && + owner.World.WorldTick - lastNotificationTick >= Info.InsufficientFundsNotificationDelay) { lastNotificationTick = owner.World.WorldTick; - Game.Sound.PlayNotification(owner.World.Map.Rules, owner, "Speech", info.InsufficientFundsNotification, owner.Faction.InternalName); + Game.Sound.PlayNotification(owner.World.Map.Rules, owner, "Speech", Info.InsufficientFundsNotification, owner.Faction.InternalName); } return false; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs index 906492efae..ba9c4ee07c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic displayResources += move; if (Game.Settings.Sound.CashTicks) - Game.Sound.PlayNotification(world.Map.Rules, player, "Sounds", "CashTickUp", player.Faction.InternalName); + Game.Sound.PlayNotification(world.Map.Rules, player, "Sounds", playerResources.Info.CashTickUpNotification, player.Faction.InternalName); } else if (displayResources > actual) { @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (Game.Settings.Sound.CashTicks && nextCashTickTime == 0) { - Game.Sound.PlayNotification(world.Map.Rules, player, "Sounds", "CashTickDown", player.Faction.InternalName); + Game.Sound.PlayNotification(world.Map.Rules, player, "Sounds", playerResources.Info.CashTickDownNotification, player.Faction.InternalName); nextCashTickTime = 2; } } diff --git a/mods/cnc/rules/player.yaml b/mods/cnc/rules/player.yaml index 8a71fae8cd..ea873b5dd0 100644 --- a/mods/cnc/rules/player.yaml +++ b/mods/cnc/rules/player.yaml @@ -16,6 +16,8 @@ Player: PowerManager: AllyRepair: PlayerResources: + CashTickUpNotification: CashTickUp + CashTickDownNotification: CashTickDown DeveloperMode: CheckboxDisplayOrder: 8 BaseAttackNotifier: diff --git a/mods/d2k/rules/player.yaml b/mods/d2k/rules/player.yaml index 749cde1409..81a0dfc689 100644 --- a/mods/d2k/rules/player.yaml +++ b/mods/d2k/rules/player.yaml @@ -68,6 +68,8 @@ Player: PlayerResources: SelectableCash: 2500, 5000, 7000, 10000, 20000 InsufficientFundsNotification: InsufficientFunds + CashTickUpNotification: CashTickUp + CashTickDownNotification: CashTickDown DeveloperMode: CheckboxDisplayOrder: 7 BaseAttackNotifier: diff --git a/mods/ra/rules/player.yaml b/mods/ra/rules/player.yaml index 7d2cbf66ec..3491858641 100644 --- a/mods/ra/rules/player.yaml +++ b/mods/ra/rules/player.yaml @@ -55,6 +55,8 @@ Player: AllyRepair: PlayerResources: InsufficientFundsNotification: InsufficientFunds + CashTickUpNotification: CashTickUp + CashTickDownNotification: CashTickDown DeveloperMode: CheckboxDisplayOrder: 9 GpsWatcher: diff --git a/mods/ts/rules/player.yaml b/mods/ts/rules/player.yaml index 09445b70d4..9e4b61e2c1 100644 --- a/mods/ts/rules/player.yaml +++ b/mods/ts/rules/player.yaml @@ -59,6 +59,8 @@ Player: AllyRepair: PlayerResources: InsufficientFundsNotification: InsufficientFunds + CashTickUpNotification: CashTickUp + CashTickDownNotification: CashTickDown DeveloperMode: CheckboxEnabled: true CheckboxDisplayOrder: 8