Convert DisableOnUpgrade to conditions.
This commit is contained in:
@@ -491,7 +491,7 @@
|
|||||||
<Compile Include="Traits\Turreted.cs" />
|
<Compile Include="Traits\Turreted.cs" />
|
||||||
<Compile Include="Traits\ProducibleWithLevel.cs" />
|
<Compile Include="Traits\ProducibleWithLevel.cs" />
|
||||||
<Compile Include="Traits\Upgrades\GrantConditionOnDeploy.cs" />
|
<Compile Include="Traits\Upgrades\GrantConditionOnDeploy.cs" />
|
||||||
<Compile Include="Traits\Upgrades\DisableOnUpgrade.cs" />
|
<Compile Include="Traits\Upgrades\DisableOnCondition.cs" />
|
||||||
<Compile Include="Traits\Upgrades\UpgradableTrait.cs" />
|
<Compile Include="Traits\Upgrades\UpgradableTrait.cs" />
|
||||||
<Compile Include="Traits\Upgrades\ProximityExternalCondition.cs" />
|
<Compile Include="Traits\Upgrades\ProximityExternalCondition.cs" />
|
||||||
<Compile Include="Traits\Upgrades\GrantConditionOnDamageState.cs" />
|
<Compile Include="Traits\Upgrades\GrantConditionOnDamageState.cs" />
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[Desc("Disable the actor when this trait is enabled by an upgrade.")]
|
[Desc("Disable the actor when this trait is enabled by an upgrade.")]
|
||||||
public class DisableOnUpgradeInfo : UpgradableTraitInfo
|
public class DisableOnConditionInfo : UpgradableTraitInfo
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new DisableOnUpgrade(this); }
|
public override object Create(ActorInitializer init) { return new DisableOnCondition(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DisableOnUpgrade : UpgradableTrait<DisableOnUpgradeInfo>, IDisable
|
public class DisableOnCondition : UpgradableTrait<DisableOnConditionInfo>, IDisable
|
||||||
{
|
{
|
||||||
public DisableOnUpgrade(DisableOnUpgradeInfo info)
|
public DisableOnCondition(DisableOnConditionInfo info)
|
||||||
: base(info) { }
|
: base(info) { }
|
||||||
|
|
||||||
public bool Disabled { get { return !IsTraitDisabled; } }
|
public bool Disabled { get { return !IsTraitDisabled; } }
|
||||||
@@ -690,6 +690,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.Key.StartsWith("DisableOnUpgrade", StringComparison.Ordinal))
|
||||||
|
RenameNodeKey(node, "DisableOnCondition");
|
||||||
}
|
}
|
||||||
|
|
||||||
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
UpgradeOverlay@EMPDISABLE:
|
UpgradeOverlay@EMPDISABLE:
|
||||||
RequiresCondition: empdisable
|
RequiresCondition: empdisable
|
||||||
Palette: disabled
|
Palette: disabled
|
||||||
DisableOnUpgrade@EMPDISABLE:
|
DisableOnCondition@EMPDISABLE:
|
||||||
RequiresCondition: empdisable
|
RequiresCondition: empdisable
|
||||||
TimedConditionBar@EMPDISABLE:
|
TimedConditionBar@EMPDISABLE:
|
||||||
Condition: empdisable
|
Condition: empdisable
|
||||||
|
|||||||
Reference in New Issue
Block a user