mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +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:
parent
5ec5222d8a
commit
c540d78fbc
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||||
{
|
{
|
||||||
ruleset = (DrawableOsuRuleset)drawableRuleset;
|
ruleset = (DrawableOsuRuleset)drawableRuleset;
|
||||||
ruleset.InputManager.Add(new InputInterceptor(this));
|
ruleset.KeyBindingInputManager.Add(new InputInterceptor(this));
|
||||||
|
|
||||||
var periods = new List<Period>();
|
var periods = new List<Period>();
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||||
{
|
{
|
||||||
// Grab the input manager to disable the user's cursor, and for future use
|
// 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;
|
inputManager.AllowUserCursorMovement = false;
|
||||||
|
|
||||||
// Generate the replay frames the cursor should follow
|
// Generate the replay frames the cursor should follow
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||||
{
|
{
|
||||||
// grab the input manager for future use.
|
// grab the input manager for future use.
|
||||||
osuInputManager = ((DrawableOsuRuleset)drawableRuleset).InputManager;
|
osuInputManager = ((DrawableOsuRuleset)drawableRuleset).KeyBindingInputManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyToPlayer(Player player)
|
public void ApplyToPlayer(Player player)
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
{
|
{
|
||||||
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
|
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;
|
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 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 };
|
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer { AlignWithStoryboard = true };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user