diff --git a/OpenRA.Game/Widgets/TextFieldWidget.cs b/OpenRA.Game/Widgets/TextFieldWidget.cs index de1125b588..bf9a3c50d5 100644 --- a/OpenRA.Game/Widgets/TextFieldWidget.cs +++ b/OpenRA.Game/Widgets/TextFieldWidget.cs @@ -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 IsDisabled = () => false; - public Color TextColor = Color.White; - public Color DisabledColor = Color.Gray; - public string Font = "Regular"; + public string Font = ChromeMetrics.Get("TextfieldFont"); + public Color TextColor = ChromeMetrics.Get("TextfieldColor"); + public Color TextColorDisabled = ChromeMetrics.Get("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(); diff --git a/mods/cnc/metrics.yaml b/mods/cnc/metrics.yaml index faad630657..dcbaf3bfa1 100644 --- a/mods/cnc/metrics.yaml +++ b/mods/cnc/metrics.yaml @@ -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 diff --git a/mods/d2k/metrics.yaml b/mods/d2k/metrics.yaml index 1f5f933e0a..1f3a480376 100644 --- a/mods/d2k/metrics.yaml +++ b/mods/d2k/metrics.yaml @@ -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 diff --git a/mods/ra/metrics.yaml b/mods/ra/metrics.yaml index 3624347ef1..7a37014ee2 100644 --- a/mods/ra/metrics.yaml +++ b/mods/ra/metrics.yaml @@ -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 diff --git a/mods/ts/metrics.yaml b/mods/ts/metrics.yaml index 40cdc94b0c..f0e66e52a0 100644 --- a/mods/ts/metrics.yaml +++ b/mods/ts/metrics.yaml @@ -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