From 3d42128d8c972d8f5521a7e7e68754f0b441789f Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Tue, 21 May 2024 21:52:11 +0300 Subject: [PATCH] AS Fixes. --- .../Traits/SupportPowers/AirstrikePowerRV.cs | 15 +++------------ .../Traits/SupportPowers/DetonateWeaponPower.cs | 2 +- .../Traits/SupportPowers/FireArmamentPower.cs | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/OpenRA.Mods.AS/Traits/SupportPowers/AirstrikePowerRV.cs b/OpenRA.Mods.AS/Traits/SupportPowers/AirstrikePowerRV.cs index f7778fdc659c..2bd231a5a76d 100644 --- a/OpenRA.Mods.AS/Traits/SupportPowers/AirstrikePowerRV.cs +++ b/OpenRA.Mods.AS/Traits/SupportPowers/AirstrikePowerRV.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.AS.Traits { - public class AirstrikePowerRVInfo : SupportPowerInfo + public class AirstrikePowerRVInfo : DirectionalSupportPowerInfo { [FieldLoader.Require] public readonly Dictionary UnitTypes = new(); @@ -44,22 +44,13 @@ public class AirstrikePowerRVInfo : SupportPowerInfo [Desc("Amount of time to keep the camera alive after the aircraft have finished attacking")] public readonly int CameraRemoveDelay = 25; - [Desc("Enables the player directional targeting")] - public readonly bool UseDirectionalTarget = false; - - [Desc("Animation used to render the direction arrows.")] - public readonly string DirectionArrowAnimation = null; - - [Desc("Palette for direction cursor animation.")] - public readonly string DirectionArrowPalette = "chrome"; - [Desc("Weapon range offset to apply during the beacon clock calculation")] public readonly WDist BeaconDistanceOffset = WDist.FromCells(6); public override object Create(ActorInitializer init) { return new AirstrikePowerRV(init.Self, this); } } - public class AirstrikePowerRV : SupportPower + public class AirstrikePowerRV : DirectionalSupportPower { readonly AirstrikePowerRVInfo info; @@ -77,7 +68,7 @@ public override void SelectTarget(Actor self, string order, SupportPowerManager Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.SelectTargetSpeechNotification, self.Owner.Faction.InternalName); - self.World.OrderGenerator = new SelectDirectionalTarget(self.World, order, manager, Info.Cursor, info.DirectionArrowAnimation, info.DirectionArrowPalette); + self.World.OrderGenerator = new SelectDirectionalTarget(self.World, order, manager, info); } else base.SelectTarget(self, order, manager); diff --git a/OpenRA.Mods.AS/Traits/SupportPowers/DetonateWeaponPower.cs b/OpenRA.Mods.AS/Traits/SupportPowers/DetonateWeaponPower.cs index 39bb8f890cda..6ea7c42c3c52 100644 --- a/OpenRA.Mods.AS/Traits/SupportPowers/DetonateWeaponPower.cs +++ b/OpenRA.Mods.AS/Traits/SupportPowers/DetonateWeaponPower.cs @@ -227,7 +227,7 @@ protected override IEnumerable RenderAnnotations(WorldRenderer wr, protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { - return world.Map.Contains(cell) ? power.Info.Cursor : "generic-blocked"; + return world.Map.Contains(cell) ? power.Info.Cursor : power.Info.BlockedCursor; } } } diff --git a/OpenRA.Mods.AS/Traits/SupportPowers/FireArmamentPower.cs b/OpenRA.Mods.AS/Traits/SupportPowers/FireArmamentPower.cs index f174e8496ee0..38a9ffa4827e 100644 --- a/OpenRA.Mods.AS/Traits/SupportPowers/FireArmamentPower.cs +++ b/OpenRA.Mods.AS/Traits/SupportPowers/FireArmamentPower.cs @@ -352,7 +352,7 @@ protected override IEnumerable RenderAnnotations(WorldRenderer wr, protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { - return IsValidTargetCell(cell) ? power.FireArmamentPowerInfo.Cursor : "generic-blocked"; + return IsValidTargetCell(cell) ? power.FireArmamentPowerInfo.Cursor : power.FireArmamentPowerInfo.BlockedCursor; } bool IsValidTargetCell(CPos xy)