Rename methods to make more sense (and always run through AddOnce)

This commit is contained in:
Dean Herbert 2022-01-28 21:22:09 +09:00
parent c6d303a5b4
commit aee93934d5
6 changed files with 14 additions and 14 deletions

View File

@ -132,7 +132,7 @@ namespace osu.Game.Tests.Visual.UserInterface
leaderboard.FinishTransforms(true); // After setting scores, we may be waiting for transforms to expire drawables leaderboard.FinishTransforms(true); // After setting scores, we may be waiting for transforms to expire drawables
leaderboard.BeatmapInfo = beatmapInfo; leaderboard.BeatmapInfo = beatmapInfo;
leaderboard.RefreshScores(); // Required in the case that the beatmap hasn't changed leaderboard.RefetchScores(); // Required in the case that the beatmap hasn't changed
}); });
[SetUpSteps] [SetUpSteps]

View File

@ -132,7 +132,7 @@ namespace osu.Game.Online.Leaderboards
return; return;
scope = value; scope = value;
RefreshScores(); RefetchScores();
} }
} }
@ -160,7 +160,7 @@ namespace osu.Game.Online.Leaderboards
case PlaceholderState.NetworkFailure: case PlaceholderState.NetworkFailure:
replacePlaceholder(new ClickablePlaceholder(@"Couldn't fetch scores!", FontAwesome.Solid.Sync) replacePlaceholder(new ClickablePlaceholder(@"Couldn't fetch scores!", FontAwesome.Solid.Sync)
{ {
Action = RefreshScores Action = RefetchScores
}); });
break; break;
@ -272,15 +272,15 @@ namespace osu.Game.Online.Leaderboards
case APIState.Online: case APIState.Online:
case APIState.Offline: case APIState.Offline:
if (IsOnlineScope) if (IsOnlineScope)
RefreshScores(); RefetchScores();
break; break;
} }
}); });
public void RefreshScores() => Scheduler.AddOnce(UpdateScores); public void RefetchScores() => Scheduler.AddOnce(refetchScores);
protected void UpdateScores() private void refetchScores()
{ {
// don't display any scores or placeholder until the first Scores_Set has been called. // don't display any scores or placeholder until the first Scores_Set has been called.
// this avoids scope changes flickering a "no scores" placeholder before initialisation of song select is finished. // this avoids scope changes flickering a "no scores" placeholder before initialisation of song select is finished.

View File

@ -26,7 +26,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
return; return;
Scores = null; Scores = null;
UpdateScores(); RefetchScores();
}, true); }, true);
} }

View File

@ -220,7 +220,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
protected override Screen CreateGameplayScreen() => new PlayerLoader(() => new PlaylistsPlayer(Room, SelectedItem.Value) protected override Screen CreateGameplayScreen() => new PlayerLoader(() => new PlaylistsPlayer(Room, SelectedItem.Value)
{ {
Exited = () => leaderboard.RefreshScores() Exited = () => leaderboard.RefetchScores()
}); });
} }
} }

View File

@ -53,7 +53,7 @@ namespace osu.Game.Screens.Select.Leaderboards
Scores = null; Scores = null;
if (IsOnlineScope) if (IsOnlineScope)
UpdateScores(); RefetchScores();
else else
{ {
if (IsLoaded) if (IsLoaded)
@ -77,7 +77,7 @@ namespace osu.Game.Screens.Select.Leaderboards
filterMods = value; filterMods = value;
UpdateScores(); RefetchScores();
} }
} }
@ -96,11 +96,11 @@ namespace osu.Game.Screens.Select.Leaderboards
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
ruleset.ValueChanged += _ => UpdateScores(); ruleset.ValueChanged += _ => RefetchScores();
mods.ValueChanged += _ => mods.ValueChanged += _ =>
{ {
if (filterMods) if (filterMods)
UpdateScores(); RefetchScores();
}; };
} }
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Select.Leaderboards
(_, changes, ___) => (_, changes, ___) =>
{ {
if (!IsOnlineScope) if (!IsOnlineScope)
RefreshScores(); RefetchScores();
}); });
} }

View File

@ -53,7 +53,7 @@ namespace osu.Game.Screens.Select
{ {
base.Refresh(); base.Refresh();
Leaderboard.RefreshScores(); Leaderboard.RefetchScores();
} }
protected override void OnTabChanged(BeatmapDetailAreaTabItem tab, bool selectedMods) protected override void OnTabChanged(BeatmapDetailAreaTabItem tab, bool selectedMods)