Skip to content
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

Fix SkinEditorOverlay freezing when ReplayPlayer screen exits early #26149

Merged
merged 4 commits into from
Feb 22, 2024

Commits on Dec 26, 2023

  1. Fix SkinEditorOverlay freezing when ReplayPlayer screen exits early

    Originally when popping in, the ReplayPlayer was loaded first (if previous screen was MainMenu), and afterwards the SkinEditor component was loaded asynchronously. However, if the ReplayPlayer screen exits quickly (like in the event the beatmap has no objects), the skin editor component has not finished initializing (this is before it was even added to the component tree, so it's still not marked `Visible`), then the screen exiting will cause `OsuGame` to call SetTarget(newScreen) -> setTarget(...) which sees that the cached `skinEditor` is not visible yet, and hides/nulls the field. This is the point where LoadComponentAsync(editor, ...) finishes, and the callback sees that the cached skinEditor field is now different (null) than the one that was loaded, and never adds it to the component tree. This occurrence is unhandled and as such the SkinEditorOverlay never hides itself, consuming all input infinitely.
    
    This PR changes the loading to start loading the ReplayPlayer *after* the SkinEditor has been loaded and added to the component tree.
    Additionally, this lowers the exit delay for ReplayPlayer and changes the "no hit objects" notification to not be an error since it's a controlled exit.
    rushiiMachine committed Dec 26, 2023
    Configuration menu
    Copy the full SHA
    1d4db3b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    85a768d View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2023

  1. SkinEditor lifetime fix & show gameplay

    If the SkinEditor was created already but not finished initializing, wait for it to initialize before handling a screen change, which could possibly null the skin editor. Additionally, in the case the skin editor is already loaded but hidden, make sure to show gameplay.
    rushiiMachine committed Dec 27, 2023
    Configuration menu
    Copy the full SHA
    0c8b551 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. Configuration menu
    Copy the full SHA
    f9e92c6 View commit details
    Browse the repository at this point in the history