Shift production audio onto ProductionQueue.
This commit is contained in:
@@ -20,15 +20,7 @@ namespace OpenRA.Traits
|
|||||||
public readonly string CashTickDown = "cashdn1.aud";
|
public readonly string CashTickDown = "cashdn1.aud";
|
||||||
|
|
||||||
// Build Palette
|
// Build Palette
|
||||||
public readonly string BuildingSelectAudio = "abldgin1.aud";
|
|
||||||
public readonly string BuildingReadyAudio = "conscmp1.aud";
|
|
||||||
public readonly string BuildingCannotPlaceAudio = "nodeply1.aud";
|
public readonly string BuildingCannotPlaceAudio = "nodeply1.aud";
|
||||||
public readonly string UnitSelectAudio = "train1.aud";
|
|
||||||
public readonly string UnitReadyAudio = "unitrdy1.aud";
|
|
||||||
public readonly string UnitReadyBlockedAudio = "nobuild1.aud";
|
|
||||||
|
|
||||||
public readonly string OnHoldAudio = "onhold1.aud";
|
|
||||||
public readonly string CancelledAudio = "cancld1.aud";
|
|
||||||
public readonly string NewOptions = "newopt1.aud";
|
public readonly string NewOptions = "newopt1.aud";
|
||||||
|
|
||||||
// For manual powerup/down in ra-ng
|
// For manual powerup/down in ra-ng
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ namespace OpenRA.Mods.RA
|
|||||||
public readonly string Type = null;
|
public readonly string Type = null;
|
||||||
public float BuildSpeed = 0.4f;
|
public float BuildSpeed = 0.4f;
|
||||||
public readonly int LowPowerSlowdown = 3;
|
public readonly int LowPowerSlowdown = 3;
|
||||||
|
|
||||||
|
public readonly string ReadyAudio = "unitrdy1.aud";
|
||||||
|
public readonly string BlockedAudio = "nobuild1.aud";
|
||||||
|
public readonly string QueuedAudio = "train1.aud";
|
||||||
|
public readonly string OnHoldAudio = "onhold1.aud";
|
||||||
|
public readonly string CancelledAudio = "cancld1.aud";
|
||||||
|
|
||||||
public virtual object Create(ActorInitializer init) { return new ProductionQueue(init.self, init.self.Owner.PlayerActor, this); }
|
public virtual object Create(ActorInitializer init) { return new ProductionQueue(init.self, init.self.Owner.PlayerActor, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,20 +160,19 @@ namespace OpenRA.Mods.RA
|
|||||||
_ =>
|
_ =>
|
||||||
{
|
{
|
||||||
var isBuilding = unit.Traits.Contains<BuildingInfo>();
|
var isBuilding = unit.Traits.Contains<BuildingInfo>();
|
||||||
var eva = self.World.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
|
|
||||||
|
|
||||||
if (isBuilding && !hasPlayedSound)
|
if (isBuilding && !hasPlayedSound)
|
||||||
{
|
{
|
||||||
Sound.PlayToPlayer(order.Player, eva.BuildingReadyAudio);
|
Sound.PlayToPlayer(order.Player, Info.ReadyAudio);
|
||||||
hasPlayedSound = true;
|
hasPlayedSound = true;
|
||||||
}
|
}
|
||||||
else if (!isBuilding)
|
else if (!isBuilding)
|
||||||
{
|
{
|
||||||
if (BuildUnit(order.TargetString))
|
if (BuildUnit(order.TargetString))
|
||||||
Sound.PlayToPlayer(order.Player, eva.UnitReadyAudio);
|
Sound.PlayToPlayer(order.Player, Info.ReadyAudio);
|
||||||
else if (!hasPlayedSound && time > 0)
|
else if (!hasPlayedSound && time > 0)
|
||||||
{
|
{
|
||||||
Sound.PlayToPlayer(order.Player, eva.UnitReadyBlockedAudio);
|
Sound.PlayToPlayer(order.Player, Info.BlockedAudio);
|
||||||
hasPlayedSound = true;
|
hasPlayedSound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,7 +333,6 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
void HandleBuildPalette( World world, string item, bool isLmb )
|
void HandleBuildPalette( World world, string item, bool isLmb )
|
||||||
{
|
{
|
||||||
var unit = Rules.Info[item];
|
var unit = Rules.Info[item];
|
||||||
var eva = world.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
|
|
||||||
var producing = CurrentQueue.AllQueued().FirstOrDefault( a => a.Item == item );
|
var producing = CurrentQueue.AllQueued().FirstOrDefault( a => a.Item == item );
|
||||||
|
|
||||||
if (isLmb)
|
if (isLmb)
|
||||||
@@ -365,7 +364,7 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
// instant cancel of things we havent really started yet, and things that are finished
|
// instant cancel of things we havent really started yet, and things that are finished
|
||||||
if (producing.Paused || producing.Done || producing.TotalCost == producing.RemainingCost)
|
if (producing.Paused || producing.Done || producing.TotalCost == producing.RemainingCost)
|
||||||
{
|
{
|
||||||
Sound.Play(eva.CancelledAudio);
|
Sound.Play(CurrentQueue.Info.CancelledAudio);
|
||||||
int numberToCancel = Game.GetModifierKeys().HasModifier(Modifiers.Shift) ? 5 : 1;
|
int numberToCancel = Game.GetModifierKeys().HasModifier(Modifiers.Shift) ? 5 : 1;
|
||||||
if (Game.GetModifierKeys().HasModifier(Modifiers.Shift) &&
|
if (Game.GetModifierKeys().HasModifier(Modifiers.Shift) &&
|
||||||
Game.GetModifierKeys().HasModifier(Modifiers.Ctrl))
|
Game.GetModifierKeys().HasModifier(Modifiers.Ctrl))
|
||||||
@@ -376,7 +375,7 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Sound.Play(eva.OnHoldAudio);
|
Sound.Play(CurrentQueue.Info.OnHoldAudio);
|
||||||
world.IssueOrder(Order.PauseProduction(CurrentQueue.self, item, true));
|
world.IssueOrder(Order.PauseProduction(CurrentQueue.self, item, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -385,11 +384,7 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
|
|
||||||
void StartProduction( World world, string item )
|
void StartProduction( World world, string item )
|
||||||
{
|
{
|
||||||
var eva = world.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
|
Sound.Play(CurrentQueue.Info.QueuedAudio);
|
||||||
var unit = Rules.Info[item];
|
|
||||||
|
|
||||||
Sound.Play(unit.Traits.Contains<BuildingInfo>() ? eva.BuildingSelectAudio : eva.UnitSelectAudio);
|
|
||||||
|
|
||||||
world.IssueOrder(Order.StartProduction(CurrentQueue.self, item,
|
world.IssueOrder(Order.StartProduction(CurrentQueue.self, item,
|
||||||
Game.GetModifierKeys().HasModifier(Modifiers.Shift) ? 5 : 1));
|
Game.GetModifierKeys().HasModifier(Modifiers.Shift) ? 5 : 1));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,10 +28,18 @@ FACT:
|
|||||||
Type: Building
|
Type: Building
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: constru1.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
ProductionQueue@Defense:
|
ProductionQueue@Defense:
|
||||||
Type: Defense
|
Type: Defense
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: constru1.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
BaseBuilding:
|
BaseBuilding:
|
||||||
|
|
||||||
NUKE:
|
NUKE:
|
||||||
@@ -158,7 +166,10 @@ PYLE:
|
|||||||
Type: Infantry
|
Type: Infantry
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: unitredy.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
HAND:
|
HAND:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Valued:
|
Valued:
|
||||||
@@ -188,10 +199,14 @@ HAND:
|
|||||||
ExitCell: 1,2
|
ExitCell: 1,2
|
||||||
Production:
|
Production:
|
||||||
Produces: Infantry
|
Produces: Infantry
|
||||||
ProductionQueue@Infantry:
|
ProductionQueue:
|
||||||
Type: Infantry
|
Type: Infantry
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: unitredy.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
|
|
||||||
AFLD:
|
AFLD:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
@@ -226,10 +241,14 @@ AFLD:
|
|||||||
ExitCell: 3,1
|
ExitCell: 3,1
|
||||||
ProductionAirdrop:
|
ProductionAirdrop:
|
||||||
Produces: Vehicle
|
Produces: Vehicle
|
||||||
ProductionQueue@Vehicle:
|
ProductionQueue:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: unitredy.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
|
|
||||||
WEAP:
|
WEAP:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
@@ -265,10 +284,14 @@ WEAP:
|
|||||||
ExitCell: 0,2
|
ExitCell: 0,2
|
||||||
Production:
|
Production:
|
||||||
Produces: Vehicle
|
Produces: Vehicle
|
||||||
ProductionQueue@Vehicle:
|
ProductionQueue:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: unitredy.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
|
|
||||||
HQ:
|
HQ:
|
||||||
RequiresPower:
|
RequiresPower:
|
||||||
@@ -387,11 +410,15 @@ HPAD:
|
|||||||
Reservable:
|
Reservable:
|
||||||
RepairsUnits:
|
RepairsUnits:
|
||||||
RallyPoint:
|
RallyPoint:
|
||||||
ProductionQueue@Plane:
|
ProductionQueue:
|
||||||
Type: Plane
|
Type: Plane
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: bldging1.aud
|
||||||
|
ReadyAudio: unitredy.aud
|
||||||
|
OnHoldAudio: onhold1.aud
|
||||||
|
CancelledAudio: cancel1.aud
|
||||||
|
|
||||||
EYE:
|
EYE:
|
||||||
RequiresPower:
|
RequiresPower:
|
||||||
CanPowerDown:
|
CanPowerDown:
|
||||||
|
|||||||
@@ -131,13 +131,7 @@ World:
|
|||||||
EvaAlerts:
|
EvaAlerts:
|
||||||
RadarUp: comcntr1.aud
|
RadarUp: comcntr1.aud
|
||||||
RadarDown: powrdn1.aud
|
RadarDown: powrdn1.aud
|
||||||
BuildingSelectAudio: bldging1.aud
|
|
||||||
BuildingReadyAudio: constru1.aud
|
|
||||||
BuildingCannotPlaceAudio: deploy1.aud
|
BuildingCannotPlaceAudio: deploy1.aud
|
||||||
UnitSelectAudio: bldging1.aud
|
|
||||||
UnitReadyAudio: unitredy.aud
|
|
||||||
OnHoldAudio: onhold1.aud
|
|
||||||
CancelledAudio: cancel1.aud
|
|
||||||
CashTickUp:
|
CashTickUp:
|
||||||
CashTickDown:
|
CashTickDown:
|
||||||
LowPower: lopower1.aud
|
LowPower: lopower1.aud
|
||||||
|
|||||||
@@ -4,10 +4,14 @@ Player:
|
|||||||
Type: Building
|
Type: Building
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: abldgin1.aud
|
||||||
|
ReadyAudio: conscmp1.aud
|
||||||
ClassicProductionQueue@Defense:
|
ClassicProductionQueue@Defense:
|
||||||
Type: Defense
|
Type: Defense
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
QueuedAudio: abldgin1.aud
|
||||||
|
ReadyAudio: conscmp1.aud
|
||||||
ClassicProductionQueue@Vehicle:
|
ClassicProductionQueue@Vehicle:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
|
|||||||
Reference in New Issue
Block a user