move TextAlign out of LabelWidget
This commit is contained in:
@@ -13,11 +13,12 @@ using System.Drawing;
|
|||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
|
|
||||||
namespace OpenRA.Widgets
|
namespace OpenRA.Widgets
|
||||||
{
|
|
||||||
public class LabelWidget : Widget
|
|
||||||
{
|
{
|
||||||
public enum TextAlign { Left, Center, Right }
|
public enum TextAlign { Left, Center, Right }
|
||||||
public enum TextVAlign { Top, Middle, Bottom }
|
public enum TextVAlign { Top, Middle, Bottom }
|
||||||
|
|
||||||
|
public class LabelWidget : Widget
|
||||||
|
{
|
||||||
public string Text = null;
|
public string Text = null;
|
||||||
public TextAlign Align = TextAlign.Left;
|
public TextAlign Align = TextAlign.Left;
|
||||||
public TextVAlign VAlign = TextVAlign.Middle;
|
public TextVAlign VAlign = TextVAlign.Middle;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
Font = "Bold",
|
Font = "Bold",
|
||||||
Bounds = new Rectangle(margin + labelWidth + 10, y, labelWidth, 25),
|
Bounds = new Rectangle(margin + labelWidth + 10, y, labelWidth, 25),
|
||||||
Text = "Their Stance",
|
Text = "Their Stance",
|
||||||
Align = LabelWidget.TextAlign.Left,
|
Align = TextAlign.Left,
|
||||||
};
|
};
|
||||||
|
|
||||||
bg.AddChild(ts);
|
bg.AddChild(ts);
|
||||||
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
Font = "Bold",
|
Font = "Bold",
|
||||||
Bounds = new Rectangle(margin + 2 * labelWidth + 20, y, labelWidth, 25),
|
Bounds = new Rectangle(margin + 2 * labelWidth + 20, y, labelWidth, 25),
|
||||||
Text = "My Stance",
|
Text = "My Stance",
|
||||||
Align = LabelWidget.TextAlign.Left,
|
Align = TextAlign.Left,
|
||||||
};
|
};
|
||||||
|
|
||||||
bg.AddChild(ms);
|
bg.AddChild(ms);
|
||||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Bounds = new Rectangle(margin, y, labelWidth, 25),
|
Bounds = new Rectangle(margin, y, labelWidth, 25),
|
||||||
Text = p.PlayerName,
|
Text = p.PlayerName,
|
||||||
Align = LabelWidget.TextAlign.Left,
|
Align = TextAlign.Left,
|
||||||
Font = "Bold",
|
Font = "Bold",
|
||||||
Color = p.ColorRamp.GetColor(0),
|
Color = p.ColorRamp.GetColor(0),
|
||||||
};
|
};
|
||||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Bounds = new Rectangle( margin + labelWidth + 10, y, labelWidth, 25),
|
Bounds = new Rectangle( margin + labelWidth + 10, y, labelWidth, 25),
|
||||||
Text = p.PlayerName,
|
Text = p.PlayerName,
|
||||||
Align = LabelWidget.TextAlign.Left,
|
Align = TextAlign.Left,
|
||||||
|
|
||||||
GetText = () => pp.Stances[ world.LocalPlayer ].ToString(),
|
GetText = () => pp.Stances[ world.LocalPlayer ].ToString(),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
{
|
{
|
||||||
itemTemplate.IsVisible = () => true;
|
itemTemplate.IsVisible = () => true;
|
||||||
itemTemplate.GetWidget<LabelWidget>("TITLE").GetText = () => "No Music Installed";
|
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)
|
foreach (var kv in Rules.InstalledMusic)
|
||||||
|
|||||||
Reference in New Issue
Block a user