From 4de5454538b0dff1b8b4a020a7f12fcb294ccc06 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 8 Nov 2023 02:06:51 +0300 Subject: [PATCH] Bring back left-side line next to health display Makes the score counter not look weird when it reaches 8 digits --- .../Screens/Play/HUD/ArgonHealthDisplay.cs | 9 +++--- .../Screens/Play/HUD/ArgonHealthRightLine.cs | 30 +++++++++++++++++++ osu.Game/Skinning/ArgonSkin.cs | 4 +++ 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 osu.Game/Screens/Play/HUD/ArgonHealthRightLine.cs diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs index 2ae6bdcb15..b2b3181d08 100644 --- a/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ArgonHealthDisplay.cs @@ -90,12 +90,11 @@ namespace osu.Game.Screens.Play.HUD } } - private const float main_path_radius = 10f; + public const float MAIN_PATH_RADIUS = 10f; [BackgroundDependencyLoader] private void load() { - RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; InternalChild = new Container @@ -105,7 +104,7 @@ namespace osu.Game.Screens.Play.HUD { background = new BackgroundPath { - PathRadius = main_path_radius, + PathRadius = MAIN_PATH_RADIUS, }, glowBar = new BarPath { @@ -125,7 +124,7 @@ namespace osu.Game.Screens.Play.HUD Blending = BlendingParameters.Additive, BarColour = main_bar_colour, GlowColour = main_bar_glow_colour, - PathRadius = main_path_radius, + PathRadius = MAIN_PATH_RADIUS, GlowPortion = 0.6f, }, } @@ -248,7 +247,7 @@ namespace osu.Game.Screens.Play.HUD private void updatePath() { - float barLength = DrawWidth - main_path_radius * 2; + float barLength = DrawWidth - MAIN_PATH_RADIUS * 2; float curveStart = barLength - 70; float curveEnd = barLength - 40; diff --git a/osu.Game/Screens/Play/HUD/ArgonHealthRightLine.cs b/osu.Game/Screens/Play/HUD/ArgonHealthRightLine.cs new file mode 100644 index 0000000000..25918f679c --- /dev/null +++ b/osu.Game/Screens/Play/HUD/ArgonHealthRightLine.cs @@ -0,0 +1,30 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Skinning; +using osuTK; + +namespace osu.Game.Screens.Play.HUD +{ + public partial class ArgonHealthRightLine : CompositeDrawable, ISerialisableDrawable + { + public bool UsesFixedAnchor { get; set; } + + [BackgroundDependencyLoader] + private void load() + { + Size = new Vector2(50f, ArgonHealthDisplay.MAIN_PATH_RADIUS * 2); + InternalChild = new Circle + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Width = 45f, + Height = 3f, + }; + } + } +} diff --git a/osu.Game/Skinning/ArgonSkin.cs b/osu.Game/Skinning/ArgonSkin.cs index 2af3a29804..e9953b57a7 100644 --- a/osu.Game/Skinning/ArgonSkin.cs +++ b/osu.Game/Skinning/ArgonSkin.cs @@ -115,6 +115,7 @@ namespace osu.Game.Skinning var skinnableTargetWrapper = new DefaultSkinComponentsContainer(container => { var health = container.OfType().FirstOrDefault(); + var healthLine = container.OfType().FirstOrDefault(); var scoreWedge = container.OfType().FirstOrDefault(); var score = container.OfType().FirstOrDefault(); var accuracy = container.OfType().FirstOrDefault(); @@ -134,6 +135,9 @@ namespace osu.Game.Skinning health.BarHeight.Value = 30f; health.Position = new Vector2(components_x_offset, 20f); + if (healthLine != null) + healthLine.Y = health.Y; + if (scoreWedge != null) { scoreWedge.Position = new Vector2(-50, 15);