1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Fix resume overlay not appearing after pausing inside window but outside of actual playfield area

Related to https://github.com/ppy/osu/discussions/27871 (although does
not actually fix the issue with the pause button, _if_ it is to be
considered an issue - the problem there is that the gameplay cursor
gets hidden, so the other condition in the modified check takes over).

Regressed in
bce3bd55e5.
Reasoning for breakage is silent change in `this` when moving the
`Contains()` check (`DrawableRuleset` will encompass screen bounds,
while `OsuResumeOverlay` is only as big as the actual playfield).
This commit is contained in:
Bartłomiej Dach 2024-04-16 13:24:30 +02:00
parent f9873968a5
commit e5e345712e
No known key found for this signature in database

View File

@ -10,6 +10,7 @@ using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Osu.UI.Cursor;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play;
using osuTK.Graphics;
@ -26,6 +27,9 @@ namespace osu.Game.Rulesets.Osu.UI
protected override LocalisableString Message => "Click the orange cursor to resume";
[Resolved]
private DrawableRuleset? drawableRuleset { get; set; }
[BackgroundDependencyLoader]
private void load()
{
@ -38,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.UI
protected override void PopIn()
{
// Can't display if the cursor is outside the window.
if (GameplayCursor.LastFrameState == Visibility.Hidden || !Contains(GameplayCursor.ActiveCursor.ScreenSpaceDrawQuad.Centre))
if (GameplayCursor.LastFrameState == Visibility.Hidden || drawableRuleset?.Contains(GameplayCursor.ActiveCursor.ScreenSpaceDrawQuad.Centre) == false)
{
Resume();
return;