Fix in a slightly different and hopefully more understandable way

This commit is contained in:
Dean Herbert 2020-04-20 14:03:55 +09:00
parent f56b85ce27
commit ee1ccb8bcb
1 changed files with 8 additions and 8 deletions

View File

@ -426,7 +426,7 @@ private void updateSelectedRuleset(RulesetInfo ruleset)
} }
/// <summary> /// <summary>
/// selection has been changed as the result of a user interaction. /// Selection has been changed as the result of a user interaction.
/// </summary> /// </summary>
private void performUpdateSelected() private void performUpdateSelected()
{ {
@ -435,7 +435,7 @@ private void performUpdateSelected()
selectionChangedDebounce?.Cancel(); selectionChangedDebounce?.Cancel();
if (beatmap == null) if (beatmapNoDebounce == null)
run(); run();
else else
selectionChangedDebounce = Scheduler.AddDelayed(run, 200); selectionChangedDebounce = Scheduler.AddDelayed(run, 200);
@ -448,11 +448,11 @@ void run()
{ {
Mods.Value = Array.Empty<Mod>(); Mods.Value = Array.Empty<Mod>();
// the ruleset transfer may cause a deselection of the current beatmap (due to incompatibility). // transferRulesetValue() may trigger a refilter. If the current selection does not match the new ruleset, we want to switch away from it.
// this can happen via Carousel.FlushPendingFilterOperations(). // The default logic on WorkingBeatmap change is to switch to a matching ruleset (see workingBeatmapChanged()), but we don't want that here.
// to ensure a good state, re-transfer no-debounce values. // We perform an early selection attempt and clear out the beatmap selection to avoid a second ruleset change (revert).
performUpdateSelected(); if (beatmap != null && !Carousel.SelectBeatmap(beatmap, false))
return; beatmap = null;
} }
// We may be arriving here due to another component changing the bindable Beatmap. // We may be arriving here due to another component changing the bindable Beatmap.
@ -716,7 +716,7 @@ private bool transferRulesetValue()
if (decoupledRuleset.Value?.Equals(Ruleset.Value) == true) if (decoupledRuleset.Value?.Equals(Ruleset.Value) == true)
return false; return false;
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;
// 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.