Remove custom back action logic (use receptor as intended)

This commit is contained in:
Dean Herbert
2020-05-17 17:35:10 +09:00
parent 864c1a73ae
commit 13d4997c91
2 changed files with 8 additions and 30 deletions

View File

@ -16,10 +16,8 @@ namespace osu.Game.Graphics.UserInterface
private readonly TwoLayerButton button;
public BackButton(Receptor receptor)
public BackButton(Receptor receptor = null)
{
receptor.OnBackPressed = () => button.Click();
Size = TwoLayerButton.SIZE_EXTENDED;
Child = button = new TwoLayerButton
@ -30,6 +28,10 @@ namespace osu.Game.Graphics.UserInterface
Icon = OsuIcon.LeftCircle,
Action = () => Action?.Invoke()
};
Add(receptor ??= new Receptor());
receptor.OnBackPressed = () => button.Click();
}
[BackgroundDependencyLoader]