Add UpgradeGrantedReferenceAttribute
This commit is contained in:
@@ -29,7 +29,7 @@ namespace OpenRA.Traits
|
|||||||
[AttributeUsage(AttributeTargets.Field)]
|
[AttributeUsage(AttributeTargets.Field)]
|
||||||
public sealed class SequenceReferenceAttribute : Attribute
|
public sealed class SequenceReferenceAttribute : Attribute
|
||||||
{
|
{
|
||||||
public readonly string ImageReference; // the field name in the same trait info that contains the image name
|
public readonly string ImageReference; // The field name in the same trait info that contains the image name.
|
||||||
public readonly bool Prefix;
|
public readonly bool Prefix;
|
||||||
public SequenceReferenceAttribute(string imageReference = null, bool prefix = false)
|
public SequenceReferenceAttribute(string imageReference = null, bool prefix = false)
|
||||||
{
|
{
|
||||||
@@ -37,4 +37,7 @@ namespace OpenRA.Traits
|
|||||||
Prefix = prefix;
|
Prefix = prefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AttributeUsage(AttributeTargets.Field)]
|
||||||
|
public sealed class UpgradeGrantedReferenceAttribute : Attribute { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
[Desc("Allows granting upgrades to actors from Lua scripts.")]
|
[Desc("Allows granting upgrades to actors from Lua scripts.")]
|
||||||
public class ScriptUpgradesCacheInfo : ITraitInfo
|
public class ScriptUpgradesCacheInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("Upgrades that can be granted from the scripts.")]
|
[Desc("Upgrades that can be granted from the scripts.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,14 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[Desc("Grants an upgrade to the collector.")]
|
[Desc("Grants an upgrade to the collector.")]
|
||||||
public class GrantUpgradeCrateActionInfo : CrateActionInfo
|
public class GrantUpgradeCrateActionInfo : CrateActionInfo
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("The upgrades to apply.")]
|
[Desc("The upgrades to apply.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Grants upgrades to the actor this is attached to when prerequisites are available.")]
|
[Desc("Grants upgrades to the actor this is attached to when prerequisites are available.")]
|
||||||
public class GlobalUpgradableInfo : ITraitInfo, Requires<UpgradeManagerInfo>
|
public class GlobalUpgradableInfo : ITraitInfo, Requires<UpgradeManagerInfo>
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("List of upgrades to apply.")]
|
[Desc("List of upgrades to apply.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
class GrantUpgradePowerInfo : SupportPowerInfo
|
class GrantUpgradePowerInfo : SupportPowerInfo
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("The upgrades to apply.")]
|
[Desc("The upgrades to apply.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
public class DeployToUpgradeInfo : ITraitInfo, Requires<UpgradeManagerInfo>
|
public class DeployToUpgradeInfo : ITraitInfo, Requires<UpgradeManagerInfo>
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("The upgrades to grant when deploying and revoke when undeploying.")]
|
[Desc("The upgrades to grant when deploying and revoke when undeploying.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Applies an upgrade to actors within a specified range.")]
|
[Desc("Applies an upgrade to actors within a specified range.")]
|
||||||
public class UpgradeActorsNearInfo : ITraitInfo
|
public class UpgradeActorsNearInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("The upgrades to grant.")]
|
[Desc("The upgrades to grant.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
{
|
{
|
||||||
public class GrantUpgradeWarhead : Warhead
|
public class GrantUpgradeWarhead : Warhead
|
||||||
{
|
{
|
||||||
|
[UpgradeGrantedReference]
|
||||||
[Desc("The upgrades to apply.")]
|
[Desc("The upgrades to apply.")]
|
||||||
public readonly string[] Upgrades = { };
|
public readonly string[] Upgrades = { };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user