mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 20:32:55 +08:00
Cleanup methods/events
This commit is contained in:
parent
ee15967c4a
commit
4a7f5f98df
@ -367,11 +367,6 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void DeleteLocalScore(ScoreInfo score)
|
|
||||||
{
|
|
||||||
dialogOverlay?.Push(new LocalScoreDeleteDialog(score));
|
|
||||||
}
|
|
||||||
|
|
||||||
public MenuItem[] ContextMenuItems
|
public MenuItem[] ContextMenuItems
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -379,7 +374,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
List<MenuItem> items = new List<MenuItem>();
|
List<MenuItem> items = new List<MenuItem>();
|
||||||
|
|
||||||
if (score.ID != 0)
|
if (score.ID != 0)
|
||||||
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => DeleteLocalScore(score)));
|
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
||||||
|
|
||||||
return items.ToArray();
|
return items.ToArray();
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
ScoreSelected = s => ScoreSelected?.Invoke(s)
|
ScoreSelected = s => ScoreSelected?.Invoke(s)
|
||||||
});
|
});
|
||||||
|
|
||||||
scoreManager.ItemRemoved += deleteLocalScore;
|
scoreManager.ItemRemoved += onScoreRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Reset()
|
protected override void Reset()
|
||||||
@ -113,15 +113,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
TopScore = null;
|
TopScore = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
private void onScoreRemoved(ScoreInfo score) => Schedule(RefreshScores);
|
||||||
{
|
|
||||||
base.Dispose(isDisposing);
|
|
||||||
|
|
||||||
if (scoreManager != null)
|
|
||||||
{
|
|
||||||
scoreManager.ItemRemoved -= deleteLocalScore;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;
|
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;
|
||||||
|
|
||||||
@ -204,9 +196,12 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteLocalScore(ScoreInfo score)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
Schedule(RefreshScores);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
if (scoreManager != null)
|
||||||
|
scoreManager.ItemRemoved -= onScoreRemoved;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user