2021-06-01 15:16:01 +08:00
|
|
|
// 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.Graphics;
|
2024-03-05 08:01:46 +08:00
|
|
|
using osu.Framework.Testing;
|
2021-06-01 15:16:01 +08:00
|
|
|
using osu.Game.Rulesets;
|
|
|
|
using osu.Game.Rulesets.Osu;
|
2022-09-19 11:34:50 +08:00
|
|
|
using osu.Game.Skinning;
|
2021-06-01 15:16:01 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Gameplay
|
|
|
|
{
|
|
|
|
public abstract partial class SkinnableHUDComponentTestScene : SkinnableTestScene
|
|
|
|
{
|
|
|
|
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
|
|
|
|
|
2024-03-05 08:01:46 +08:00
|
|
|
[SetUpSteps]
|
|
|
|
public virtual void SetUpSteps()
|
|
|
|
{
|
|
|
|
AddStep("setup components", SetUpComponents);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SetUpComponents()
|
2021-06-01 15:16:01 +08:00
|
|
|
{
|
|
|
|
SetContents(skin =>
|
|
|
|
{
|
2022-09-20 23:24:29 +08:00
|
|
|
var implementation = skin is LegacySkin
|
2021-06-01 15:16:01 +08:00
|
|
|
? CreateLegacyImplementation()
|
2023-01-10 05:07:18 +08:00
|
|
|
: skin is ArgonSkin
|
|
|
|
? CreateArgonImplementation()
|
|
|
|
: CreateDefaultImplementation();
|
2021-06-01 15:16:01 +08:00
|
|
|
|
|
|
|
implementation.Anchor = Anchor.Centre;
|
|
|
|
implementation.Origin = Anchor.Centre;
|
|
|
|
return implementation;
|
|
|
|
});
|
2024-03-05 08:01:46 +08:00
|
|
|
}
|
2021-06-01 15:16:01 +08:00
|
|
|
|
|
|
|
protected abstract Drawable CreateDefaultImplementation();
|
2023-01-10 05:07:18 +08:00
|
|
|
protected virtual Drawable CreateArgonImplementation() => CreateDefaultImplementation();
|
2021-06-01 15:16:01 +08:00
|
|
|
protected abstract Drawable CreateLegacyImplementation();
|
|
|
|
}
|
|
|
|
}
|