From 39db1e8cbb9ba539838e1ac4b117e1611cf04063 Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Thu, 3 May 2018 23:50:30 +0300 Subject: [PATCH] Rename HoldToQuit to QuitButton --- osu.Game.Tests/Visual/TestCaseHoldToQuit.cs | 4 ++-- .../Play/HUD/{HoldToQuit.cs => QuitButton.cs} | 12 ++++++------ osu.Game/Screens/Play/HUDOverlay.cs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) rename osu.Game/Screens/Play/HUD/{HoldToQuit.cs => QuitButton.cs} (91%) diff --git a/osu.Game.Tests/Visual/TestCaseHoldToQuit.cs b/osu.Game.Tests/Visual/TestCaseHoldToQuit.cs index a9b391cd79..9a2228c23c 100644 --- a/osu.Game.Tests/Visual/TestCaseHoldToQuit.cs +++ b/osu.Game.Tests/Visual/TestCaseHoldToQuit.cs @@ -16,8 +16,8 @@ namespace osu.Game.Tests.Visual public TestCaseHoldToQuit() { - HoldToQuit holdToQuit; - Add(holdToQuit = new HoldToQuit + QuitButton holdToQuit; + Add(holdToQuit = new QuitButton { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, diff --git a/osu.Game/Screens/Play/HUD/HoldToQuit.cs b/osu.Game/Screens/Play/HUD/QuitButton.cs similarity index 91% rename from osu.Game/Screens/Play/HUD/HoldToQuit.cs rename to osu.Game/Screens/Play/HUD/QuitButton.cs index ee67dd35f8..aa6dc388ac 100644 --- a/osu.Game/Screens/Play/HUD/HoldToQuit.cs +++ b/osu.Game/Screens/Play/HUD/QuitButton.cs @@ -14,16 +14,16 @@ using OpenTK; namespace osu.Game.Screens.Play.HUD { - public class HoldToQuit : FillFlowContainer + public class QuitButton : FillFlowContainer { - private readonly HoldToQuitButton button; + private readonly Button button; public Action ExitAction { get => button.ExitAction; set => button.ExitAction = value; } - public HoldToQuit() + public QuitButton() { OsuSpriteText text; Direction = FillDirection.Horizontal; @@ -37,12 +37,12 @@ namespace osu.Game.Screens.Play.HUD Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft }, - button = new HoldToQuitButton(text) + button = new Button(text) }; AutoSizeAxes = Axes.Both; } - public class HoldToQuitButton : CircularContainer + private class Button : CircularContainer { private readonly OsuSpriteText text; private SpriteIcon icon; @@ -54,7 +54,7 @@ namespace osu.Game.Screens.Play.HUD private const int progress_duration = 1000; private const int text_display_time = 5000; - public HoldToQuitButton(OsuSpriteText text) => this.text = text; + public Button(OsuSpriteText text) => this.text = text; [BackgroundDependencyLoader] private void load(OsuColour colours) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index c2471c967e..cba5c94266 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play public readonly HealthDisplay HealthDisplay; public readonly SongProgress Progress; public readonly ModDisplay ModDisplay; - public readonly HoldToQuit HoldToQuit; + public readonly QuitButton HoldToQuit; public readonly PlayerSettingsOverlay PlayerSettingsOverlay; private Bindable showHud; @@ -58,7 +58,7 @@ namespace osu.Game.Screens.Play AccuracyCounter = CreateAccuracyCounter(), HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), - HoldToQuit = CreateHoldToQuit(), + HoldToQuit = CreateQuitButton(), ModDisplay = CreateModsContainer(), PlayerSettingsOverlay = CreatePlayerSettingsOverlay() } @@ -207,11 +207,11 @@ namespace osu.Game.Screens.Play RelativeSizeAxes = Axes.X, }; - protected virtual HoldToQuit CreateHoldToQuit() => new HoldToQuit + protected virtual QuitButton CreateQuitButton() => new QuitButton { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, - Margin = new MarginPadding { Bottom = Progress.Size.Y * 1.25f, Right = 5 } + Position = new Vector2(-5, -70) }; protected virtual ModDisplay CreateModsContainer() => new ModDisplay