Unify widget state image suffixes (disabled, pressed, hover, focus)
- Add a property for arrows image collection (in drop-downs, scrollbars and production tabs) - Add a property for separators image collection (in drop-downs) - Add hover and disable states to the drop-down separator - Unify button, textfield and checkbox state suffixes
This commit is contained in:
committed by
Paul Chote
parent
2dda2d7689
commit
7943f4deb6
@@ -24,6 +24,17 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
return ChromeProvider.GetImage("chrome-" + world.LocalPlayer.Faction.InternalName, name);
|
||||
}
|
||||
|
||||
public static string GetStatefulImageName(string baseName, bool disabled = false, bool pressed = false, bool hover = false, bool focused = false)
|
||||
{
|
||||
var suffix = disabled ? "-disabled" :
|
||||
focused ? "-focused" :
|
||||
pressed ? "-pressed" :
|
||||
hover ? "-hover" :
|
||||
"";
|
||||
|
||||
return baseName + suffix;
|
||||
}
|
||||
|
||||
public static void DrawRGBA(Sprite s, float2 pos)
|
||||
{
|
||||
Game.Renderer.RgbaSpriteRenderer.DrawSprite(s, pos);
|
||||
|
||||
Reference in New Issue
Block a user