Improve consistency between the update rule code and descriptions.

This commit is contained in:
Paul Chote
2018-04-28 18:05:25 +00:00
committed by abcdefg30
parent 8c2f25e249
commit efc744dec3
7 changed files with 36 additions and 25 deletions

View File

@@ -21,20 +21,29 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
get
{
return "Map editor now requires an EditorPlayer to avoid loading all kinds of unnecessary player traits.";
return "Map editor now requires an EditorPlayer to avoid loading unnecessary player traits.\n" +
"A warning is displayed if this actor has not been defined.";
}
}
bool messageDisplayed;
bool warningRequired = true;
public override IEnumerable<string> AfterUpdate(ModData modData)
{
if (!messageDisplayed)
if (warningRequired)
{
messageDisplayed = true;
warningRequired = false;
yield return "The map editor now requires an EditorPlayer actor.\n" +
"Please add an EditorPlayer with the traits AlwaysVisible and Shroud to player.yaml\n(or a different rules yaml file of your choice).";
}
}
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
if (actorNode.KeyMatches("EditorPlayer"))
warningRequired = false;
yield break;
}
}
}

View File

@@ -22,8 +22,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
get
{
return "Mod-specific default sound values have been removed from several traits.\n" +
"The original values are added back via yaml.";
return "Mod-specific default sound values have been removed from several traits\n" +
"(" + fields.Select(f => f.Item1 + "." + f.Item2).JoinWith(", ") + ")\n" +
"Uses of these traits are listed for inspection so the values can be overriden in yaml.";
}
}
@@ -38,10 +39,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
string BuildMessage(Tuple<string, string, string, List<string>> field)
{
return "The default value for {0}.{1} has been removed.\n".F(field.Item1, field.Item2)
+ "You may wish to explicitly define `{0}: {1}` on the `{2}` trait \n".F(field.Item2, field.Item3, field.Item1)
+ "definitions on the following actors (if they have not already been inherited from a parent).\n"
+ UpdateUtils.FormatMessageList(field.Item4);
return "The default value for {0}.{1} has been removed.\n".F(field.Item1, field.Item2) +
"You may wish to explicitly define `{0}: {1}` on the `{2}` trait \n".F(field.Item2, field.Item3, field.Item1) +
"definitions on the following actors (if they have not already been inherited from a parent).\n" +
UpdateUtils.FormatMessageList(field.Item4);
}
public override IEnumerable<string> AfterUpdate(ModData modData)

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
get
{
return "HackyAI no longer automatically excludes actors with Harvester trait from attack squads.\n" +
"They need to be explicitly added to ExcludeFromSquads.";
"They need to be explicitly added to ExcludeFromSquads. HackyAI instances are listed for inspection.";
}
}
@@ -31,10 +31,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override IEnumerable<string> AfterUpdate(ModData modData)
{
if (locations.Any())
yield return "The automatic exclusion of harvesters from AI squads has been removed.\n"
+ "You may wish to add your harvester-type actors to `ExcludeFromSquads` under `UnitCommonNames`\n"
+ "on the following definitions:\n"
+ UpdateUtils.FormatMessageList(locations);
yield return "The automatic exclusion of harvesters from AI squads has been removed.\n" +
"You may wish to add your harvester-type actors to `ExcludeFromSquads` under `UnitCommonNames`\n" +
"on the following definitions:\n" +
UpdateUtils.FormatMessageList(locations);
locations.Clear();
}

View File

@@ -24,8 +24,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
get
{
return "Actor ids starting with '^' are now reserved for abstract\n" +
"inheritance templates, and will not be parsed by the game.";
return "Actor ids starting with '^' are now reserved for abstract inheritance templates.\n" +
"Definitions that may be affected are listed for inspection so that they can be renamed if necessary.";
}
}

View File

@@ -23,7 +23,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
get
{
return "The PaletteFromCurrentTileset trait and Palette field on TileSets have been removed.\n" +
"Terrain palettes are now explicitly defined on the world actor.";
"Terrain palettes are now explicitly defined on the world actor.\n" +
"Palette definitions are generated based on the Tileset metadata.";
}
}

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
get
{
return "WithReloadingSpriteTurret has been superseded by conditions.\n" +
"The trait is switched for with WithSpriteTurret.";
"Instances of this trait are replaced by WithSpriteTurret.";
}
}
@@ -31,10 +31,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override IEnumerable<string> AfterUpdate(ModData modData)
{
if (locations.Any())
yield return "WithReloadingSpriteTurret has been replaced by WithSpriteTurret\n"
+ "You should use AmmoPool.AmmoConditions to switch turret type when reloading\n"
+ "to restore the previous behaviour on the following actors:"
+ UpdateUtils.FormatMessageList(locations);
yield return "WithReloadingSpriteTurret has been replaced by WithSpriteTurret\n" +
"You should use AmmoPool.AmmoConditions to switch turret type when reloading\n" +
"to restore the previous behaviour on the following actors:\n" +
UpdateUtils.FormatMessageList(locations);
locations.Clear();
}

View File

@@ -20,8 +20,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
get
{
return "The D2k-specific WormSpawner trait was renamed to ActorSpawner,\n" +
"generalized, and moved into the common mod code.";
return "The D2k-specific WormSpawner trait was renamed to ActorSpawner, generalized,\n" +
"and moved into the common mod code. Uses of the old traits are updated to account for this.";
}
}