1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Fix test failure

After the legacy key counter was moved to ruleset-specific component
containers, `TestSceneSkinnableHUDOverlay` no longer had a key counter,
because it wasn't creating a ruleset-specific HUD component container
due to

    4983e5f33e/osu.Game/Screens/Play/HUDOverlay.cs (L131-L133)

Therefore, to fix, do just enough persuading to make it create one.
This commit is contained in:
Bartłomiej Dach 2024-07-24 18:30:18 +02:00
parent c3dae81935
commit 12a9086aa3
No known key found for this signature in database

View File

@ -16,12 +16,13 @@ using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD;
using osu.Game.Skinning;
using osu.Game.Tests.Gameplay;
using osuTK.Input;
namespace osu.Game.Tests.Visual.Gameplay
{
@ -91,10 +92,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
SetContents(_ =>
{
hudOverlay = new HUDOverlay(null, Array.Empty<Mod>());
// Add any key just to display the key counter visually.
hudOverlay.InputCountController.Add(new KeyCounterKeyboardTrigger(Key.Space));
hudOverlay = new HUDOverlay(new DrawableOsuRuleset(new OsuRuleset(), new OsuBeatmap()), Array.Empty<Mod>());
action?.Invoke(hudOverlay);