From 1186d40fda1261f128bf57e7d609cd37bd744920 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 23 Jul 2010 18:26:59 +1200 Subject: [PATCH] quick hack to fix unclickable tabs on buildpalette --- OpenRA.Game/Widgets/BuildPaletteWidget.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Widgets/BuildPaletteWidget.cs b/OpenRA.Game/Widgets/BuildPaletteWidget.cs index 7e9095db75..59d2085c88 100644 --- a/OpenRA.Game/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Game/Widgets/BuildPaletteWidget.cs @@ -75,7 +75,8 @@ namespace OpenRA.Widgets public override Rectangle EventBounds { - get { return new Rectangle((int)(paletteOrigin.X) - 24, (int)(paletteOrigin.Y), 215, paletteHeight + 9); } + get { return new Rectangle((int)(paletteOrigin.X) - 24, (int)(paletteOrigin.Y), 215, 48 * numActualRows); + } } public override void Tick(World world) @@ -167,6 +168,7 @@ namespace OpenRA.Widgets } int paletteHeight = 0; + int numActualRows = 0; public override void DrawInner(World world) { if (!IsVisible()) return; @@ -198,7 +200,7 @@ namespace OpenRA.Widgets var queue = world.LocalPlayer.PlayerActor.traits.Get(); var overlayBits = new List>(); - var numActualRows = Math.Max((allBuildables.Length + Columns - 1) / Columns, Rows); + numActualRows = Math.Max((allBuildables.Length + Columns - 1) / Columns, Rows); // Palette Background WidgetUtils.DrawRGBA(ChromeProvider.GetImage(paletteCollection, "top"), new float2(origin.X - 9, origin.Y - 9));