Use Enabled instead of a private field.

This commit is contained in:
Nabile Rahmani 2017-07-13 23:35:19 +02:00
parent 8014cd55a2
commit 840cc918ea
1 changed files with 6 additions and 5 deletions

View File

@ -182,7 +182,6 @@ private class Button : OsuClickableContainer
private FillFlowContainer flow;
private Box background;
private AspectContainer aspect;
private bool isClicked;
public Button()
{
@ -278,14 +277,16 @@ protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
protected override bool OnClick(InputState state)
{
if (isClicked)
if (!Enabled)
return false;
isClicked = true;
box.FlashColour(Color4.White, 500, EasingTypes.OutQuint);
aspect.ScaleTo(1.2f, 2000, EasingTypes.OutQuint);
return base.OnClick(state);
bool result = base.OnClick(state);
Enabled.Value = false;
return result;
}
}
}