1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 01:22:59 +08:00

InGameOverlay fixes

This commit is contained in:
Andrey Zavadskiy 2017-04-05 22:36:03 +03:00
parent f2a9ec0f24
commit 6a510097df
3 changed files with 11 additions and 20 deletions

View File

@ -11,6 +11,9 @@ namespace osu.Game.Screens.Play
{
public class FailOverlay : InGameOverlay
{
public override string Header => "failed";
public override string Description => "you're dead, try again?";
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Key == Key.Escape)
@ -28,11 +31,5 @@ namespace osu.Game.Screens.Play
AddButton(@"Retry", colours.YellowDark, OnRetry);
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
}
public FailOverlay()
{
Title = @"failed";
Description = @"you're dead, try again?";
}
}
}

View File

@ -27,8 +27,8 @@ namespace osu.Game.Screens.Play
public Action OnRetry;
public Action OnQuit;
protected string Title;
protected string Description;
public abstract string Header { get; }
public abstract string Description { get; }
private FillFlowContainer buttons;
@ -82,6 +82,8 @@ namespace osu.Game.Screens.Play
protected override bool OnMouseMove(InputState state) => true;
protected abstract void AddButtons(OsuColour colours);
protected void AddButton(string text, Color4 colour, Action action)
{
buttons.Add(new PauseButton
@ -131,7 +133,7 @@ namespace osu.Game.Screens.Play
{
new OsuSpriteText
{
Text = Title,
Text = Header,
Font = @"Exo2.0-Medium",
Spacing = new Vector2(5, 0),
Origin = Anchor.TopCentre,
@ -187,11 +189,6 @@ namespace osu.Game.Screens.Play
AddButtons(colours);
}
protected virtual void AddButtons(OsuColour colours)
{
}
protected InGameOverlay()
{
AlwaysReceiveInput = true;

View File

@ -14,6 +14,9 @@ namespace osu.Game.Screens.Play
{
public Action OnResume;
public override string Header => "paused";
public override string Description => "you're not going to do what i think you're going to do, are ya?";
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Key == Key.Escape)
@ -32,12 +35,6 @@ namespace osu.Game.Screens.Play
AddButton(@"Retry", colours.YellowDark, OnRetry);
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
}
public PauseOverlay()
{
Title = @"paused";
Description = @"you're not going to do what i think you're going to do, are ya?";
}
}
}