mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Avoid refresh if score is not related to current display
This commit is contained in:
@ -98,19 +98,23 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
TopScore = null;
|
TopScore = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onScoreRemoved(ValueChangedEvent<WeakReference<ScoreInfo>> score)
|
private void onScoreRemoved(ValueChangedEvent<WeakReference<ScoreInfo>> score) =>
|
||||||
|
scoreStoreChanged(score);
|
||||||
|
|
||||||
|
private void onScoreAdded(ValueChangedEvent<WeakReference<ScoreInfo>> score) =>
|
||||||
|
scoreStoreChanged(score);
|
||||||
|
|
||||||
|
private void scoreStoreChanged(ValueChangedEvent<WeakReference<ScoreInfo>> score)
|
||||||
{
|
{
|
||||||
if (Scope != BeatmapLeaderboardScope.Local)
|
if (Scope != BeatmapLeaderboardScope.Local)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RefreshScores();
|
if (score.NewValue.TryGetTarget(out var scoreInfo))
|
||||||
|
{
|
||||||
|
if (Beatmap.ID != scoreInfo.BeatmapInfoID)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onScoreAdded(ValueChangedEvent<WeakReference<ScoreInfo>> score)
|
|
||||||
{
|
|
||||||
if (Scope != BeatmapLeaderboardScope.Local)
|
|
||||||
return;
|
|
||||||
|
|
||||||
RefreshScores();
|
RefreshScores();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user