mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Avoid changing target content midway through code
This commit is contained in:
parent
6c52b8339b
commit
0548ca2aa8
@ -206,7 +206,7 @@ namespace osu.Game
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly FramedBeatmapClock beatmapClock = new FramedBeatmapClock(true);
|
private readonly FramedBeatmapClock beatmapClock = new FramedBeatmapClock(true);
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content ?? base.Content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private Container content;
|
private Container content;
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ namespace osu.Game
|
|||||||
dependencies.Cache(ScoreDownloader = new ScoreModelDownloader(ScoreManager, API));
|
dependencies.Cache(ScoreDownloader = new ScoreModelDownloader(ScoreManager, API));
|
||||||
|
|
||||||
// Add after all the above cache operations as it depends on them.
|
// Add after all the above cache operations as it depends on them.
|
||||||
Add(difficultyCache);
|
base.Content.Add(difficultyCache);
|
||||||
|
|
||||||
// TODO: OsuGame or OsuGameBase?
|
// TODO: OsuGame or OsuGameBase?
|
||||||
dependencies.CacheAs(beatmapUpdater = new BeatmapUpdater(BeatmapManager, difficultyCache, API, Storage));
|
dependencies.CacheAs(beatmapUpdater = new BeatmapUpdater(BeatmapManager, difficultyCache, API, Storage));
|
||||||
@ -305,19 +305,19 @@ namespace osu.Game
|
|||||||
dependencies.CacheAs(metadataClient = new OnlineMetadataClient(endpoints));
|
dependencies.CacheAs(metadataClient = new OnlineMetadataClient(endpoints));
|
||||||
dependencies.CacheAs(soloStatisticsWatcher = new SoloStatisticsWatcher());
|
dependencies.CacheAs(soloStatisticsWatcher = new SoloStatisticsWatcher());
|
||||||
|
|
||||||
Add(new BeatmapOnlineChangeIngest(beatmapUpdater, realm, metadataClient));
|
base.Content.Add(new BeatmapOnlineChangeIngest(beatmapUpdater, realm, metadataClient));
|
||||||
|
|
||||||
BeatmapManager.ProcessBeatmap = args => beatmapUpdater.Process(args.beatmapSet, !args.isBatch);
|
BeatmapManager.ProcessBeatmap = args => beatmapUpdater.Process(args.beatmapSet, !args.isBatch);
|
||||||
|
|
||||||
dependencies.Cache(userCache = new UserLookupCache());
|
dependencies.Cache(userCache = new UserLookupCache());
|
||||||
Add(userCache);
|
base.Content.Add(userCache);
|
||||||
|
|
||||||
dependencies.Cache(beatmapCache = new BeatmapLookupCache());
|
dependencies.Cache(beatmapCache = new BeatmapLookupCache());
|
||||||
Add(beatmapCache);
|
base.Content.Add(beatmapCache);
|
||||||
|
|
||||||
var scorePerformanceManager = new ScorePerformanceCache();
|
var scorePerformanceManager = new ScorePerformanceCache();
|
||||||
dependencies.Cache(scorePerformanceManager);
|
dependencies.Cache(scorePerformanceManager);
|
||||||
Add(scorePerformanceManager);
|
base.Content.Add(scorePerformanceManager);
|
||||||
|
|
||||||
dependencies.CacheAs<IRulesetConfigCache>(rulesetConfigCache = new RulesetConfigCache(realm, RulesetStore));
|
dependencies.CacheAs<IRulesetConfigCache>(rulesetConfigCache = new RulesetConfigCache(realm, RulesetStore));
|
||||||
|
|
||||||
@ -344,34 +344,37 @@ namespace osu.Game
|
|||||||
|
|
||||||
// add api components to hierarchy.
|
// add api components to hierarchy.
|
||||||
if (API is APIAccess apiAccess)
|
if (API is APIAccess apiAccess)
|
||||||
Add(apiAccess);
|
base.Content.Add(apiAccess);
|
||||||
|
|
||||||
Add(spectatorClient);
|
base.Content.Add(spectatorClient);
|
||||||
Add(MultiplayerClient);
|
base.Content.Add(MultiplayerClient);
|
||||||
Add(metadataClient);
|
base.Content.Add(metadataClient);
|
||||||
Add(soloStatisticsWatcher);
|
base.Content.Add(soloStatisticsWatcher);
|
||||||
|
|
||||||
Add(rulesetConfigCache);
|
base.Content.Add(rulesetConfigCache);
|
||||||
|
|
||||||
PreviewTrackManager previewTrackManager;
|
PreviewTrackManager previewTrackManager;
|
||||||
dependencies.Cache(previewTrackManager = new PreviewTrackManager(BeatmapManager.BeatmapTrackStore));
|
dependencies.Cache(previewTrackManager = new PreviewTrackManager(BeatmapManager.BeatmapTrackStore));
|
||||||
Add(previewTrackManager);
|
base.Content.Add(previewTrackManager);
|
||||||
|
|
||||||
Add(MusicController = new MusicController());
|
base.Content.Add(MusicController = new MusicController());
|
||||||
dependencies.CacheAs(MusicController);
|
dependencies.CacheAs(MusicController);
|
||||||
|
|
||||||
MusicController.TrackChanged += onTrackChanged;
|
MusicController.TrackChanged += onTrackChanged;
|
||||||
Add(beatmapClock);
|
base.Content.Add(beatmapClock);
|
||||||
|
|
||||||
GlobalActionContainer globalBindings;
|
GlobalActionContainer globalBindings;
|
||||||
|
|
||||||
Add(SafeAreaContainer = new SafeAreaContainer
|
base.Content.Add(SafeAreaContainer = new SafeAreaContainer
|
||||||
{
|
{
|
||||||
SafeAreaOverrideEdges = SafeAreaOverrideEdges,
|
SafeAreaOverrideEdges = SafeAreaOverrideEdges,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = CreateScalingContainer().WithChildren(new Drawable[]
|
Child = CreateScalingContainer().WithChildren(new Drawable[]
|
||||||
{
|
{
|
||||||
(GlobalCursorDisplay = new GlobalCursorDisplay
|
(GlobalCursorDisplay = new GlobalCursorDisplay
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both
|
||||||
|
}).WithChild(content = new OsuTooltipContainer(GlobalCursorDisplay.MenuCursor)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
}),
|
}),
|
||||||
@ -380,11 +383,6 @@ namespace osu.Game
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
GlobalCursorDisplay.Child = content = new OsuTooltipContainer(GlobalCursorDisplay.MenuCursor)
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
};
|
|
||||||
|
|
||||||
KeyBindingStore = new RealmKeyBindingStore(realm, keyCombinationProvider);
|
KeyBindingStore = new RealmKeyBindingStore(realm, keyCombinationProvider);
|
||||||
KeyBindingStore.Register(globalBindings, RulesetStore.AvailableRulesets);
|
KeyBindingStore.Register(globalBindings, RulesetStore.AvailableRulesets);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user