diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index fcfe5d1530..a6c4340c15 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -48,9 +48,6 @@ namespace OpenRA public int Generation; - public Rectangle RenderBounds { get; private set; } - public Rectangle SelectableBounds { get; private set; } - public Rectangle SelectionOverlayBounds { get; private set; } public IEffectiveOwner EffectiveOwner { get; private set; } public IOccupySpace OccupiesSpace { get; private set; } public ITargetable[] Targetables { get; private set; } @@ -113,14 +110,6 @@ namespace OpenRA // PERF: Cache all these traits as soon as the actor is created. This is a fairly cheap one-off cost per // actor that allows us to provide some fast implementations of commonly used methods that are relied on by // performance-sensitive parts of the core game engine, such as pathfinding, visibility and rendering. - - // RenderBounds are used for ScreenMap binning - // SelectableBounds define the selectable area of the actor - // SelectionOverlayBounds are used to draw the selection box and determine offsets for other selection overlays - RenderBounds = DetermineRenderBounds(); - SelectableBounds = DetermineSelectableBounds(); - SelectionOverlayBounds = DetermineSelectionOverlayBounds(); - EffectiveOwner = TraitOrDefault(); facing = TraitOrDefault(); health = TraitOrDefault(); @@ -135,44 +124,6 @@ namespace OpenRA SyncHashes = TraitsImplementing().Select(sync => new SyncHash(sync)).ToArray(); } - Rectangle DetermineRenderBounds() - { - var size = TraitsImplementing().Select(x => x.RenderSize(this)).FirstOrDefault(Exts.IsTraitEnabled); - var offset = -size / 2; - - return new Rectangle(offset.X, offset.Y, size.X, size.Y); - } - - Rectangle DetermineSelectableBounds() - { - var si = Info.TraitInfoOrDefault(); - if (si == null || si.Bounds == null) - return RenderBounds; - - var size = new int2(si.Bounds[0], si.Bounds[1]); - - var offset = -size / 2; - if (si.Bounds.Length > 2) - offset += new int2(si.Bounds[2], si.Bounds[3]); - - return new Rectangle(offset.X, offset.Y, size.X, size.Y); - } - - Rectangle DetermineSelectionOverlayBounds() - { - var sd = Info.TraitInfoOrDefault(); - if (sd == null || sd.SelectionBoxBounds == null) - return SelectableBounds; - - var size = new int2(sd.SelectionBoxBounds[0], sd.SelectionBoxBounds[1]); - - var offset = -size / 2; - if (sd.SelectionBoxBounds.Length > 2) - offset += new int2(sd.SelectionBoxBounds[2], sd.SelectionBoxBounds[3]); - - return new Rectangle(offset.X, offset.Y, size.X, size.Y); - } - public void Tick() { var wasIdle = IsIdle; diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index 125d4a5b74..ecb68cdcd6 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -263,6 +263,7 @@ + diff --git a/OpenRA.Game/Traits/Interactable.cs b/OpenRA.Game/Traits/Interactable.cs new file mode 100644 index 0000000000..6a796e1fa8 --- /dev/null +++ b/OpenRA.Game/Traits/Interactable.cs @@ -0,0 +1,80 @@ +#region Copyright & License Information +/* + * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you 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. For more + * information, see COPYING. + */ +#endregion + +using System.Drawing; +using System.Linq; +using OpenRA.Graphics; +using OpenRA.Traits; + +namespace OpenRA.Traits +{ + [Desc("Used to enable mouse interaction on actors that are not Selectable.")] + public class InteractableInfo : ITraitInfo, IMouseBoundsInfo, IDecorationBoundsInfo + { + [Desc("Defines a custom rectangle for mouse interaction with the actor.", + "If null, the engine will guess an appropriate size based on the With*Body trait.", + "The first two numbers define the width and height of the rectangle.", + "The (optional) second two numbers define an x and y offset from the actor center.")] + public readonly int[] Bounds = null; + + [Desc("Defines a custom rectangle for Decorations (e.g. the selection box).", + "If null, Bounds will be used instead")] + public readonly int[] DecorationBounds = null; + + public virtual object Create(ActorInitializer init) { return new Interactable(this); } + } + + public class Interactable : INotifyCreated, IMouseBounds, IDecorationBounds + { + readonly InteractableInfo info; + IAutoMouseBounds[] autoBounds; + + public Interactable(InteractableInfo info) + { + this.info = info; + } + + void INotifyCreated.Created(Actor self) + { + autoBounds = self.TraitsImplementing().ToArray(); + } + + Rectangle AutoBounds(Actor self, WorldRenderer wr) + { + return autoBounds.Select(s => s.AutoMouseoverBounds(self, wr)).FirstOrDefault(r => !r.IsEmpty); + } + + Rectangle Bounds(Actor self, WorldRenderer wr, int[] bounds) + { + if (bounds == null) + return AutoBounds(self, wr); + + var size = new int2(bounds[0], bounds[1]); + + var offset = -size / 2; + if (bounds.Length > 2) + offset += new int2(bounds[2], bounds[3]); + + var xy = wr.ScreenPxPosition(self.CenterPosition) + offset; + return new Rectangle(xy.X, xy.Y, size.X, size.Y); + } + + Rectangle IMouseBounds.MouseoverBounds(Actor self, WorldRenderer wr) + { + return Bounds(self, wr, info.Bounds); + } + + Rectangle IDecorationBounds.DecorationBounds(Actor self, WorldRenderer wr) + { + return Bounds(self, wr, info.DecorationBounds ?? info.Bounds); + } + } +} diff --git a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs index 8fbb7673cc..6cb60eb580 100644 --- a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs +++ b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs @@ -31,7 +31,6 @@ namespace OpenRA.Traits { public readonly PPos[] Footprint; public readonly WPos CenterPosition; - public readonly Rectangle SelectableBounds; public readonly HashSet TargetTypes; readonly Actor actor; readonly Shroud shroud; @@ -83,7 +82,6 @@ namespace OpenRA.Traits footprint.Select(p => shroud.Contains(p).ToString()).JoinWith("|"))); CenterPosition = self.CenterPosition; - SelectableBounds = self.SelectableBounds; TargetTypes = self.GetEnabledTargetTypes().ToHashSet(); tooltips = self.TraitsImplementing().ToArray(); diff --git a/OpenRA.Game/Traits/Selectable.cs b/OpenRA.Game/Traits/Selectable.cs index 8cf9d90368..e1e0468079 100644 --- a/OpenRA.Game/Traits/Selectable.cs +++ b/OpenRA.Game/Traits/Selectable.cs @@ -16,65 +16,29 @@ using OpenRA.Graphics; namespace OpenRA.Traits { [Desc("This actor is selectable. Defines bounds of selectable area, selection class and selection priority.")] - public class SelectableInfo : ITraitInfo, IDecorationBoundsInfo + public class SelectableInfo : InteractableInfo { public readonly int Priority = 10; - [Desc("Bounds for the selectable area.")] - public readonly int[] Bounds = null; - - [Desc("Area outside the visible selection box that is enabled for selection")] - public readonly int Margin = 0; - [Desc("All units having the same selection class specified will be selected with select-by-type commands (e.g. double-click). " + "Defaults to the actor name when not defined or inherited.")] public readonly string Class = null; [VoiceReference] public readonly string Voice = "Select"; - public object Create(ActorInitializer init) { return new Selectable(init.Self, this); } + public override object Create(ActorInitializer init) { return new Selectable(init.Self, this); } } - public class Selectable : IMouseBounds, IDecorationBounds + public class Selectable : Interactable { public readonly string Class = null; - - public SelectableInfo Info; + public readonly SelectableInfo Info; public Selectable(Actor self, SelectableInfo info) + : base(info) { Class = string.IsNullOrEmpty(info.Class) ? self.Info.Name : info.Class; Info = info; } - - Rectangle IMouseBounds.MouseoverBounds(Actor self, WorldRenderer wr) - { - if (Info.Bounds == null) - return Rectangle.Empty; - - var size = new int2(Info.Bounds[0], Info.Bounds[1]); - - var offset = -size / 2 - new int2(Info.Margin, Info.Margin); - if (Info.Bounds.Length > 2) - offset += new int2(Info.Bounds[2], Info.Bounds[3]); - - var xy = wr.ScreenPxPosition(self.CenterPosition) + offset; - return new Rectangle(xy.X, xy.Y, size.X + 2 * Info.Margin, size.Y + 2 * Info.Margin); - } - - Rectangle IDecorationBounds.DecorationBounds(Actor self, WorldRenderer wr) - { - if (Info.Bounds == null) - return Rectangle.Empty; - - var size = new int2(Info.Bounds[0], Info.Bounds[1]); - - var offset = -size / 2; - if (Info.Bounds.Length > 2) - offset += new int2(Info.Bounds[2], Info.Bounds[3]); - - var xy = wr.ScreenPxPosition(self.CenterPosition) + offset; - return new Rectangle(xy.X, xy.Y, size.X, size.Y); - } } } diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index da60974d4a..aa56c7e91f 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -102,20 +102,15 @@ namespace OpenRA.Traits IEnumerable ScreenBounds(Actor self, WorldRenderer wr); } - public interface IAutoSelectionSizeInfo : ITraitInfoInterface { } - public interface IAutoSelectionSize { int2 SelectionSize(Actor self); } - // TODO: Replace Rectangle with an int2[] polygon public interface IMouseBounds { Rectangle MouseoverBounds(Actor self, WorldRenderer wr); } + public interface IMouseBoundsInfo : ITraitInfoInterface { } public interface IAutoMouseBounds { Rectangle AutoMouseoverBounds(Actor self, WorldRenderer wr); } // HACK: This provides a shim for legacy code until it can be rewritten public interface IDecorationBounds { Rectangle DecorationBounds(Actor self, WorldRenderer wr); } public interface IDecorationBoundsInfo : ITraitInfoInterface { } - public interface IAutoRenderSizeInfo : ITraitInfoInterface { } - public interface IAutoRenderSize { int2 RenderSize(Actor self); } - public interface IIssueOrder { IEnumerable Orders { get; } @@ -159,11 +154,6 @@ namespace OpenRA.Traits public interface INotifyOwnerChanged { void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner); } public interface INotifyEffectiveOwnerChanged { void OnEffectiveOwnerChanged(Actor self, Player oldEffectiveOwner, Player newEffectiveOwner); } - public interface ISelectionDecorationsInfo : ITraitInfoInterface - { - int[] SelectionBoxBounds { get; } - } - public interface IVoiced { string VoiceSet { get; } diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithVoxelUnloadBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithVoxelUnloadBody.cs index 9ce1ad7f69..7ff0f027af 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithVoxelUnloadBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithVoxelUnloadBody.cs @@ -22,7 +22,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits.Render { // TODO: This trait is hacky and should go away as soon as we support granting a condition on docking, in favor of toggling two regular WithVoxelBodies - public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires, IAutoSelectionSizeInfo, IAutoRenderSizeInfo + public class WithVoxelUnloadBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires { [Desc("Voxel sequence name to use when docked to a refinery.")] public readonly string UnloadSequence = "unload"; @@ -46,11 +46,10 @@ namespace OpenRA.Mods.Cnc.Traits.Render } } - public class WithVoxelUnloadBody : IAutoSelectionSize, IAutoRenderSize, IAutoMouseBounds + public class WithVoxelUnloadBody : IAutoMouseBounds { public bool Docked; - readonly int2 size; readonly ModelAnimation modelAnimation; readonly RenderVoxels rv; @@ -67,11 +66,6 @@ namespace OpenRA.Mods.Cnc.Traits.Render rv.Add(modelAnimation); - // Selection size - var rvi = self.Info.TraitInfo(); - var s = (int)(rvi.Scale * idleModel.Size.Aggregate(Math.Max)); - size = new int2(s, s); - var unloadModel = self.World.ModelCache.GetModelSequence(rv.Image, info.UnloadSequence); rv.Add(new ModelAnimation(unloadModel, () => WVec.Zero, () => new[] { body.QuantizeOrientation(self, self.Orientation) }, @@ -79,9 +73,6 @@ namespace OpenRA.Mods.Cnc.Traits.Render () => 0, info.ShowShadow)); } - int2 IAutoSelectionSize.SelectionSize(Actor self) { return size; } - int2 IAutoRenderSize.RenderSize(Actor self) { return size; } - Rectangle IAutoMouseBounds.AutoMouseoverBounds(Actor self, WorldRenderer wr) { return modelAnimation.ScreenBounds(self.CenterPosition, wr, rv.Info.Scale); diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithVoxelWalkerBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithVoxelWalkerBody.cs index 26ccbc381c..a41e4e8624 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithVoxelWalkerBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithVoxelWalkerBody.cs @@ -23,8 +23,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits.Render { - public class WithVoxelWalkerBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires, Requires, Requires, - IAutoSelectionSizeInfo, IAutoRenderSizeInfo + public class WithVoxelWalkerBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires, Requires, Requires { public readonly string Sequence = "idle"; @@ -48,12 +47,11 @@ namespace OpenRA.Mods.Cnc.Traits.Render } } - public class WithVoxelWalkerBody : IAutoSelectionSize, ITick, IActorPreviewInitModifier, IAutoRenderSize, IAutoMouseBounds + public class WithVoxelWalkerBody : ITick, IActorPreviewInitModifier, IAutoMouseBounds { readonly WithVoxelWalkerBodyInfo info; readonly IMove movement; readonly IFacing facing; - readonly int2 size; readonly ModelAnimation modelAnimation; readonly RenderVoxels rv; @@ -76,16 +74,8 @@ namespace OpenRA.Mods.Cnc.Traits.Render () => false, () => frame, info.ShowShadow); rv.Add(modelAnimation); - - // Selection size - var rvi = self.Info.TraitInfo(); - var s = (int)(rvi.Scale * model.Size.Aggregate(Math.Max)); - size = new int2(s, s); } - int2 IAutoSelectionSize.SelectionSize(Actor self) { return size; } - int2 IAutoRenderSize.RenderSize(Actor self) { return size; } - void ITick.Tick(Actor self) { if (movement.IsMoving || facing.Facing != oldFacing) diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 346cb88720..91e393d806 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -327,8 +327,6 @@ - - @@ -417,8 +415,6 @@ - - diff --git a/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs b/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs deleted file mode 100644 index 6e1f8b528b..0000000000 --- a/OpenRA.Mods.Common/Traits/CustomSelectionSize.cs +++ /dev/null @@ -1,35 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you 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. For more - * information, see COPYING. - */ -#endregion - -using OpenRA.Traits; - -namespace OpenRA.Mods.Common.Traits -{ - [Desc("Special case trait for actors that need to define targetable area and screen map bounds manually.")] - public class CustomSelectionSizeInfo : ITraitInfo, IAutoSelectionSizeInfo - { - [FieldLoader.Require] - public readonly int[] CustomBounds = null; - - public object Create(ActorInitializer init) { return new CustomSelectionSize(this); } - } - - public class CustomSelectionSize : IAutoSelectionSize - { - readonly CustomSelectionSizeInfo info; - public CustomSelectionSize(CustomSelectionSizeInfo info) { this.info = info; } - - public int2 SelectionSize(Actor self) - { - return new int2(info.CustomBounds[0], info.CustomBounds[1]); - } - } -} diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs index 6998484edc..8af9352d37 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs @@ -19,17 +19,11 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("This actor will remain visible (but not updated visually) under fog, once discovered.")] - public class FrozenUnderFogInfo : ITraitInfo, Requires, IDefaultVisibilityInfo, IRulesetLoaded + public class FrozenUnderFogInfo : ITraitInfo, Requires, IDefaultVisibilityInfo { [Desc("Players with these stances can always see the actor.")] public readonly Stance AlwaysVisibleStances = Stance.Ally; - void IRulesetLoaded.RulesetLoaded(Ruleset rules, ActorInfo info) - { - if (!info.HasTraitInfo() && !info.HasTraitInfo()) - throw new YamlException("Cannot create a frozen actor for actor type '{0}' with empty bounds (no selection size given).".F(info.Name)); - } - public object Create(ActorInitializer init) { return new FrozenUnderFog(init, this); } } diff --git a/OpenRA.Mods.Common/Traits/Render/AutoRenderSize.cs b/OpenRA.Mods.Common/Traits/Render/AutoRenderSize.cs deleted file mode 100644 index caa43be7fd..0000000000 --- a/OpenRA.Mods.Common/Traits/Render/AutoRenderSize.cs +++ /dev/null @@ -1,57 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you 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. For more - * information, see COPYING. - */ -#endregion - -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using OpenRA.Graphics; -using OpenRA.Traits; - -namespace OpenRA.Mods.Common.Traits.Render -{ - [Desc("Automatically calculates the screen map boundaries from the sprite size.")] - public class AutoRenderSizeInfo : ITraitInfo, Requires, IAutoRenderSizeInfo, IDecorationBoundsInfo - { - public object Create(ActorInitializer init) { return new AutoRenderSize(init.Self); } - } - - public class AutoRenderSize : IAutoRenderSize, IMouseBounds, IDecorationBounds - { - readonly RenderSprites rs; - - public AutoRenderSize(Actor self) - { - rs = self.Trait(); - } - - public int2 RenderSize(Actor self) - { - return rs.AutoRenderSize(self); - } - - Rectangle Bounds(Actor self, WorldRenderer wr) - { - return self.TraitsImplementing() - .Select(s => s.AutoMouseoverBounds(self, wr)) - .FirstOrDefault(r => !r.IsEmpty); - } - - Rectangle IMouseBounds.MouseoverBounds(Actor self, WorldRenderer wr) - { - return Bounds(self, wr); - } - - Rectangle IDecorationBounds.DecorationBounds(Actor self, WorldRenderer wr) - { - return Bounds(self, wr); - } - } -} diff --git a/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs b/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs deleted file mode 100644 index 876172b23f..0000000000 --- a/OpenRA.Mods.Common/Traits/Render/AutoSelectionSize.cs +++ /dev/null @@ -1,32 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you 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. For more - * information, see COPYING. - */ -#endregion - -using OpenRA.Traits; - -namespace OpenRA.Mods.Common.Traits.Render -{ - [Desc("Automatically calculates the targetable area and screen map boundaries from the sprite size.")] - public class AutoSelectionSizeInfo : ITraitInfo, Requires, IAutoSelectionSizeInfo - { - public object Create(ActorInitializer init) { return new AutoSelectionSize(this); } - } - - public class AutoSelectionSize : IAutoSelectionSize - { - public AutoSelectionSize(AutoSelectionSizeInfo info) { } - - public int2 SelectionSize(Actor self) - { - var rs = self.Trait(); - return rs.AutoSelectionSize(self); - } - } -} diff --git a/OpenRA.Mods.Common/Traits/Render/CustomRenderSize.cs b/OpenRA.Mods.Common/Traits/Render/CustomRenderSize.cs deleted file mode 100644 index ceff71a3dd..0000000000 --- a/OpenRA.Mods.Common/Traits/Render/CustomRenderSize.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you 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. For more - * information, see COPYING. - */ -#endregion - -using System.Drawing; -using OpenRA.Graphics; -using OpenRA.Traits; - -namespace OpenRA.Mods.Common.Traits -{ - [Desc("Special case trait for actors that need to define targetable area and screen map bounds manually.")] - public class CustomRenderSizeInfo : ITraitInfo, IAutoRenderSizeInfo, IDecorationBoundsInfo - { - [FieldLoader.Require] - public readonly int[] CustomBounds = null; - - [Desc("Defines a custom rectangle for Decorations.", - "If null, CustomBounds will be used instead")] - public readonly int[] DecorationBounds = null; - - public object Create(ActorInitializer init) { return new CustomRenderSize(this); } - } - - public class CustomRenderSize : IAutoRenderSize, IMouseBounds, IDecorationBounds - { - readonly CustomRenderSizeInfo info; - public CustomRenderSize(CustomRenderSizeInfo info) { this.info = info; } - - public int2 RenderSize(Actor self) - { - return new int2(info.CustomBounds[0], info.CustomBounds[1]); - } - - Rectangle IMouseBounds.MouseoverBounds(Actor self, WorldRenderer wr) - { - if (info.CustomBounds == null) - return Rectangle.Empty; - - var size = new int2(info.CustomBounds[0], info.CustomBounds[1]); - - var offset = -size / 2; - if (info.CustomBounds.Length > 2) - offset += new int2(info.CustomBounds[2], info.CustomBounds[3]); - - var xy = wr.ScreenPxPosition(self.CenterPosition); - return new Rectangle(xy.X, xy.Y, size.X, size.Y); - } - - Rectangle IDecorationBounds.DecorationBounds(Actor self, WorldRenderer wr) - { - var bounds = info.DecorationBounds ?? info.CustomBounds; - if (bounds == null) - return Rectangle.Empty; - - var size = new int2(bounds[0], bounds[1]); - - var offset = -size / 2; - if (bounds.Length > 2) - offset += new int2(bounds[2], bounds[3]); - - var xy = wr.ScreenPxPosition(self.CenterPosition); - return new Rectangle(xy.X, xy.Y, size.X, size.Y); - } - } -} diff --git a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs index 8ffafcbddb..c6598f0c98 100644 --- a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs +++ b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs @@ -18,15 +18,10 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Render { - public class SelectionDecorationsInfo : ITraitInfo, ISelectionDecorationsInfo, Requires + public class SelectionDecorationsInfo : ITraitInfo, Requires { [PaletteReference] public readonly string Palette = "chrome"; - [Desc("Bounds for visual selection box. If null, it uses AutoSelectionSize.", - "The first two values define the bounds' size, the optional third and fourth", - "values specify the position relative to the actors' center. Defaults to selectable bounds.")] - public readonly int[] VisualBounds = null; - [Desc("Health bar, production progress bar etc.")] public readonly bool RenderSelectionBars = true; @@ -37,8 +32,6 @@ namespace OpenRA.Mods.Common.Traits.Render public readonly string Image = "pips"; public object Create(ActorInitializer init) { return new SelectionDecorations(init.Self, this); } - - public int[] SelectionBoxBounds { get { return VisualBounds; } } } public class SelectionDecorations : IRenderAboveShroud, INotifyCreated, ITick diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs index 5ed6054ec8..c20e2832f1 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs @@ -20,7 +20,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Render { [Desc("Also returns a default selection size that is calculated automatically from the voxel dimensions.")] - public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires, IAutoSelectionSizeInfo, IAutoRenderSizeInfo + public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires { public readonly string Sequence = "idle"; @@ -40,9 +40,8 @@ namespace OpenRA.Mods.Common.Traits.Render } } - public class WithVoxelBody : ConditionalTrait, IAutoSelectionSize, IAutoRenderSize, IAutoMouseBounds + public class WithVoxelBody : ConditionalTrait, IAutoMouseBounds { - readonly int2 size; readonly ModelAnimation modelAnimation; readonly RenderVoxels rv; @@ -58,15 +57,8 @@ namespace OpenRA.Mods.Common.Traits.Render () => IsTraitDisabled, () => 0, info.ShowShadow); rv.Add(modelAnimation); - // Selection size - var rvi = self.Info.TraitInfo(); - var s = (int)(rvi.Scale * model.Size.Aggregate(Math.Max)); - size = new int2(s, s); } - public int2 SelectionSize(Actor self) { return size; } - public int2 RenderSize(Actor self) { return size; } - Rectangle IAutoMouseBounds.AutoMouseoverBounds(Actor self, WorldRenderer wr) { return modelAnimation.ScreenBounds(self.CenterPosition, wr, rv.Info.Scale); diff --git a/OpenRA.Mods.Common/Traits/Tooltip.cs b/OpenRA.Mods.Common/Traits/Tooltip.cs index 3c9fa516ea..40c713d1b0 100644 --- a/OpenRA.Mods.Common/Traits/Tooltip.cs +++ b/OpenRA.Mods.Common/Traits/Tooltip.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public abstract class TooltipInfoBase : ConditionalTraitInfo + public abstract class TooltipInfoBase : ConditionalTraitInfo, Requires { [Translate] public readonly string Name = ""; } diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index a6cc2924c7..8f0da268e0 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1253,6 +1253,48 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + if (engineVersion < 20171208) + { + // Move SelectionDecorations.VisualBounds to Selectable.Bounds + if (node.Key.StartsWith("AutoRenderSize", StringComparison.Ordinal)) + RenameNodeKey(node, "Interactable"); + + if (node.Key.StartsWith("CustomRenderSize", StringComparison.Ordinal)) + { + RenameNodeKey(node, "Interactable"); + var boundsNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "CustomBounds"); + if (boundsNode != null) + RenameNodeKey(boundsNode, "Bounds"); + } + + if (node.Key.StartsWith("SelectionDecorations", StringComparison.Ordinal)) + { + var boundsNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "VisualBounds"); + if (boundsNode != null) + { + RenameNodeKey(boundsNode, "DecorationBounds"); + node.Value.Nodes.Remove(boundsNode); + var selectable = parent.Value.Nodes.FirstOrDefault(n => n.Key.StartsWith("Selectable", StringComparison.Ordinal)); + if (selectable == null) + { + selectable = new MiniYamlNode("Selectable", new MiniYaml("")); + addNodes.Add(selectable); + } + + selectable.Value.Nodes.Add(boundsNode); + } + } + + if (node.Key == "-Selectable") + addNodes.Add(new MiniYamlNode("Interactable", new MiniYaml(""))); + + if (depth == 0) + { + node.Value.Nodes.RemoveAll(n => n.Key.StartsWith("CustomSelectionSize", StringComparison.Ordinal)); + node.Value.Nodes.RemoveAll(n => n.Key.StartsWith("AutoSelectionSize", StringComparison.Ordinal)); + } + } + UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); } diff --git a/mods/cnc/maps/cnc64gdi01/rules.yaml b/mods/cnc/maps/cnc64gdi01/rules.yaml index 9b3ab6624f..ef4a5aa7b7 100644 --- a/mods/cnc/maps/cnc64gdi01/rules.yaml +++ b/mods/cnc/maps/cnc64gdi01/rules.yaml @@ -46,3 +46,4 @@ OLDLST: RejectsOrders: Cargo: Types: disabled + Interactable: diff --git a/mods/cnc/maps/funpark01/rules.yaml b/mods/cnc/maps/funpark01/rules.yaml index b670717673..b8f9ead20c 100644 --- a/mods/cnc/maps/funpark01/rules.yaml +++ b/mods/cnc/maps/funpark01/rules.yaml @@ -46,6 +46,7 @@ OLDLST: RejectsOrders: Cargo: Types: disabled + Interactable: TREX: Health: diff --git a/mods/cnc/maps/gdi01/rules.yaml b/mods/cnc/maps/gdi01/rules.yaml index d9257d9bc9..1f9d9ad7b6 100644 --- a/mods/cnc/maps/gdi01/rules.yaml +++ b/mods/cnc/maps/gdi01/rules.yaml @@ -115,3 +115,4 @@ OLDLST: RejectsOrders: Cargo: Types: disabled + Interactable: diff --git a/mods/cnc/maps/gdi02/rules.yaml b/mods/cnc/maps/gdi02/rules.yaml index af169ce7f9..36fa58982a 100644 --- a/mods/cnc/maps/gdi02/rules.yaml +++ b/mods/cnc/maps/gdi02/rules.yaml @@ -121,3 +121,4 @@ OLDLST: RejectsOrders: Cargo: Types: disabled + Interactable: diff --git a/mods/cnc/maps/gdi06/rules.yaml b/mods/cnc/maps/gdi06/rules.yaml index 3b7d677878..c0c8667144 100644 --- a/mods/cnc/maps/gdi06/rules.yaml +++ b/mods/cnc/maps/gdi06/rules.yaml @@ -65,6 +65,7 @@ OLDLST: RejectsOrders: Cargo: Types: disabled + Interactable: SAM: SpawnActorOnDeath: diff --git a/mods/cnc/maps/gdi07/rules.yaml b/mods/cnc/maps/gdi07/rules.yaml index 8a278ca357..7e1d2b612a 100644 --- a/mods/cnc/maps/gdi07/rules.yaml +++ b/mods/cnc/maps/gdi07/rules.yaml @@ -117,6 +117,7 @@ OLDLST: RejectsOrders: Cargo: Types: disabled + Interactable: HQ: Tooltip: diff --git a/mods/cnc/maps/nod04b/rules.yaml b/mods/cnc/maps/nod04b/rules.yaml index 70bb6411d4..bdd9511763 100644 --- a/mods/cnc/maps/nod04b/rules.yaml +++ b/mods/cnc/maps/nod04b/rules.yaml @@ -25,3 +25,4 @@ TRAN: -Selectable: RevealsShroud: Range: 5c0 + Interactable: diff --git a/mods/cnc/maps/nod06a/rules.yaml b/mods/cnc/maps/nod06a/rules.yaml index ed4ca4fc3b..303129bfda 100644 --- a/mods/cnc/maps/nod06a/rules.yaml +++ b/mods/cnc/maps/nod06a/rules.yaml @@ -35,3 +35,4 @@ FLARE: TRAN: -Selectable: + Interactable: diff --git a/mods/cnc/maps/nod06b/rules.yaml b/mods/cnc/maps/nod06b/rules.yaml index a006ce6dbe..34b943760f 100644 --- a/mods/cnc/maps/nod06b/rules.yaml +++ b/mods/cnc/maps/nod06b/rules.yaml @@ -28,3 +28,4 @@ FLARE: TRAN: -Selectable: + Interactable: diff --git a/mods/cnc/maps/nod06c/rules.yaml b/mods/cnc/maps/nod06c/rules.yaml index 42dc9d9413..ad0cde2d9b 100644 --- a/mods/cnc/maps/nod06c/rules.yaml +++ b/mods/cnc/maps/nod06c/rules.yaml @@ -131,6 +131,7 @@ TRAN: -Selectable: Buildable: Prerequisites: ~disabled + Interactable: ORCA: Buildable: diff --git a/mods/cnc/maps/nod07a/rules.yaml b/mods/cnc/maps/nod07a/rules.yaml index 90867ede57..ec54e81eea 100644 --- a/mods/cnc/maps/nod07a/rules.yaml +++ b/mods/cnc/maps/nod07a/rules.yaml @@ -140,3 +140,4 @@ TRAN.IN: Image: TRAN Buildable: Prerequisites: ~disabled + Interactable: diff --git a/mods/cnc/maps/nod07c/rules.yaml b/mods/cnc/maps/nod07c/rules.yaml index 92fdb504d1..5b51d77404 100644 --- a/mods/cnc/maps/nod07c/rules.yaml +++ b/mods/cnc/maps/nod07c/rules.yaml @@ -127,6 +127,7 @@ TRAN.IN: Image: TRAN Buildable: Prerequisites: ~disabled + Interactable: HPAD.IN: Inherits: HPAD diff --git a/mods/cnc/maps/nod08a/rules.yaml b/mods/cnc/maps/nod08a/rules.yaml index 4e646af849..526a7b0ed5 100644 --- a/mods/cnc/maps/nod08a/rules.yaml +++ b/mods/cnc/maps/nod08a/rules.yaml @@ -196,3 +196,4 @@ TRAN.IN: Image: TRAN Buildable: Prerequisites: ~disabled + Interactable: diff --git a/mods/cnc/maps/nod08b/rules.yaml b/mods/cnc/maps/nod08b/rules.yaml index a249a4dccd..0ad7469a22 100644 --- a/mods/cnc/maps/nod08b/rules.yaml +++ b/mods/cnc/maps/nod08b/rules.yaml @@ -224,3 +224,4 @@ TRAN.IN: Image: TRAN Buildable: Prerequisites: ~disabled + Interactable: diff --git a/mods/cnc/maps/nod09/rules.yaml b/mods/cnc/maps/nod09/rules.yaml index 3b8bef9eb4..d34b213d03 100644 --- a/mods/cnc/maps/nod09/rules.yaml +++ b/mods/cnc/maps/nod09/rules.yaml @@ -151,6 +151,7 @@ TRAN.IN: Image: TRAN Buildable: Prerequisites: ~disabled + Interactable: NUKEOUT.IN: Inherits: NUKE diff --git a/mods/cnc/rules/aircraft.yaml b/mods/cnc/rules/aircraft.yaml index 1b816fe538..d105d258f6 100644 --- a/mods/cnc/rules/aircraft.yaml +++ b/mods/cnc/rules/aircraft.yaml @@ -49,7 +49,8 @@ TRAN: Weapon: HeliExplode EmptyWeapon: HeliExplode SelectionDecorations: - VisualBounds: 41,41 + Selectable: + DecorationBounds: 41,41 HELI: Inherits: ^Helicopter @@ -107,10 +108,11 @@ HELI: Weapon: HeliExplode EmptyWeapon: HeliExplode SelectionDecorations: - VisualBounds: 30,24 ReloadAmmoPool: Delay: 40 Count: 1 + Selectable: + DecorationBounds: 30,24 ORCA: Inherits: ^Helicopter @@ -158,13 +160,15 @@ ORCA: WithMoveAnimation: MoveSequence: move SelectionDecorations: - VisualBounds: 30,24 ReloadAmmoPool: Delay: 100 Count: 2 + Selectable: + DecorationBounds: 30,24 C17: Inherits: ^Plane + Interactable: Tooltip: Name: Supply Aircraft Valued: @@ -199,6 +203,7 @@ C17: A10: Inherits: ^Plane + Interactable: Tooltip: Name: A10 Bomber Valued: diff --git a/mods/cnc/rules/civilian.yaml b/mods/cnc/rules/civilian.yaml index 965bac1e1a..472a93fc4d 100644 --- a/mods/cnc/rules/civilian.yaml +++ b/mods/cnc/rules/civilian.yaml @@ -409,16 +409,14 @@ BRIDGE1: Building: Footprint: ____ ____ ____ ____ Dimensions: 4,4 - CustomSelectionSize: - CustomBounds: 96,96 FreeActor@north: Actor: bridgehut SpawnOffset: 2,0 FreeActor@south: Actor: bridgehut SpawnOffset: 0,2 - CustomRenderSize: - CustomBounds: 96,96 + Interactable: + Bounds: 96,96 BRIDGE2: Inherits: ^Bridge @@ -428,16 +426,14 @@ BRIDGE2: Building: Footprint: _____ _____ _____ _____ _____ Dimensions: 5,5 - CustomSelectionSize: - CustomBounds: 120,120 FreeActor@north: Actor: bridgehut SpawnOffset: 0,0 FreeActor@south: Actor: bridgehut SpawnOffset: 2,2 - CustomRenderSize: - CustomBounds: 120,120 + Interactable: + Bounds: 120,120 BRIDGE3: Inherits: ^Bridge @@ -447,16 +443,14 @@ BRIDGE3: Building: Footprint: ______ ______ ______ ______ ______ Dimensions: 6,5 - CustomSelectionSize: - CustomBounds: 144,120 FreeActor@north: Actor: bridgehut SpawnOffset: 3,0 FreeActor@south: Actor: bridgehut SpawnOffset: 1,2 - CustomRenderSize: - CustomBounds: 144,120 + Interactable: + Bounds: 144,120 BRIDGE4: Inherits: ^Bridge @@ -466,29 +460,25 @@ BRIDGE4: Building: Footprint: ______ ______ ______ ______ Dimensions: 6,4 - CustomSelectionSize: - CustomBounds: 144,96 FreeActor@north: Actor: bridgehut SpawnOffset: 1,0 FreeActor@south: Actor: bridgehut SpawnOffset: 3,2 - CustomRenderSize: - CustomBounds: 144,96 + Interactable: + Bounds: 144,96 BRIDGEHUT: AlwaysVisible: Building: Footprint: __ __ Dimensions: 2,2 - CustomSelectionSize: - CustomBounds: 48,48 LegacyBridgeHut: Targetable: TargetTypes: BridgeHut, C4 - CustomRenderSize: - CustomBounds: 48,48 + Interactable: + Bounds: 48,48 C1: Inherits: ^CivInfantry diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 944b692e45..2e74af03a5 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -11,9 +11,7 @@ ^SpriteActor: BodyOrientation: QuantizeFacingsFromSequence: - AutoSelectionSize: RenderSprites: - AutoRenderSize: ^1x1Shape: HitShape: @@ -730,6 +728,7 @@ ^CivBuildingHusk: Inherits@1: ^SpriteActor + Interactable: AppearsOnRadar: Building: Dimensions: 1,1 @@ -765,6 +764,7 @@ Inherits: ^CivBuilding -Selectable: -SelectionDecorations: + Interactable: Tooltip: GenericName: Field -Explodes: @@ -775,6 +775,7 @@ ^CivFieldHusk: Inherits@1: ^SpriteActor + Interactable: AppearsOnRadar: Building: Dimensions: 1,1 @@ -794,6 +795,7 @@ ^Wall: Inherits@1: ^SpriteActor Inherits@shape: ^1x1Shape + Interactable: CombatDebugOverlay: AppearsOnRadar: Building: @@ -830,6 +832,7 @@ ^Tree: Inherits@1: ^SpriteActor + Interactable: Tooltip: Name: Tree ShowOwnerRow: false @@ -871,6 +874,7 @@ ^TreeHusk: Inherits@1: ^SpriteActor + Interactable: AppearsOnRadar: Building: Footprint: __ x_ @@ -886,6 +890,7 @@ ^TibTree: Inherits@1: ^SpriteActor + Interactable: Tooltip: Name: Blossom Tree ShowOwnerRow: false @@ -905,6 +910,7 @@ ^Rock: Inherits@1: ^SpriteActor + Interactable: Tooltip: Name: Rock ShowOwnerRow: false @@ -925,6 +931,7 @@ ^CommonHuskDefaults: Inherits@1: ^SpriteActor + Interactable: Health: HP: 140 Armor: @@ -1001,6 +1008,7 @@ ^Crate: Inherits@1: ^SpriteActor + Interactable: HiddenUnderFog: Tooltip: Name: Crate diff --git a/mods/cnc/rules/infantry.yaml b/mods/cnc/rules/infantry.yaml index 872965544d..453a1745a0 100644 --- a/mods/cnc/rules/infantry.yaml +++ b/mods/cnc/rules/infantry.yaml @@ -254,8 +254,8 @@ TREX: Weapon: teeth Selectable: Bounds: 48,36,2,1 + DecorationBounds: 52,38 SelectionDecorations: - VisualBounds: 52,38 Buildable: Description: Bipedal carnivore with a massive skull @@ -266,9 +266,10 @@ TRIC: Armament: Weapon: horn SelectionDecorations: - VisualBounds: 34,24,0,2 Buildable: Description: Quadruped with large bony frill and three horns + Selectable: + DecorationBounds: 34,24,0,2 RAPT: Inherits: ^DINO diff --git a/mods/cnc/rules/misc.yaml b/mods/cnc/rules/misc.yaml index 5f67ea24ef..84aed6fe07 100644 --- a/mods/cnc/rules/misc.yaml +++ b/mods/cnc/rules/misc.yaml @@ -46,6 +46,7 @@ SCRATE: Name: Steel Crate mpspawn: + Interactable: EditorOnlyTooltip: Name: (multiplayer player starting point) AlwaysVisible: @@ -59,6 +60,7 @@ mpspawn: Categories: System waypoint: + Interactable: EditorOnlyTooltip: Name: (waypoint for scripted behavior) AlwaysVisible: @@ -78,6 +80,7 @@ waypoint: Palette: colorpicker CAMERA: + Interactable: EditorOnlyTooltip: Name: (reveals area to owner) AlwaysVisible: @@ -94,6 +97,7 @@ CAMERA: Categories: System CAMERA.small: + Interactable: EditorOnlyTooltip: Name: (reveals small area to owner) AlwaysVisible: @@ -131,7 +135,6 @@ FLARE: ShowOwnerRow: false BodyOrientation: QuantizedFacings: 1 - AutoSelectionSize: EditorTilesetFilter: Categories: System - AutoRenderSize: + Interactable: diff --git a/mods/cnc/rules/ships.yaml b/mods/cnc/rules/ships.yaml index 6dfba2837d..b81e4f990d 100644 --- a/mods/cnc/rules/ships.yaml +++ b/mods/cnc/rules/ships.yaml @@ -29,11 +29,11 @@ BOAT: Sequence: left # Just a work-around to avoid crash Selectable: Bounds: 42,24 + DecorationBounds: 42,24 AutoTarget: AllowMovement: false RejectsOrders: SelectionDecorations: - VisualBounds: 42,24 GrantConditionOnDamageState@HEAVY: Condition: heavy-damage ValidDamageStates: Heavy diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index acb0dd700c..015af5f536 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -192,6 +192,7 @@ PROC: Capacity: 700 Selectable: Bounds: 72,56,0,12 + DecorationBounds: 73,72 CustomSellValue: Value: 500 FreeActor: @@ -203,7 +204,6 @@ PROC: Amount: -40 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 73,72 SILO: Inherits: ^BaseBuilding @@ -229,7 +229,6 @@ SILO: HasMinibib: Yes RenderSprites: WithSpriteBody: - AutoSelectionSize: WithSiloAnimation: StoresResources: PipCount: 10 @@ -241,9 +240,9 @@ SILO: MustBeDestroyed: RequiredForShortGame: false SelectionDecorations: - VisualBounds: 49,30 -AcceptsDeliveredCash: - AutoRenderSize: + Selectable: + DecorationBounds: 49,30 PYLE: Inherits: ^BaseBuilding @@ -338,8 +337,8 @@ HAND: ProvidesPrerequisite@buildingname: Selectable: Bounds: 48,48 + DecorationBounds: 48,68,0,-10 SelectionDecorations: - VisualBounds: 48,68,0,-10 AFLD: Inherits: ^BaseBuilding @@ -414,8 +413,8 @@ WEAP: LocalCenterOffset: 0,-512,0 Selectable: Bounds: 72,48 + DecorationBounds: 72,64,0,-16 SelectionDecorations: - VisualBounds: 72,64,0,-16 Health: HP: 1100 RevealsShroud: @@ -515,8 +514,8 @@ HQ: LocalCenterOffset: 0,-512,0 Selectable: Bounds: 48,40,0,9 + DecorationBounds: 48,53,0,-4 SelectionDecorations: - VisualBounds: 48,53,0,-4 WithSpriteBody: PauseOnCondition: lowpower Health: @@ -581,8 +580,8 @@ FIX: Dimensions: 3,3 Selectable: Bounds: 64,34,0,3 + DecorationBounds: 72,48 SelectionDecorations: - VisualBounds: 72,48 Health: HP: 800 RevealsShroud: @@ -624,8 +623,8 @@ EYE: LocalCenterOffset: 0,-512,0 Selectable: Bounds: 48,40,0,9 + DecorationBounds: 48,53,0,-4 SelectionDecorations: - VisualBounds: 48,53,0,-4 WithSpriteBody: PauseOnCondition: lowpower Health: @@ -683,8 +682,8 @@ TMPL: LocalCenterOffset: 0,-512,0 Selectable: Bounds: 72,48 + DecorationBounds: 72,68,0,-12 SelectionDecorations: - VisualBounds: 72,68,0,-12 Health: HP: 2100 RevealsShroud: @@ -803,7 +802,6 @@ SAM: RealignDelay: -1 -WithSpriteBody: WithEmbeddedTurretSpriteBody: - AutoSelectionSize: Armament: Weapon: Dragon MuzzleSequence: muzzle @@ -815,7 +813,6 @@ SAM: Amount: -20 BodyOrientation: UseClassicFacingFudge: True - AutoRenderSize: OBLI: Inherits: ^Defense @@ -834,8 +831,8 @@ OBLI: Description: Advanced base defense.\nRequires power to operate.\n Strong vs all Ground units\n Cannot target Aircraft Selectable: Bounds: 24,24 + DecorationBounds: 22,44,0,-10 SelectionDecorations: - VisualBounds: 22,44,0,-10 Health: HP: 600 Armor: @@ -916,8 +913,8 @@ ATWR: Description: All-purpose defensive structure.\n Strong vs Aircraft, Tanks\n Weak vs Infantry Selectable: Bounds: 24,24 + DecorationBounds: 22,48,0,-12 SelectionDecorations: - VisualBounds: 22,48,0,-12 Health: HP: 550 Armor: @@ -1028,6 +1025,7 @@ BRIK: BARRACKS: AlwaysVisible: + Interactable: Tooltip: Name: Infantry Production Buildable: @@ -1035,6 +1033,7 @@ BARRACKS: VEHICLEPRODUCTION: AlwaysVisible: + Interactable: Tooltip: Name: Vehicle Production Buildable: @@ -1042,6 +1041,7 @@ VEHICLEPRODUCTION: ANYPOWER: AlwaysVisible: + Interactable: Tooltip: Name: Power Plant Buildable: @@ -1049,6 +1049,7 @@ ANYPOWER: ANYHQ: AlwaysVisible: + Interactable: Tooltip: Name: a communications center Buildable: diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index 2613b4886c..01c422c5e7 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -13,6 +13,7 @@ MCV: Description: Deploys into another Construction Yard.\n Unarmed Selectable: Priority: 4 + DecorationBounds: 36,36 Mobile: Speed: 71 Crushes: crate, infantry @@ -34,7 +35,6 @@ MCV: SpawnActorOnDeath: Actor: MCV.Husk SelectionDecorations: - VisualBounds: 36,36 HARV: Inherits: ^Tank @@ -53,6 +53,7 @@ HARV: Description: Collects Tiberium for processing.\n Unarmed Selectable: Priority: 7 + DecorationBounds: 36,36 Harvester: Resources: Tiberium, BlueTiberium PipCount: 7 @@ -76,7 +77,6 @@ HARV: Explodes: Weapon: TiberiumExplosion SelectionDecorations: - VisualBounds: 36,36 APC: Inherits: ^Tank @@ -386,7 +386,8 @@ MTNK: SpawnActorOnDeath: Actor: MTNK.Husk SelectionDecorations: - VisualBounds: 28,28 + Selectable: + DecorationBounds: 28,28 HTNK: Inherits: ^Tank @@ -437,7 +438,8 @@ HTNK: SpawnActorOnDeath: Actor: HTNK.Husk SelectionDecorations: - VisualBounds: 34,34,0,-3 + Selectable: + DecorationBounds: 34,34,0,-3 MSAM: Inherits: ^Tank diff --git a/mods/d2k/maps/atreides-04/rules.yaml b/mods/d2k/maps/atreides-04/rules.yaml index 0b866a11a3..87368a05cf 100644 --- a/mods/d2k/maps/atreides-04/rules.yaml +++ b/mods/d2k/maps/atreides-04/rules.yaml @@ -87,8 +87,7 @@ tile475: WithSpriteBody: BodyOrientation: QuantizedFacings: 1 - AutoSelectionSize: - AutoRenderSize: + Interactable: # Placed after the sietch is destroyed so that the cliff is still unpassable invisibleBlocker: diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index b2e6caae47..38ee5e439b 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -57,6 +57,7 @@ frigate: Inherits: ^Plane ParaDrop: DropRange: 1c0 + Interactable: Tooltip: Name: Frigate Aircraft: diff --git a/mods/d2k/rules/arrakis.yaml b/mods/d2k/rules/arrakis.yaml index 73a657a900..fd0ce85a69 100644 --- a/mods/d2k/rules/arrakis.yaml +++ b/mods/d2k/rules/arrakis.yaml @@ -1,4 +1,5 @@ spicebloom.spawnpoint: + Interactable: EditorOnlyTooltip: Name: Spice Bloom spawnpoint AlwaysVisible: @@ -32,7 +33,6 @@ spicebloom: HiddenUnderShroud: BodyOrientation: QuantizedFacings: 1 - AutoSelectionSize: RenderSprites: AppearsOnRadar: UseLocation: true @@ -63,10 +63,11 @@ spicebloom: Radius: 512 EditorTilesetFilter: Categories: System - AutoRenderSize: + Interactable: sandworm: Inherits@1: ^SpriteActor + Interactable: Tooltip: Name: Sandworm Health: diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index cd2da8ef04..8eebb168d6 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -11,9 +11,7 @@ ^SpriteActor: BodyOrientation: QuantizeFacingsFromSequence: - AutoSelectionSize: RenderSprites: - AutoRenderSize: ^GainsExperience: GainsExperience: @@ -226,6 +224,7 @@ ^Husk: Inherits@1: ^SpriteActor + Interactable: Health: HP: 75 Armor: @@ -340,6 +339,7 @@ ^Plane: Inherits@1: ^ExistsInWorld Inherits@2: ^SpriteActor + Interactable: Huntable: AppearsOnRadar: UseLocation: true diff --git a/mods/d2k/rules/misc.yaml b/mods/d2k/rules/misc.yaml index 4635659e32..ff0f0a4af1 100644 --- a/mods/d2k/rules/misc.yaml +++ b/mods/d2k/rules/misc.yaml @@ -134,14 +134,13 @@ crate: Palette: effect WithCrateBody: Passenger: - CustomSelectionSize: - CustomBounds: 20,20 EditorTilesetFilter: Categories: System - CustomRenderSize: - CustomBounds: 20,20 + Interactable: + Bounds: 20,20 mpspawn: + Interactable: EditorOnlyTooltip: Name: (multiplayer player starting point) AlwaysVisible: @@ -155,6 +154,7 @@ mpspawn: Categories: System waypoint: + Interactable: EditorOnlyTooltip: Name: (waypoint for scripted behavior) AlwaysVisible: @@ -177,6 +177,7 @@ waypoint: Palette: colorpicker camera: + Interactable: EditorOnlyTooltip: Name: (reveals area to owner) AlwaysVisible: @@ -193,6 +194,7 @@ camera: Categories: System wormspawner: + Interactable: EditorOnlyTooltip: Name: (worm spawning location) AlwaysVisible: @@ -208,6 +210,7 @@ wormspawner: upgrade.conyard: AlwaysVisible: + Interactable: Tooltip: Name: Construction Yard Upgrade Buildable: @@ -230,6 +233,7 @@ upgrade.conyard: upgrade.barracks: AlwaysVisible: + Interactable: Tooltip: Name: Barracks Upgrade Buildable: @@ -253,6 +257,7 @@ upgrade.barracks: upgrade.light: AlwaysVisible: + Interactable: Tooltip: Name: Light Factory Upgrade Buildable: @@ -276,6 +281,7 @@ upgrade.light: upgrade.heavy: AlwaysVisible: + Interactable: Tooltip: Name: Heavy Factory Upgrade Buildable: @@ -299,6 +305,7 @@ upgrade.heavy: upgrade.hightech: AlwaysVisible: + Interactable: Tooltip: Name: High Tech Factory Upgrade Buildable: diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 88f062c085..e9e0f25619 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -1,5 +1,6 @@ ^concrete: AlwaysVisible: + Interactable: Building: TerrainTypes: Rock BuildSounds: CHUNG.WAV @@ -454,6 +455,7 @@ heavy_factory: Description: Produces heavy vehicles. Selectable: Bounds: 96,68,0,12 + DecorationBounds: 96,96 Valued: Cost: 1000 Tooltip: @@ -515,7 +517,6 @@ heavy_factory: Amount: -150 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 96,96 GrantConditionOnPrerequisite: Prerequisites: upgrade.heavy Condition: stardecoration @@ -660,6 +661,7 @@ starport: wall: Inherits@1: ^SpriteActor + Interactable: CombatDebugOverlay: HiddenUnderShroud: Buildable: @@ -740,6 +742,7 @@ medium_gun_turret: Selectable: Bounds: 32,32 Priority: 3 + DecorationBounds: 32,40,0,-8 Health: HP: 2700 Armor: @@ -759,7 +762,6 @@ medium_gun_turret: Power: Amount: -50 SelectionDecorations: - VisualBounds: 32,40,0,-8 large_gun_turret: Inherits: ^Defense @@ -787,6 +789,7 @@ large_gun_turret: Selectable: Bounds: 32,32 Priority: 3 + DecorationBounds: 32,40,0,-8 Health: HP: 3000 Armor: @@ -804,7 +807,6 @@ large_gun_turret: Power: Amount: -60 SelectionDecorations: - VisualBounds: 32,40,0,-8 RevealOnDeath: Radius: 5c768 @@ -840,8 +842,8 @@ repair_pad: Range: 4c768 Selectable: Bounds: 96,64 + DecorationBounds: 96,80 SelectionDecorations: - VisualBounds: 96,80 Reservable: RepairsUnits: Interval: 10 @@ -874,6 +876,7 @@ high_tech_factory: Description: Unlocks advanced technology. Selectable: Bounds: 96,68,0,12 + DecorationBounds: 96,96 Valued: Cost: 1150 Tooltip: @@ -933,7 +936,6 @@ high_tech_factory: Power: Amount: -75 SelectionDecorations: - VisualBounds: 96,96 GrantConditionOnPrerequisite: Prerequisites: upgrade.hightech Condition: stardecoration @@ -956,6 +958,7 @@ research_centre: Description: Unlocks advanced tanks. Selectable: Bounds: 96,64,0,16 + DecorationBounds: 96,80 Valued: Cost: 1000 Tooltip: @@ -994,7 +997,6 @@ research_centre: Amount: -175 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 96,80 palace: Inherits: ^Building diff --git a/mods/d2k/rules/vehicles.yaml b/mods/d2k/rules/vehicles.yaml index 28b09362cb..37869b552d 100644 --- a/mods/d2k/rules/vehicles.yaml +++ b/mods/d2k/rules/vehicles.yaml @@ -14,6 +14,7 @@ mcv: Selectable: Class: mcv Priority: 3 + DecorationBounds: 42,42 Health: HP: 4500 Armor: @@ -40,7 +41,6 @@ mcv: AttractsWorms: Intensity: 700 SelectionDecorations: - VisualBounds: 42,42 SelfHealing: Step: 5 Delay: 3 @@ -63,6 +63,7 @@ harvester: Selectable: Class: harvester Priority: 7 + DecorationBounds: 42,42 Harvester: PipCount: 7 Capacity: 28 @@ -91,7 +92,6 @@ harvester: AttractsWorms: Intensity: 700 SelectionDecorations: - VisualBounds: 42,42 SelfHealing: Step: 5 Delay: 3 @@ -360,11 +360,12 @@ devastator: AttractsWorms: Intensity: 700 SelectionDecorations: - VisualBounds: 44,38,0,0 SelfHealing: Step: 5 Delay: 3 HealIfBelow: 50 + Selectable: + DecorationBounds: 44,38,0,0 raider: Inherits: ^Vehicle diff --git a/mods/ra/maps/allies-01/rules.yaml b/mods/ra/maps/allies-01/rules.yaml index 2c69b0a1ae..d3428cb2f9 100644 --- a/mods/ra/maps/allies-01/rules.yaml +++ b/mods/ra/maps/allies-01/rules.yaml @@ -19,20 +19,19 @@ TRAN.Extraction: Cargo: Types: Einstein MaxWeight: 1 - AutoSelectionSize: RenderSprites: Image: tran - AutoRenderSize: + Interactable: + Interactable: TRAN.Insertion: Inherits: TRAN.Extraction WithFacingSpriteBody: Cargo: MaxWeight: 0 - AutoSelectionSize: RenderSprites: Image: tran - AutoRenderSize: + Interactable: EINSTEIN: Passenger: diff --git a/mods/ra/maps/allies-03b/rules.yaml b/mods/ra/maps/allies-03b/rules.yaml index 796da79c92..241ecb97f1 100644 --- a/mods/ra/maps/allies-03b/rules.yaml +++ b/mods/ra/maps/allies-03b/rules.yaml @@ -127,6 +127,7 @@ TRAN: Range: 0c0 Cargo: Types: ~disabled + Interactable: JEEP.mission: Inherits: JEEP @@ -143,6 +144,7 @@ JEEP.mission: Range: 0c0 RenderSprites: Image: JEEP + Interactable: E3: Buildable: diff --git a/mods/ra/maps/allies-05a/rules.yaml b/mods/ra/maps/allies-05a/rules.yaml index bced5d50b9..1e8cd5edd3 100644 --- a/mods/ra/maps/allies-05a/rules.yaml +++ b/mods/ra/maps/allies-05a/rules.yaml @@ -36,6 +36,7 @@ LST: -Selectable: Targetable: TargetTypes: Ground, Water + Interactable: LST.IN: Inherits: LST @@ -50,6 +51,7 @@ TRAN: Range: 4c0 Targetable@GROUND: TargetTypes: Ground + Interactable: TRAN.IN: Inherits: TRAN diff --git a/mods/ra/maps/bomber-john/rules.yaml b/mods/ra/maps/bomber-john/rules.yaml index 05e7c130dc..40f4bdedbc 100644 --- a/mods/ra/maps/bomber-john/rules.yaml +++ b/mods/ra/maps/bomber-john/rules.yaml @@ -164,6 +164,7 @@ MINVV: Weapon: CrateNuke EmptyWeapon: CrateNuke HitShape: + Interactable: T17: -Health: diff --git a/mods/ra/maps/evacuation/rules.yaml b/mods/ra/maps/evacuation/rules.yaml index def3814002..23708f096e 100644 --- a/mods/ra/maps/evacuation/rules.yaml +++ b/mods/ra/maps/evacuation/rules.yaml @@ -71,6 +71,7 @@ TRAN: Prerequisites: ~disabled RevealsShroud: Range: 0c0 + Interactable: 2TNK: Buildable: diff --git a/mods/ra/maps/fort-lonestar/rules.yaml b/mods/ra/maps/fort-lonestar/rules.yaml index 56c24a3b17..32612e7a08 100644 --- a/mods/ra/maps/fort-lonestar/rules.yaml +++ b/mods/ra/maps/fort-lonestar/rules.yaml @@ -131,8 +131,8 @@ MOBILETENT: Name: Mobile Tent Selectable: Priority: 4 + DecorationBounds: 21,21 SelectionDecorations: - VisualBounds: 21,21 Health: HP: 600 Armor: diff --git a/mods/ra/maps/infiltration/rules.yaml b/mods/ra/maps/infiltration/rules.yaml index d0065c30ca..6891b655a4 100644 --- a/mods/ra/maps/infiltration/rules.yaml +++ b/mods/ra/maps/infiltration/rules.yaml @@ -45,6 +45,7 @@ LST.Unselectable.UnloadOnly: PipCount: 0 Targetable: TargetTypes: Ground, Water, Repair, NoAutoTarget + Interactable: SPY.Strong: Inherits: SPY diff --git a/mods/ra/maps/intervention/rules.yaml b/mods/ra/maps/intervention/rules.yaml index 1237a8445c..622aa580c0 100644 --- a/mods/ra/maps/intervention/rules.yaml +++ b/mods/ra/maps/intervention/rules.yaml @@ -65,6 +65,7 @@ WEAP: MAINLAND: AlwaysVisible: + Interactable: Tooltip: Name: Reach the mainland ProvidesPrerequisite: @@ -80,6 +81,7 @@ FIX: GIVEFIX: AlwaysVisible: + Interactable: Tooltip: Name: Weapons Factory or Helipad diff --git a/mods/ra/maps/monster-tank-madness/rules.yaml b/mods/ra/maps/monster-tank-madness/rules.yaml index 94622c29fd..6e33ee7c0c 100644 --- a/mods/ra/maps/monster-tank-madness/rules.yaml +++ b/mods/ra/maps/monster-tank-madness/rules.yaml @@ -103,6 +103,7 @@ TRAN: Types: Demitri MaxWeight: 1 -Selectable: + Interactable: LST: Cargo: diff --git a/mods/ra/maps/survival01/rules.yaml b/mods/ra/maps/survival01/rules.yaml index 9da2349cfb..c283edd929 100644 --- a/mods/ra/maps/survival01/rules.yaml +++ b/mods/ra/maps/survival01/rules.yaml @@ -57,6 +57,7 @@ ATEK.mission: -Huntable: RenderSprites: Image: ATEK + Interactable: GUN: Valued: diff --git a/mods/ra/rules/aircraft.yaml b/mods/ra/rules/aircraft.yaml index 96d9bfd600..b991a2f850 100644 --- a/mods/ra/rules/aircraft.yaml +++ b/mods/ra/rules/aircraft.yaml @@ -36,6 +36,7 @@ BADR: RejectsOrders: GivesExperience: Experience: 1000 + Interactable: BADR.Bomber: Inherits: ^NeutralPlane @@ -78,6 +79,7 @@ BADR.Bomber: Image: badr GivesExperience: Experience: 1000 + Interactable: MIG: Inherits: ^Plane @@ -128,8 +130,8 @@ MIG: ReturnOnIdle: Selectable: Bounds: 36,28,0,2 + DecorationBounds: 40,29,0,1 SelectionDecorations: - VisualBounds: 40,29,0,1 Contrail@1: Offset: -598,-683,0 Contrail@2: @@ -197,7 +199,6 @@ YAK: AmmoCondition: ammo ReturnOnIdle: SelectionDecorations: - VisualBounds: 30,28,0,2 WithMuzzleOverlay: Contrail: Offset: -853,0,0 @@ -208,6 +209,8 @@ YAK: Interval: 2 ProducibleWithLevel: Prerequisites: aircraft.upgraded + Selectable: + DecorationBounds: 30,28,0,2 TRAN: Inherits: ^Helicopter @@ -261,7 +264,8 @@ TRAN: SpawnActorOnDeath: Actor: TRAN.Husk SelectionDecorations: - VisualBounds: 40,36 + Selectable: + DecorationBounds: 40,36 HELI: Inherits: ^Helicopter @@ -319,13 +323,14 @@ HELI: Ammo: 8 AmmoCondition: ammo SelectionDecorations: - VisualBounds: 36,28 SpawnActorOnDeath: Actor: HELI.Husk SmokeTrailWhenDamaged: Offset: -427,0,0 ProducibleWithLevel: Prerequisites: aircraft.upgraded + Selectable: + DecorationBounds: 36,28 HIND: Inherits: ^Helicopter @@ -385,7 +390,6 @@ HIND: ReloadDelay: 8 AmmoCondition: ammo SelectionDecorations: - VisualBounds: 38,32 WithMuzzleOverlay: SpawnActorOnDeath: Actor: HIND.Husk @@ -393,6 +397,8 @@ HIND: Offset: -427,0,0 ProducibleWithLevel: Prerequisites: aircraft.upgraded + Selectable: + DecorationBounds: 38,32 U2: Inherits: ^NeutralPlane @@ -424,3 +430,4 @@ U2: Offset: -1c43,0,0 Interval: 2 RejectsOrders: + Interactable: diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml index d2e3cc5d1f..dddc6abfea 100644 --- a/mods/ra/rules/civilian.yaml +++ b/mods/ra/rules/civilian.yaml @@ -296,14 +296,13 @@ V19.Husk: -HitShape: -Health: -Explodes: + Interactable: BARL: Inherits: ^TechBuilding -Selectable: SelectionDecorations: RenderSelectionBars: False - CustomSelectionSize: - CustomBounds: 24,24 Health: HP: 10 Explodes: @@ -320,16 +319,15 @@ BARL: -Demolishable: EditorTilesetFilter: Categories: Decoration - CustomRenderSize: - CustomBounds: 24,24 + Interactable: + Bounds: 24,24 + Interactable: BRL3: Inherits: ^TechBuilding -Selectable: SelectionDecorations: RenderSelectionBars: False - CustomSelectionSize: - CustomBounds: 24,24 Health: HP: 10 Explodes: @@ -346,8 +344,9 @@ BRL3: -Demolishable: EditorTilesetFilter: Categories: Decoration - CustomRenderSize: - CustomBounds: 24,24 + Interactable: + Bounds: 24,24 + Interactable: AMMOBOX1: Inherits: ^AmmoBox @@ -487,16 +486,14 @@ BRIDGE1: Building: Footprint: _____ _____ _____ Dimensions: 5,3 - CustomSelectionSize: - CustomBounds: 120,72 FreeActor@north: Actor: bridgehut SpawnOffset: 2,-1 FreeActor@south: Actor: bridgehut SpawnOffset: 0,1 - CustomRenderSize: - CustomBounds: 120,72 + Interactable: + Bounds: 120,72 BRIDGE2: Inherits: ^Bridge @@ -507,16 +504,14 @@ BRIDGE2: Building: Footprint: _____ _____ Dimensions: 5,2 - CustomSelectionSize: - CustomBounds: 120,48 FreeActor@north: Actor: bridgehut SpawnOffset: 0,-1 FreeActor@south: Actor: bridgehut SpawnOffset: 2,1 - CustomRenderSize: - CustomBounds: 120,48 + Interactable: + Bounds: 120,48 SBRIDGE1: Inherits: ^Bridge @@ -527,16 +522,14 @@ SBRIDGE1: Building: Footprint: ___ ___ Dimensions: 3,2 - CustomSelectionSize: - CustomBounds: 72,48 FreeActor@north: Actor: bridgehut.small SpawnOffset: 1,0 FreeActor@south: Actor: bridgehut.small SpawnOffset: 1,1 - CustomRenderSize: - CustomBounds: 72,48 + Interactable: + Bounds: 72,48 SBRIDGE2: Inherits: ^Bridge @@ -547,16 +540,14 @@ SBRIDGE2: Building: Footprint: __ __ __ Dimensions: 2,3 - CustomSelectionSize: - CustomBounds: 48,72 FreeActor@west: Actor: bridgehut.small SpawnOffset: 0,1 FreeActor@east: Actor: bridgehut.small SpawnOffset: 1,1 - CustomRenderSize: - CustomBounds: 48,72 + Interactable: + Bounds: 48,72 SBRIDGE3: Inherits: ^Bridge @@ -790,8 +781,8 @@ WINDMILL: RequireTilesets: TEMPERAT Selectable: Bounds: 24,24,0,-14 + DecorationBounds: 36,36,0,-14 SelectionDecorations: - VisualBounds: 36,36,0,-14 Tooltip: Name: Windmill Building: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 2613c7437c..cb5720d3c3 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -10,9 +10,7 @@ ^SpriteActor: BodyOrientation: QuantizeFacingsFromSequence: - AutoSelectionSize: RenderSprites: - AutoRenderSize: ^1x1Shape: HitShape: @@ -662,6 +660,7 @@ Inherits@1: ^ExistsInWorld Inherits@2: ^SpriteActor Inherits@shape: ^1x1Shape + Interactable: Building: Dimensions: 1,1 Footprint: x @@ -773,8 +772,6 @@ -Selectable: SelectionDecorations: RenderSelectionBars: False - CustomSelectionSize: - CustomBounds: 24,24 Health: HP: 10 Explodes: @@ -787,8 +784,9 @@ Type: Light EditorTilesetFilter: Categories: Decoration - CustomRenderSize: - CustomBounds: 24,24 + Interactable: + Bounds: 24,24 + Interactable: ^CivBuilding: Inherits: ^TechBuilding @@ -822,10 +820,12 @@ -Demolishable: EditorTilesetFilter: ExcludeTilesets: INTERIOR + Interactable: ^Tree: Inherits@1: ^SpriteActor Inherits@shape: ^1x1Shape + Interactable: Tooltip: Name: Tree ShowOwnerRow: false @@ -867,6 +867,7 @@ ^TreeHusk: Inherits@1: ^SpriteActor + Interactable: RenderSprites: Palette: terrain AppearsOnRadar: @@ -884,6 +885,7 @@ ^BasicHusk: Inherits@1: ^SpriteActor + Interactable: Health: HP: 280 Armor: @@ -959,6 +961,7 @@ ^Bridge: Inherits@shape: ^1x1Shape AlwaysVisible: + Interactable: Tooltip: Name: Bridge ShowOwnerRow: false @@ -968,8 +971,6 @@ Building: Footprint: ____ ____ Dimensions: 4,2 - CustomSelectionSize: - CustomBounds: 96,48 Health: HP: 1000 Armor: @@ -977,11 +978,12 @@ ScriptTriggers: BodyOrientation: QuantizedFacings: 1 - CustomRenderSize: - CustomBounds: 96,48 + Interactable: + Bounds: 96,48 ^Rock: Inherits@1: ^SpriteActor + Interactable: Tooltip: Name: Rock ShowOwnerRow: false @@ -1009,6 +1011,7 @@ ^Crate: Inherits@1: ^SpriteActor + Interactable: HiddenUnderFog: Tooltip: Name: Crate @@ -1042,6 +1045,7 @@ ^Mine: Inherits: ^SpriteActor + Interactable: WithSpriteBody: HiddenUnderFog: Mine: diff --git a/mods/ra/rules/fakes.yaml b/mods/ra/rules/fakes.yaml index 6d76cf95eb..656c5a9214 100644 --- a/mods/ra/rules/fakes.yaml +++ b/mods/ra/rules/fakes.yaml @@ -245,8 +245,8 @@ FAPW: Image: APWR Selectable: Bounds: 72,48 + DecorationBounds: 72,68,0,-10 SelectionDecorations: - VisualBounds: 72,68,0,-10 Valued: Cost: 60 diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml index ffe29aebf0..acdf16b505 100644 --- a/mods/ra/rules/infantry.yaml +++ b/mods/ra/rules/infantry.yaml @@ -13,8 +13,8 @@ DOG: GenericName: Dog Selectable: Bounds: 12,17,-1,-4 + DecorationBounds: 12,17,-1,-4 SelectionDecorations: - VisualBounds: 12,17,-1,-4 Health: HP: 18 Mobile: @@ -673,8 +673,8 @@ Ant: Description: Irradiated insect that grew oversize. Selectable: Bounds: 24,24,0,-5 + DecorationBounds: 30,30,0,-2 SelectionDecorations: - VisualBounds: 30,30,0,-2 Health: HP: 750 Mobile: diff --git a/mods/ra/rules/misc.yaml b/mods/ra/rules/misc.yaml index 9570861b5c..361d3ad46d 100644 --- a/mods/ra/rules/misc.yaml +++ b/mods/ra/rules/misc.yaml @@ -142,6 +142,7 @@ SCRATE: Name: Steel Crate CAMERA: + Interactable: EditorOnlyTooltip: Name: (reveals area to owner) AlwaysVisible: @@ -195,16 +196,16 @@ FLARE: QuantizedFacings: 1 HiddenUnderFog: Type: CenterPosition + Interactable: Tooltip: Name: Flare ShowOwnerRow: false - AutoSelectionSize: EditorTilesetFilter: Categories: Decoration - AutoRenderSize: MINE: Inherits@1: ^SpriteActor + Interactable: HiddenUnderShroud: Tooltip: Name: Ore Mine @@ -223,6 +224,7 @@ MINE: GMINE: Inherits@1: ^SpriteActor + Interactable: HiddenUnderShroud: Tooltip: Name: Gem Mine @@ -242,6 +244,7 @@ GMINE: RAILMINE: Inherits@1: ^SpriteActor + Interactable: HiddenUnderShroud: Tooltip: Name: Abandoned Mine @@ -258,6 +261,7 @@ RAILMINE: QUEE: Inherits@1: ^SpriteActor Inherits@shape: ^2x1Shape + Interactable: HiddenUnderShroud: Tooltip: Name: Queen Ant @@ -273,6 +277,7 @@ QUEE: LAR1: Inherits@1: ^SpriteActor Inherits@shape: ^1x1Shape + Interactable: HiddenUnderShroud: Tooltip: Name: Ant Larva @@ -355,6 +360,7 @@ aircraft.upgraded: ProvidesPrerequisite: mpspawn: + Interactable: EditorOnlyTooltip: Name: (multiplayer player starting point) AlwaysVisible: @@ -368,6 +374,7 @@ mpspawn: Categories: System waypoint: + Interactable: EditorOnlyTooltip: Name: (waypoint for scripted behavior) AlwaysVisible: @@ -403,3 +410,4 @@ CTFLAG: -Targetable: EditorTilesetFilter: Categories: Decoration + Interactable: diff --git a/mods/ra/rules/ships.yaml b/mods/ra/rules/ships.yaml index c5793880f0..f53e07fa20 100644 --- a/mods/ra/rules/ships.yaml +++ b/mods/ra/rules/ships.yaml @@ -47,7 +47,6 @@ SS: FireDelay: 2 AttackFrontal: SelectionDecorations: - VisualBounds: 38,38 AutoTarget: InitialStance: HoldFire InitialStanceAI: ReturnFire @@ -63,6 +62,8 @@ SS: Weapon: UnitExplodeSubmarine EmptyWeapon: UnitExplodeSubmarine -MustBeDestroyed: + Selectable: + DecorationBounds: 38,38 MSUB: Inherits: ^Ship @@ -118,7 +119,6 @@ MSUB: FireDelay: 2 AttackFrontal: SelectionDecorations: - VisualBounds: 44,44 AutoTarget: InitialStance: HoldFire InitialStanceAI: ReturnFire @@ -130,6 +130,8 @@ MSUB: Weapon: UnitExplodeSubmarine EmptyWeapon: UnitExplodeSubmarine -MustBeDestroyed: + Selectable: + DecorationBounds: 44,44 DD: Inherits: ^Ship @@ -173,12 +175,13 @@ DD: LocalYaw: 64, -64 AttackTurreted: SelectionDecorations: - VisualBounds: 38,38 WithSpriteTurret: DetectCloaked: CloakTypes: Underwater Range: 4c0 RenderDetectionCircle: + Selectable: + DecorationBounds: 38,38 CA: Inherits: ^Ship @@ -232,11 +235,12 @@ CA: AttackTurreted: WithMuzzleOverlay: SelectionDecorations: - VisualBounds: 44,44 WithSpriteTurret@PRIMARY: Turret: primary WithSpriteTurret@SECONDARY: Turret: secondary + Selectable: + DecorationBounds: 44,44 LST: Inherits: ^Ship @@ -265,7 +269,6 @@ LST: RevealsShroud@GAPGEN: Range: 5c0 SelectionDecorations: - VisualBounds: 36,36 WithLandingCraftAnimation: OpenTerrainTypes: Clear, Rough, Road, Ore, Gems, Beach Cargo: @@ -275,6 +278,8 @@ LST: PassengerFacing: 0 LoadingCondition: notmobile -Chronoshiftable: + Selectable: + DecorationBounds: 36,36 PT: Inherits: ^Ship @@ -315,9 +320,10 @@ PT: AttackTurreted: WithMuzzleOverlay: SelectionDecorations: - VisualBounds: 36,36 WithSpriteTurret: DetectCloaked: CloakTypes: Underwater Range: 4c0 RenderDetectionCircle: + Selectable: + DecorationBounds: 36,36 diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 97f656147d..69c92c95a0 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -75,8 +75,8 @@ GAP: Description: Obscures the enemy's view with shroud.\nRequires power to operate. Selectable: Bounds: 24,24 + DecorationBounds: 24,48,0,-12 SelectionDecorations: - VisualBounds: 24,48,0,-12 WithSpriteBody: PauseOnCondition: disabled Health: @@ -341,8 +341,8 @@ IRON: Dimensions: 2,1 Selectable: Bounds: 48,28,0,2 + DecorationBounds: 50,50,0,-12 SelectionDecorations: - VisualBounds: 50,50,0,-12 Health: HP: 1000 Armor: @@ -473,8 +473,8 @@ TSLA: Name: Tesla Coil Selectable: Bounds: 24,24 + DecorationBounds: 24,40,0,-8 SelectionDecorations: - VisualBounds: 24,40,0,-8 Health: HP: 400 Armor: @@ -518,8 +518,8 @@ AGUN: Name: AA Gun Selectable: Bounds: 24,24 + DecorationBounds: 24,32,0,-4 SelectionDecorations: - VisualBounds: 24,32,0,-4 Health: HP: 400 Armor: @@ -1094,8 +1094,8 @@ PROC: LocalCenterOffset: 0,-512,0 Selectable: Bounds: 72,50,0,12 + DecorationBounds: 72,70,0,-2 SelectionDecorations: - VisualBounds: 72,70,0,-2 Targetable: TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate Health: @@ -1460,8 +1460,8 @@ APWR: LocalCenterOffset: 0,-512,0 Selectable: Bounds: 72,48 + DecorationBounds: 72,68,0,-10 SelectionDecorations: - VisualBounds: 72,68,0,-10 Health: HP: 700 Armor: @@ -1743,8 +1743,8 @@ FIX: Dimensions: 3,3 Selectable: Bounds: 68,34,0,3 + DecorationBounds: 72,48 SelectionDecorations: - VisualBounds: 72,48 Health: HP: 800 Armor: @@ -1943,6 +1943,7 @@ WOOD: BARRACKS: AlwaysVisible: + Interactable: Tooltip: Name: Infantry Production Buildable: @@ -1950,6 +1951,7 @@ BARRACKS: TECHCENTER: AlwaysVisible: + Interactable: Tooltip: Name: Tech Center Buildable: @@ -1957,6 +1959,7 @@ TECHCENTER: ANYPOWER: AlwaysVisible: + Interactable: Tooltip: Name: Power Plant Buildable: diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml index ecbb061b5e..b104585a48 100644 --- a/mods/ra/rules/vehicles.yaml +++ b/mods/ra/rules/vehicles.yaml @@ -39,11 +39,12 @@ V2RL: RequiresCondition: !ammo Sequence: empty-idle SelectionDecorations: - VisualBounds: 28,28 Explodes: Weapon: V2Explode ProducibleWithLevel: Prerequisites: vehicles.upgraded + Selectable: + DecorationBounds: 28,28 1TNK: Inherits: ^Tank @@ -125,9 +126,10 @@ V2RL: SpawnActorOnDeath: Actor: 2TNK.Husk SelectionDecorations: - VisualBounds: 28,28 ProducibleWithLevel: Prerequisites: vehicles.upgraded + Selectable: + DecorationBounds: 28,28 3TNK: Inherits: ^Tank @@ -168,9 +170,10 @@ V2RL: SpawnActorOnDeath: Actor: 3TNK.Husk SelectionDecorations: - VisualBounds: 28,28 ProducibleWithLevel: Prerequisites: vehicles.upgraded + Selectable: + DecorationBounds: 28,28 4TNK: Inherits: ^Tank @@ -225,11 +228,12 @@ V2RL: HealIfBelow: 50 DamageCooldown: 150 SelectionDecorations: - VisualBounds: 44,38,0,-4 ProducibleWithLevel: Prerequisites: vehicles.upgraded DetectCloaked: Range: 6c0 + Selectable: + DecorationBounds: 44,38,0,-4 ARTY: Inherits: ^Tank @@ -283,8 +287,8 @@ HARV: GenericName: Harvester Selectable: Priority: 7 + DecorationBounds: 42,42 SelectionDecorations: - VisualBounds: 42,42 Harvester: Capacity: 20 Resources: Ore,Gems @@ -333,8 +337,8 @@ MCV: Name: Mobile Construction Vehicle Selectable: Priority: 4 + DecorationBounds: 42,42 SelectionDecorations: - VisualBounds: 42,42 Health: HP: 600 Armor: @@ -611,9 +615,10 @@ TTNK: WithIdleOverlay@SPINNER: Sequence: spinner SelectionDecorations: - VisualBounds: 30,30 ProducibleWithLevel: Prerequisites: vehicles.upgraded + Selectable: + DecorationBounds: 30,30 FTRK: Inherits: ^Vehicle @@ -657,9 +662,10 @@ FTRK: WithMuzzleOverlay: WithSpriteTurret: SelectionDecorations: - VisualBounds: 28,28 ProducibleWithLevel: Prerequisites: vehicles.upgraded + Selectable: + DecorationBounds: 28,28 DTRK: Inherits: ^Vehicle @@ -705,7 +711,6 @@ CTNK: Tooltip: Name: Chrono Tank SelectionDecorations: - VisualBounds: 30,30 Health: HP: 450 Armor: @@ -731,6 +736,8 @@ CTNK: ChargeDelay: 300 ProducibleWithLevel: Prerequisites: vehicles.upgraded + Selectable: + DecorationBounds: 30,30 QTNK: Inherits: ^Tank @@ -756,10 +763,11 @@ QTNK: RevealsShroud@GAPGEN: Range: 4c0 SelectionDecorations: - VisualBounds: 44,38,0,-4 MadTank: Targetable: TargetTypes: Ground, MADTank, Repair, Vehicle + Selectable: + DecorationBounds: 44,38,0,-4 STNK: Inherits: ^Vehicle diff --git a/mods/ts/rules/aircraft.yaml b/mods/ts/rules/aircraft.yaml index 0b73d866eb..0298f7cc97 100644 --- a/mods/ts/rules/aircraft.yaml +++ b/mods/ts/rules/aircraft.yaml @@ -378,15 +378,13 @@ HUNTER: Hovers@CRUISING: RequiresCondition: cruising QuantizeFacingsFromSequence: - AutoSelectionSize: DrawLineToTarget: AppearsOnRadar: UseLocation: true - Selectable: + Interactable: SelectionDecorations: Palette: pips ActorLostNotification: HitShape: EditorTilesetFilter: Categories: System - AutoRenderSize: diff --git a/mods/ts/rules/bridges.yaml b/mods/ts/rules/bridges.yaml index 3d2166e6ae..ca4712cf43 100644 --- a/mods/ts/rules/bridges.yaml +++ b/mods/ts/rules/bridges.yaml @@ -23,7 +23,6 @@ CABHUT: RenderSprites: Palette: terraindecoration WithSpriteBody: - AutoSelectionSize: AppearsOnRadar: RadarColorFromTerrain: Terrain: Bridge @@ -34,7 +33,7 @@ CABHUT: Name: Bridge EditorTilesetFilter: Categories: Bridge - AutoRenderSize: + Interactable: ^LowBridge: Inherits: ^LowBridgeRamp @@ -80,10 +79,8 @@ LOBRDG_A_D: RampActors: lobrdg_r_ne, lobrdg_r_sw AOffset: 1,-1 BOffset: 1,1 - CustomSelectionSize: - CustomBounds: 96, 48 - CustomRenderSize: - CustomBounds: 96, 48 + Interactable: + Bounds: 96, 48 LOBRDG_B: Inherits: ^LowBridge @@ -118,10 +115,8 @@ LOBRDG_B_D: RampActors: lobrdg_r_nw, lobrdg_r_se AOffset: 1,1 BOffset: -1,1 - CustomSelectionSize: - CustomBounds: 96, 48 - CustomRenderSize: - CustomBounds: 96, 48 + Interactable: + Bounds: 96, 48 LOBRDG_R_SE: Inherits: ^LowBridgeRamp @@ -178,12 +173,10 @@ LOBRDG_R_SW: Name: Bridge Immobile: OccupiesSpace: false - CustomSelectionSize: - CustomBounds: 96, 144 EditorTilesetFilter: Categories: Bridge - CustomRenderSize: - CustomBounds: 96, 144 + Interactable: + Bounds: 96, 144 BRIDGE1: Inherits: ^ElevatedBridgePlaceholder diff --git a/mods/ts/rules/civilian-structures.yaml b/mods/ts/rules/civilian-structures.yaml index 83fe1d263a..430364d13d 100644 --- a/mods/ts/rules/civilian-structures.yaml +++ b/mods/ts/rules/civilian-structures.yaml @@ -1363,6 +1363,7 @@ GASPOT: Dimensions: 1, 1 Selectable: Bounds: 48, 30, 0, -4 + DecorationBounds: 48, 82, 0, -25 Power: Amount: -10 Armor: @@ -1375,7 +1376,6 @@ GASPOT: WithIdleOverlay@LIGHTS: Sequence: idle-lights SelectionDecorations: - VisualBounds: 48, 82, 0, -25 EditorTilesetFilter: Categories: Civilian building @@ -1404,8 +1404,8 @@ GALITE: Palette: alpha Selectable: Bounds: 24, 24, 0, -4 + DecorationBounds: 25, 35, 0, -12 SelectionDecorations: - VisualBounds: 25, 35, 0, -12 -Cloak@EXTERNALCLOAK: -ExternalCondition@CLOAKGENERATOR: -ExternalCondition@CRATE-CLOAK: @@ -1492,6 +1492,7 @@ UFO: Palette: terraindecoration Selectable: Bounds: 144, 72, 0, 0 + DecorationBounds: 144, 72, 0, 0 Tooltip: Name: Scrin Ship Health: @@ -1501,7 +1502,6 @@ UFO: EditorTilesetFilter: RequireTilesets: TEMPERATE SelectionDecorations: - VisualBounds: 144, 72, 0, 0 ThrowsShrapnel@SMALL: Pieces: 9, 12 ThrowsShrapnel@LARGE: diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index 2e28104beb..8826e28f9a 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -13,9 +13,7 @@ UseClassicPerspectiveFudge: False CameraPitch: 85 QuantizeFacingsFromSequence: - AutoSelectionSize: RenderSprites: - AutoRenderSize: ^GainsExperience: GainsExperience: @@ -428,12 +426,10 @@ Palette: terraindecoration WithCrateBody: Images: crate - CustomSelectionSize: - CustomBounds: 24,24 EditorTilesetFilter: Categories: System - CustomRenderSize: - CustomBounds: 24,24 + Interactable: + Bounds: 24,24 ^Wall: Inherits@1: ^SpriteActor @@ -441,6 +437,7 @@ CombatDebugOverlay: HiddenUnderShroud: AppearsOnRadar: + Interactable: Building: Dimensions: 1,1 Footprint: x @@ -485,6 +482,7 @@ Height: 768 ^BuildingPlug: + Interactable: AlwaysVisible: Building: BuildSounds: place2.aud @@ -873,6 +871,7 @@ HiddenUnderFog: Type: GroundPosition ScriptTriggers: + Interactable: Tooltip: GenericName: Destroyed Aircraft FallsToEarth: @@ -930,6 +929,7 @@ ^BlossomTree: Inherits@1: ^SpriteActor + Interactable: Tooltip: Name: Blossom Tree RenderSprites: @@ -951,6 +951,7 @@ ^Tree: Inherits@1: ^SpriteActor + Interactable: HiddenUnderShroud: RenderSprites: Palette: terraindecoration @@ -968,6 +969,7 @@ ^Rock: Inherits@1: ^SpriteActor + Interactable: HiddenUnderShroud: RenderSprites: Palette: terraindecoration @@ -985,6 +987,7 @@ ^Decoration: Inherits@1: ^SpriteActor + Interactable: HiddenUnderShroud: RenderSprites: Palette: terraindecoration @@ -1097,12 +1100,11 @@ Inherits: ^TerrainOverlay EditorOnlyTooltip: Name: Railway - AutoSelectionSize: ChangesTerrain: TerrainType: Rail EditorTilesetFilter: Categories: Railway - AutoRenderSize: + Interactable: ^Tunnel: RenderSprites: @@ -1114,16 +1116,14 @@ Building: Dimensions: 3, 3 Footprint: ___ ___ ___ - CustomSelectionSize: - CustomBounds: 144, 144 Targetable: AlwaysVisible: TunnelEntrance: Dimensions: 3, 3 EditorTilesetFilter: Categories: Tunnel - CustomRenderSize: - CustomBounds: 144, 144 + Interactable: + Bounds: 144, 144 ^Gate: Inherits: ^Building diff --git a/mods/ts/rules/gdi-infantry.yaml b/mods/ts/rules/gdi-infantry.yaml index 7f071521cb..35e80bff83 100644 --- a/mods/ts/rules/gdi-infantry.yaml +++ b/mods/ts/rules/gdi-infantry.yaml @@ -171,7 +171,6 @@ JUMPJET.Husk: VTOL: true RenderSprites: Image: jumpjet - AutoSelectionSize: WithSpriteBody: Sequence: die-falling Health: @@ -188,7 +187,7 @@ JUMPJET.Husk: FallbackSequence: die-splash EditorTilesetFilter: Categories: Husk - AutoRenderSize: + Interactable: GHOST: Inherits: ^Soldier diff --git a/mods/ts/rules/gdi-structures.yaml b/mods/ts/rules/gdi-structures.yaml index 22360c552a..93a1530ab5 100644 --- a/mods/ts/rules/gdi-structures.yaml +++ b/mods/ts/rules/gdi-structures.yaml @@ -30,6 +30,7 @@ GAPOWR: Sequence: idle-plug Selectable: Bounds: 90, 48, 0, -6 + DecorationBounds: 90, 84, 0, -12 Power: Amount: 100 RequiresCondition: !empdisable @@ -61,7 +62,6 @@ GAPOWR: Amount: 50 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 90, 84, 0, -12 GAPILE: Inherits: ^Building @@ -82,6 +82,7 @@ GAPILE: Dimensions: 2,2 Selectable: Bounds: 88, 48, 0, -8 + DecorationBounds: 88, 56, 0, -8 Health: HP: 800 Armor: @@ -112,7 +113,6 @@ GAPILE: Amount: -20 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 88, 56, 0, -8 WithTextDecoration@primary: RequiresSelection: true Text: PRIMARY @@ -140,6 +140,7 @@ GAWEAP: Dimensions: 4,3 Selectable: Bounds: 154, 96, -2, -12 + DecorationBounds: 154, 100, -2, -12 Health: HP: 1000 RevealsShroud: @@ -176,7 +177,6 @@ GAWEAP: Amount: -30 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 154, 100, -2, -12 WithTextDecoration@primary: RequiresSelection: true Text: PRIMARY @@ -231,9 +231,9 @@ GAHPAD: Amount: -10 Selectable: Bounds: 88, 66, 0, -5 + DecorationBounds: 88, 66, 0, -5 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 88, 66, 0, -5 WithTextDecoration@primary: RequiresSelection: true Text: PRIMARY @@ -259,6 +259,7 @@ GADEPT: Dimensions: 3,3 Selectable: Bounds: 96, 64, -6, -6 + DecorationBounds: 98, 68, -6, -6 Health: HP: 1100 RevealsShroud: @@ -292,7 +293,6 @@ GADEPT: Amount: -30 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 98, 68, -6, -6 RenderSprites: Image: gadept.gdi FactionImages: @@ -319,6 +319,7 @@ GARADR: Dimensions: 2,2 Selectable: Bounds: 96, 48, 0, -6 + DecorationBounds: 96, 118, 0, -38 Health: HP: 1000 Armor: @@ -342,7 +343,6 @@ GARADR: RequiresCondition: !powerdown ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 96, 118, 0, -38 GATECH: Inherits: ^Building @@ -364,6 +364,7 @@ GATECH: Dimensions: 3,2 Selectable: Bounds: 110, 60, 3, -4 + DecorationBounds: 110, 60, 3, -4 Health: HP: 500 Armor: @@ -378,7 +379,6 @@ GATECH: Amount: -150 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 110, 60, 3, -4 GAPLUG: Inherits: ^Building @@ -390,6 +390,7 @@ GAPLUG: Name: GDI Upgrade Center Selectable: Bounds: 115,72,0,-12 + DecorationBounds: 115,104,0,-24 Buildable: BuildPaletteOrder: 170 Prerequisites: proc, gatech, ~structures.gdi, ~techlevel.superweapons @@ -487,4 +488,3 @@ GAPLUG: Sequence: idle-hunterseekerb ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 115,104,0,-24 diff --git a/mods/ts/rules/gdi-support.yaml b/mods/ts/rules/gdi-support.yaml index 5b02c2e322..1ad60b7e8f 100644 --- a/mods/ts/rules/gdi-support.yaml +++ b/mods/ts/rules/gdi-support.yaml @@ -54,6 +54,7 @@ GACTWR: Building: Selectable: Bounds: 48, 36, 0, -6 + DecorationBounds: 48, 48, 0, -12 Health: HP: 500 Armor: @@ -128,7 +129,6 @@ GACTWR: tower.sam: tower.sam ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 48, 48, 0, -12 GAVULC: Inherits: ^BuildingPlug diff --git a/mods/ts/rules/gdi-vehicles.yaml b/mods/ts/rules/gdi-vehicles.yaml index dd8d68a035..1dd9e374ca 100644 --- a/mods/ts/rules/gdi-vehicles.yaml +++ b/mods/ts/rules/gdi-vehicles.yaml @@ -386,4 +386,5 @@ JUGG: RevealOnFire: ArmamentNames: deployed SelectionDecorations: - VisualBounds: 48,40,0,-8 + Selectable: + DecorationBounds: 48,40,0,-8 diff --git a/mods/ts/rules/misc.yaml b/mods/ts/rules/misc.yaml index 321cc87f7c..ab145e28e8 100644 --- a/mods/ts/rules/misc.yaml +++ b/mods/ts/rules/misc.yaml @@ -1,4 +1,5 @@ mpspawn: + Interactable: EditorOnlyTooltip: Name: (multiplayer player starting point) AlwaysVisible: @@ -12,6 +13,7 @@ mpspawn: Categories: System waypoint: + Interactable: EditorOnlyTooltip: Name: (waypoint for scripted behavior) AlwaysVisible: @@ -41,6 +43,7 @@ waypoint: Palette: colorpicker CAMERA: + Interactable: EditorOnlyTooltip: Name: (reveals area to owner) AlwaysVisible: diff --git a/mods/ts/rules/nod-infantry.yaml b/mods/ts/rules/nod-infantry.yaml index 4feeaafe24..ddb9a117cb 100644 --- a/mods/ts/rules/nod-infantry.yaml +++ b/mods/ts/rules/nod-infantry.yaml @@ -48,6 +48,7 @@ CYBORG: Description: Cybernetic infantry unit.\n Strong vs Infantry, Light armor\n Weak vs Vehicles, Aircraft Selectable: Bounds: 16,31,0,-10 + DecorationBounds: 16,31,0,-10 Voiced: VoiceSet: Cyborg Mobile: @@ -62,7 +63,6 @@ CYBORG: AttackFrontal: Voice: Attack SelectionDecorations: - VisualBounds: 16,31,0,-10 ProducibleWithLevel: Prerequisites: barracks.upgraded @@ -84,6 +84,7 @@ CYC2: Description: Elite cybernetic infantry unit.\n Strong vs Infantry, Vehicles, Buildings\n Weak vs Aircraft\nMaximum 1 can be trained. Selectable: Bounds: 16,32,-1,-12 + DecorationBounds: 16,32,-1,-12 Voiced: VoiceSet: CyborgCommando Mobile: @@ -99,7 +100,6 @@ CYC2: AttackFrontal: Voice: Attack SelectionDecorations: - VisualBounds: 16,32,-1,-12 ProducibleWithLevel: Prerequisites: barracks.upgraded diff --git a/mods/ts/rules/nod-structures.yaml b/mods/ts/rules/nod-structures.yaml index b732362bd2..fc67482561 100644 --- a/mods/ts/rules/nod-structures.yaml +++ b/mods/ts/rules/nod-structures.yaml @@ -17,6 +17,7 @@ NAPOWR: Dimensions: 2,2 Selectable: Bounds: 88, 48, 2, -6 + DecorationBounds: 88, 80, 2, -12 Health: HP: 750 Armor: @@ -35,7 +36,6 @@ NAPOWR: ScalePowerWithHealth: PowerTooltip: SelectionDecorations: - VisualBounds: 88, 80, 2, -12 NAAPWR: Inherits: ^Building @@ -56,6 +56,7 @@ NAAPWR: Dimensions: 2,3 Selectable: Bounds: 100, 54, 0, -4 + DecorationBounds: 100, 74, 0, -12 Health: HP: 750 Armor: @@ -74,7 +75,6 @@ NAAPWR: ScalePowerWithHealth: PowerTooltip: SelectionDecorations: - VisualBounds: 100, 74, 0, -12 ProvidesPrerequisite@buildingname: NAHAND: @@ -96,6 +96,7 @@ NAHAND: Dimensions: 3,2 Selectable: Bounds: 116, 60, 3, -6 + DecorationBounds: 116, 78, 3, -8 Health: HP: 800 Armor: @@ -124,7 +125,6 @@ NAHAND: Amount: -20 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 116, 78, 3, -8 WithTextDecoration@primary: RequiresSelection: true Text: PRIMARY @@ -152,6 +152,7 @@ NAWEAP: Dimensions: 4,3 Selectable: Bounds: 149, 80, -3, -10 + DecorationBounds: 149, 116, -3, -20 Health: HP: 1000 Armor: @@ -184,7 +185,6 @@ NAWEAP: Amount: -30 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 149, 116, -3, -20 WithTextDecoration@primary: RequiresSelection: true Text: PRIMARY @@ -239,9 +239,9 @@ NAHPAD: Amount: -10 Selectable: Bounds: 78, 48, 0, -6 + DecorationBounds: 78, 54, 0, -8 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 78, 54, 0, -8 WithTextDecoration@primary: RequiresSelection: true Text: PRIMARY @@ -270,6 +270,7 @@ NARADR: Dimensions: 2,2 Selectable: Bounds: 96, 48, 0, -6 + DecorationBounds: 96, 72, 0, -12 Health: HP: 1000 Armor: @@ -293,7 +294,6 @@ NARADR: RequiresCondition: !powerdown ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 96, 72, 0, -12 NATECH: Inherits: ^Building @@ -315,6 +315,7 @@ NATECH: Dimensions: 2,2 Selectable: Bounds: 86, 48, 0, -4 + DecorationBounds: 86, 58, 0, -4 Health: HP: 500 Armor: @@ -329,7 +330,6 @@ NATECH: Amount: -150 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 86, 58, 0, -4 NATMPL: Inherits: ^Building diff --git a/mods/ts/rules/nod-support.yaml b/mods/ts/rules/nod-support.yaml index e6dc2d11d3..1f43d9491a 100644 --- a/mods/ts/rules/nod-support.yaml +++ b/mods/ts/rules/nod-support.yaml @@ -99,8 +99,6 @@ NAFNCE: Direction: Y Condition: laserfence-direction-y -WithWallSpriteBody: - CustomSelectionSize: - CustomBounds: 48, 24 ExternalCondition@ACTIVE: Condition: active-posts WithWallSpriteBody@XENABLED: @@ -129,8 +127,8 @@ NAFNCE: Weapons: SmallDebris Pieces: 0, 1 Range: 2c0, 5c0 - CustomRenderSize: - CustomBounds: 48, 24 + Interactable: + Bounds: 48, 24 NALASR: Inherits: ^Defense @@ -148,6 +146,7 @@ NALASR: Building: Selectable: Bounds: 40, 30, -8, -6 + DecorationBounds: 40, 36, -8, -8 Health: HP: 500 Armor: @@ -171,7 +170,6 @@ NALASR: Amount: -40 RequiresCondition: !powerdown SelectionDecorations: - VisualBounds: 40, 36, -8, -8 BodyOrientation: QuantizedFacings: 0 @@ -194,6 +192,7 @@ NAOBEL: Dimensions: 2,2 Selectable: Bounds: 88, 42, 0, -6 + DecorationBounds: 88, 72, 0, -12 Health: HP: 725 Armor: @@ -221,7 +220,6 @@ NAOBEL: Amount: -150 RequiresCondition: !powerdown SelectionDecorations: - VisualBounds: 88, 72, 0, -12 NASAM: Inherits: ^Defense @@ -238,6 +236,7 @@ NASAM: Description: Nod Anti-Air base defense.\nRequires power to operate.\n Strong vs Aircraft\n Weak vs Ground units Selectable: Bounds: 40, 30, -3, -8 + DecorationBounds: 40, 36, -3, -8 Health: HP: 600 Armor: @@ -260,7 +259,6 @@ NASAM: Amount: -30 RequiresCondition: !powerdown SelectionDecorations: - VisualBounds: 40, 36, -3, -8 NASTLH: Inherits: ^Building @@ -305,8 +303,8 @@ NASTLH: AffectsParent: true Selectable: Bounds: 106, 48, 8, -6 + DecorationBounds: 106, 60, 8, -15 SelectionDecorations: - VisualBounds: 106, 60, 8, -15 NAMISL: Inherits: ^Building @@ -329,6 +327,7 @@ NAMISL: Dimensions: 2,2 Selectable: Bounds: 75,48 + DecorationBounds: 75,48 Health: HP: 1000 Armor: @@ -363,7 +362,6 @@ NAMISL: CameraRange: 10c0 WithNukeLaunchOverlay: SelectionDecorations: - VisualBounds: 75,48 NAWAST: Inherits: ^Building @@ -386,6 +384,7 @@ NAWAST: Dimensions: 3,3 Selectable: Bounds: 100, 60, 5, -5 + DecorationBounds: 100, 60, 5, -5 Health: HP: 400 RevealsShroud: @@ -412,5 +411,4 @@ NAWAST: Sequence: bib ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 100, 60, 5, -5 RenderSprites: diff --git a/mods/ts/rules/shared-structures.yaml b/mods/ts/rules/shared-structures.yaml index 9f1a89296e..501891b457 100644 --- a/mods/ts/rules/shared-structures.yaml +++ b/mods/ts/rules/shared-structures.yaml @@ -46,6 +46,7 @@ GACNST: Amount: 0 Selectable: Bounds: 144, 60, 0, -6 + DecorationBounds: 144, 80, 0, -12 ProvidesPrerequisite@gdi: Factions: gdi Prerequisite: structures.gdi @@ -53,7 +54,6 @@ GACNST: Factions: nod Prerequisite: structures.nod SelectionDecorations: - VisualBounds: 144, 80, 0, -12 PROC: Inherits: ^Building @@ -72,6 +72,7 @@ PROC: Dimensions: 4,3 Selectable: Bounds: 134, 96, 0, -12 + DecorationBounds: 134, 122, 0, -18 Health: HP: 900 RevealsShroud: @@ -103,7 +104,6 @@ PROC: Amount: -30 ProvidesPrerequisite@buildingname: SelectionDecorations: - VisualBounds: 134, 122, 0, -18 RenderSprites: Image: proc.gdi FactionImages: @@ -129,6 +129,7 @@ GASILO: Dimensions: 2, 2 Selectable: Bounds: 80, 48, -5, 0 + DecorationBounds: 80, 48, -5, 0 -GivesBuildableArea: Health: HP: 300 @@ -155,12 +156,12 @@ GASILO: Power: Amount: -10 SelectionDecorations: - VisualBounds: 80, 48, -5, 0 Explodes: Weapon: TiberiumExplosion ANYPOWER: AlwaysVisible: + Interactable: Tooltip: Name: Power Plant Buildable: @@ -168,6 +169,7 @@ ANYPOWER: BARRACKS: AlwaysVisible: + Interactable: Tooltip: Name: Infantry Production Buildable: @@ -175,6 +177,7 @@ BARRACKS: FACTORY: AlwaysVisible: + Interactable: Tooltip: Name: Vehicle Production Buildable: @@ -182,6 +185,7 @@ FACTORY: RADAR: AlwaysVisible: + Interactable: Tooltip: Name: Radar Buildable: @@ -189,6 +193,7 @@ RADAR: TECH: AlwaysVisible: + Interactable: Tooltip: Name: Tech Center Buildable: diff --git a/mods/ts/rules/shared-support.yaml b/mods/ts/rules/shared-support.yaml index 9acefe7d42..4aaeda6f05 100644 --- a/mods/ts/rules/shared-support.yaml +++ b/mods/ts/rules/shared-support.yaml @@ -16,6 +16,7 @@ NAPULS: Dimensions: 2,2 Selectable: Bounds: 78, 54, 0, -12 + DecorationBounds: 78, 54, 0, -12 Health: HP: 500 Armor: @@ -37,7 +38,6 @@ NAPULS: Amount: -150 RequiresCondition: !powerdown SelectionDecorations: - VisualBounds: 78, 54, 0, -12 RenderSprites: Image: napuls.gdi FactionImages: diff --git a/mods/ts/rules/shared-vehicles.yaml b/mods/ts/rules/shared-vehicles.yaml index e64682c026..6fff6e555c 100644 --- a/mods/ts/rules/shared-vehicles.yaml +++ b/mods/ts/rules/shared-vehicles.yaml @@ -12,6 +12,7 @@ MCV: Name: Mobile Construction Vehicle Selectable: Priority: 3 + DecorationBounds: 42,42 Health: HP: 1000 Armor: @@ -33,7 +34,6 @@ MCV: NoTransformSounds: Voice: Move SelectionDecorations: - VisualBounds: 42,42 RenderSprites: Image: mcv.gdi FactionImages: @@ -55,6 +55,7 @@ HARV: Selectable: Priority: 7 Bounds: 36,36 + DecorationBounds: 36,36 Harvester: DeliveryBuildings: proc Capacity: 28 @@ -98,7 +99,6 @@ HARV: LocalOffset: 543,0,0 Palette: effect SelectionDecorations: - VisualBounds: 36,36 RenderSprites: Image: harv.gdi FactionImages: diff --git a/mods/ts/rules/trees.yaml b/mods/ts/rules/trees.yaml index 09627ee25f..860d278634 100644 --- a/mods/ts/rules/trees.yaml +++ b/mods/ts/rules/trees.yaml @@ -115,10 +115,9 @@ VEINHOLE: RenderSprites: Palette: player WithSpriteBody: - AutoSelectionSize: EditorTilesetFilter: Categories: Resource spawn - AutoRenderSize: + Interactable: ^TibFlora: Inherits: ^Tree