mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 10:22:54 +08:00
Added tests for new Taiko touch control schemes
This commit is contained in:
parent
d2247f704d
commit
32d1d5a34a
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Testing;
|
using osu.Game.Rulesets.Taiko.Configuration;
|
||||||
using osu.Game.Rulesets.Taiko.UI;
|
using osu.Game.Rulesets.Taiko.UI;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
@ -14,35 +14,37 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
{
|
{
|
||||||
private DrumTouchInputArea drumTouchInputArea = null!;
|
private DrumTouchInputArea drumTouchInputArea = null!;
|
||||||
|
|
||||||
[SetUpSteps]
|
private void createDrum(TaikoTouchControlScheme _forcedControlScheme)
|
||||||
public void SetUpSteps()
|
|
||||||
{
|
{
|
||||||
AddStep("create drum", () =>
|
Child = new TaikoInputManager(new TaikoRuleset().RulesetInfo)
|
||||||
{
|
{
|
||||||
Child = new TaikoInputManager(new TaikoRuleset().RulesetInfo)
|
RelativeSizeAxes = Axes.Both,
|
||||||
{
|
Children = new Drawable[]
|
||||||
RelativeSizeAxes = Axes.Both,
|
{
|
||||||
Children = new Drawable[]
|
new InputDrum
|
||||||
{
|
{
|
||||||
new InputDrum
|
Anchor = Anchor.TopCentre,
|
||||||
{
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Height = 0.2f,
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Height = 0.2f,
|
|
||||||
},
|
|
||||||
drumTouchInputArea = new DrumTouchInputArea
|
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
Origin = Anchor.BottomCentre,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
drumTouchInputArea = new DrumTouchInputArea
|
||||||
});
|
{
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
ForceControlScheme = _forcedControlScheme
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDrum()
|
public void TestDrum()
|
||||||
{
|
{
|
||||||
|
AddStep("create drum (kddk)", () => createDrum(TaikoTouchControlScheme.KDDK));
|
||||||
|
AddStep("show drum", () => drumTouchInputArea.Show());
|
||||||
|
AddStep("create drum (ddkk)", () => createDrum(TaikoTouchControlScheme.DDKK));
|
||||||
|
AddStep("show drum", () => drumTouchInputArea.Show());
|
||||||
|
AddStep("create drum (kkdd)", () => createDrum(TaikoTouchControlScheme.KKDD));
|
||||||
AddStep("show drum", () => drumTouchInputArea.Show());
|
AddStep("show drum", () => drumTouchInputArea.Show());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class DrumTouchInputArea : VisibilityContainer
|
public partial class DrumTouchInputArea : VisibilityContainer
|
||||||
{
|
{
|
||||||
|
public TaikoTouchControlScheme? ForceControlScheme { get; set; }
|
||||||
// visibility state affects our child. we always want to handle input.
|
// visibility state affects our child. we always want to handle input.
|
||||||
public override bool PropagatePositionalInputSubTree => true;
|
public override bool PropagatePositionalInputSubTree => true;
|
||||||
public override bool PropagateNonPositionalInputSubTree => true;
|
public override bool PropagateNonPositionalInputSubTree => true;
|
||||||
@ -55,7 +56,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
const float centre_region = 0.80f;
|
const float centre_region = 0.80f;
|
||||||
|
|
||||||
config.BindWith(TaikoRulesetSetting.TouchControlScheme, configTouchControlScheme);
|
if (ForceControlScheme == null)
|
||||||
|
config.BindWith(TaikoRulesetSetting.TouchControlScheme, configTouchControlScheme);
|
||||||
|
else
|
||||||
|
configTouchControlScheme.Value = (TaikoTouchControlScheme)ForceControlScheme;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user