-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make ScreenFooter support subscreens
#35313
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
Conversation
ScreenFooter support subscreens
6246f31 to
c80fe7a
Compare
| [Resolved] | ||
| private ISongSelect? songSelect { get; set; } | ||
| private readonly ISongSelect? songSelect; | ||
|
|
||
| public FooterButtonOptions(ISongSelect? songSelect) | ||
| { | ||
| this.songSelect = songSelect; | ||
| } |
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 change was brought over from a previous attempt. It's somewhat irrelevant to the PR and can probably be reverted if too much. It results in the removal of OsuScreen.LoadComponentsAgainstScreenDependencies(), which I think is weird behaivour to have.
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 think it's pretty reasonable to expect that footer buttons specific to a screen can resolve dependencies from said screen. It's a pretty common pain point in use cases like popovers as well, currently (badly) solved by having popover containers nested in screens.
This particular case isn't too bad to change to ctor passing, but I really do wonder how long that conclusion will hold up as the footer sees more use.
Which is to say I'm not completely sure how to feel about this change, but I worry it will have to be reverted sooner rather than later. For the multiplayer song selects at least, do you have the knowledge that you won't need DI in footer buttons?
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've dropped the commit just to not draw this out. Simple enough to be done at any time in the future if deemed necessary.
Added back the necessary invocation here: https://github.com/ppy/osu/pull/35313/files#diff-49af9f4667a633afdb043b20538a2a6740cbb2e7cf42e7942637608346565570R118-R126
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.
Other than the singular review thread above, no real comments, this is pretty quaint.
3649d09 to
302d7df
Compare
302d7df to
4be2942
Compare
Intro
In #35117 I included changes to
OsuGamewhich allowed the footer to be displayed in subscreens for use in the playlist song selection. The change is fragile as evidenced by the failing tests, so I set out to do this more properly.This is the culmination of about 6 attempts at this, because the footer is extremely complicated. There are many edge cases to consider, such as:
OsuScreen.BackButtonVisibilityand whether theScreenFooteritself is visible.OnEntering()/OnExiting()produces slightly different behaviour.Therefore I've tried to keep the changes somewhat simple for this attempt but I still foresee this going through several refactoring efforts.
Outline
I've tried to imagine somewhat complicated scenarios here, and reduced it to tracking what I call the "leading screen" which is the most-nested 'current screen'. For example:
This is done by the new class
ScreenStackFooterwhich handles both the footer and the legacy back button almost exactly asOsuGamealready does it, except with the above leading screen detail included.Testing
Besides the new included tests, I've also tested this works with #35117.