1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 14:12:54 +08:00

Unbind ruleset event from leaderboard.

This commit is contained in:
Unknown 2017-11-25 21:23:36 +05:30
parent 0b3f75505e
commit ae9ce2f122

View File

@ -22,6 +22,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Framework.Logging; using osu.Framework.Logging;
using System.Net; using System.Net;
using osu.Game.Rulesets;
namespace osu.Game.Screens.Select.Leaderboards namespace osu.Game.Screens.Select.Leaderboards
{ {
@ -206,11 +207,21 @@ namespace osu.Game.Screens.Select.Leaderboards
this.osuGame = osuGame; this.osuGame = osuGame;
if (osuGame != null) if (osuGame != null)
osuGame.Ruleset.ValueChanged += r => updateScores(); osuGame.Ruleset.ValueChanged += handleRulesetChange;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (osuGame != null)
osuGame.Ruleset.ValueChanged -= handleRulesetChange;
} }
private GetScoresRequest getScoresRequest; private GetScoresRequest getScoresRequest;
private void handleRulesetChange(RulesetInfo ruleset) => updateScores();
private void updateScores() private void updateScores()
{ {
if (!IsLoaded) return; if (!IsLoaded) return;