mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Unbind ruleset event from leaderboard.
This commit is contained in:
parent
0b3f75505e
commit
ae9ce2f122
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user