mirror of
https://github.com/ppy/osu
synced 2025-02-21 21:17:13 +00:00
Avoid need for weird null check by reordering initialisation process
This commit is contained in:
parent
9a29c9ae26
commit
ef35493864
@ -127,9 +127,6 @@ namespace osu.Game.Screens.Select
|
|||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(AudioManager audio, OsuColour colours, ManageCollectionsDialog? manageCollectionsDialog, DifficultyRecommender? recommender)
|
private void load(AudioManager audio, OsuColour colours, ManageCollectionsDialog? manageCollectionsDialog, DifficultyRecommender? recommender)
|
||||||
{
|
{
|
||||||
// initial value transfer is required for FilterControl (it uses our re-cached bindables in its async load for the initial filter).
|
|
||||||
transferRulesetValue();
|
|
||||||
|
|
||||||
LoadComponentAsync(Carousel = new BeatmapCarousel
|
LoadComponentAsync(Carousel = new BeatmapCarousel
|
||||||
{
|
{
|
||||||
AllowSelection = false, // delay any selection until our bindables are ready to make a good choice.
|
AllowSelection = false, // delay any selection until our bindables are ready to make a good choice.
|
||||||
@ -143,6 +140,9 @@ namespace osu.Game.Screens.Select
|
|||||||
GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s),
|
GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s),
|
||||||
}, c => carouselContainer.Child = c);
|
}, c => carouselContainer.Child = c);
|
||||||
|
|
||||||
|
// initial value transfer is required for FilterControl (it uses our re-cached bindables in its async load for the initial filter).
|
||||||
|
transferRulesetValue();
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new ResetScrollContainer(() => Carousel.ScrollToSelected())
|
new ResetScrollContainer(() => Carousel.ScrollToSelected())
|
||||||
@ -860,9 +860,6 @@ namespace osu.Game.Screens.Select
|
|||||||
Logger.Log($"decoupled ruleset transferred (\"{decoupledRuleset.Value}\" -> \"{Ruleset.Value}\")");
|
Logger.Log($"decoupled ruleset transferred (\"{decoupledRuleset.Value}\" -> \"{Ruleset.Value}\")");
|
||||||
rulesetNoDebounce = decoupledRuleset.Value = Ruleset.Value;
|
rulesetNoDebounce = decoupledRuleset.Value = Ruleset.Value;
|
||||||
|
|
||||||
// We want to check for null since this method gets called before the loading of the carousel.
|
|
||||||
if (Carousel.IsNull()) return true;
|
|
||||||
|
|
||||||
// if we have a pending filter operation, we want to run it now.
|
// if we have a pending filter operation, we want to run it now.
|
||||||
// it could change selection (ie. if the ruleset has been changed).
|
// it could change selection (ie. if the ruleset has been changed).
|
||||||
Carousel.FlushPendingFilterOperations();
|
Carousel.FlushPendingFilterOperations();
|
||||||
|
Loading…
Reference in New Issue
Block a user