2022-06-01 15:56:03 +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;
|
2023-02-02 15:20:36 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
|
using osu.Framework.Extensions.ObjectExtensions;
|
2022-07-22 15:18:14 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2023-01-11 20:04:52 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Configuration;
|
2022-06-01 15:56:03 +08:00
|
|
|
|
using osu.Game.Rulesets.Taiko.UI;
|
2022-07-22 15:18:14 +08:00
|
|
|
|
using osu.Game.Tests.Visual;
|
2022-06-01 15:56:03 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class TestSceneDrumTouchInputArea : OsuTestScene
|
2022-06-01 15:56:03 +08:00
|
|
|
|
{
|
2022-07-22 15:18:14 +08:00
|
|
|
|
private DrumTouchInputArea drumTouchInputArea = null!;
|
2022-06-01 15:56:03 +08:00
|
|
|
|
|
2023-02-02 15:20:36 +08:00
|
|
|
|
private readonly Bindable<TaikoTouchControlScheme> controlScheme = new Bindable<TaikoTouchControlScheme>();
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
|
|
|
|
var config = (TaikoRulesetConfigManager)RulesetConfigs.GetConfigFor(Ruleset.Value.CreateInstance()).AsNonNull();
|
|
|
|
|
config.BindWith(TaikoRulesetSetting.TouchControlScheme, controlScheme);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void createDrum()
|
2022-06-01 15:56:03 +08:00
|
|
|
|
{
|
2023-01-11 20:04:52 +08:00
|
|
|
|
Child = new TaikoInputManager(new TaikoRuleset().RulesetInfo)
|
2022-06-02 13:36:07 +08:00
|
|
|
|
{
|
2023-01-11 20:04:52 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Children = new Drawable[]
|
2023-01-13 03:04:37 +08:00
|
|
|
|
{
|
2023-01-11 20:04:52 +08:00
|
|
|
|
new InputDrum
|
2022-07-22 15:18:14 +08:00
|
|
|
|
{
|
2023-01-11 20:04:52 +08:00
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Height = 0.2f,
|
2022-07-22 15:18:14 +08:00
|
|
|
|
},
|
2023-01-11 20:04:52 +08:00
|
|
|
|
drumTouchInputArea = new DrumTouchInputArea
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2022-06-01 15:56:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 15:18:14 +08:00
|
|
|
|
[Test]
|
|
|
|
|
public void TestDrum()
|
2022-06-02 13:36:07 +08:00
|
|
|
|
{
|
2023-02-02 15:20:36 +08:00
|
|
|
|
AddStep("create drum", createDrum);
|
2022-07-22 15:18:14 +08:00
|
|
|
|
AddStep("show drum", () => drumTouchInputArea.Show());
|
2023-02-02 15:20:36 +08:00
|
|
|
|
|
|
|
|
|
AddStep("change scheme (kddk)", () => controlScheme.Value = TaikoTouchControlScheme.KDDK);
|
|
|
|
|
AddStep("change scheme (kkdd)", () => controlScheme.Value = TaikoTouchControlScheme.KKDD);
|
|
|
|
|
AddStep("change scheme (ddkk)", () => controlScheme.Value = TaikoTouchControlScheme.DDKK);
|
2022-06-01 15:56:03 +08:00
|
|
|
|
}
|
2023-01-11 19:26:26 +08:00
|
|
|
|
|
|
|
|
|
protected override Ruleset CreateRuleset() => new TaikoRuleset();
|
2022-06-01 15:56:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|