Changed 'UpgradeOverlay' to 'WithColoredOverlay'

This commit is contained in:
abc013
2017-02-01 20:14:51 +01:00
parent 77a709a325
commit 851c8e6075
5 changed files with 13 additions and 8 deletions

View File

@@ -355,7 +355,7 @@
<Compile Include="Traits\Modifiers\DisabledOverlay.cs" /> <Compile Include="Traits\Modifiers\DisabledOverlay.cs" />
<Compile Include="Traits\Modifiers\FrozenUnderFog.cs" /> <Compile Include="Traits\Modifiers\FrozenUnderFog.cs" />
<Compile Include="Traits\Modifiers\HiddenUnderFog.cs" /> <Compile Include="Traits\Modifiers\HiddenUnderFog.cs" />
<Compile Include="Traits\Modifiers\UpgradeOverlay.cs" /> <Compile Include="Traits\Modifiers\WithColoredOverlay.cs" />
<Compile Include="Traits\MustBeDestroyed.cs" /> <Compile Include="Traits\MustBeDestroyed.cs" />
<Compile Include="Traits\Parachutable.cs" /> <Compile Include="Traits\Parachutable.cs" />
<Compile Include="Traits\ParaDrop.cs" /> <Compile Include="Traits\ParaDrop.cs" />

View File

@@ -15,18 +15,18 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits namespace OpenRA.Mods.Common.Traits
{ {
[Desc("Display a colored overlay when a timed upgrade is active.")] [Desc("Display a colored overlay when a timed condition is active.")]
public class UpgradeOverlayInfo : ConditionalTraitInfo public class WithColoredOverlayInfo : ConditionalTraitInfo
{ {
[Desc("Palette to use when rendering the overlay")] [Desc("Palette to use when rendering the overlay")]
[PaletteReference] public readonly string Palette = "invuln"; [PaletteReference] public readonly string Palette = "invuln";
public override object Create(ActorInitializer init) { return new UpgradeOverlay(this); } public override object Create(ActorInitializer init) { return new WithColoredOverlay(this); }
} }
public class UpgradeOverlay : ConditionalTrait<UpgradeOverlayInfo>, IRenderModifier public class WithColoredOverlay : ConditionalTrait<WithColoredOverlayInfo>, IRenderModifier
{ {
public UpgradeOverlay(UpgradeOverlayInfo info) public WithColoredOverlay(WithColoredOverlayInfo info)
: base(info) { } : base(info) { }
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r) public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)

View File

@@ -776,6 +776,11 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
// Rename UpgradeOverlay to WithColoredOverlay
if (engineVersion < 20170201)
if (node.Key.StartsWith("UpgradeOverlay", StringComparison.Ordinal))
RenameNodeKey(node, "WithColoredOverlay" + node.Key.Substring(14));
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
} }

View File

@@ -116,7 +116,7 @@
ZOffset: 256 ZOffset: 256
^IronCurtainable: ^IronCurtainable:
UpgradeOverlay@IRONCURTAIN: WithColoredOverlay@IRONCURTAIN:
RequiresCondition: invulnerability RequiresCondition: invulnerability
DamageMultiplier@IRONCURTAIN: DamageMultiplier@IRONCURTAIN:
RequiresCondition: invulnerability RequiresCondition: invulnerability

View File

@@ -79,7 +79,7 @@
Conditions: crate-firepower, crate-damage, crate-speed Conditions: crate-firepower, crate-damage, crate-speed
^EmpDisable: ^EmpDisable:
UpgradeOverlay@EMPDISABLE: WithColoredOverlay@EMPDISABLE:
RequiresCondition: empdisable RequiresCondition: empdisable
Palette: disabled Palette: disabled
DisableOnCondition@EMPDISABLE: DisableOnCondition@EMPDISABLE: