Remove duplication between ButtonWidget and ToggleButtonWidget.

This commit is contained in:
Paul Chote
2013-04-08 22:55:01 +12:00
parent 71999bdc52
commit eddc1fc0cf
8 changed files with 15 additions and 23 deletions

View File

@@ -166,14 +166,13 @@ namespace OpenRA.Widgets
public static void DrawBackground(string baseName, Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted)
{
var variant = highlighted ? "-highlighted" : "";
var state = disabled ? "-disabled" :
pressed ? "-pressed" :
hover ? "-hover" :
"";
if (highlighted)
state += "-highlighted";
WidgetUtils.DrawPanel(baseName + state, rect);
WidgetUtils.DrawPanel(baseName + variant + state, rect);
}
}
}