mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Move SoloStatisticsWatcher
to OsuGame
Doesn't feel like it needs to be in base, and it being in base was causing problems elsewhere before.
This commit is contained in:
parent
da4ebd0681
commit
21b9fb95e2
@ -47,6 +47,7 @@ using osu.Game.Localisation;
|
||||
using osu.Game.Online;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Online.Solo;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.BeatmapListing;
|
||||
using osu.Game.Overlays.Music;
|
||||
@ -1015,6 +1016,7 @@ namespace osu.Game
|
||||
ScreenStack.Push(CreateLoader().With(l => l.RelativeSizeAxes = Axes.Both));
|
||||
});
|
||||
|
||||
loadComponentSingleFile(new SoloStatisticsWatcher(), Add, true);
|
||||
loadComponentSingleFile(Toolbar = new Toolbar
|
||||
{
|
||||
OnHome = delegate
|
||||
|
@ -50,7 +50,6 @@ using osu.Game.Online.API;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Online.Metadata;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Solo;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Settings;
|
||||
@ -207,7 +206,6 @@ namespace osu.Game
|
||||
protected MultiplayerClient MultiplayerClient { get; private set; }
|
||||
|
||||
private MetadataClient metadataClient;
|
||||
private SoloStatisticsWatcher soloStatisticsWatcher;
|
||||
|
||||
private RealmAccess realm;
|
||||
|
||||
@ -328,7 +326,6 @@ namespace osu.Game
|
||||
dependencies.CacheAs(SpectatorClient = new OnlineSpectatorClient(endpoints));
|
||||
dependencies.CacheAs(MultiplayerClient = new OnlineMultiplayerClient(endpoints));
|
||||
dependencies.CacheAs(metadataClient = new OnlineMetadataClient(endpoints));
|
||||
dependencies.CacheAs(soloStatisticsWatcher = new SoloStatisticsWatcher());
|
||||
|
||||
base.Content.Add(new BeatmapOnlineChangeIngest(beatmapUpdater, realm, metadataClient));
|
||||
|
||||
@ -371,7 +368,6 @@ namespace osu.Game
|
||||
base.Content.Add(SpectatorClient);
|
||||
base.Content.Add(MultiplayerClient);
|
||||
base.Content.Add(metadataClient);
|
||||
base.Content.Add(soloStatisticsWatcher);
|
||||
|
||||
base.Content.Add(rulesetConfigCache);
|
||||
|
||||
|
@ -43,7 +43,8 @@ namespace osu.Game.Screens.Play
|
||||
[Resolved]
|
||||
private SessionStatics statics { get; set; }
|
||||
|
||||
[Resolved]
|
||||
[Resolved(canBeNull: true)]
|
||||
[CanBeNull]
|
||||
private SoloStatisticsWatcher soloStatisticsWatcher { get; set; }
|
||||
|
||||
private readonly object scoreSubmissionLock = new object();
|
||||
@ -179,7 +180,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
await submitScore(score).ConfigureAwait(false);
|
||||
spectatorClient.EndPlaying(GameplayState);
|
||||
soloStatisticsWatcher.RegisterForStatisticsUpdateAfter(score.ScoreInfo);
|
||||
soloStatisticsWatcher?.RegisterForStatisticsUpdateAfter(score.ScoreInfo);
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
|
@ -40,9 +40,9 @@ namespace osu.Game.Screens.Ranking
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(SoloStatisticsWatcher soloStatisticsWatcher)
|
||||
private void load(SoloStatisticsWatcher? soloStatisticsWatcher)
|
||||
{
|
||||
if (ShowUserStatistics)
|
||||
if (ShowUserStatistics && soloStatisticsWatcher != null)
|
||||
{
|
||||
Debug.Assert(Score != null);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user