Add conditional showing of Clear Debug Draw buttons only if there is anything to clear
#2989
This commit is contained in:
@@ -117,7 +117,6 @@ namespace FlaxEditor.Windows
|
||||
{
|
||||
if (!AudioMuted)
|
||||
Audio.MasterVolume = value;
|
||||
|
||||
_audioVolume = value;
|
||||
}
|
||||
}
|
||||
@@ -677,6 +676,14 @@ namespace FlaxEditor.Windows
|
||||
checkbox.StateChanged += x => ShowDebugDraw = x.Checked;
|
||||
}
|
||||
|
||||
// Clear Debug Draw
|
||||
if (DebugDraw.CanClear())
|
||||
{
|
||||
var button = menu.AddButton("Clear Debug Draw");
|
||||
button.CloseMenuOnClick = false;
|
||||
button.Clicked += () => DebugDraw.Clear();
|
||||
}
|
||||
|
||||
menu.AddSeparator();
|
||||
|
||||
// Mute Audio
|
||||
@@ -695,13 +702,6 @@ namespace FlaxEditor.Windows
|
||||
slider.ValueChanged += () => AudioVolume = slider.Value;
|
||||
}
|
||||
|
||||
// Debug Draw Clear
|
||||
{
|
||||
var button = menu.AddButton("Clear Debug Draw");
|
||||
button.CloseMenuOnClick = false;
|
||||
button.Clicked += () => DebugDraw.Clear();
|
||||
}
|
||||
|
||||
menu.MinimumWidth = 200;
|
||||
menu.AddSeparator();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user