1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Replace custom delegates by generic delegates.

This commit is contained in:
Huo Yaoyuan 2016-08-31 23:15:17 +08:00
parent 43d8dd8cf5
commit 6826391b7a
2 changed files with 5 additions and 5 deletions

View File

@ -118,7 +118,7 @@ namespace osu.Game.GameModes
Colour = colour ?? Color4.White; Colour = colour ?? Color4.White;
} }
internal event VoidDelegate Activated; internal event Action Activated;
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)
{ {

View File

@ -277,7 +277,7 @@ namespace osu.Game.GameModes.Menu
private Sprite logo; private Sprite logo;
private Container logoBounceContainer; private Container logoBounceContainer;
private MenuVisualisation vis; private MenuVisualisation vis;
private VoidDelegate clickAction; private Action clickAction;
public float SizeForFlow => logo == null ? 0 : logo.ActualSize.X * logo.Scale * logoBounceContainer.Scale * 0.8f; public float SizeForFlow => logo == null ? 0 : logo.ActualSize.X * logo.Scale * logoBounceContainer.Scale * 0.8f;
@ -319,7 +319,7 @@ namespace osu.Game.GameModes.Menu
}); });
} }
public OsuLogo(VoidDelegate action) public OsuLogo(Action action)
{ {
clickAction = action; clickAction = action;
} }
@ -396,14 +396,14 @@ namespace osu.Game.GameModes.Menu
private TextAwesome icon; private TextAwesome icon;
private string internalName; private string internalName;
private readonly FontAwesome symbol; private readonly FontAwesome symbol;
private VoidDelegate clickAction; private Action clickAction;
private readonly float extraWidth; private readonly float extraWidth;
private Key triggerKey; private Key triggerKey;
private string text; private string text;
public override Quad ScreenSpaceInputQuad => box.ScreenSpaceInputQuad; public override Quad ScreenSpaceInputQuad => box.ScreenSpaceInputQuad;
public Button(string text, string internalName, FontAwesome symbol, Color4 colour, VoidDelegate clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown) public Button(string text, string internalName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown)
{ {
this.internalName = internalName; this.internalName = internalName;
this.symbol = symbol; this.symbol = symbol;