diff --git a/OpenRA.Mods.Common/Widgets/SupportPowersWidget.cs b/OpenRA.Mods.Common/Widgets/SupportPowersWidget.cs index 20aed21a1f..4ab921e23f 100644 --- a/OpenRA.Mods.Common/Widgets/SupportPowersWidget.cs +++ b/OpenRA.Mods.Common/Widgets/SupportPowersWidget.cs @@ -28,6 +28,8 @@ namespace OpenRA.Mods.Common.Widgets [Translate] public readonly string HoldText = ""; + public readonly string OverlayFont = "TinyBold"; + public readonly int2 IconSize = new int2(64, 48); public readonly int IconMargin = 10; public readonly int2 IconSpriteOffset = int2.Zero; @@ -107,6 +109,8 @@ namespace OpenRA.Mods.Common.Widgets hotkeys = Exts.MakeArray(HotkeyCount, i => modData.Hotkeys[HotkeyPrefix + (i + 1).ToString("D2")]); + + overlayFont = Game.Renderer.Fonts[OverlayFont]; } public class SupportPowerIcon @@ -191,7 +195,6 @@ namespace OpenRA.Mods.Common.Widgets public override void Draw() { var iconOffset = 0.5f * IconSize.ToFloat2() + IconSpriteOffset; - overlayFont = Game.Renderer.Fonts["TinyBold"]; holdOffset = iconOffset - overlayFont.Measure(HoldText) / 2; readyOffset = iconOffset - overlayFont.Measure(ReadyText) / 2;