Change editor screen selection logic to use SelectItem for sound feedback

This commit is contained in:
Salman Ahmed 2024-04-17 02:48:32 +03:00
parent 42892acc1a
commit 9e69268676

View File

@ -372,7 +372,7 @@ namespace osu.Game.Screens.Edit
}
}
},
new EditorScreenSwitcherControl
screenSwitcher = new EditorScreenSwitcherControl
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
@ -662,23 +662,23 @@ namespace osu.Game.Screens.Edit
return true;
case GlobalAction.EditorComposeMode:
Mode.Value = EditorScreenMode.Compose;
screenSwitcher.SelectItem(EditorScreenMode.Compose);
return true;
case GlobalAction.EditorDesignMode:
Mode.Value = EditorScreenMode.Design;
screenSwitcher.SelectItem(EditorScreenMode.Design);
return true;
case GlobalAction.EditorTimingMode:
Mode.Value = EditorScreenMode.Timing;
screenSwitcher.SelectItem(EditorScreenMode.Timing);
return true;
case GlobalAction.EditorSetupMode:
Mode.Value = EditorScreenMode.SongSetup;
screenSwitcher.SelectItem(EditorScreenMode.SongSetup);
return true;
case GlobalAction.EditorVerifyMode:
Mode.Value = EditorScreenMode.Verify;
screenSwitcher.SelectItem(EditorScreenMode.Verify);
return true;
case GlobalAction.EditorTestGameplay:
@ -959,6 +959,8 @@ namespace osu.Game.Screens.Edit
[CanBeNull]
private ScheduledDelegate playbackDisabledDebounce;
private EditorScreenSwitcherControl screenSwitcher;
private void updateSampleDisabledState()
{
bool shouldDisableSamples = clock.SeekingOrStopped.Value