Remove all usage of DI to retrieve InputManager

Uses GetContainingInputManager instead, as per framework changes.
This commit is contained in:
Dean Herbert
2017-08-15 14:30:50 +09:00
parent a74ebdfe56
commit 6ded194c53
6 changed files with 21 additions and 35 deletions

View File

@ -34,9 +34,8 @@ namespace osu.Game.Graphics.Containers
protected override Container<Drawable> Content => content;
[BackgroundDependencyLoader]
private void load(UserInputManager input, OsuConfigManager config)
private void load(OsuConfigManager config)
{
this.input = input;
parallaxEnabled = config.GetBindable<bool>(OsuSetting.MenuParallax);
parallaxEnabled.ValueChanged += delegate
{
@ -48,6 +47,12 @@ namespace osu.Game.Graphics.Containers
};
}
protected override void LoadComplete()
{
base.LoadComplete();
input = GetContainingInputManager();
}
private bool firstUpdate = true;
protected override void Update()

View File

@ -28,18 +28,10 @@ namespace osu.Game.Graphics.UserInterface
{
focus = value;
if (!focus && HasFocus)
inputManager.ChangeFocus(null);
GetContainingInputManager().ChangeFocus(null);
}
}
private InputManager inputManager;
[BackgroundDependencyLoader]
private void load(UserInputManager inputManager)
{
this.inputManager = inputManager;
}
protected override void OnFocus(InputState state)
{
base.OnFocus(state);