Fix IDE0055
This rule no longer appears to be buggy, so enforce it. Some of the automated fixes are adjusted in order to improve the result. #pragma directives have no option to control indentation, so remove them where possible.
This commit is contained in:
committed by
Pavel Penev
parent
60cbf79c9b
commit
360f24f609
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNodeBuilder actorNode)
|
||||
{
|
||||
if (actorNode.ChildrenMatching("Selection").Any(x => !x.IsRemoval())
|
||||
&& !actorNode.ChildrenMatching("ControlGroups").Any())
|
||||
&& !actorNode.ChildrenMatching("ControlGroups").Any())
|
||||
actorNode.AddNode(new MiniYamlNodeBuilder("ControlGroups", ""));
|
||||
|
||||
yield break;
|
||||
|
||||
@@ -27,10 +27,11 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
public override IEnumerable<string> AfterUpdate(ModData modData)
|
||||
{
|
||||
if (locations.Count > 0)
|
||||
yield return "The *Palette fields have been removed from the *PlaceBuildingPreview traits.\n" +
|
||||
"You may wish to inspect the following definitions and define new Alpha or\n" +
|
||||
"LineBuildSegmentAlpha properties as appropriate to recreate transparency effects:\n" +
|
||||
UpdateUtils.FormatMessageList(locations);
|
||||
yield return
|
||||
"The *Palette fields have been removed from the *PlaceBuildingPreview traits.\n" +
|
||||
"You may wish to inspect the following definitions and define new Alpha or\n" +
|
||||
"LineBuildSegmentAlpha properties as appropriate to recreate transparency effects:\n" +
|
||||
UpdateUtils.FormatMessageList(locations);
|
||||
|
||||
locations.Clear();
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
public override IEnumerable<string> AfterUpdate(ModData modData)
|
||||
{
|
||||
if (locations.Count > 0)
|
||||
yield return "You must define new Color fields on the following traits:\n" +
|
||||
UpdateUtils.FormatMessageList(locations);
|
||||
yield return
|
||||
"You must define new Color fields on the following traits:\n" +
|
||||
UpdateUtils.FormatMessageList(locations);
|
||||
|
||||
locations.Clear();
|
||||
}
|
||||
|
||||
@@ -56,9 +56,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
|
||||
if (requiredMetadata.Count != 0)
|
||||
{
|
||||
yield return $"The ExplicitSequenceFilenames rule requires {requiredMetadata.JoinWith(", ")}\n" +
|
||||
"to be defined under the SpriteSequenceFormat definition in mod.yaml.\n" +
|
||||
"Add these definitions back and run the update rule again.";
|
||||
yield return
|
||||
$"The ExplicitSequenceFilenames rule requires {requiredMetadata.JoinWith(", ")}\n" +
|
||||
"to be defined under the SpriteSequenceFormat definition in mod.yaml.\n" +
|
||||
"Add these definitions back and run the update rule again.";
|
||||
disabled = true;
|
||||
}
|
||||
}
|
||||
@@ -457,8 +458,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
|
||||
var overrideFilename = filename;
|
||||
if (useTilesetCode)
|
||||
overrideFilename = filename[..1] + tilesetCodes[sequenceTileset] +
|
||||
filename[2..];
|
||||
overrideFilename = filename[..1] + tilesetCodes[sequenceTileset] + filename[2..];
|
||||
|
||||
if (addExtension)
|
||||
overrideFilename += useTilesetExtension ? tilesetExtensions[sequenceTileset] : defaultSpriteExtension;
|
||||
|
||||
@@ -26,9 +26,10 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
public override IEnumerable<string> AfterUpdate(ModData modData)
|
||||
{
|
||||
if (locations.Count > 0)
|
||||
yield return "The PaletteFromEmbeddedSpritePalette trait no longer references a sequence.\n" +
|
||||
"You must manually define Filename (and Frame if needed) on the following actors:\n" +
|
||||
UpdateUtils.FormatMessageList(locations);
|
||||
yield return
|
||||
"The PaletteFromEmbeddedSpritePalette trait no longer references a sequence.\n" +
|
||||
"You must manually define Filename (and Frame if needed) on the following actors:\n" +
|
||||
UpdateUtils.FormatMessageList(locations);
|
||||
|
||||
locations.Clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user