Proper mouseover support.

This commit is contained in:
Paul Chote
2011-07-04 04:58:56 +12:00
parent 1114293035
commit e9d67860de
10 changed files with 47 additions and 21 deletions

View File

@@ -117,7 +117,7 @@ namespace OpenRA.Widgets
var s = font.Measure(text);
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
DrawBackground("button", rb, disabled, Depressed, rb.Contains(Viewport.LastMousePos));
DrawBackground("button", rb, disabled, Depressed, Widget.MouseOverWidget == this);
font.DrawText(text, new int2(rb.X + (UsableWidth - s.X)/ 2, rb.Y + (Bounds.Height - s.Y) / 2) + stateOffset,
disabled ? Color.Gray : Color.White);
}