(04facf9b6) Gray out the text in disabled buttons if the button has no visible sprite (the buttons in the main menu for example looked the same when disabled)
This commit is contained in:
@@ -20,6 +20,8 @@ namespace Barotrauma
|
||||
public OnButtonDownHandler OnButtonDown;
|
||||
|
||||
public bool CanBeSelected = true;
|
||||
|
||||
private Color? defaultTextColor;
|
||||
|
||||
public override bool Enabled
|
||||
{
|
||||
@@ -30,8 +32,13 @@ namespace Barotrauma
|
||||
|
||||
set
|
||||
{
|
||||
if (value == enabled) return;
|
||||
if (value == enabled) { return; }
|
||||
enabled = value;
|
||||
if (color.A == 0)
|
||||
{
|
||||
if (defaultTextColor == null) { defaultTextColor = TextBlock.TextColor; }
|
||||
TextBlock.TextColor = enabled ? defaultTextColor.Value : defaultTextColor.Value * 0.5f;
|
||||
}
|
||||
frame.Color = enabled ? color : Color.Gray * 0.7f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user