1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Add ability to adjust health bar settings in test scene

This commit is contained in:
Dean Herbert 2023-10-06 18:56:16 +09:00
parent f40e910c51
commit 71be3c8f8b
No known key found for this signature in database

View File

@ -3,6 +3,7 @@
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
@ -21,6 +22,8 @@ namespace osu.Game.Tests.Visual.Gameplay
[Cached(typeof(HealthProcessor))]
private HealthProcessor healthProcessor = new DrainingHealthProcessor(0);
private ArgonHealthDisplay healthDisplay = null!;
[SetUpSteps]
public void SetUpSteps()
{
@ -36,13 +39,25 @@ namespace osu.Game.Tests.Visual.Gameplay
RelativeSizeAxes = Axes.Both,
Colour = Color4.Gray,
},
new ArgonHealthDisplay
healthDisplay = new ArgonHealthDisplay
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
};
});
AddSliderStep("Width", 0, 1f, 1f, val =>
{
if (healthDisplay.IsNotNull())
healthDisplay.BarLength.Value = val;
});
AddSliderStep("Height", 0, 64, 0, val =>
{
if (healthDisplay.IsNotNull())
healthDisplay.BarHeight.Value = val;
});
}
[Test]