mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 07:42:55 +08:00
Add visual disabled state to ternary buttons
This commit is contained in:
parent
ddbeb56f0f
commit
77bd0e8d70
@ -66,6 +66,9 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
||||
|
||||
private void onAction()
|
||||
{
|
||||
if (!Button.Enabled.Value)
|
||||
return;
|
||||
|
||||
Button.Toggle();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
||||
{
|
||||
public readonly Bindable<TernaryState> Bindable;
|
||||
|
||||
public readonly Bindable<bool> Enabled = new Bindable<bool>();
|
||||
|
||||
public readonly string Description;
|
||||
|
||||
/// <summary>
|
||||
|
@ -293,14 +293,22 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
private void updateAutoBankTernaryButtonTooltip()
|
||||
{
|
||||
bool enabled = SelectionHandler.AutoSelectionBankEnabled.Value;
|
||||
|
||||
var autoBankButton = SampleBankTernaryStates.Single(t => t.Bindable == SelectionHandler.SelectionBankStates[EditorSelectionHandler.HIT_BANK_AUTO]);
|
||||
autoBankButton.Tooltip = !SelectionHandler.AutoSelectionBankEnabled.Value ? "Auto normal bank can only be used during hit object placement" : string.Empty;
|
||||
autoBankButton.Enabled.Value = enabled;
|
||||
autoBankButton.Tooltip = !enabled ? "Auto normal bank can only be used during hit object placement" : string.Empty;
|
||||
}
|
||||
|
||||
private void updateAdditionBankTernaryButtonTooltips()
|
||||
{
|
||||
bool enabled = SelectionHandler.SelectionAdditionBanksEnabled.Value;
|
||||
|
||||
foreach (var ternaryButton in SampleAdditionBankTernaryStates)
|
||||
ternaryButton.Tooltip = !SelectionHandler.SelectionAdditionBanksEnabled.Value ? "Add an addition sample first to be able to set a bank" : string.Empty;
|
||||
{
|
||||
ternaryButton.Enabled.Value = enabled;
|
||||
ternaryButton.Tooltip = !enabled ? "Add an addition sample first to be able to set a bank" : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
#region Placement
|
||||
|
Loading…
Reference in New Issue
Block a user