1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-24 19:17:20 +08:00

Fix player settings overlay cog overlapping skin elements

This brings it down to be in line with the flowing elements that usually
do their best to not get in the way.

Decided against putting it in the `HUDOverlay` flow for simplicity. It
will work fine until it doesn't.
This commit is contained in:
Dean Herbert 2024-12-13 17:28:15 +09:00
parent 1e809c7f16
commit a796af9511
No known key found for this signature in database
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)
{
@ -99,6 +103,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);