move TextAlign out of LabelWidget
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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(),
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
itemTemplate.IsVisible = () => true;
|
||||
itemTemplate.GetWidget<LabelWidget>("TITLE").GetText = () => "No Music Installed";
|
||||
itemTemplate.GetWidget<LabelWidget>("TITLE").Align = LabelWidget.TextAlign.Center;
|
||||
itemTemplate.GetWidget<LabelWidget>("TITLE").Align = TextAlign.Center;
|
||||
}
|
||||
|
||||
foreach (var kv in Rules.InstalledMusic)
|
||||
|
||||
Reference in New Issue
Block a user