From 4d27101acab1bf3115360424fc586af33a18313b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 19:33:38 +0900 Subject: [PATCH 1/3] Add ability to adjust game clock's speed (pgup/pgdn). A bit hacky, probably need to expose rate better. --- osu.Game/OsuGame.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index c6e07c3a79..a4ca4c5817 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -20,6 +20,7 @@ using osu.Game.Graphics.UserInterface.Volume; using osu.Game.Database; using osu.Framework.Allocation; using osu.Framework.Graphics.Transformations; +using osu.Framework.Timing; using osu.Game.Modes; using osu.Game.Overlays.Toolbar; using osu.Game.Screens; @@ -154,11 +155,19 @@ namespace osu.Game private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args) { + if (args.Repeat) return false; + switch (args.Key) { case Key.F8: chat.ToggleVisibility(); return true; + case Key.PageUp: + case Key.PageDown: + var rate = ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate * (args.Key == Key.PageUp ? 1.1f : 0.9f); + ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate = rate; + Logger.Log($@"Adjusting game clock to {rate}", LoggingTarget.Debug); + return true; } if (state.Keyboard.ControlPressed) From ff85ccca6d91db674d5080b364abd3c493a2a6b8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 19:34:52 +0900 Subject: [PATCH 2/3] Move the actual outro sequence into Intro rather than MainMenu. --- osu-resources | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 1 - osu.Game/Screens/Menu/Intro.cs | 13 +++++++++++-- osu.Game/Screens/Menu/MainMenu.cs | 10 +++++++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/osu-resources b/osu-resources index 6edd5eacdd..a3b2991157 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 6edd5eacdd25cc8c4f4dbca3414678c0b7dc5deb +Subproject commit a3b2991157ec0bdeb0e73d10e7b845aa16715420 diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index f5cf111269..3f2d7fcffc 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -144,7 +144,6 @@ namespace osu.Game.Screens.Menu private void onExit() { - State = MenuState.Exit; OnExit?.Invoke(); } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index ed7c0fa7e9..ca85546b10 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -25,6 +25,7 @@ namespace osu.Game.Screens.Menu MainMenu mainMenu; private AudioSample welcome; + private AudioSample seeya; private AudioTrack bgm; internal override bool ShowOverlays => (ParentGameMode as OsuGameMode)?.ShowOverlays ?? false; @@ -58,6 +59,7 @@ namespace osu.Game.Screens.Menu private void load(AudioManager audio) { welcome = audio.Sample.Get(@"welcome"); + seeya = audio.Sample.Get(@"seeya"); bgm = audio.Track.Get(@"circles"); bgm.Looping = true; @@ -106,8 +108,15 @@ namespace osu.Game.Screens.Menu protected override void OnResuming(GameMode last) { - //we are just an intro. if we are resumed, we just want to exit after a short delay (to allow the last mode to transition out). - Scheduler.AddDelayed(Exit, 600); + //we also handle the exit transition. + seeya.Play(); + + double fadeOutTime = (last.LifetimeEnd - Time.Current) + 100; + + Scheduler.AddDelayed(Exit, fadeOutTime); + + //don't want to fade out completely else we will stop running updates and shit will hit the fan. + Game.FadeTo(0.01f, fadeOutTime); base.OnResuming(last); } diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index a6f8b51536..7b000ff7d5 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -1,6 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.GameModes; using osu.Framework.GameModes.Testing; @@ -49,7 +50,7 @@ namespace osu.Game.Screens.Menu OnSolo = delegate { Push(new PlaySongSelect()); }, OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, - OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); }, + OnExit = delegate { Exit(); }, } } } @@ -93,5 +94,12 @@ namespace osu.Game.Screens.Menu Content.FadeIn(length, EasingTypes.OutQuint); Content.MoveTo(new Vector2(0, 0), length, EasingTypes.OutQuint); } + + protected override bool OnExiting(GameMode next) + { + buttons.State = MenuState.Exit; + Content.FadeOut(ButtonSystem.EXIT_DELAY); + return base.OnExiting(next); + } } } From 3cb9cb647d447a00929a7621f35b95f5be35e8cc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 21:36:42 +0900 Subject: [PATCH 3/3] Tidy up BackButton and adjust transitions a bit. --- osu.Game/Graphics/UserInterface/BackButton.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 7ccc5c061b..8d173384c3 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -16,13 +16,10 @@ namespace osu.Game.Graphics.UserInterface { private TextAwesome icon; - private Container leftContainer; - private Container rightContainer; - private Box leftBox; private Box rightBox; - private const double transform_time = 300.0; + private const double transform_time = 600; private const int pulse_length = 250; private const float shear = 0.1f; @@ -36,7 +33,7 @@ namespace osu.Game.Graphics.UserInterface Children = new Drawable[] { - leftContainer = new Container + new Container { RelativeSizeAxes = Axes.Both, Width = 0.4f, @@ -56,7 +53,7 @@ namespace osu.Game.Graphics.UserInterface }, } }, - rightContainer = new Container + new Container { Origin = Anchor.TopRight, Anchor = Anchor.TopRight, @@ -84,10 +81,7 @@ namespace osu.Game.Graphics.UserInterface }; } - public override bool Contains(Vector2 screenSpacePos) - { - return leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos); - } + public override bool Contains(Vector2 screenSpacePos) => leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos); protected override bool OnHover(InputState state) {