mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Better handle OnClick
This commit is contained in:
parent
d5a2ebf79f
commit
e8315085c0
@ -108,14 +108,18 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
var clickResult = base.OnClick(e);
|
||||
if (!Enabled.Value)
|
||||
return false;
|
||||
|
||||
if (IsLoading)
|
||||
return clickResult;
|
||||
|
||||
IsLoading |= clickResult;
|
||||
|
||||
return clickResult;
|
||||
try
|
||||
{
|
||||
return base.OnClick(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// run afterwards as this will disable this button.
|
||||
IsLoading = true;
|
||||
}
|
||||
}
|
||||
|
||||
private class ChevronIcon : SpriteIcon
|
||||
|
Loading…
Reference in New Issue
Block a user