Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use toggle artwork for production tabs. Change tab label color on ale…
…rted tabs. Contributes towards #1006.
  • Loading branch information
pchote committed Jul 15, 2011
1 parent 8f4c237 commit 1c29c95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs
Expand Up @@ -134,12 +134,13 @@ public override void Draw()
{
var rect = new Rectangle(origin.X + ContentWidth, origin.Y, TabWidth, rb.Height);
var hover = !leftHover && !rightHover && Widget.MouseOverWidget == this && rect.Contains(Viewport.LastMousePos);
ButtonWidget.DrawBackground("button", rect, false, tab.Queue == palette.CurrentQueue, hover);
var baseName = tab.Queue == palette.CurrentQueue ? "button-toggled" : "button";
ButtonWidget.DrawBackground(baseName, rect, false, false, hover);
ContentWidth += TabWidth - 1;

int2 textSize = font.Measure(tab.Name);
int2 position = new int2(rect.X + (rect.Width - textSize.X)/2, rect.Y + (rect.Height - textSize.Y)/2);
font.DrawTextWithContrast(tab.Name, position, Color.White, Color.Black, 1);
font.DrawTextWithContrast(tab.Name, position, tab.Queue.CurrentDone ? Color.Gold : Color.White, Color.Black, 1);
}

Game.Renderer.DisableScissor();
Expand Down

0 comments on commit 1c29c95

Please sign in to comment.