Allow custom button types.
This commit is contained in:
@@ -24,6 +24,7 @@ namespace OpenRA.Widgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Translate] public string Text = "";
|
[Translate] public string Text = "";
|
||||||
|
public string Background = "button";
|
||||||
public bool Depressed = false;
|
public bool Depressed = false;
|
||||||
public int VisualHeight = ChromeMetrics.Get<int>("ButtonDepth");
|
public int VisualHeight = ChromeMetrics.Get<int>("ButtonDepth");
|
||||||
public string Font = ChromeMetrics.Get<string>("ButtonFont");
|
public string Font = ChromeMetrics.Get<string>("ButtonFont");
|
||||||
@@ -76,6 +77,7 @@ namespace OpenRA.Widgets
|
|||||||
Contrast = other.Contrast;
|
Contrast = other.Contrast;
|
||||||
ContrastColor = other.ContrastColor;
|
ContrastColor = other.ContrastColor;
|
||||||
Depressed = other.Depressed;
|
Depressed = other.Depressed;
|
||||||
|
Background = other.Background;
|
||||||
VisualHeight = other.VisualHeight;
|
VisualHeight = other.VisualHeight;
|
||||||
GetText = other.GetText;
|
GetText = other.GetText;
|
||||||
GetColor = other.GetColor;
|
GetColor = other.GetColor;
|
||||||
@@ -210,7 +212,7 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
public virtual void DrawBackground(Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted)
|
public virtual void DrawBackground(Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted)
|
||||||
{
|
{
|
||||||
DrawBackground("button", rect, disabled, pressed, hover, highlighted);
|
DrawBackground(Background, rect, disabled, pressed, hover, highlighted);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawBackground(string baseName, Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted)
|
public static void DrawBackground(string baseName, Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted)
|
||||||
|
|||||||
Reference in New Issue
Block a user