-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid updates (and update notifications) from appearing in more gameplay cases #30073
base: master
Are you sure you want to change the base?
Conversation
osu.Game/OsuGame.cs
Outdated
BeatmapManager.PauseImports = p.NewValue != LocalUserPlayingStates.NotPlaying; | ||
SkinManager.PauseImports = p.NewValue != LocalUserPlayingStates.NotPlaying; | ||
ScoreManager.PauseImports = p.NewValue != LocalUserPlayingStates.NotPlaying; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this stops imports from running during break time and on the fail screen, which is an extra win.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a cursory read of structure, haven't examined the logic in detail yet (or tested)
|
||
namespace osu.Game.Screens.Play | ||
{ | ||
public enum LocalUserPlayingStates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit weird for this enum name to be in plural, I'd normally expect LocalUserPlayingState
...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had it plural to avoid the classic namespace conflict with field (was called PlayingState
). Can go with non-plural not, sure.
@@ -94,6 +94,7 @@ public abstract partial class Player : ScreenWithBeatmapBackground, ISamplePlayb | |||
public IBindable<bool> LocalUserPlaying => localUserPlaying; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue this should no longer be public (or even exist).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's gonna touch a lot of tests though (take a quick look and see if you thing it's worth it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see the extent of it is mostly asserts, right? If that is accurate then I think it's worth getting rid just to lower the redundancy around here. I'll have to cross-check all of the existing conditional changes anyway to make sure nothing slipped by so that seems like a rather minor inconvenience from both authoring and reviewing angles.
osu.Game/OsuGame.cs
Outdated
// For scores, we need to allow imports during "Break" state else local user's scores will never be imported. | ||
ScoreManager.PauseImports = p.NewValue == LocalUserPlayingStates.Playing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird, can the state not transition to NotPlaying
on gameplay completion or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can try and make that happen sure.
osu.Game/Screens/Play/Player.cs
Outdated
@@ -508,7 +508,7 @@ private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime) | |||
|
|||
private void updateGameplayState() | |||
{ | |||
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value; | |||
bool inGameplay = !DrawableRuleset.HasReplayLoaded.Value && !GameplayState.HasPassed; | |||
bool inBreak = breakTracker.IsBreakTime.Value || DrawableRuleset.IsPaused.Value || GameplayState.HasFailed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm with failing being considered as "break" I'm not sure the ScoreManager.PauseImports
change is entirely correct. I'd say any sort of gameplay completion should transition the state to NotPlaying
...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I didn't originally add failing is that I thought we'd want things like imports to stay blocked while at the fail screen (else they may continue into the start of the next play). I think it's also quite crippling when imports run during HighPerformanceSession
. But maybe this is an edge case we just allow to happen for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd want things like imports to stay blocked while at the fail screen
Except for the part where you can request the failed play to be imported at the fail screen which will presumably deadlock now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably need a test and just doing as you say for now.
We had a test covering this but it wasn't within `OsuGame` so didn't have full import blocking coverage (see https://github.com/ppy/osu/blob/cbbe2f9dc04abb052a0d762aa798eba094fdd80c/osu.Game.Tests/Visual/Gameplay/TestScenePlayerLocalScoreImport.cs#L89-L88).
Second attempt at #29657 taking on feedback from #29657 (comment).
Closes #29341.