mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge branch 'master' into fix-selecting-incompatible-freemods
This commit is contained in:
@ -172,6 +172,18 @@ namespace osu.Game.Screens.Menu
|
||||
return;
|
||||
}
|
||||
|
||||
// disabled until the underlying runtime issue is resolved, see https://github.com/mono/mono/issues/20805.
|
||||
if (RuntimeInfo.OS == RuntimeInfo.Platform.iOS)
|
||||
{
|
||||
notifications?.Post(new SimpleNotification
|
||||
{
|
||||
Text = "Multiplayer is temporarily unavailable on iOS as we figure out some low level issues.",
|
||||
Icon = FontAwesome.Solid.AppleAlt,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
OnMultiplayer?.Invoke();
|
||||
}
|
||||
|
||||
|
@ -427,11 +427,18 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void updatePauseOnFocusLostState()
|
||||
{
|
||||
if (!PauseOnFocusLost || breakTracker.IsBreakTime.Value)
|
||||
if (!PauseOnFocusLost || !pausingSupportedByCurrentState || breakTracker.IsBreakTime.Value)
|
||||
return;
|
||||
|
||||
if (gameActive.Value == false)
|
||||
Pause();
|
||||
{
|
||||
bool paused = Pause();
|
||||
|
||||
// if the initial pause could not be satisfied, the pause cooldown may be active.
|
||||
// reschedule the pause attempt until it can be achieved.
|
||||
if (!paused)
|
||||
Scheduler.AddOnce(updatePauseOnFocusLostState);
|
||||
}
|
||||
}
|
||||
|
||||
private IBeatmap loadPlayableBeatmap()
|
||||
@ -674,6 +681,9 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private double? lastPauseActionTime;
|
||||
|
||||
protected bool PauseCooldownActive =>
|
||||
lastPauseActionTime.HasValue && GameplayClockContainer.GameplayClock.CurrentTime < lastPauseActionTime + pause_cooldown;
|
||||
|
||||
/// <summary>
|
||||
/// A set of conditionals which defines whether the current game state and configuration allows for
|
||||
/// pausing to be attempted via <see cref="Pause"/>. If false, the game should generally exit if a user pause
|
||||
@ -684,11 +694,9 @@ namespace osu.Game.Screens.Play
|
||||
LoadedBeatmapSuccessfully && Configuration.AllowPause && ValidForResume
|
||||
// replays cannot be paused and exit immediately
|
||||
&& !DrawableRuleset.HasReplayLoaded.Value
|
||||
// cannot pause if we are already in a fail state
|
||||
&& !HasFailed;
|
||||
|
||||
private bool pauseCooldownActive =>
|
||||
lastPauseActionTime.HasValue && GameplayClockContainer.GameplayClock.CurrentTime < lastPauseActionTime + pause_cooldown;
|
||||
|
||||
private bool canResume =>
|
||||
// cannot resume from a non-paused state
|
||||
GameplayClockContainer.IsPaused.Value
|
||||
@ -697,12 +705,12 @@ namespace osu.Game.Screens.Play
|
||||
// already resuming
|
||||
&& !IsResuming;
|
||||
|
||||
public void Pause()
|
||||
public bool Pause()
|
||||
{
|
||||
if (!pausingSupportedByCurrentState) return;
|
||||
if (!pausingSupportedByCurrentState) return false;
|
||||
|
||||
if (!IsResuming && pauseCooldownActive)
|
||||
return;
|
||||
if (!IsResuming && PauseCooldownActive)
|
||||
return false;
|
||||
|
||||
if (IsResuming)
|
||||
{
|
||||
@ -713,6 +721,7 @@ namespace osu.Game.Screens.Play
|
||||
GameplayClockContainer.Stop();
|
||||
PauseOverlay.Show();
|
||||
lastPauseActionTime = GameplayClockContainer.GameplayClock.CurrentTime;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Resume()
|
||||
|
Reference in New Issue
Block a user