mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 11:03:05 +08:00
Fix tournament bracket parsing's ruleset refetch logic not working correctly
Due to equality being based on `ShortName`, it was feasible that the re-fetch exited early (in bindable shortcutting logic) causing the ruleset's `OnlineID` to remain `-1` or something equally wrong. Resolves issue pointed out at https://github.com/ppy/osu/discussions/17538#discussioncomment-2471746.
This commit is contained in:
parent
a7a7584d3e
commit
a06b0a4966
@ -66,6 +66,18 @@ namespace osu.Game.Tournament
|
||||
dependencies.CacheAs(new StableInfo(storage));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
MenuCursorContainer.Cursor.AlwaysPresent = true; // required for tooltip display
|
||||
|
||||
// we don't want to show the menu cursor as it would appear on stream output.
|
||||
MenuCursorContainer.Cursor.Alpha = 0;
|
||||
|
||||
base.LoadComplete();
|
||||
|
||||
Task.Run(readBracket);
|
||||
}
|
||||
|
||||
private void readBracket()
|
||||
{
|
||||
try
|
||||
@ -79,10 +91,14 @@ namespace osu.Game.Tournament
|
||||
|
||||
ladder ??= new LadderInfo();
|
||||
|
||||
ladder.Ruleset.Value = ladder.Ruleset.Value != null
|
||||
var resolvedRuleset = ladder.Ruleset.Value != null
|
||||
? RulesetStore.GetRuleset(ladder.Ruleset.Value.ShortName)
|
||||
: RulesetStore.AvailableRulesets.First();
|
||||
|
||||
// Must set to null initially to avoid the following re-fetch hitting `ShortName` based equality check.
|
||||
ladder.Ruleset.Value = null;
|
||||
ladder.Ruleset.Value = resolvedRuleset;
|
||||
|
||||
bool addedInfo = false;
|
||||
|
||||
// assign teams
|
||||
@ -280,18 +296,6 @@ namespace osu.Game.Tournament
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
MenuCursorContainer.Cursor.AlwaysPresent = true; // required for tooltip display
|
||||
|
||||
// we don't want to show the menu cursor as it would appear on stream output.
|
||||
MenuCursorContainer.Cursor.Alpha = 0;
|
||||
|
||||
base.LoadComplete();
|
||||
|
||||
Task.Run(readBracket);
|
||||
}
|
||||
|
||||
protected virtual void SaveChanges()
|
||||
{
|
||||
if (!bracketLoadTaskCompletionSource.Task.IsCompletedSuccessfully)
|
||||
|
Loading…
Reference in New Issue
Block a user