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 NUnit.Framework;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
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
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public abstract partial class SkinnableHUDComponentTestScene : SkinnableTestScene
|
2021-06-01 15:16:01 +08:00
|
|
|
{
|
|
|
|
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
public void SetUp() => Schedule(() =>
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|