Remove necessity for nested PassThroughInputManger

This commit is contained in:
Dean Herbert
2021-04-08 15:17:53 +09:00
parent 0a4b621739
commit 8aff53172d
5 changed files with 26 additions and 45 deletions

View File

@ -308,18 +308,21 @@ namespace osu.Game
AddInternal(RulesetConfigCache);
var globalInput = new GlobalInputManager(this)
GlobalActionContainer globalBindings;
var mainContent = new Drawable[]
{
RelativeSizeAxes = Axes.Both,
Child = MenuCursorContainer = new MenuCursorContainer { RelativeSizeAxes = Axes.Both }
MenuCursorContainer = new MenuCursorContainer { RelativeSizeAxes = Axes.Both },
// to avoid positional input being blocked by children, ensure the GlobalActionContainer is above everything.
globalBindings = new GlobalActionContainer(this)
};
MenuCursorContainer.Child = content = new OsuTooltipContainer(MenuCursorContainer.Cursor) { RelativeSizeAxes = Axes.Both };
base.Content.Add(CreateScalingContainer().WithChild(globalInput));
base.Content.Add(CreateScalingContainer().WithChildren(mainContent));
KeyBindingStore.Register(globalInput.GlobalBindings);
dependencies.Cache(globalInput.GlobalBindings);
KeyBindingStore.Register(globalBindings);
dependencies.Cache(globalBindings);
PreviewTrackManager previewTrackManager;
dependencies.Cache(previewTrackManager = new PreviewTrackManager());