From acd54d1ebcc6f2703f4fc61ce4f147ee4790761b Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan <huoyaoyuan@hotmail.com> Date: Thu, 13 Oct 2016 22:21:15 +0800 Subject: [PATCH 1/4] Single Visibility enum type. --- osu.Game/OsuGame.cs | 24 ++++++++++++------------ osu.Game/Overlays/ChatConsole.cs | 16 +++++----------- osu.Game/Overlays/Toolbar.cs | 16 +++++----------- osu.Game/Overlays/Visibility.cs | 17 +++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 5 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 osu.Game/Overlays/Visibility.cs diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 9eb32117c5..4c1d2e1b98 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -31,7 +31,7 @@ namespace osu.Game { public string Path; } - + public Toolbar Toolbar; public ChatConsole Chat; public MainMenu MainMenu => intro?.ChildGameMode as MainMenu; @@ -40,7 +40,7 @@ namespace osu.Game private IpcChannel<ImportBeatmap> BeatmapIPC; public Bindable<PlayMode> PlayMode; - + public OsuGame(string[] args) { this.args = args; @@ -56,7 +56,7 @@ namespace osu.Game public override void Load(BaseGame game) { BeatmapIPC = new IpcChannel<ImportBeatmap>(Host); - + if (!Host.IsPrimaryInstance) { if (args.Length == 1 && File.Exists(args[0])) @@ -83,7 +83,7 @@ namespace osu.Game Console.WriteLine($@"Failed to import beatmap: {ex}"); } }; - + base.Load(game); //attach our bindables to the audio subsystem. @@ -113,10 +113,10 @@ namespace osu.Game } }); - Toolbar.State = ToolbarState.Hidden; + Toolbar.State = Visibility.Hidden; Toolbar.Flush(); - Chat.State = ChatConsoleState.Hidden; + Chat.State = Visibility.Hidden; Chat.Flush(); intro.ModePushed += modeAdded; @@ -134,10 +134,10 @@ namespace osu.Game switch (args.Key) { case Key.F8: - Chat.State = Chat.State == ChatConsoleState.Hidden ? ChatConsoleState.Visible : ChatConsoleState.Hidden; + Chat.State = Chat.State.Reverse(); return true; } - + return base.OnKeyDown(state, args); } @@ -152,12 +152,12 @@ namespace osu.Game //central game mode change logic. if (newMode is Player || newMode is Intro) { - Toolbar.State = ToolbarState.Hidden; - Chat.State = ChatConsoleState.Hidden; + Toolbar.State = Visibility.Hidden; + Chat.State = Visibility.Hidden; } else { - Toolbar.State = ToolbarState.Visible; + Toolbar.State = Visibility.Visible; } Cursor.FadeIn(100); @@ -178,7 +178,7 @@ namespace osu.Game }); return true; } - + return base.OnExiting(); } diff --git a/osu.Game/Overlays/ChatConsole.cs b/osu.Game/Overlays/ChatConsole.cs index 5763275486..7293ccfdf9 100644 --- a/osu.Game/Overlays/ChatConsole.cs +++ b/osu.Game/Overlays/ChatConsole.cs @@ -25,7 +25,7 @@ using osu.Framework; namespace osu.Game.Overlays { - public class ChatConsole : Container, IStateful<ChatConsoleState> + public class ChatConsole : Container, IStateful<Visibility> { private ChannelDisplay channelDisplay; @@ -140,9 +140,9 @@ namespace osu.Game.Overlays api.Queue(fetchReq); } - private ChatConsoleState state; + private Visibility state; - public ChatConsoleState State + public Visibility State { get { return state; } @@ -154,11 +154,11 @@ namespace osu.Game.Overlays switch (state) { - case ChatConsoleState.Hidden: + case Visibility.Hidden: MoveToY(-Size.Y, transition_length, EasingTypes.InQuint); FadeOut(transition_length, EasingTypes.InQuint); break; - case ChatConsoleState.Visible: + case Visibility.Visible: MoveToY(0, transition_length, EasingTypes.OutQuint); FadeIn(transition_length, EasingTypes.OutQuint); break; @@ -166,10 +166,4 @@ namespace osu.Game.Overlays } } } - - public enum ChatConsoleState - { - Visible, - Hidden, - } } diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index 185123e0e3..ce2aad61b3 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -16,7 +16,7 @@ using osu.Framework; namespace osu.Game.Overlays { - public class Toolbar : Container, IStateful<ToolbarState> + public class Toolbar : Container, IStateful<Visibility> { const float height = 50; @@ -26,9 +26,9 @@ namespace osu.Game.Overlays private ToolbarModeSelector modeSelector; - private ToolbarState state; + private Visibility state; - public ToolbarState State + public Visibility State { get { return state; } set @@ -39,11 +39,11 @@ namespace osu.Game.Overlays switch (state) { - case ToolbarState.Hidden: + case Visibility.Hidden: MoveToY(-Size.Y, transition_time, EasingTypes.InQuint); FadeOut(transition_time, EasingTypes.InQuint); break; - case ToolbarState.Visible: + case Visibility.Visible: MoveToY(0, transition_time, EasingTypes.OutQuint); FadeIn(transition_time, EasingTypes.OutQuint); break; @@ -119,10 +119,4 @@ namespace osu.Game.Overlays public void SetGameMode(PlayMode mode) => modeSelector.SetGameMode(mode); } - - public enum ToolbarState - { - Visible, - Hidden, - } } diff --git a/osu.Game/Overlays/Visibility.cs b/osu.Game/Overlays/Visibility.cs new file mode 100644 index 0000000000..c86ab5c401 --- /dev/null +++ b/osu.Game/Overlays/Visibility.cs @@ -0,0 +1,17 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Overlays +{ + public enum Visibility + { + Hidden, + Visible + } + + public static class OverlayVisibilityHelper + { + public static Visibility Reverse(this Visibility input) + => input == Visibility.Visible ? Visibility.Hidden : Visibility.Visible; + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 068c1e1fd8..1f89696ded 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -160,6 +160,7 @@ <Compile Include="Overlays\ToolbarButton.cs" /> <Compile Include="Overlays\ToolbarModeButton.cs" /> <Compile Include="Overlays\ToolbarModeSelector.cs" /> + <Compile Include="Overlays\Visibility.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Users\User.cs" /> <Compile Include="VolumeControl.cs" /> From c93a440d3bf5c20b37e9db3836efa2ceaecd93f0 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan <huoyaoyuan@hotmail.com> Date: Thu, 13 Oct 2016 22:27:37 +0800 Subject: [PATCH 2/4] Make Options:IStateful. --- osu.Game/GameModes/Menu/MainMenu.cs | 3 ++- osu.Game/OsuGame.cs | 2 +- osu.Game/Overlays/Options.cs | 30 ++++++++++++++--------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/osu.Game/GameModes/Menu/MainMenu.cs b/osu.Game/GameModes/Menu/MainMenu.cs index f6f9a79bf1..f029d0b8ef 100644 --- a/osu.Game/GameModes/Menu/MainMenu.cs +++ b/osu.Game/GameModes/Menu/MainMenu.cs @@ -14,6 +14,7 @@ using osu.Game.GameModes.Play; using osu.Game.Graphics.Containers; using OpenTK; using osu.Framework; +using osu.Game.Overlays; namespace osu.Game.GameModes.Menu { @@ -48,7 +49,7 @@ namespace osu.Game.GameModes.Menu OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); }, OnSettings = delegate { - osu.Options.PoppedOut = !osu.Options.PoppedOut; + osu.Options.State = osu.Options.State.Reverse(); }, } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4c1d2e1b98..6fb8e8f8ba 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -96,7 +96,7 @@ namespace osu.Game Toolbar = new Toolbar { OnHome = delegate { MainMenu?.MakeCurrent(); }, - OnSettings = delegate { Options.PoppedOut = !Options.PoppedOut; }, + OnSettings = delegate { Options.State = Options.State.Reverse(); }, OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, Alpha = 0.001f, }, diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs index bdab31bc6e..6722b0abf6 100644 --- a/osu.Game/Overlays/Options.cs +++ b/osu.Game/Overlays/Options.cs @@ -13,7 +13,7 @@ using osu.Framework; namespace osu.Game.Overlays { - public class Options : Container + public class Options : Container, IStateful<Visibility> { const float width = 300; @@ -41,35 +41,35 @@ namespace osu.Game.Overlays switch (args.Key) { case Key.Escape: - if (!poppedOut) return false; + if (State == Visibility.Hidden) return false; - PoppedOut = false; + State = Visibility.Hidden; return true; } return base.OnKeyDown(state, args); } - private bool poppedOut; + private Visibility state; - public bool PoppedOut + public Visibility State { - get { return poppedOut; } + get { return state; } set { - if (value == poppedOut) return; + if (value == state) return; - poppedOut = value; + state = value; - if (poppedOut) + switch (state) { - MoveTo(new Vector2(0, 0), 300, EasingTypes.Out); + case Visibility.Hidden: + MoveTo(new Vector2(-width, 0), 300, EasingTypes.Out); + break; + case Visibility.Visible: + MoveTo(new Vector2(0, 0), 300, EasingTypes.Out); + break; } - else - { - MoveTo(new Vector2(-width, 0), 300, EasingTypes.Out); - } - } } } From 1c97edaac2f870901e2374b040b524687cc5a909 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan <huoyaoyuan@hotmail.com> Date: Thu, 13 Oct 2016 22:57:05 +0800 Subject: [PATCH 3/4] Base class for overlays. --- osu.Game/GameModes/Menu/MainMenu.cs | 4 +-- osu.Game/OsuGame.cs | 4 +-- osu.Game/Overlays/ChatConsole.cs | 47 +++++++++-------------------- osu.Game/Overlays/Options.cs | 39 ++++++++---------------- osu.Game/Overlays/Overlay.cs | 41 +++++++++++++++++++++++++ osu.Game/Overlays/Toolbar.cs | 46 +++++++++++----------------- osu.Game/Overlays/Visibility.cs | 17 ----------- osu.Game/osu.Game.csproj | 2 +- 8 files changed, 89 insertions(+), 111 deletions(-) create mode 100644 osu.Game/Overlays/Overlay.cs delete mode 100644 osu.Game/Overlays/Visibility.cs diff --git a/osu.Game/GameModes/Menu/MainMenu.cs b/osu.Game/GameModes/Menu/MainMenu.cs index f029d0b8ef..13ed6fec77 100644 --- a/osu.Game/GameModes/Menu/MainMenu.cs +++ b/osu.Game/GameModes/Menu/MainMenu.cs @@ -48,9 +48,7 @@ namespace osu.Game.GameModes.Menu OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); }, - OnSettings = delegate { - osu.Options.State = osu.Options.State.Reverse(); - }, + OnSettings = osu.Options.ReverseVisibility, } } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 6fb8e8f8ba..e1acbae5b7 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -96,7 +96,7 @@ namespace osu.Game Toolbar = new Toolbar { OnHome = delegate { MainMenu?.MakeCurrent(); }, - OnSettings = delegate { Options.State = Options.State.Reverse(); }, + OnSettings = Options.ReverseVisibility, OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, Alpha = 0.001f, }, @@ -134,7 +134,7 @@ namespace osu.Game switch (args.Key) { case Key.F8: - Chat.State = Chat.State.Reverse(); + Chat.ReverseVisibility(); return true; } diff --git a/osu.Game/Overlays/ChatConsole.cs b/osu.Game/Overlays/ChatConsole.cs index 7293ccfdf9..820b9245d3 100644 --- a/osu.Game/Overlays/ChatConsole.cs +++ b/osu.Game/Overlays/ChatConsole.cs @@ -1,12 +1,12 @@ //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Drawables; @@ -17,15 +17,10 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Chat; using osu.Game.Online.Chat.Display; -using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Input; -using OpenTK.Input; -using osu.Framework; namespace osu.Game.Overlays { - public class ChatConsole : Container, IStateful<Visibility> + public class ChatConsole : Overlay { private ChannelDisplay channelDisplay; @@ -69,7 +64,7 @@ namespace osu.Game.Overlays private long? lastMessageId; - List<Channel> careChannels; + private List<Channel> careChannels; private void initializeChannels() { @@ -112,7 +107,7 @@ namespace osu.Game.Overlays careChannels.Add(channel); } - GetMessagesRequest fetchReq; + private GetMessagesRequest fetchReq; public void FetchNewMessages(APIAccess api) { @@ -140,30 +135,18 @@ namespace osu.Game.Overlays api.Queue(fetchReq); } - private Visibility state; + private const int transition_length = 500; - public Visibility State + protected override void PopIn() { - get { return state; } + MoveToY(0, transition_length, EasingTypes.OutQuint); + FadeIn(transition_length, EasingTypes.OutQuint); + } - set - { - state = value; - - const int transition_length = 500; - - switch (state) - { - case Visibility.Hidden: - MoveToY(-Size.Y, transition_length, EasingTypes.InQuint); - FadeOut(transition_length, EasingTypes.InQuint); - break; - case Visibility.Visible: - MoveToY(0, transition_length, EasingTypes.OutQuint); - FadeIn(transition_length, EasingTypes.OutQuint); - break; - } - } + protected override void PopOut() + { + MoveToY(-Size.Y, transition_length, EasingTypes.InQuint); + FadeOut(transition_length, EasingTypes.InQuint); } } } diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs index 6722b0abf6..5bcc5e9a16 100644 --- a/osu.Game/Overlays/Options.cs +++ b/osu.Game/Overlays/Options.cs @@ -1,21 +1,20 @@ //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; -using osu.Framework.Graphics.Transformations; using OpenTK; using OpenTK.Graphics; -using osu.Framework.Input; using OpenTK.Input; using osu.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Transformations; +using osu.Framework.Input; namespace osu.Game.Overlays { - public class Options : Container, IStateful<Visibility> + public class Options : Overlay { - const float width = 300; + private const float width = 300; public override void Load(BaseGame game) { @@ -49,28 +48,14 @@ namespace osu.Game.Overlays return base.OnKeyDown(state, args); } - private Visibility state; - - public Visibility State + protected override void PopIn() { - get { return state; } + MoveToX(0, 300, EasingTypes.Out); + } - set - { - if (value == state) return; - - state = value; - - switch (state) - { - case Visibility.Hidden: - MoveTo(new Vector2(-width, 0), 300, EasingTypes.Out); - break; - case Visibility.Visible: - MoveTo(new Vector2(0, 0), 300, EasingTypes.Out); - break; - } - } + protected override void PopOut() + { + MoveToX(-width, 300, EasingTypes.Out); } } } diff --git a/osu.Game/Overlays/Overlay.cs b/osu.Game/Overlays/Overlay.cs new file mode 100644 index 0000000000..5c0e501703 --- /dev/null +++ b/osu.Game/Overlays/Overlay.cs @@ -0,0 +1,41 @@ +using osu.Framework; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Overlays +{ + public abstract class Overlay : Container, IStateful<Visibility> + { + private Visibility state; + public Visibility State + { + get { return state; } + set + { + if (value == state) return; + state = value; + + switch (value) + { + case Visibility.Hidden: + PopOut(); + break; + case Visibility.Visible: + PopIn(); + break; + } + } + } + + protected abstract void PopIn(); + + protected abstract void PopOut(); + + public void ReverseVisibility() + => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible); + } + public enum Visibility + { + Hidden, + Visible + } +} diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index ce2aad61b3..c4bc9518cc 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -1,24 +1,23 @@ //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Drawables; -using OpenTK; -using OpenTK.Graphics; -using osu.Game.Graphics; -using osu.Game.Configuration; -using System; using osu.Framework.Graphics.Transformations; -using osu.Framework.Timing; +using osu.Game.Configuration; using osu.Game.GameModes.Play; -using osu.Framework; +using osu.Game.Graphics; namespace osu.Game.Overlays { - public class Toolbar : Container, IStateful<Visibility> + public class Toolbar : Overlay { - const float height = 50; + private const float height = 50; public Action OnSettings; public Action OnHome; @@ -26,29 +25,18 @@ namespace osu.Game.Overlays private ToolbarModeSelector modeSelector; - private Visibility state; + private const int transition_time = 200; - public Visibility State + protected override void PopIn() { - get { return state; } - set - { - state = value; + MoveToY(0, transition_time, EasingTypes.OutQuint); + FadeIn(transition_time, EasingTypes.OutQuint); + } - const int transition_time = 200; - - switch (state) - { - case Visibility.Hidden: - MoveToY(-Size.Y, transition_time, EasingTypes.InQuint); - FadeOut(transition_time, EasingTypes.InQuint); - break; - case Visibility.Visible: - MoveToY(0, transition_time, EasingTypes.OutQuint); - FadeIn(transition_time, EasingTypes.OutQuint); - break; - } - } + protected override void PopOut() + { + MoveToY(-Size.Y, transition_time, EasingTypes.InQuint); + FadeOut(transition_time, EasingTypes.InQuint); } public override void Load(BaseGame game) diff --git a/osu.Game/Overlays/Visibility.cs b/osu.Game/Overlays/Visibility.cs deleted file mode 100644 index c86ab5c401..0000000000 --- a/osu.Game/Overlays/Visibility.cs +++ /dev/null @@ -1,17 +0,0 @@ -//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. -//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Overlays -{ - public enum Visibility - { - Hidden, - Visible - } - - public static class OverlayVisibilityHelper - { - public static Visibility Reverse(this Visibility input) - => input == Visibility.Visible ? Visibility.Hidden : Visibility.Visible; - } -} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1f89696ded..f1d8334eba 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -156,11 +156,11 @@ <Compile Include="OsuGameBase.cs" /> <Compile Include="Overlays\ChatConsole.cs" /> <Compile Include="Overlays\Options.cs" /> + <Compile Include="Overlays\Overlay.cs" /> <Compile Include="Overlays\Toolbar.cs" /> <Compile Include="Overlays\ToolbarButton.cs" /> <Compile Include="Overlays\ToolbarModeButton.cs" /> <Compile Include="Overlays\ToolbarModeSelector.cs" /> - <Compile Include="Overlays\Visibility.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Users\User.cs" /> <Compile Include="VolumeControl.cs" /> From 254cc87578bcb0671259fd3cb23264d951587b6f Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan <huoyaoyuan@hotmail.com> Date: Fri, 14 Oct 2016 05:02:13 +0800 Subject: [PATCH 4/4] Use name ToggleVisibility. --- osu.Game/GameModes/Menu/MainMenu.cs | 2 +- osu.Game/OsuGame.cs | 4 ++-- osu.Game/Overlays/Overlay.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/GameModes/Menu/MainMenu.cs b/osu.Game/GameModes/Menu/MainMenu.cs index 13ed6fec77..475d4c8dea 100644 --- a/osu.Game/GameModes/Menu/MainMenu.cs +++ b/osu.Game/GameModes/Menu/MainMenu.cs @@ -48,7 +48,7 @@ namespace osu.Game.GameModes.Menu OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); }, - OnSettings = osu.Options.ReverseVisibility, + OnSettings = osu.Options.ToggleVisibility, } } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index e1acbae5b7..5d0e401321 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -96,7 +96,7 @@ namespace osu.Game Toolbar = new Toolbar { OnHome = delegate { MainMenu?.MakeCurrent(); }, - OnSettings = Options.ReverseVisibility, + OnSettings = Options.ToggleVisibility, OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, Alpha = 0.001f, }, @@ -134,7 +134,7 @@ namespace osu.Game switch (args.Key) { case Key.F8: - Chat.ReverseVisibility(); + Chat.ToggleVisibility(); return true; } diff --git a/osu.Game/Overlays/Overlay.cs b/osu.Game/Overlays/Overlay.cs index 5c0e501703..31e4c10d2a 100644 --- a/osu.Game/Overlays/Overlay.cs +++ b/osu.Game/Overlays/Overlay.cs @@ -30,7 +30,7 @@ namespace osu.Game.Overlays protected abstract void PopOut(); - public void ReverseVisibility() + public void ToggleVisibility() => State = (State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible); } public enum Visibility