mirror of
https://github.com/osukey/osukey.git
synced 2025-05-14 01:57:22 +09:00
Add test coverage of disabled mouse buttons
This commit is contained in:
parent
9c5789848f
commit
eaaab2e76d
@ -4,6 +4,7 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -12,6 +13,7 @@ using osu.Framework.Input.Bindings;
|
|||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Input.States;
|
using osu.Framework.Input.States;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -22,6 +24,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public partial class TestSceneTouchInput : OsuManualInputManagerTestScene
|
public partial class TestSceneTouchInput : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; } = null!;
|
||||||
|
|
||||||
private TestActionKeyCounter leftKeyCounter = null!;
|
private TestActionKeyCounter leftKeyCounter = null!;
|
||||||
|
|
||||||
private TestActionKeyCounter rightKeyCounter = null!;
|
private TestActionKeyCounter rightKeyCounter = null!;
|
||||||
@ -91,6 +96,23 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
assertKeyCounter(1, 1);
|
assertKeyCounter(1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSimpleInputButtonsDisabled()
|
||||||
|
{
|
||||||
|
AddStep("Disable mouse buttons", () => config.SetValue(OsuSetting.MouseDisableButtons, true));
|
||||||
|
|
||||||
|
beginTouch(TouchSource.Touch1);
|
||||||
|
|
||||||
|
assertKeyCounter(0, 0);
|
||||||
|
checkNotPressed(OsuAction.LeftButton);
|
||||||
|
|
||||||
|
beginTouch(TouchSource.Touch2);
|
||||||
|
|
||||||
|
assertKeyCounter(0, 0);
|
||||||
|
checkNotPressed(OsuAction.LeftButton);
|
||||||
|
checkNotPressed(OsuAction.RightButton);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAlternatingInput()
|
public void TestAlternatingInput()
|
||||||
{
|
{
|
||||||
@ -207,6 +229,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
AddStep("Release all touches", () =>
|
AddStep("Release all touches", () =>
|
||||||
{
|
{
|
||||||
|
config.SetValue(OsuSetting.MouseDisableButtons, false);
|
||||||
foreach (TouchSource source in InputManager.CurrentState.Touch.ActiveSources)
|
foreach (TouchSource source in InputManager.CurrentState.Touch.ActiveSources)
|
||||||
InputManager.EndTouch(new Touch(source, osuInputManager.ScreenSpaceDrawQuad.Centre));
|
InputManager.EndTouch(new Touch(source, osuInputManager.ScreenSpaceDrawQuad.Centre));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user