diff --git a/OpenRa.Game/Chrome.cs b/OpenRa.Game/Chrome.cs index e0f030c822..9c7e94472b 100644 --- a/OpenRa.Game/Chrome.cs +++ b/OpenRa.Game/Chrome.cs @@ -966,10 +966,10 @@ namespace OpenRa void StartProduction( World world, string item ) { - var queueInfo = world.LocalPlayer.PlayerActor.Info.Traits.Get(); + var eva = world.LocalPlayer.PlayerActor.Info.Traits.Get(); var unit = Rules.Info[item]; - Sound.Play(unit.Traits.Contains() ? queueInfo.BuildingSelectAudio : queueInfo.UnitSelectAudio); + Sound.Play(unit.Traits.Contains() ? eva.BuildingSelectAudio : eva.UnitSelectAudio); Game.IssueOrder(Order.StartProduction(world.LocalPlayer, item)); } @@ -978,10 +978,10 @@ namespace OpenRa var player = world.LocalPlayer; var unit = Rules.Info[item]; var queue = player.PlayerActor.traits.Get(); - var queueInfo = player.PlayerActor.Info.Traits.Get(); + var eva = player.PlayerActor.Info.Traits.Get(); var producing = queue.AllItems(unit.Category).FirstOrDefault( a => a.Item == item ); - Sound.Play(queueInfo.ClickAudio); + Sound.Play(eva.TabClick); if (isLmb) { @@ -1010,12 +1010,12 @@ namespace OpenRa // instant cancel of things we havent really started yet, and things that are finished if (producing.Paused || producing.Done || producing.TotalCost == producing.RemainingCost) { - Sound.Play(queueInfo.CancelledAudio); + Sound.Play(eva.CancelledAudio); Game.IssueOrder(Order.CancelProduction(player, item)); } else { - Sound.Play(queueInfo.OnHoldAudio); + Sound.Play(eva.OnHoldAudio); Game.IssueOrder(Order.PauseProduction(player, item, true)); } } diff --git a/OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs b/OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs index 44529520c9..acd1608140 100644 --- a/OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRa.Game/Orders/PlaceBuildingOrderGenerator.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * This file is part of OpenRA. @@ -52,8 +52,8 @@ namespace OpenRa.Orders if (!world.CanPlaceBuilding( Building, BuildingInfo, topLeft, null) || !world.IsCloseEnoughToBase(Producer.Owner, Building, BuildingInfo, topLeft)) { - var queueInfo = world.LocalPlayer.PlayerActor.Info.Traits.Get(); - Sound.Play(queueInfo.BuildingCannotPlaceAudio); + var eva = world.LocalPlayer.PlayerActor.Info.Traits.Get(); + Sound.Play(eva.BuildingCannotPlaceAudio); yield break; } diff --git a/OpenRa.Game/Traits/Player/EvaAlerts.cs b/OpenRa.Game/Traits/Player/EvaAlerts.cs new file mode 100644 index 0000000000..6c1975ac7d --- /dev/null +++ b/OpenRa.Game/Traits/Player/EvaAlerts.cs @@ -0,0 +1,63 @@ +#region Copyright & License Information +/* + * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. + * This file is part of OpenRA. + * + * OpenRA is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * OpenRA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with OpenRA. If not, see . + */ +#endregion + + +namespace OpenRa.Traits +{ + class EvaAlertsInfo : StatelessTraitInfo + { + // Sound effects + public readonly string TabClick = "ramenu1.aud"; + + public readonly string ChatBeep = "rabeep1.aud"; + public readonly string RadarUp = "radaron2.aud"; + public readonly string RadarDown = "radardn1.aud"; + + public readonly string CashTickUp = "cashup1.aud"; + public readonly string CashTickDown = "cashdn1.aud"; + + // Build Palette + public readonly string BuildPaletteOpen = "bleep13.aud"; + public readonly string BuildPaletteClose = "bleep13.aud"; + public readonly string BuildingSelectAudio = "abldgin1.aud"; + public readonly string BuildingReadyAudio = "conscmp1.aud"; + public readonly string BuildingCannotPlaceAudio = "nodeply1.aud"; + public readonly string UnitSelectAudio = "train1.aud"; + public readonly string UnitReadyAudio = "unitrdy1.aud"; + public readonly string OnHoldAudio = "onhold1.aud"; + public readonly string CancelledAudio = "cancld1.aud"; + public readonly string ClickAudio = "ramenu1.aud"; + + + // For manual powerup/down in ra-ng + public readonly string DisablePower = "bleep11.aud"; + public readonly string EnablePower = "bleep12.aud"; + + // Eva speech + public readonly string LowPower = "lopower1.aud"; + public readonly string SilosNeeded = "silond1.aud"; + public readonly string UnitLost = "unitlst1.aud"; + public readonly string NavalUnitLost = "navylst1.aud"; + public readonly string PrimaryBuildingSelected = "pribldg1.aud"; + public readonly string CreditsStolen = "credit1.aud"; + } + + class EvaAlerts {} +} diff --git a/OpenRa.Game/Traits/Player/ProductionQueue.cs b/OpenRa.Game/Traits/Player/ProductionQueue.cs index b111888fbd..070bea1c85 100644 --- a/OpenRa.Game/Traits/Player/ProductionQueue.cs +++ b/OpenRa.Game/Traits/Player/ProductionQueue.cs @@ -1,4 +1,4 @@ -#region Copyright & License Information +#region Copyright & License Information /* * Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford. * This file is part of OpenRA. @@ -27,15 +27,6 @@ namespace OpenRa.Traits { class ProductionQueueInfo : ITraitInfo { - public readonly string BuildingSelectAudio = "abldgin1.aud"; - public readonly string BuildingReadyAudio = "conscmp1.aud"; - public readonly string BuildingCannotPlaceAudio = "nodeply1.aud"; - public readonly string UnitSelectAudio = "train1.aud"; - public readonly string UnitReadyAudio = "unitrdy1.aud"; - public readonly string OnHoldAudio = "onhold1.aud"; - public readonly string CancelledAudio = "cancld1.aud"; - public readonly string ClickAudio = "ramenu1.aud"; - public object Create(Actor self) { return new ProductionQueue(self); } } @@ -83,7 +74,8 @@ namespace OpenRa.Traits var isBuilding = unit.Traits.Contains(); if( !hasPlayedSound ) { - Sound.PlayToPlayer( order.Player, isBuilding ? self.Info.Traits.Get().BuildingReadyAudio : self.Info.Traits.Get().UnitReadyAudio ); + var eva = self.Info.Traits.Get(); + Sound.PlayToPlayer( order.Player, isBuilding ? eva.BuildingReadyAudio : eva.UnitReadyAudio ); hasPlayedSound = true; } if( !isBuilding ) diff --git a/mods/cnc/system.yaml b/mods/cnc/system.yaml index fb092f8631..4126f89b58 100644 --- a/mods/cnc/system.yaml +++ b/mods/cnc/system.yaml @@ -1,5 +1,12 @@ Player: ProductionQueue: + EvaAlerts: + TabClick: button.aud + ChatBeep: beepy2.aud + RadarUp: comcntr1.aud + RadarDown: powrdn1.aud + BuildPaletteOpen: appear1.aud + BuildPaletteClose: appear1.aud BuildingSelectAudio: bldging1.aud BuildingReadyAudio: constru1.aud BuildingCannotPlaceAudio: deploy1.aud @@ -7,16 +14,8 @@ Player: UnitReadyAudio: unitredy.aud OnHoldAudio: onhold1.aud CancelledAudio: cancel1.aud - ClickAudio: button.aud - EvaAlerts: - TabClick: button.aud - ChatBeep: target1.aud - RadarUp: comcntr1.aud - RadarDown: powrdn1.aud - BuildPaletteOpen: appear1.aud - BuildPaletteClose: appear1.aud - CashTickUp: clock1.aud - CashTickDown: clock1.aud +# CashTickUp: clock1.aud +# CashTickDown: clock1.aud LowPower: lopower1.aud SilosNeeded: silos1.aud UnitLost: unitlost.aud