Fix and enable SA1133, SA1134 style rules.

This commit is contained in:
Paul Chote
2019-05-23 18:43:21 +00:00
committed by abcdefg30
parent fbf9461890
commit 78a70be0d4
214 changed files with 1012 additions and 432 deletions

View File

@@ -25,7 +25,8 @@ namespace OpenRA.Mods.Common.Widgets
public bool DisableKeyRepeat = false;
public bool DisableKeySound = false;
[Translate] public string Text = "";
[Translate]
public string Text = "";
public TextAlign Align = TextAlign.Center;
public int LeftMargin = 5;
public int RightMargin = 5;
@@ -55,9 +56,13 @@ namespace OpenRA.Mods.Common.Widgets
public Action<MouseInput> OnMouseUp = _ => { };
protected Lazy<TooltipContainerWidget> tooltipContainer;
[Translate] public string TooltipText;
[Translate]
public string TooltipText;
public Func<string> GetTooltipText;
[Translate] public string TooltipDesc;
[Translate]
public string TooltipDesc;
public Func<string> GetTooltipDesc;
// Equivalent to OnMouseUp, but without an input arg

View File

@@ -26,7 +26,8 @@ namespace OpenRA.Mods.Common.Widgets
public Func<string> GetImageName;
public Func<string> GetImageCollection;
[Translate] public string TooltipText;
[Translate]
public string TooltipText;
Lazy<TooltipContainerWidget> tooltipContainer;
public Func<string> GetTooltipText;

View File

@@ -21,7 +21,8 @@ namespace OpenRA.Mods.Common.Widgets
public class LabelWidget : Widget
{
[Translate] public string Text = null;
[Translate]
public string Text = null;
public TextAlign Align = TextAlign.Left;
public TextVAlign VAlign = TextVAlign.Middle;
public string Font = ChromeMetrics.Get<string>("TextFont");

View File

@@ -21,7 +21,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public class ActorEditLogic : ChromeLogic
{
// Error states define overlapping bits to simplify panel reflow logic
[Flags] enum ActorIDStatus { Normal = 0, Duplicate = 1, Empty = 3 }
[Flags]
enum ActorIDStatus { Normal = 0, Duplicate = 1, Empty = 3 }
readonly WorldRenderer worldRenderer;
readonly EditorActorLayer editorActorLayer;

View File

@@ -66,9 +66,14 @@ namespace OpenRA.Mods.Common.Widgets
public readonly bool DrawTime = true;
[Translate] public readonly string ReadyText = "";
[Translate] public readonly string HoldText = "";
[Translate] public readonly string InfiniteSymbol = "\u221E";
[Translate]
public readonly string ReadyText = "";
[Translate]
public readonly string HoldText = "";
[Translate]
public readonly string InfiniteSymbol = "\u221E";
public int DisplayedIconCount { get; private set; }
public int TotalIconCount { get; private set; }

View File

@@ -22,8 +22,11 @@ namespace OpenRA.Mods.Common.Widgets
{
public class SupportPowersWidget : Widget
{
[Translate] public readonly string ReadyText = "";
[Translate] public readonly string HoldText = "";
[Translate]
public readonly string ReadyText = "";
[Translate]
public readonly string HoldText = "";
public readonly int2 IconSize = new int2(64, 48);
public readonly int IconMargin = 10;