From 6a510097df21b9fbc826677c23c63b314aa53cfe Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Wed, 5 Apr 2017 22:36:03 +0300 Subject: [PATCH] InGameOverlay fixes --- osu.Game/Screens/Play/FailOverlay.cs | 9 +++------ osu.Game/Screens/Play/InGameOverlay.cs | 13 +++++-------- osu.Game/Screens/Play/PauseOverlay.cs | 9 +++------ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index c8539dc475..ceabaee43b 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -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?"; - } } } diff --git a/osu.Game/Screens/Play/InGameOverlay.cs b/osu.Game/Screens/Play/InGameOverlay.cs index 00c78913c6..cdd858644d 100644 --- a/osu.Game/Screens/Play/InGameOverlay.cs +++ b/osu.Game/Screens/Play/InGameOverlay.cs @@ -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; diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index 2a67662298..a6b550368b 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -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?"; - } } } \ No newline at end of file