1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Add playfield layer to skin editor

This commit is contained in:
Dean Herbert 2023-07-28 15:48:21 +09:00
parent 5bd06832d0
commit 6cf065f6d1
2 changed files with 16 additions and 3 deletions

View File

@ -12,6 +12,7 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions.EnumExtensions; using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Configuration; using osu.Game.Configuration;
@ -103,10 +104,11 @@ namespace osu.Game.Screens.Play
private readonly List<Drawable> hideTargets; private readonly List<Drawable> hideTargets;
private readonly Drawable playfieldComponents;
public HUDOverlay(DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, bool alwaysShowLeaderboard = true) public HUDOverlay(DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, bool alwaysShowLeaderboard = true)
{ {
Drawable rulesetComponents; Drawable rulesetComponents;
this.drawableRuleset = drawableRuleset; this.drawableRuleset = drawableRuleset;
this.mods = mods; this.mods = mods;
@ -123,6 +125,9 @@ namespace osu.Game.Screens.Play
rulesetComponents = drawableRuleset != null rulesetComponents = drawableRuleset != null
? new HUDComponentsContainer(drawableRuleset.Ruleset.RulesetInfo) { AlwaysPresent = true, } ? new HUDComponentsContainer(drawableRuleset.Ruleset.RulesetInfo) { AlwaysPresent = true, }
: Empty(), : Empty(),
playfieldComponents = drawableRuleset != null
? new SkinComponentsContainer(new SkinComponentsContainerLookup(SkinComponentsContainerLookup.TargetArea.Playfield, drawableRuleset.Ruleset.RulesetInfo)) { AlwaysPresent = true, }
: Empty(),
topRightElements = new FillFlowContainer topRightElements = new FillFlowContainer
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
@ -162,7 +167,7 @@ namespace osu.Game.Screens.Play
}, },
}; };
hideTargets = new List<Drawable> { mainComponents, rulesetComponents, topRightElements }; hideTargets = new List<Drawable> { mainComponents, rulesetComponents, playfieldComponents, topRightElements };
if (!alwaysShowLeaderboard) if (!alwaysShowLeaderboard)
hideTargets.Add(LeaderboardFlow); hideTargets.Add(LeaderboardFlow);
@ -230,6 +235,11 @@ namespace osu.Game.Screens.Play
{ {
base.Update(); base.Update();
Quad playfieldScreenSpaceDrawQuad = drawableRuleset.Playfield.SkinnableComponentScreenSpaceDrawQuad;
playfieldComponents.Position = ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
playfieldComponents.Size = ToLocalSpace(playfieldScreenSpaceDrawQuad.BottomRight) - ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
float? lowestTopScreenSpaceLeft = null; float? lowestTopScreenSpaceLeft = null;
float? lowestTopScreenSpaceRight = null; float? lowestTopScreenSpaceRight = null;

View File

@ -68,7 +68,10 @@ namespace osu.Game.Skinning
MainHUDComponents, MainHUDComponents,
[Description("Song select")] [Description("Song select")]
SongSelect SongSelect,
[Description("Playfield")]
Playfield
} }
} }
} }