1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 02:57:25 +08:00

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.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]

View File

@ -132,7 +132,7 @@ namespace osu.Game.Online.Leaderboards
return;
scope = value;
RefreshScores();
RefetchScores();
}
}
@ -160,7 +160,7 @@ namespace osu.Game.Online.Leaderboards
case PlaceholderState.NetworkFailure:
replacePlaceholder(new ClickablePlaceholder(@"Couldn't fetch scores!", FontAwesome.Solid.Sync)
{
Action = RefreshScores
Action = RefetchScores
});
break;
@ -272,15 +272,15 @@ namespace osu.Game.Online.Leaderboards
case APIState.Online:
case APIState.Offline:
if (IsOnlineScope)
RefreshScores();
RefetchScores();
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.
// 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;
Scores = null;
UpdateScores();
RefetchScores();
}, true);
}

View File

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

View File

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