diff --git a/OpenRA.Mods.Common/Effects/Beacon.cs b/OpenRA.Mods.Common/Effects/Beacon.cs index 4f1de0ac5c..172a9e0567 100644 --- a/OpenRA.Mods.Common/Effects/Beacon.cs +++ b/OpenRA.Mods.Common/Effects/Beacon.cs @@ -17,7 +17,7 @@ using OpenRA.Scripting; namespace OpenRA.Mods.Common.Effects { - public class Beacon : IEffect, IScriptBindable + public class Beacon : IEffect, IScriptBindable, IEffectAboveShroud { static readonly int MaxArrowHeight = 512; @@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Effects } } - public void Tick(World world) + void IEffect.Tick(World world) { arrowHeight += arrowSpeed; var clamped = arrowHeight.Clamp(0, MaxArrowHeight); @@ -98,7 +98,9 @@ namespace OpenRA.Mods.Common.Effects clock.Tick(); } - public IEnumerable Render(WorldRenderer r) + IEnumerable IEffect.Render(WorldRenderer r) { return SpriteRenderable.None; } + + IEnumerable IEffectAboveShroud.RenderAboveShroud(WorldRenderer r) { if (!owner.IsAlliedWith(owner.World.RenderPlayer)) yield break; diff --git a/OpenRA.Mods.Common/Orders/BeaconOrderGenerator.cs b/OpenRA.Mods.Common/Orders/BeaconOrderGenerator.cs index 25327124a5..95eb41ab8e 100644 --- a/OpenRA.Mods.Common/Orders/BeaconOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/BeaconOrderGenerator.cs @@ -18,13 +18,8 @@ namespace OpenRA.Mods.Common.Orders { public IEnumerable Order(World world, CPos cell, int2 worldPixel, MouseInput mi) { - if (mi.Button != MouseButton.Left) - world.CancelInputMode(); - else if (!world.ShroudObscures(cell)) - { - world.CancelInputMode(); - yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = cell, SuppressVisualFeedback = true }; - } + world.CancelInputMode(); + yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = cell, SuppressVisualFeedback = true }; } public virtual void Tick(World world) { } @@ -32,7 +27,7 @@ namespace OpenRA.Mods.Common.Orders public IEnumerable RenderAfterWorld(WorldRenderer wr, World world) { yield break; } public string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { - return !world.ShroudObscures(cell) ? "ability" : "generic-blocked"; + return "ability"; } } } diff --git a/OpenRA.Mods.TS/Effects/AnimatedBeacon.cs b/OpenRA.Mods.TS/Effects/AnimatedBeacon.cs index de5099f904..58b61097ad 100644 --- a/OpenRA.Mods.TS/Effects/AnimatedBeacon.cs +++ b/OpenRA.Mods.TS/Effects/AnimatedBeacon.cs @@ -18,7 +18,7 @@ using OpenRA.Scripting; namespace OpenRA.Mods.TS.Effects { - public class AnimatedBeacon : IEffect + public class AnimatedBeacon : IEffect, IEffectAboveShroud { readonly Player owner; readonly WPos position; @@ -43,19 +43,21 @@ namespace OpenRA.Mods.TS.Effects owner.World.Add(new DelayedAction(duration, () => owner.World.Remove(this))); } - public void Tick(World world) + void IEffect.Tick(World world) { if (beacon != null) beacon.Tick(); } - public IEnumerable Render(WorldRenderer r) + IEnumerable IEffect.Render(WorldRenderer r) { return SpriteRenderable.None; } + + IEnumerable IEffectAboveShroud.RenderAboveShroud(WorldRenderer r) { if (beacon == null) - return Enumerable.Empty(); + return SpriteRenderable.None; if (!owner.IsAlliedWith(owner.World.RenderPlayer)) - return Enumerable.Empty(); + return SpriteRenderable.None; var palette = r.Palette(isPlayerPalette ? beaconPalette + owner.InternalName : beaconPalette); return beacon.Render(position, palette);