Make states better defined

This commit is contained in:
Dean Herbert 2024-10-01 17:41:59 +09:00
parent ad3007eaad
commit 3d54f4a5ab
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -6,12 +6,12 @@ namespace osu.Game.Screens.Play
public enum LocalUserPlayingStates
{
/// <summary>
/// The local player is not current in gameplay.
/// The local player is not current in gameplay. If watching a replay, gameplay always remains in this state.
/// </summary>
NotPlaying,
/// <summary>
/// The local player is in a break, paused, or failed or passed but still at the gameplay screen.
/// The local player is in a break, paused, or failed but still at the gameplay screen.
/// </summary>
Break,

View File

@ -508,16 +508,16 @@ namespace osu.Game.Screens.Play
private void updateGameplayState()
{
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value && !GameplayState.HasFailed;
bool inBreak = breakTracker.IsBreakTime.Value || DrawableRuleset.IsPaused.Value;
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value;
bool inBreak = breakTracker.IsBreakTime.Value || DrawableRuleset.IsPaused.Value || GameplayState.HasFailed;
if (inGameplay)
playingState.Value = inBreak ? LocalUserPlayingStates.Break : LocalUserPlayingStates.Playing;
else
playingState.Value = LocalUserPlayingStates.NotPlaying;
localUserPlaying.Value = playingState.Value != LocalUserPlayingStates.NotPlaying;
OverlayActivationMode.Value = playingState.Value != LocalUserPlayingStates.NotPlaying ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
localUserPlaying.Value = playingState.Value == LocalUserPlayingStates.Playing;
OverlayActivationMode.Value = playingState.Value == LocalUserPlayingStates.Playing ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
}
private void updateSampleDisabledState()