Moves TextFieldWidget defaults to metrics.yaml.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -34,9 +34,9 @@ namespace OpenRA.Widgets
|
||||
public int CursorPosition { get; set; }
|
||||
|
||||
public Func<bool> IsDisabled = () => false;
|
||||
public Color TextColor = Color.White;
|
||||
public Color DisabledColor = Color.Gray;
|
||||
public string Font = "Regular";
|
||||
public string Font = ChromeMetrics.Get<string>("TextfieldFont");
|
||||
public Color TextColor = ChromeMetrics.Get<Color>("TextfieldColor");
|
||||
public Color TextColorDisabled = ChromeMetrics.Get<Color>("TextfieldColorDisabled");
|
||||
|
||||
public TextFieldWidget() {}
|
||||
protected TextFieldWidget(TextFieldWidget widget)
|
||||
@@ -46,7 +46,7 @@ namespace OpenRA.Widgets
|
||||
MaxLength = widget.MaxLength;
|
||||
Font = widget.Font;
|
||||
TextColor = widget.TextColor;
|
||||
DisabledColor = widget.DisabledColor;
|
||||
TextColorDisabled = widget.TextColorDisabled;
|
||||
VisualHeight = widget.VisualHeight;
|
||||
}
|
||||
|
||||
@@ -215,11 +215,11 @@ namespace OpenRA.Widgets
|
||||
Bounds.Width - LeftMargin - RightMargin, Bounds.Bottom));
|
||||
}
|
||||
|
||||
var color = disabled ? DisabledColor : TextColor;
|
||||
var color = disabled ? TextColorDisabled : TextColor;
|
||||
font.DrawText(apparentText, textPos, color);
|
||||
|
||||
if (showCursor && HasKeyboardFocus)
|
||||
font.DrawText("|", new float2(textPos.X + cursorPosition.X - 2, textPos.Y), Color.White);
|
||||
font.DrawText("|", new float2(textPos.X + cursorPosition.X - 2, textPos.Y), TextColor);
|
||||
|
||||
if (textSize.X > Bounds.Width - LeftMargin - RightMargin)
|
||||
Game.Renderer.DisableScissor();
|
||||
|
||||
@@ -11,6 +11,9 @@ Metrics:
|
||||
HotkeyFont: Regular
|
||||
HotkeyColor: 255,255,255
|
||||
HotkeyColorDisabled: 128,128,128
|
||||
TextfieldFont: Regular
|
||||
TextfieldColor: 255,255,255
|
||||
TextfieldColorDisabled: 128,128,128
|
||||
TextFont: Regular
|
||||
TextColor: 255,255,255
|
||||
TextContrast: false
|
||||
|
||||
@@ -11,6 +11,9 @@ Metrics:
|
||||
HotkeyFont: Regular
|
||||
HotkeyColor: 255,255,255
|
||||
HotkeyColorDisabled: 128,128,128
|
||||
TextfieldFont: Regular
|
||||
TextfieldColor: 255,255,255
|
||||
TextfieldColorDisabled: 128,128,128
|
||||
TextFont: Regular
|
||||
TextColor: 255,255,255
|
||||
TextContrast: false
|
||||
|
||||
@@ -11,6 +11,9 @@ Metrics:
|
||||
HotkeyFont: Regular
|
||||
HotkeyColor: 255,255,255
|
||||
HotkeyColorDisabled: 128,128,128
|
||||
TextfieldFont: Regular
|
||||
TextfieldColor: 255,255,255
|
||||
TextfieldColorDisabled: 128,128,128
|
||||
TextFont: Regular
|
||||
TextColor: 255,255,255
|
||||
TextContrast: false
|
||||
|
||||
@@ -11,6 +11,9 @@ Metrics:
|
||||
HotkeyFont: Regular
|
||||
HotkeyColor: 255,255,255
|
||||
HotkeyColorDisabled: 128,128,128
|
||||
TextfieldFont: Regular
|
||||
TextfieldColor: 255,255,255
|
||||
TextfieldColorDisabled: 128,128,128
|
||||
TextFont: Regular
|
||||
TextColor: 255,255,255
|
||||
TextContrast: false
|
||||
|
||||
Reference in New Issue
Block a user