1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Change skin editor flow to always save on toggle

This also moves the beatmap skin disable toggle to on toggle, in line
with review feedback.

I've decided to always apply the disable, not just on the `Player`
screen. It should be assumed that if a user is in the skin editor they
are never going to need access to this anyway.
This commit is contained in:
Dean Herbert 2023-06-21 16:11:19 +09:00
parent 366dd96875
commit cb0f642ad7

View File

@ -71,6 +71,8 @@ namespace osu.Game.Overlays.SkinEditor
protected override void PopIn()
{
globallyDisableBeatmapSkinSetting();
if (skinEditor != null)
{
skinEditor.Show();
@ -96,7 +98,13 @@ namespace osu.Game.Overlays.SkinEditor
});
}
protected override void PopOut() => skinEditor?.Hide();
protected override void PopOut()
{
skinEditor?.Save(false);
skinEditor?.Hide();
globallyReenableBeatmapSkinSetting();
}
protected override void Update()
{
@ -156,24 +164,15 @@ namespace osu.Game.Overlays.SkinEditor
/// </summary>
public void SetTarget(OsuScreen screen)
{
try
{
lastTargetScreen = screen;
lastTargetScreen = screen;
if (skinEditor == null) return;
if (skinEditor == null) return;
skinEditor.Save(userTriggered: false);
// ensure the toolbar is re-hidden even if a new screen decides to try and show it.
updateComponentVisibility();
// ensure the toolbar is re-hidden even if a new screen decides to try and show it.
updateComponentVisibility();
// AddOnce with parameter will ensure the newest target is loaded if there is any overlap.
Scheduler.AddOnce(setTarget, screen);
}
finally
{
globallyReenableBeatmapSkinSetting();
}
// AddOnce with parameter will ensure the newest target is loaded if there is any overlap.
Scheduler.AddOnce(setTarget, screen);
}
private void setTarget(OsuScreen? target)
@ -189,9 +188,6 @@ namespace osu.Game.Overlays.SkinEditor
return;
}
if (target is Player)
globallyDisableBeatmapSkinSetting();
if (skinEditor.State.Value == Visibility.Visible)
skinEditor.UpdateTargetScreen(target);
else