mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 18:32:56 +08:00
InGameOverlay fixes
This commit is contained in:
parent
f2a9ec0f24
commit
6a510097df
@ -11,6 +11,9 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public class FailOverlay : InGameOverlay
|
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)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Key == Key.Escape)
|
if (args.Key == Key.Escape)
|
||||||
@ -28,11 +31,5 @@ namespace osu.Game.Screens.Play
|
|||||||
AddButton(@"Retry", colours.YellowDark, OnRetry);
|
AddButton(@"Retry", colours.YellowDark, OnRetry);
|
||||||
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
|
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FailOverlay()
|
|
||||||
{
|
|
||||||
Title = @"failed";
|
|
||||||
Description = @"you're dead, try again?";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ namespace osu.Game.Screens.Play
|
|||||||
public Action OnRetry;
|
public Action OnRetry;
|
||||||
public Action OnQuit;
|
public Action OnQuit;
|
||||||
|
|
||||||
protected string Title;
|
public abstract string Header { get; }
|
||||||
protected string Description;
|
public abstract string Description { get; }
|
||||||
|
|
||||||
private FillFlowContainer buttons;
|
private FillFlowContainer buttons;
|
||||||
|
|
||||||
@ -82,6 +82,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected override bool OnMouseMove(InputState state) => true;
|
protected override bool OnMouseMove(InputState state) => true;
|
||||||
|
|
||||||
|
protected abstract void AddButtons(OsuColour colours);
|
||||||
|
|
||||||
protected void AddButton(string text, Color4 colour, Action action)
|
protected void AddButton(string text, Color4 colour, Action action)
|
||||||
{
|
{
|
||||||
buttons.Add(new PauseButton
|
buttons.Add(new PauseButton
|
||||||
@ -131,7 +133,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Title,
|
Text = Header,
|
||||||
Font = @"Exo2.0-Medium",
|
Font = @"Exo2.0-Medium",
|
||||||
Spacing = new Vector2(5, 0),
|
Spacing = new Vector2(5, 0),
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
@ -187,11 +189,6 @@ namespace osu.Game.Screens.Play
|
|||||||
AddButtons(colours);
|
AddButtons(colours);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void AddButtons(OsuColour colours)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected InGameOverlay()
|
protected InGameOverlay()
|
||||||
{
|
{
|
||||||
AlwaysReceiveInput = true;
|
AlwaysReceiveInput = true;
|
||||||
|
@ -14,6 +14,9 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public Action OnResume;
|
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)
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Key == Key.Escape)
|
if (args.Key == Key.Escape)
|
||||||
@ -32,12 +35,6 @@ namespace osu.Game.Screens.Play
|
|||||||
AddButton(@"Retry", colours.YellowDark, OnRetry);
|
AddButton(@"Retry", colours.YellowDark, OnRetry);
|
||||||
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
|
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?";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user