1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Expose the actual KeyBindingInputManager

Turns out that `CreateInputManager` is called more than once, and some
mods (ie. `InputBlockingMod`) rely on consuming the "main" one. So let's
go back to accessing and exposing in `DrawableOsuRuleset` rather than
storing out own reference.
This commit is contained in:
Dean Herbert 2023-02-14 18:10:25 +09:00
parent 5ec5222d8a
commit c540d78fbc
4 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
ruleset = (DrawableOsuRuleset)drawableRuleset;
ruleset.InputManager.Add(new InputInterceptor(this));
ruleset.KeyBindingInputManager.Add(new InputInterceptor(this));
var periods = new List<Period>();

View File

@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
// Grab the input manager to disable the user's cursor, and for future use
inputManager = ((DrawableOsuRuleset)drawableRuleset).InputManager;
inputManager = ((DrawableOsuRuleset)drawableRuleset).KeyBindingInputManager;
inputManager.AllowUserCursorMovement = false;
// Generate the replay frames the cursor should follow

View File

@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
{
// grab the input manager for future use.
osuInputManager = ((DrawableOsuRuleset)drawableRuleset).InputManager;
osuInputManager = ((DrawableOsuRuleset)drawableRuleset).KeyBindingInputManager;
}
public void ApplyToPlayer(Player player)

View File

@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.UI
{
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
public OsuInputManager InputManager { get; private set; }
public new OsuInputManager KeyBindingInputManager => (OsuInputManager)base.KeyBindingInputManager;
public new OsuPlayfield Playfield => (OsuPlayfield)base.Playfield;
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.UI
protected override Playfield CreatePlayfield() => new OsuPlayfield();
protected override PassThroughInputManager CreateInputManager() => InputManager = new OsuInputManager(Ruleset.RulesetInfo);
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { AlignWithStoryboard = true };