Expose the global binding container to OsuGameTestScene

This commit is contained in:
Salman Ahmed 2020-09-04 10:23:06 +03:00
parent 001509df55
commit 4d9a06bde9
2 changed files with 8 additions and 5 deletions

View File

@ -14,6 +14,7 @@
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Online.API;
using osu.Game.Overlays;
using osu.Game.Rulesets;
@ -109,6 +110,8 @@ public class TestOsuGame : OsuGame
public new OsuConfigManager LocalConfig => base.LocalConfig;
public new GlobalActionContainer GlobalBinding => base.GlobalBinding;
public new Bindable<WorkingBeatmap> Beatmap => base.Beatmap;
public new Bindable<RulesetInfo> Ruleset => base.Ruleset;

View File

@ -64,6 +64,8 @@ public class OsuGameBase : Framework.Game, ICanAcceptFiles
protected FileStore FileStore;
protected GlobalActionContainer GlobalBinding;
protected KeyBindingStore KeyBindingStore;
protected SettingsStore SettingsStore;
@ -250,10 +252,8 @@ List<ScoreInfo> getBeatmapScores(BeatmapSetInfo set)
AddInternal(apiAccess);
AddInternal(RulesetConfigCache);
GlobalActionContainer globalBinding;
MenuCursorContainer = new MenuCursorContainer { RelativeSizeAxes = Axes.Both };
MenuCursorContainer.Child = globalBinding = new GlobalActionContainer(this)
MenuCursorContainer.Child = GlobalBinding = new GlobalActionContainer(this)
{
RelativeSizeAxes = Axes.Both,
Child = content = new OsuTooltipContainer(MenuCursorContainer.Cursor) { RelativeSizeAxes = Axes.Both }
@ -261,8 +261,8 @@ List<ScoreInfo> getBeatmapScores(BeatmapSetInfo set)
base.Content.Add(CreateScalingContainer().WithChild(MenuCursorContainer));
KeyBindingStore.Register(globalBinding);
dependencies.Cache(globalBinding);
KeyBindingStore.Register(GlobalBinding);
dependencies.Cache(GlobalBinding);
PreviewTrackManager previewTrackManager;
dependencies.Cache(previewTrackManager = new PreviewTrackManager());