mirror of
https://github.com/ppy/osu.git
synced 2025-02-01 01:12:54 +08:00
fix addition bank toggle can be switched off with selection
This commit is contained in:
parent
e5bc359b88
commit
ba501a8eb8
@ -150,9 +150,23 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
if (SelectionAdditionBankStates.Values.All(b => b.Value == TernaryState.False))
|
if (SelectionAdditionBankStates.Values.All(b => b.Value == TernaryState.False))
|
||||||
bindable.Value = TernaryState.True;
|
bindable.Value = TernaryState.True;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Auto should never apply when there is a selection made.
|
// Auto should never apply when there is a selection made.
|
||||||
|
if (bankName == HIT_BANK_AUTO)
|
||||||
|
break;
|
||||||
|
|
||||||
// Completely empty selections should be allowed in the case that none of the selected objects have any addition samples.
|
// Completely empty selections should be allowed in the case that none of the selected objects have any addition samples.
|
||||||
|
// This is also required to stop a bindable feedback loop when a HitObject has zero addition samples (and LINQ `All` below becomes true).
|
||||||
|
if (SelectedItems.SelectMany(enumerateAllSamples).All(h => h.All(o => o.Name == HitSampleInfo.HIT_NORMAL)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Never remove a sample bank.
|
||||||
|
// These are basically radio buttons, not toggles.
|
||||||
|
if (SelectedItems.SelectMany(enumerateAllSamples).All(h => h.Where(o => o.Name != HitSampleInfo.HIT_NORMAL).All(s => s.Bank == bankName)))
|
||||||
|
bindable.Value = TernaryState.True;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TernaryState.True:
|
case TernaryState.True:
|
||||||
|
Loading…
Reference in New Issue
Block a user