Allow profile and beatmap overlays to coexist
Apologies for submitting this PR without prior discussion. The changes are relatively minor, so please feel free to close it if it doesn't align with the project's direction.
I noticed the long-standing issue at https://github.com/ppy/osu/issues/5063, and I've personally experienced this inconvenience while playing.
I reviewed the code, and found
https://github.com/ppy/osu/blob/4ec526874b33f9c35f564757a93fc563d7649a15/osu.Game/OsuGame.cs#L1266
the comments suggest that informational overlays are intended to be implemented as a stack. However, they currently they are singletons, allowing only one overlay to be displayed at a time. Refactoring these overlays from singletons to multiple instances to achieve a true stack would involve significant development effort.
In this PR, my approach is to allow informational overlays to coexist. When a user navigates to a specific overlay, it's brought to the foreground with the popIn animation.
While this doesn't implement a stacked overlay system, but the user can open the userProfile and beatmap and return to the previous. I believe this is a relatively low-cost solution for now.
screen recording:
https://github.com/user-attachments/assets/d8d79ccf-7f37-45ad-8990-f46bc1a9a2a9
If you find this approach suitable, I can add tests for this.
Did you check performance with this? You're drawing the most expensive parts of the game all at the same time. There's very little chance this will stand up performance-wise.
Did you check performance with this? You're drawing the most expensive parts of the game all at the same time. There's very little chance this will stand up performance-wise.
You're right, the frame generation time has indeed increased significantly. I'm wondering if we could optimize this by hiding the covered overlays when multiple FullscreenOverlays are present on the screen?
Hey, I fixed the stuff you mentioned in the review.
The only snag is, this solution kinda makes both the profile and beatmap render at the same time. I tried optimizing it to only show the top overlay, but the scope of the changes is quite extensive, especially in OsuGame.cs,
I'm still new to the codebase, so big refactors like that are a bit beyond me right now. Thinking it's best to just close this PR for now.