1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 04:22:55 +08:00

hide addition bank field when no additions active

This commit is contained in:
OliBomby 2023-05-31 20:00:45 +02:00
parent fede432969
commit 9e78a6b34e

View File

@ -180,6 +180,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
updateAdditionBankPlaceholderText();
updateAdditionBankText();
updateAdditionBankActivated();
additionBank.Current.BindValueChanged(val =>
{
updateAdditionBank(val.NewValue);
@ -262,6 +263,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
additionBank.PlaceholderText = string.IsNullOrEmpty(commonAdditionBank) ? "(multiple)" : string.Empty;
}
private void updateAdditionBankActivated()
{
bool anyAdditions = relevantSamples.Any(o => o.Any(s => s.Name != HitSampleInfo.HIT_NORMAL));
if (anyAdditions)
additionBank.Show();
else
additionBank.Hide();
}
private void updateAdditionBankText()
{
if (additionBank.Current.Disabled) return;
@ -347,6 +357,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
samples.Add(relevantSample?.With(sampleName) ?? h.CreateHitSampleInfo(sampleName));
});
updateAdditionBankActivated();
updateAdditionBankText();
}
@ -365,6 +376,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
});
updateAdditionBankText();
updateAdditionBankActivated();
}
protected override bool OnKeyDown(KeyDownEvent e)