Replace UpgradeMinEnabledLevel checks with an EnabledByDefault shim.

This commit is contained in:
Paul Chote
2016-11-13 15:31:17 +00:00
parent e337048a97
commit 23f4ae5027
16 changed files with 49 additions and 21 deletions

View File

@@ -20,7 +20,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Displays a text overlay relative to the selection box.")]
public class WithTextDecorationInfo : UpgradableTraitInfo, IRulesetLoaded
public class WithTextDecorationInfo : UpgradableTraitInfo
{
[FieldLoader.Require] [Translate] public readonly string Text = null;
@@ -47,10 +47,12 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithTextDecoration(init.Self, this); }
void IRulesetLoaded<ActorInfo>.RulesetLoaded(Ruleset rules, ActorInfo info)
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
{
if (!Game.ModData.Manifest.Fonts.ContainsKey(Font))
throw new YamlException("Font '{0}' is not listed in the mod.yaml's Fonts section".F(Font));
base.RulesetLoaded(rules, ai);
}
}