1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 10:53:21 +08:00

Merge pull request #31106 from peppy/player-settings-fix-overlap-skins

Fix player settings overlay cog overlapping skin elements
This commit is contained in:
Dan Balasescu 2024-12-13 19:30:39 +09:00 committed by GitHub
commit 35c70ceb18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
@ -43,6 +44,9 @@ namespace osu.Game.Screens.Play.HUD
private InputManager inputManager = null!;
[Resolved]
private HUDOverlay? hudOverlay { get; set; }
public PlayerSettingsOverlay()
: base(0, EXPANDED_WIDTH)
{
@ -104,6 +108,9 @@ namespace osu.Game.Screens.Play.HUD
{
base.Update();
if (hudOverlay != null)
button.Y = ToLocalSpace(hudOverlay.TopRightElements.ScreenSpaceDrawQuad.BottomRight).Y;
// Only check expanded if already expanded.
// This is because if we are always checking, it would bypass blocking overlays.
// Case in point: the skin editor overlay blocks input from reaching the player, but checking raw coordinates would make settings pop out.

View File

@ -87,7 +87,8 @@ namespace osu.Game.Screens.Play
private static bool hasShownNotificationOnce;
private readonly FillFlowContainer bottomRightElements;
private readonly FillFlowContainer topRightElements;
internal readonly FillFlowContainer TopRightElements;
internal readonly IBindable<bool> IsPlaying = new Bindable<bool>();
@ -136,7 +137,7 @@ namespace osu.Game.Screens.Play
PlayfieldSkinLayer = drawableRuleset != null
? new SkinnableContainer(new GlobalSkinnableContainerLookup(GlobalSkinnableContainers.Playfield, drawableRuleset.Ruleset.RulesetInfo)) { AlwaysPresent = true, }
: Empty(),
topRightElements = new FillFlowContainer
TopRightElements = new FillFlowContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
@ -182,7 +183,7 @@ namespace osu.Game.Screens.Play
},
};
hideTargets = new List<Drawable> { mainComponents, topRightElements, rightSettings };
hideTargets = new List<Drawable> { mainComponents, TopRightElements, rightSettings };
if (rulesetComponents != null)
hideTargets.Add(rulesetComponents);
@ -275,9 +276,9 @@ namespace osu.Game.Screens.Play
processDrawables(rulesetComponents);
if (lowestTopScreenSpaceRight.HasValue)
topRightElements.Y = MathHelper.Clamp(ToLocalSpace(new Vector2(0, lowestTopScreenSpaceRight.Value)).Y, 0, DrawHeight - topRightElements.DrawHeight);
TopRightElements.Y = MathHelper.Clamp(ToLocalSpace(new Vector2(0, lowestTopScreenSpaceRight.Value)).Y, 0, DrawHeight - TopRightElements.DrawHeight);
else
topRightElements.Y = 0;
TopRightElements.Y = 0;
if (lowestTopScreenSpaceLeft.HasValue)
LeaderboardFlow.Y = MathHelper.Clamp(ToLocalSpace(new Vector2(0, lowestTopScreenSpaceLeft.Value)).Y, 0, DrawHeight - LeaderboardFlow.DrawHeight);