Reduce the possibility of recomputing drawables when underlying beatmap hasn't changed

This commit is contained in:
Dean Herbert 2017-05-17 16:45:17 +09:00
parent 12716d2ab4
commit cab12ee55a
3 changed files with 12 additions and 8 deletions

View File

@ -49,6 +49,8 @@ namespace osu.Game.Screens.Select
get { return beatmap; }
set
{
if (beatmap == value) return;
beatmap = value;
pendingBeatmapSwitch?.Cancel();

View File

@ -100,6 +100,8 @@ namespace osu.Game.Screens.Select.Leaderboards
get { return beatmap; }
set
{
if (beatmap == value) return;
beatmap = value;
Scores = null;

View File

@ -313,15 +313,15 @@ namespace osu.Game.Screens.Select
{
bool beatmapSetChange = false;
if (!beatmap.Equals(Beatmap?.BeatmapInfo))
if (beatmap.Equals(Beatmap?.BeatmapInfo))
return;
if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
{
if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
{
sampleChangeBeatmap.Play();
beatmapSetChange = true;
}
sampleChangeBeatmap.Play();
beatmapSetChange = true;
}
selectionChangeNoBounce = beatmap;