-
-
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
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).
Not sure of the status or urgency of this, are you looking to still check off the todo item in the OP or should I consider doing so part of review? |
I'll test this now, forgot. |
In testing it looks to work as expected. Tested using inserted We have downgrades enabled so it will detect the last published version and start to download / update to it. |
private Bindable<bool> localUserPlaying = null!; | ||
private IBindable<LocalUserPlayingStates> localUserPlaying = null!; |
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.
What happened here? The class doesn't exist? See android build failure.
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.
Probably something something missed in the rename because osu.Desktop.slnf
.
private Bindable<bool> localUserPlaying = null!; | |
private IBindable<LocalUserPlayingStates> localUserPlaying = null!; | |
private Bindable<bool> localUserPlaying = null!; | |
private IBindable<LocalUserPlayingState> localUserPlaying = null!; |
probably fixes.
At this point the update is already started in the background but I guess we can still block the notification from interrupting the user.
From a structural perspective, I really really don't like this one. We have way too many states flying around right now:
Resulting in a 19 file diff that is pretty rough to review. Not mentioned here: what is a "local user playing state"? why is it not a "gameplay state"? we already have a While I'm going to grit my teeth and continue powering through this one given that it's the second attempt, in the future I suggest we use |
A `false` value marks the user as being on the latest release, and notifies them as such when clicking the button in settings. In reality, we don't know whether this is the case yet - we're just deferring the check. Somewhat minor change because the chance of a user manually going into settings and clicking the button is very small.
Have made a few changes here, please check the last few commits @peppy |
@@ -10,7 +10,7 @@ namespace osu.Game.Input | |||
{ | |||
public partial class OsuUserInputManager : UserInputManager | |||
{ | |||
protected override bool AllowRightClickFromLongTouch => PlayingState.Value == LocalUserPlayingState.NotPlaying; | |||
protected override bool AllowRightClickFromLongTouch => PlayingState.Value != LocalUserPlayingState.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.
Arguable. I set this to avoid the silly hold ring from showing during breaks. And there's nothing at pause / fail that needs right click.
But if you feel strong about this then I'm fine with this change.
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.
Isn't the rest of the game interface technically available at the pause/fail screen? If you have a keyboard you can access settings, chat, user overlay, beatmap overlay, etc?
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.
Also, as far as I can tell this is a revert to master
. That said, I haven't gone through the other cases like GameplayScreenRotationLocker
which change logic from master
(again, as far as I can tell). Am I misunderstanding things?
We discussed yesterday what would it take to make it so that PR reviews didn't take many times longer than actually making changes - not making subtle changes like this would help.
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.
Fine to go with as you have it, will revisit in a future.
Second attempt at #29657 taking on feedback from #29657 (comment).
Closes #29341.