2019-01-24 16:43: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.
|
2018-06-07 19:24:33 +08:00
|
|
|
|
|
2022-10-09 22:14:16 +08:00
|
|
|
|
using System.Linq;
|
2018-06-07 19:24:33 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Input.Bindings;
|
2022-10-09 22:14:16 +08:00
|
|
|
|
using osu.Game.Input.Bindings;
|
2018-06-07 19:24:33 +08:00
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests
|
|
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public abstract partial class ManiaInputTestScene : OsuTestScene
|
2018-06-07 19:24:33 +08:00
|
|
|
|
{
|
2023-06-23 23:59:36 +08:00
|
|
|
|
private readonly Container<Drawable>? content;
|
|
|
|
|
|
2018-06-07 19:24:33 +08:00
|
|
|
|
protected override Container<Drawable> Content => content ?? base.Content;
|
|
|
|
|
|
2019-05-15 03:37:25 +08:00
|
|
|
|
protected ManiaInputTestScene(int keys)
|
2018-06-07 19:24:33 +08:00
|
|
|
|
{
|
|
|
|
|
base.Content.Add(content = new LocalInputManager(keys));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private partial class LocalInputManager : ManiaInputManager
|
|
|
|
|
{
|
|
|
|
|
public LocalInputManager(int variant)
|
|
|
|
|
: base(new ManiaRuleset().RulesetInfo, variant)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-23 16:33:02 +08:00
|
|
|
|
protected override KeyBindingContainer<ManiaAction> CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
2018-06-07 19:24:33 +08:00
|
|
|
|
=> new LocalKeyBindingContainer(ruleset, variant, unique);
|
|
|
|
|
|
|
|
|
|
private partial class LocalKeyBindingContainer : RulesetKeyBindingContainer
|
|
|
|
|
{
|
|
|
|
|
public LocalKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
|
|
|
|
|
: base(ruleset, variant, unique)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-09 22:14:16 +08:00
|
|
|
|
protected override void ReloadMappings(IQueryable<RealmKeyBinding> realmKeyBindings)
|
2018-06-07 19:24:33 +08:00
|
|
|
|
{
|
|
|
|
|
KeyBindings = DefaultKeyBindings;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|