mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:53:21 +08:00
Improve implementation
This commit is contained in:
parent
bd43a9e96e
commit
09230304a4
@ -81,10 +81,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private bool isRestarting;
|
||||
|
||||
public bool RestartedViaHotkey;
|
||||
|
||||
public Bindable<bool> IsRestartingFromHotkey = new Bindable<bool>();
|
||||
|
||||
private Bindable<bool> mouseWheelDisabled;
|
||||
|
||||
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
|
||||
@ -291,7 +287,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
IsRestartingFromHotkey.Value = true;
|
||||
Configuration.AutomaticallySkipIntro = true;
|
||||
fadeOut(true);
|
||||
Restart();
|
||||
},
|
||||
@ -373,8 +369,11 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
skipIntroOverlay.IsSkippable.ValueChanged += e =>
|
||||
{
|
||||
if (RestartedViaHotkey && e.NewValue && RestartCount > 0)
|
||||
if (Configuration.AutomaticallySkipIntro && e.NewValue && RestartCount > 0)
|
||||
{
|
||||
Configuration.AutomaticallySkipIntro = false;
|
||||
skipIntroOverlay.RequestSkip.Invoke();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -31,5 +31,7 @@ namespace osu.Game.Screens.Play
|
||||
/// Whether the player should be allowed to skip intros/outros, advancing to the start of gameplay or the end of a storyboard.
|
||||
/// </summary>
|
||||
public bool AllowSkipping { get; set; } = true;
|
||||
|
||||
public bool AutomaticallySkipIntro { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -365,17 +365,12 @@ namespace osu.Game.Screens.Play
|
||||
CurrentPlayer = createPlayer();
|
||||
CurrentPlayer.RestartCount = restartCount++;
|
||||
CurrentPlayer.RestartRequested = restartRequested;
|
||||
CurrentPlayer.IsRestartingFromHotkey.ValueChanged += e =>
|
||||
{
|
||||
if (e.NewValue)
|
||||
isHotKeyRestart = true;
|
||||
};
|
||||
|
||||
LoadTask = LoadComponentAsync(CurrentPlayer, _ =>
|
||||
{
|
||||
if (isHotKeyRestart)
|
||||
{
|
||||
CurrentPlayer.RestartedViaHotkey = true;
|
||||
CurrentPlayer.Configuration.AutomaticallySkipIntro = true;
|
||||
isHotKeyRestart = false;
|
||||
}
|
||||
|
||||
@ -390,6 +385,11 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void restartRequested()
|
||||
{
|
||||
if (CurrentPlayer != null)
|
||||
{
|
||||
isHotKeyRestart = CurrentPlayer.Configuration.AutomaticallySkipIntro;
|
||||
}
|
||||
|
||||
hideOverlays = true;
|
||||
ValidForResume = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user