Remove duplication between ButtonWidget and ToggleButtonWidget.
This commit is contained in:
@@ -20,7 +20,6 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
public readonly string TooltipTemplate = "BUTTON_TOOLTIP";
|
||||
public readonly string TooltipText;
|
||||
public readonly string TooltipContainer;
|
||||
public Func<bool> IsToggled = () => false;
|
||||
Lazy<TooltipContainerWidget> tooltipContainer;
|
||||
|
||||
public ToggleButtonWidget()
|
||||
@@ -52,11 +51,5 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
if (TooltipContainer == null) return;
|
||||
tooltipContainer.Value.RemoveTooltip();
|
||||
}
|
||||
|
||||
public override void DrawBackground(Rectangle rect, bool disabled, bool pressed, bool hover, bool highlighted)
|
||||
{
|
||||
var baseName = IsToggled() ? "button-toggled" : "button";
|
||||
ButtonWidget.DrawBackground(baseName, rect, disabled, pressed, hover, highlighted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user