mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:43:19 +08:00
Merge branch 'prevent-dependency-pollution' of github.com:Tom94/osu into better-transforms
This commit is contained in:
commit
750fc0db0e
@ -80,6 +80,11 @@ namespace osu.Game
|
||||
|
||||
public void ToggleDirect() => direct.ToggleVisibility();
|
||||
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
||||
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager frameworkConfig)
|
||||
{
|
||||
@ -97,7 +102,7 @@ namespace osu.Game
|
||||
Task.Run(() => BeatmapDatabase.Import(paths.ToArray()));
|
||||
}
|
||||
|
||||
Dependencies.Cache(this);
|
||||
dependencies.Cache(this);
|
||||
|
||||
configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
|
||||
Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value);
|
||||
@ -206,13 +211,13 @@ namespace osu.Game
|
||||
});
|
||||
};
|
||||
|
||||
Dependencies.Cache(settings);
|
||||
Dependencies.Cache(social);
|
||||
Dependencies.Cache(chat);
|
||||
Dependencies.Cache(userProfile);
|
||||
Dependencies.Cache(musicController);
|
||||
Dependencies.Cache(notificationManager);
|
||||
Dependencies.Cache(dialogOverlay);
|
||||
dependencies.Cache(settings);
|
||||
dependencies.Cache(social);
|
||||
dependencies.Cache(chat);
|
||||
dependencies.Cache(userProfile);
|
||||
dependencies.Cache(musicController);
|
||||
dependencies.Cache(notificationManager);
|
||||
dependencies.Cache(dialogOverlay);
|
||||
|
||||
// ensure both overlays aren't presented at the same time
|
||||
chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State;
|
||||
|
@ -81,21 +81,26 @@ namespace osu.Game
|
||||
Name = @"osu!lazer";
|
||||
}
|
||||
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
||||
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Dependencies.Cache(this);
|
||||
Dependencies.Cache(LocalConfig);
|
||||
dependencies.Cache(this);
|
||||
dependencies.Cache(LocalConfig);
|
||||
|
||||
SQLiteConnection connection = Host.Storage.GetDatabase(@"client");
|
||||
|
||||
Dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
|
||||
Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
|
||||
Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
|
||||
Dependencies.Cache(new OsuColour());
|
||||
dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
|
||||
dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
|
||||
dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
|
||||
dependencies.Cache(new OsuColour());
|
||||
|
||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 }, true);
|
||||
dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 }, true);
|
||||
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
||||
@ -127,7 +132,7 @@ namespace osu.Game
|
||||
|
||||
OszArchiveReader.Register();
|
||||
|
||||
Dependencies.Cache(API = new APIAccess
|
||||
dependencies.Cache(API = new APIAccess
|
||||
{
|
||||
Username = LocalConfig.Get<string>(OsuSetting.Username),
|
||||
Token = LocalConfig.Get<string>(OsuSetting.Token)
|
||||
|
@ -47,10 +47,13 @@ namespace osu.Game.Screens.Tournament
|
||||
|
||||
public ITeamList TeamList;
|
||||
|
||||
protected override DependencyContainer CreateLocalDependencies(DependencyContainer parent) => new DependencyContainer(parent);
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
|
||||
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textures, Storage storage, DependencyContainer dependencies)
|
||||
private void load(TextureStore textures, Storage storage)
|
||||
{
|
||||
this.storage = storage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user