From be8682fc19338223c67a457a6b5a54f6e1cde3b9 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 8 Oct 2011 17:20:29 +1300 Subject: [PATCH] move TextAlign out of LabelWidget --- OpenRA.Game/Widgets/LabelWidget.cs | 5 +++-- OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs | 8 ++++---- OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Widgets/LabelWidget.cs b/OpenRA.Game/Widgets/LabelWidget.cs index 7257b70972..3aaedc3d78 100644 --- a/OpenRA.Game/Widgets/LabelWidget.cs +++ b/OpenRA.Game/Widgets/LabelWidget.cs @@ -14,10 +14,11 @@ using OpenRA.Graphics; namespace OpenRA.Widgets { + public enum TextAlign { Left, Center, Right } + public enum TextVAlign { Top, Middle, Bottom } + public class LabelWidget : Widget { - public enum TextAlign { Left, Center, Right } - public enum TextVAlign { Top, Middle, Bottom } public string Text = null; public TextAlign Align = TextAlign.Left; public TextVAlign VAlign = TextVAlign.Middle; diff --git a/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs index 15ab8c3319..e2ca755e20 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/DiplomacyLogic.cs @@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic Font = "Bold", Bounds = new Rectangle(margin + labelWidth + 10, y, labelWidth, 25), Text = "Their Stance", - Align = LabelWidget.TextAlign.Left, + Align = TextAlign.Left, }; bg.AddChild(ts); @@ -70,7 +70,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic Font = "Bold", Bounds = new Rectangle(margin + 2 * labelWidth + 20, y, labelWidth, 25), Text = "My Stance", - Align = LabelWidget.TextAlign.Left, + Align = TextAlign.Left, }; bg.AddChild(ms); @@ -85,7 +85,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { Bounds = new Rectangle(margin, y, labelWidth, 25), Text = p.PlayerName, - Align = LabelWidget.TextAlign.Left, + Align = TextAlign.Left, Font = "Bold", Color = p.ColorRamp.GetColor(0), }; @@ -97,7 +97,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { Bounds = new Rectangle( margin + labelWidth + 10, y, labelWidth, 25), Text = p.PlayerName, - Align = LabelWidget.TextAlign.Left, + Align = TextAlign.Left, GetText = () => pp.Stances[ world.LocalPlayer ].ToString(), }; diff --git a/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs index 423eb59e6c..1965195121 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs @@ -75,7 +75,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { itemTemplate.IsVisible = () => true; itemTemplate.GetWidget("TITLE").GetText = () => "No Music Installed"; - itemTemplate.GetWidget("TITLE").Align = LabelWidget.TextAlign.Center; + itemTemplate.GetWidget("TITLE").Align = TextAlign.Center; } foreach (var kv in Rules.InstalledMusic)