mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Skip song intro only in case of a quick restart
This commit is contained in:
parent
e411a2d187
commit
0d418559bc
@ -81,6 +81,10 @@ 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>();
|
||||
@ -287,6 +291,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
IsRestartingFromHotkey.Value = true;
|
||||
fadeOut(true);
|
||||
Restart();
|
||||
},
|
||||
@ -368,7 +373,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
skipIntroOverlay.IsSkippable.ValueChanged += (e) =>
|
||||
{
|
||||
if (RestartCount > 0 && e.NewValue)
|
||||
if (RestartedViaHotkey && e.NewValue && RestartCount > 0)
|
||||
skipIntroOverlay.RequestSkip.Invoke();
|
||||
};
|
||||
}
|
||||
|
@ -123,6 +123,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private EpilepsyWarning? epilepsyWarning;
|
||||
|
||||
private bool isHotKeyRestart;
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private INotificationOverlay? notificationOverlay { get; set; }
|
||||
|
||||
@ -363,9 +365,20 @@ 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;
|
||||
isHotKeyRestart = false;
|
||||
}
|
||||
|
||||
MetadataInfo.Loading = false;
|
||||
OnPlayerLoaded();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user