From 2b3a6302706221035456fd37f4b2e57311a06109 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 28 May 2018 13:43:47 +0200 Subject: [PATCH 01/11] add OverlayActivation enum + fix Toolbar being toggleable when it shouldn't be able to + allow opening overlays in MenuState.Initial again --- .../Containers/OsuFocusedOverlayContainer.cs | 10 ++++-- osu.Game/OsuGame.cs | 22 ++++-------- osu.Game/Overlays/OverlayActivation.cs | 12 +++++++ osu.Game/Overlays/Toolbar/Toolbar.cs | 20 +++++++++++ osu.Game/Screens/Menu/ButtonSystem.cs | 20 ++++------- osu.Game/Screens/Menu/Disclaimer.cs | 4 ++- osu.Game/Screens/Menu/Intro.cs | 4 ++- osu.Game/Screens/Menu/MainMenu.cs | 6 +++- osu.Game/Screens/OsuScreen.cs | 35 +++++++++++++------ 9 files changed, 89 insertions(+), 44 deletions(-) create mode 100644 osu.Game/Overlays/OverlayActivation.cs diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 11a2034a8f..318632a403 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Input; using OpenTK; using osu.Framework.Configuration; +using osu.Game.Overlays; namespace osu.Game.Graphics.Containers { @@ -16,13 +17,16 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; - private readonly BindableBool allowOpeningOverlays = new BindableBool(true); + /// + /// Defaults to so that the overlay works even if BDL couldn't pass an . + /// + private readonly Bindable allowOverlays = new Bindable(OverlayActivation.All); [BackgroundDependencyLoader(true)] private void load(OsuGame osuGame, AudioManager audio) { if (osuGame != null) - allowOpeningOverlays.BindTo(osuGame.AllowOpeningOverlays); + allowOverlays.BindTo(osuGame.AllowOverlays); samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out"); @@ -52,7 +56,7 @@ namespace osu.Game.Graphics.Containers private void onStateChanged(Visibility visibility) { - if (allowOpeningOverlays) + if (allowOverlays == OverlayActivation.All) { switch (visibility) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index a43c1507b6..35f29c3fd1 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -77,8 +77,7 @@ namespace osu.Game public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight; - public readonly BindableBool HideOverlaysOnEnter = new BindableBool(); - public readonly BindableBool AllowOpeningOverlays = new BindableBool(true); + public readonly Bindable AllowOverlays = new Bindable(); private OsuScreen screenStack; @@ -368,20 +367,13 @@ namespace osu.Game settings.StateChanged += _ => updateScreenOffset(); notifications.StateChanged += _ => updateScreenOffset(); - notifications.Enabled.BindTo(AllowOpeningOverlays); + AllowOverlays.ValueChanged += state => notifications.Enabled.Value = state == OverlayActivation.All; + } - HideOverlaysOnEnter.ValueChanged += hide => - { - //central game screen change logic. - if (hide) - { - hideAllOverlays(); - musicController.State = Visibility.Hidden; - Toolbar.State = Visibility.Hidden; - } - else - Toolbar.State = Visibility.Visible; - }; + public void CloseAllOverlays() + { + hideAllOverlays(); + musicController.State = Visibility.Hidden; } private void forwardLoggedErrorsToNotifications() diff --git a/osu.Game/Overlays/OverlayActivation.cs b/osu.Game/Overlays/OverlayActivation.cs new file mode 100644 index 0000000000..735682ed57 --- /dev/null +++ b/osu.Game/Overlays/OverlayActivation.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Overlays +{ + public enum OverlayActivation + { + Disabled, + //UserTriggered, // currently there is no way to discern user action + All + } +} diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 424a457110..78739c03fe 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -10,6 +10,8 @@ using osu.Framework.Input; using osu.Game.Graphics; using OpenTK; using osu.Framework.Graphics.Shapes; +using osu.Framework.Allocation; +using osu.Framework.Configuration; namespace osu.Game.Overlays.Toolbar { @@ -29,6 +31,11 @@ namespace osu.Game.Overlays.Toolbar private const float alpha_hovering = 0.8f; private const float alpha_normal = 0.6f; + /// + /// Defaults to so that the overlay works even if BDL couldn't pass an . + /// + private readonly Bindable allowOverlays = new Bindable(OverlayActivation.All); + public Toolbar() { Children = new Drawable[] @@ -76,6 +83,19 @@ namespace osu.Game.Overlays.Toolbar Size = new Vector2(1, HEIGHT); } + [BackgroundDependencyLoader(true)] + private void load(OsuGame osuGame) + { + if (osuGame != null) + allowOverlays.BindTo(osuGame.AllowOverlays); + + StateChanged += visibility => + { + if (allowOverlays == OverlayActivation.Disabled) + State = Visibility.Hidden; + }; + } + public class ToolbarBackground : Container { private readonly Box solidBackground; diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 8b88204ed0..40e115364d 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -20,6 +20,7 @@ using osu.Game.Input.Bindings; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; +using osu.Game.Overlays; namespace osu.Game.Screens.Menu { @@ -27,8 +28,7 @@ namespace osu.Game.Screens.Menu { public event Action StateChanged; - private readonly BindableBool hideOverlaysOnEnter = new BindableBool(); - private readonly BindableBool allowOpeningOverlays = new BindableBool(); + private readonly Bindable allowOverlays = new Bindable(); public Action OnEdit; public Action OnExit; @@ -137,10 +137,7 @@ namespace osu.Game.Screens.Menu private void load(AudioManager audio, OsuGame game) { if (game != null) - { - hideOverlaysOnEnter.BindTo(game.HideOverlaysOnEnter); - allowOpeningOverlays.BindTo(game.AllowOpeningOverlays); - } + allowOverlays.BindTo(game.AllowOverlays); sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -332,19 +329,19 @@ namespace osu.Game.Screens.Menu case MenuState.Exit: case MenuState.Initial: logoTracking = false; + allowOverlays.Value = OverlayActivation.Disabled; logoDelayedAction = Scheduler.AddDelayed(() => { - hideOverlaysOnEnter.Value = true; - allowOpeningOverlays.Value = false; - logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); logo.ScaleTo(1, 800, Easing.OutExpo); - }, 150); + if(state != MenuState.Exit) + allowOverlays.Value = OverlayActivation.All; + }, 150); break; case MenuState.TopLevel: case MenuState.Play: @@ -365,9 +362,6 @@ namespace osu.Game.Screens.Menu logoTracking = true; logo.Impact(); - - hideOverlaysOnEnter.Value = false; - allowOpeningOverlays.Value = true; }, 200); break; default: diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index b8cb7f2a4a..3671a54068 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -9,6 +9,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Game.Overlays; namespace osu.Game.Screens.Menu { @@ -19,7 +20,6 @@ namespace osu.Game.Screens.Menu private Color4 iconColour; protected override bool HideOverlaysOnEnter => true; - protected override bool AllowOpeningOverlays => false; public override bool CursorVisible => false; @@ -93,6 +93,8 @@ namespace osu.Game.Screens.Menu LoadComponentAsync(intro = new Intro()); iconColour = colours.Yellow; + + AllowOverlays.Value = OverlayActivation.Disabled; } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index c174e2d470..aa89b86786 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -15,6 +15,7 @@ using osu.Game.IO.Archives; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; +using osu.Game.Overlays; namespace osu.Game.Screens.Menu { @@ -32,7 +33,6 @@ namespace osu.Game.Screens.Menu private SampleChannel seeya; protected override bool HideOverlaysOnEnter => true; - protected override bool AllowOpeningOverlays => false; public override bool CursorVisible => false; @@ -77,6 +77,8 @@ namespace osu.Game.Screens.Menu welcome = audio.Sample.Get(@"welcome"); seeya = audio.Sample.Get(@"seeya"); + + AllowOverlays.Value = OverlayActivation.Disabled; } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index d5f3b11467..728880b0f8 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -10,6 +10,7 @@ using osu.Framework.Input; using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; +using osu.Game.Overlays; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Charts; using osu.Game.Screens.Direct; @@ -25,7 +26,6 @@ namespace osu.Game.Screens.Menu private readonly ButtonSystem buttons; protected override bool HideOverlaysOnEnter => buttons.State == MenuState.Initial; - protected override bool AllowOpeningOverlays => buttons.State != MenuState.Initial; protected override bool AllowBackButton => buttons.State != MenuState.Initial; @@ -64,6 +64,8 @@ namespace osu.Game.Screens.Menu }, sideFlashes = new MenuSideFlashes(), }; + + buttons.StateChanged += state => UpdateOverlayStates?.Invoke(); } [BackgroundDependencyLoader(true)] @@ -78,6 +80,8 @@ namespace osu.Game.Screens.Menu } preloadSongSelect(); + + AllowOverlays.Value = OverlayActivation.Disabled; } private void preloadSongSelect() diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index cd9cbe119f..e48d72b6fc 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -18,6 +18,8 @@ using osu.Game.Rulesets; using osu.Game.Screens.Menu; using OpenTK; using OpenTK.Input; +using osu.Game.Overlays; +using osu.Framework.Graphics.Containers; namespace osu.Game.Screens { @@ -40,19 +42,23 @@ namespace osu.Game.Screens /// protected virtual BackgroundScreen CreateBackground() => null; - private readonly BindableBool hideOverlaysOnEnter = new BindableBool(); + private Action updateOverlayStates; /// - /// Whether overlays should be hidden when this screen is entered or resumed. + /// Allows manually updating visibility of all overlays if is not enough. + /// + protected Action UpdateOverlayStates => updateOverlayStates; + + /// + /// Whether all overlays should be hidden when this screen is entered or resumed. /// protected virtual bool HideOverlaysOnEnter => false; - private readonly BindableBool allowOpeningOverlays = new BindableBool(); - /// - /// Whether overlays should be able to be opened while this screen is active. + /// Whether overlays should be able to be opened. + /// It's bound at load which means changes at construction will potentially disappear. /// - protected virtual bool AllowOpeningOverlays => true; + protected readonly Bindable AllowOverlays = new Bindable(); /// /// Whether this allows the cursor to be displayed. @@ -103,8 +109,18 @@ namespace osu.Game.Screens if (osuGame != null) { Ruleset.BindTo(osuGame.Ruleset); - hideOverlaysOnEnter.BindTo(osuGame.HideOverlaysOnEnter); - allowOpeningOverlays.BindTo(osuGame.AllowOpeningOverlays); + AllowOverlays.BindTo(osuGame.AllowOverlays); + + updateOverlayStates = () => + { + if (HideOverlaysOnEnter) + { + osuGame.CloseAllOverlays(); + osuGame.Toolbar.State = Visibility.Hidden; + } + else + osuGame.Toolbar.State = Visibility.Visible; + }; } sampleExit = audio.Sample.Get(@"UI/screen-back"); @@ -236,8 +252,7 @@ namespace osu.Game.Screens if (backgroundParallaxContainer != null) backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; - hideOverlaysOnEnter.Value = HideOverlaysOnEnter; - allowOpeningOverlays.Value = AllowOpeningOverlays; + updateOverlayStates?.Invoke(); } private void onExitingLogo() From 707af0209732ef29de79d4417c2aab9892ff8f89 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 3 Jun 2018 11:30:58 +0200 Subject: [PATCH 02/11] apply feedback -don't directly set AllowOverlay Bindable this should be done specifically where needed -remove AllowOverlay Bindable from ButtonSystem -remove unnecessary xmldoc --- .../Containers/OsuFocusedOverlayContainer.cs | 3 --- osu.Game/Overlays/Toolbar/Toolbar.cs | 3 --- osu.Game/Screens/Menu/ButtonSystem.cs | 13 +------------ osu.Game/Screens/Menu/Disclaimer.cs | 3 +-- osu.Game/Screens/Menu/Intro.cs | 3 +-- osu.Game/Screens/Menu/MainMenu.cs | 3 --- osu.Game/Screens/OsuScreen.cs | 11 +++++++---- 7 files changed, 10 insertions(+), 29 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 318632a403..e9c02e84ec 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -17,9 +17,6 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; - /// - /// Defaults to so that the overlay works even if BDL couldn't pass an . - /// private readonly Bindable allowOverlays = new Bindable(OverlayActivation.All); [BackgroundDependencyLoader(true)] diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 78739c03fe..032ea01700 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -31,9 +31,6 @@ namespace osu.Game.Overlays.Toolbar private const float alpha_hovering = 0.8f; private const float alpha_normal = 0.6f; - /// - /// Defaults to so that the overlay works even if BDL couldn't pass an . - /// private readonly Bindable allowOverlays = new Bindable(OverlayActivation.All); public Toolbar() diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 40e115364d..bbbe918279 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -8,7 +8,6 @@ using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -20,7 +19,6 @@ using osu.Game.Input.Bindings; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; -using osu.Game.Overlays; namespace osu.Game.Screens.Menu { @@ -28,8 +26,6 @@ namespace osu.Game.Screens.Menu { public event Action StateChanged; - private readonly Bindable allowOverlays = new Bindable(); - public Action OnEdit; public Action OnExit; public Action OnDirect; @@ -134,11 +130,8 @@ namespace osu.Game.Screens.Menu } [BackgroundDependencyLoader(true)] - private void load(AudioManager audio, OsuGame game) + private void load(AudioManager audio) { - if (game != null) - allowOverlays.BindTo(game.AllowOverlays); - sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -329,7 +322,6 @@ namespace osu.Game.Screens.Menu case MenuState.Exit: case MenuState.Initial: logoTracking = false; - allowOverlays.Value = OverlayActivation.Disabled; logoDelayedAction = Scheduler.AddDelayed(() => { @@ -338,9 +330,6 @@ namespace osu.Game.Screens.Menu logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); logo.ScaleTo(1, 800, Easing.OutExpo); - - if(state != MenuState.Exit) - allowOverlays.Value = OverlayActivation.All; }, 150); break; case MenuState.TopLevel: diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 3671a54068..2436f0a940 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -20,6 +20,7 @@ namespace osu.Game.Screens.Menu private Color4 iconColour; protected override bool HideOverlaysOnEnter => true; + protected override OverlayActivation OverlayActivationLevel => OverlayActivation.Disabled; public override bool CursorVisible => false; @@ -93,8 +94,6 @@ namespace osu.Game.Screens.Menu LoadComponentAsync(intro = new Intro()); iconColour = colours.Yellow; - - AllowOverlays.Value = OverlayActivation.Disabled; } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index aa89b86786..494c92c698 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -33,6 +33,7 @@ namespace osu.Game.Screens.Menu private SampleChannel seeya; protected override bool HideOverlaysOnEnter => true; + protected override OverlayActivation OverlayActivationLevel => OverlayActivation.Disabled; public override bool CursorVisible => false; @@ -77,8 +78,6 @@ namespace osu.Game.Screens.Menu welcome = audio.Sample.Get(@"welcome"); seeya = audio.Sample.Get(@"seeya"); - - AllowOverlays.Value = OverlayActivation.Disabled; } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 728880b0f8..8eddaaee93 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -10,7 +10,6 @@ using osu.Framework.Input; using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; -using osu.Game.Overlays; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Charts; using osu.Game.Screens.Direct; @@ -80,8 +79,6 @@ namespace osu.Game.Screens.Menu } preloadSongSelect(); - - AllowOverlays.Value = OverlayActivation.Disabled; } private void preloadSongSelect() diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index e48d72b6fc..0bff75f53b 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -54,11 +54,12 @@ namespace osu.Game.Screens /// protected virtual bool HideOverlaysOnEnter => false; + private readonly Bindable allowOverlays = new Bindable(); + /// - /// Whether overlays should be able to be opened. - /// It's bound at load which means changes at construction will potentially disappear. + /// Whether overlays should be able to be opened once this screen is entered or resumed. /// - protected readonly Bindable AllowOverlays = new Bindable(); + protected virtual OverlayActivation OverlayActivationLevel => OverlayActivation.All; /// /// Whether this allows the cursor to be displayed. @@ -109,7 +110,7 @@ namespace osu.Game.Screens if (osuGame != null) { Ruleset.BindTo(osuGame.Ruleset); - AllowOverlays.BindTo(osuGame.AllowOverlays); + allowOverlays.BindTo(osuGame.AllowOverlays); updateOverlayStates = () => { @@ -252,6 +253,8 @@ namespace osu.Game.Screens if (backgroundParallaxContainer != null) backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; + allowOverlays.Value = OverlayActivationLevel; + updateOverlayStates?.Invoke(); } From 2afe0feb245b34ca0c5862ec84dda8d12d44518c Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 3 Jun 2018 12:02:43 +0200 Subject: [PATCH 03/11] remove white space I think --- osu.Game/Screens/OsuScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 8a36645145..e705b6f298 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -257,7 +257,7 @@ namespace osu.Game.Screens backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; allowOverlays.Value = OverlayActivationLevel; - + updateOverlayStates?.Invoke(); } From b84441ab879271de900099b4b23a2c2bc1099db7 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Mon, 4 Jun 2018 22:25:18 +0900 Subject: [PATCH 04/11] Fix TestImportOverIPC --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 586217a05f..645c76f265 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -264,7 +264,8 @@ namespace osu.Game.Tests.Beatmaps.IO private string createTemporaryBeatmap() { - var temp = new FileInfo(osz_path).CopyTo(Path.GetTempFileName(), true).FullName; + var temp = Path.GetTempFileName() + Guid.NewGuid() + ".osz"; + File.Copy(osz_path, temp, true); Assert.IsTrue(File.Exists(temp)); return temp; } @@ -344,12 +345,12 @@ namespace osu.Game.Tests.Beatmaps.IO private void waitForOrAssert(Func result, string failureMessage, int timeout = 60000) { - Action waitAction = () => + Task task = Task.Run(() => { while (!result()) Thread.Sleep(200); - }; + }); - Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), failureMessage); + Assert.IsTrue(task.Wait(timeout), failureMessage); } } } From 86be1bef6b8856be4306cbaf3dcc763685096c77 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Jun 2018 15:10:09 +0900 Subject: [PATCH 05/11] Use UserTriggered in Player --- .../Containers/OsuFocusedOverlayContainer.cs | 20 +++++++++---------- osu.Game/Overlays/OverlayActivation.cs | 2 +- osu.Game/Screens/Play/Player.cs | 3 +++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index e9c02e84ec..51a9706ea4 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -53,20 +53,18 @@ namespace osu.Game.Graphics.Containers private void onStateChanged(Visibility visibility) { - if (allowOverlays == OverlayActivation.All) + switch (visibility) { - switch (visibility) - { - case Visibility.Visible: + case Visibility.Visible: + if (allowOverlays != OverlayActivation.Disabled) samplePopIn?.Play(); - break; - case Visibility.Hidden: - samplePopOut?.Play(); - break; - } + else + State = Visibility.Hidden; + break; + case Visibility.Hidden: + samplePopOut?.Play(); + break; } - else - State = Visibility.Hidden; } } } diff --git a/osu.Game/Overlays/OverlayActivation.cs b/osu.Game/Overlays/OverlayActivation.cs index 735682ed57..da4e153ce9 100644 --- a/osu.Game/Overlays/OverlayActivation.cs +++ b/osu.Game/Overlays/OverlayActivation.cs @@ -6,7 +6,7 @@ namespace osu.Game.Overlays public enum OverlayActivation { Disabled, - //UserTriggered, // currently there is no way to discern user action + UserTriggered, All } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c93e4b7b40..6e0f6cb1c5 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -21,6 +21,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Online.API; +using osu.Game.Overlays; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; @@ -37,6 +38,8 @@ namespace osu.Game.Screens.Play protected override bool HideOverlaysOnEnter => true; + protected override OverlayActivation OverlayActivationLevel => OverlayActivation.UserTriggered; + public Action RestartRequested; public bool HasFailed { get; private set; } From d1fd09ed4767a3a3bd94493343057fc94ecd9071 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Jun 2018 15:49:27 +0900 Subject: [PATCH 06/11] Rename variables --- osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs | 6 +++--- osu.Game/OsuGame.cs | 2 +- osu.Game/Overlays/Toolbar/Toolbar.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 51a9706ea4..0186a170c9 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -17,13 +17,13 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; - private readonly Bindable allowOverlays = new Bindable(OverlayActivation.All); + protected readonly Bindable OverlayActivationMode = new Bindable(OverlayActivation.All); [BackgroundDependencyLoader(true)] private void load(OsuGame osuGame, AudioManager audio) { if (osuGame != null) - allowOverlays.BindTo(osuGame.AllowOverlays); + OverlayActivationMode.BindTo(osuGame.OverlayActivationMode); samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out"); @@ -56,7 +56,7 @@ namespace osu.Game.Graphics.Containers switch (visibility) { case Visibility.Visible: - if (allowOverlays != OverlayActivation.Disabled) + if (OverlayActivationMode != OverlayActivation.Disabled) samplePopIn?.Play(); else State = Visibility.Hidden; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 35f29c3fd1..5c256ed5c8 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -77,7 +77,7 @@ namespace osu.Game public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight; - public readonly Bindable AllowOverlays = new Bindable(); + public readonly Bindable OverlayActivationMode = new Bindable(); private OsuScreen screenStack; diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 032ea01700..1eaf748011 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Toolbar private void load(OsuGame osuGame) { if (osuGame != null) - allowOverlays.BindTo(osuGame.AllowOverlays); + allowOverlays.BindTo(osuGame.OverlayActivationMode); StateChanged += visibility => { diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index a6e32cda7b..ba9c65e42d 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -110,7 +110,7 @@ namespace osu.Game.Screens if (osuGame != null) { Ruleset.BindTo(osuGame.Ruleset); - allowOverlays.BindTo(osuGame.AllowOverlays); + allowOverlays.BindTo(osuGame.OverlayActivationMode); updateOverlayStates = () => { From 9e25e02696de1d38735abb8590ff6ef72e34d1f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Jun 2018 15:49:58 +0900 Subject: [PATCH 07/11] Ensure notifications don't appear during UserTriggered mode Closes #2640. --- osu.Game/OsuGame.cs | 2 - osu.Game/Overlays/NotificationOverlay.cs | 49 +++++++++++------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 5c256ed5c8..68c50dafab 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -366,8 +366,6 @@ namespace osu.Game settings.StateChanged += _ => updateScreenOffset(); notifications.StateChanged += _ => updateScreenOffset(); - - AllowOverlays.ValueChanged += state => notifications.Enabled.Value = state == OverlayActivation.All; } public void CloseAllOverlays() diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs index 09b6022ac5..3dc8f5ec15 100644 --- a/osu.Game/Overlays/NotificationOverlay.cs +++ b/osu.Game/Overlays/NotificationOverlay.cs @@ -22,11 +22,6 @@ namespace osu.Game.Overlays public const float TRANSITION_LENGTH = 600; - /// - /// Whether posted notifications should be processed. - /// - public readonly BindableBool Enabled = new BindableBool(true); - private FlowContainer sections; /// @@ -34,27 +29,6 @@ namespace osu.Game.Overlays /// public Func GetToolbarHeight; - public NotificationOverlay() - { - ScheduledDelegate notificationsEnabler = null; - Enabled.ValueChanged += v => - { - if (!IsLoaded) - { - processingPosts = v; - return; - } - - notificationsEnabler?.Cancel(); - - if (v) - // we want a slight delay before toggling notifications on to avoid the user becoming overwhelmed. - notificationsEnabler = Scheduler.AddDelayed(() => processingPosts = true, 1000); - else - processingPosts = false; - }; - } - [BackgroundDependencyLoader] private void load() { @@ -103,6 +77,29 @@ namespace osu.Game.Overlays }; } + private ScheduledDelegate notificationsEnabler; + private void updateProcessingMode() + { + bool enabled = OverlayActivationMode == OverlayActivation.All || State == Visibility.Visible; + + notificationsEnabler?.Cancel(); + + if (enabled) + // we want a slight delay before toggling notifications on to avoid the user becoming overwhelmed. + notificationsEnabler = Scheduler.AddDelayed(() => processingPosts = true, State == Visibility.Visible ? 0 : 1000); + else + processingPosts = false; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + StateChanged += _ => updateProcessingMode(); + OverlayActivationMode.ValueChanged += _ => updateProcessingMode(); + OverlayActivationMode.TriggerChange(); + } + private int totalCount => sections.Select(c => c.DisplayedCount).Sum(); private int unreadCount => sections.Select(c => c.UnreadCount).Sum(); From 55921efffb5ab4533078a554c9483afb2064b584 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Jun 2018 16:17:51 +0900 Subject: [PATCH 08/11] Rewrite much state logic --- osu.Game/OsuGame.cs | 42 ++++++++++++++++----------- osu.Game/Screens/Menu/ButtonSystem.cs | 11 ++++++- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- osu.Game/Screens/Menu/Intro.cs | 2 +- osu.Game/Screens/Menu/MainMenu.cs | 2 -- osu.Game/Screens/OsuScreen.cs | 16 +++------- osu.Game/Screens/Play/Player.cs | 2 +- 7 files changed, 42 insertions(+), 35 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 68c50dafab..36c76851c6 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -93,6 +93,8 @@ namespace osu.Game private SettingsOverlay settings; + private readonly List overlays = new List(); + // todo: move this to SongSelect once Screen has the ability to unsuspend. public readonly Bindable> SelectedMods = new Bindable>(new List()); @@ -105,6 +107,17 @@ namespace osu.Game public void ToggleDirect() => direct.ToggleVisibility(); + /// + /// Close all game-wide overlays. + /// + /// Whether the toolbar should also be hidden. + public void CloseAllOverlays(bool toolbar = true) + { + foreach (var o in overlays) + o.State = Visibility.Hidden; + if (toolbar) Toolbar.State = Visibility.Hidden; + } + private DependencyContainer dependencies; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => @@ -250,7 +263,7 @@ namespace osu.Game Depth = -5, OnHome = delegate { - hideAllOverlays(); + CloseAllOverlays(false); intro?.ChildScreen?.MakeCurrent(); }, }, overlayContent.Add); @@ -307,6 +320,8 @@ namespace osu.Game // ensure only one of these overlays are open at once. var singleDisplayOverlays = new OverlayContainer[] { chat, social, direct }; + overlays.AddRange(singleDisplayOverlays); + foreach (var overlay in singleDisplayOverlays) { overlay.StateChanged += state => @@ -322,6 +337,8 @@ namespace osu.Game } var singleDisplaySideOverlays = new OverlayContainer[] { settings, notifications }; + overlays.AddRange(singleDisplaySideOverlays); + foreach (var overlay in singleDisplaySideOverlays) { overlay.StateChanged += state => @@ -338,6 +355,8 @@ namespace osu.Game // eventually informational overlays should be displayed in a stack, but for now let's only allow one to stay open at a time. var informationalOverlays = new OverlayContainer[] { beatmapSetOverlay, userProfile }; + overlays.AddRange(informationalOverlays); + foreach (var overlay in informationalOverlays) { overlay.StateChanged += state => @@ -352,6 +371,11 @@ namespace osu.Game }; } + OverlayActivationMode.ValueChanged += v => + { + if (v != OverlayActivation.All) CloseAllOverlays(); + }; + void updateScreenOffset() { float offset = 0; @@ -368,12 +392,6 @@ namespace osu.Game notifications.StateChanged += _ => updateScreenOffset(); } - public void CloseAllOverlays() - { - hideAllOverlays(); - musicController.State = Visibility.Hidden; - } - private void forwardLoggedErrorsToNotifications() { int recentErrorCount = 0; @@ -488,16 +506,6 @@ namespace osu.Game private OsuScreen currentScreen; private FrameworkConfigManager frameworkConfig; - private void hideAllOverlays() - { - settings.State = Visibility.Hidden; - chat.State = Visibility.Hidden; - direct.State = Visibility.Hidden; - social.State = Visibility.Hidden; - userProfile.State = Visibility.Hidden; - notifications.State = Visibility.Hidden; - } - protected override bool OnExiting() { if (screenStack.ChildScreen == null) return false; diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index a0f2fc45cd..7235a96e15 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -16,6 +16,7 @@ using osu.Framework.Input.Bindings; using osu.Framework.Threading; using osu.Game.Graphics; using osu.Game.Input.Bindings; +using osu.Game.Overlays; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; @@ -129,9 +130,12 @@ namespace osu.Game.Screens.Menu buttonFlow.AddRange(buttonsTopLevel); } + private OsuGame game; + [BackgroundDependencyLoader(true)] - private void load(AudioManager audio) + private void load(AudioManager audio, OsuGame game) { + this.game = game; sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -321,6 +325,8 @@ namespace osu.Game.Screens.Menu { logoTracking = false; + game.OverlayActivationMode.Value = state == MenuState.Exit ? OverlayActivation.Disabled : OverlayActivation.UserTriggered; + logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; @@ -352,6 +358,9 @@ namespace osu.Game.Screens.Menu if (impact) logo.Impact(); + + game.OverlayActivationMode.Value = OverlayActivation.All; + game.Toolbar.State = Visibility.Visible; }, 200); break; default: diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 2436f0a940..0c70dbf570 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -20,7 +20,7 @@ namespace osu.Game.Screens.Menu private Color4 iconColour; protected override bool HideOverlaysOnEnter => true; - protected override OverlayActivation OverlayActivationLevel => OverlayActivation.Disabled; + protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled; public override bool CursorVisible => false; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index d58f0e95b5..c5bd345a31 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Menu private SampleChannel seeya; protected override bool HideOverlaysOnEnter => true; - protected override OverlayActivation OverlayActivationLevel => OverlayActivation.Disabled; + protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled; public override bool CursorVisible => false; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 8eddaaee93..cbdd8b4e8b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -63,8 +63,6 @@ namespace osu.Game.Screens.Menu }, sideFlashes = new MenuSideFlashes(), }; - - buttons.StateChanged += state => UpdateOverlayStates?.Invoke(); } [BackgroundDependencyLoader(true)] diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index ba9c65e42d..d98aac8f84 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -44,22 +44,17 @@ namespace osu.Game.Screens private Action updateOverlayStates; - /// - /// Allows manually updating visibility of all overlays if is not enough. - /// - protected Action UpdateOverlayStates => updateOverlayStates; - /// /// Whether all overlays should be hidden when this screen is entered or resumed. /// protected virtual bool HideOverlaysOnEnter => false; - private readonly Bindable allowOverlays = new Bindable(); + protected readonly Bindable OverlayActivationMode = new Bindable(); /// /// Whether overlays should be able to be opened once this screen is entered or resumed. /// - protected virtual OverlayActivation OverlayActivationLevel => OverlayActivation.All; + protected virtual OverlayActivation InitialOverlayActivationMode => OverlayActivation.All; /// /// Whether this allows the cursor to be displayed. @@ -110,15 +105,12 @@ namespace osu.Game.Screens if (osuGame != null) { Ruleset.BindTo(osuGame.Ruleset); - allowOverlays.BindTo(osuGame.OverlayActivationMode); + OverlayActivationMode.BindTo(osuGame.OverlayActivationMode); updateOverlayStates = () => { if (HideOverlaysOnEnter) - { osuGame.CloseAllOverlays(); - osuGame.Toolbar.State = Visibility.Hidden; - } else osuGame.Toolbar.State = Visibility.Visible; }; @@ -257,7 +249,7 @@ namespace osu.Game.Screens if (backgroundParallaxContainer != null) backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; - allowOverlays.Value = OverlayActivationLevel; + OverlayActivationMode.Value = InitialOverlayActivationMode; updateOverlayStates?.Invoke(); } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 6e0f6cb1c5..54f65e3991 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -38,7 +38,7 @@ namespace osu.Game.Screens.Play protected override bool HideOverlaysOnEnter => true; - protected override OverlayActivation OverlayActivationLevel => OverlayActivation.UserTriggered; + protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.UserTriggered; public Action RestartRequested; From aaaa8a3b7c8b77c8f9adb421a414c0e2ebce90e9 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 6 Jun 2018 09:55:16 +0200 Subject: [PATCH 09/11] match Bindable names --- osu.Game/Overlays/Toolbar/Toolbar.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 1eaf748011..48d0674b3d 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Toolbar private const float alpha_hovering = 0.8f; private const float alpha_normal = 0.6f; - private readonly Bindable allowOverlays = new Bindable(OverlayActivation.All); + private readonly Bindable overlayActivationMode = new Bindable(OverlayActivation.All); public Toolbar() { @@ -84,11 +84,11 @@ namespace osu.Game.Overlays.Toolbar private void load(OsuGame osuGame) { if (osuGame != null) - allowOverlays.BindTo(osuGame.OverlayActivationMode); + overlayActivationMode.BindTo(osuGame.OverlayActivationMode); StateChanged += visibility => { - if (allowOverlays == OverlayActivation.Disabled) + if (overlayActivationMode == OverlayActivation.Disabled) State = Visibility.Hidden; }; } From 9306fec4982e9b347481fd371ac2346a1c270bb7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Jun 2018 18:21:03 +0900 Subject: [PATCH 10/11] Fix missing null checks --- osu.Game/Screens/Menu/ButtonSystem.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 7235a96e15..42e25aad43 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -322,17 +322,18 @@ namespace osu.Game.Screens.Menu case MenuState.Initial: logoDelayedAction?.Cancel(); logoDelayedAction = Scheduler.AddDelayed(() => - { - logoTracking = false; + { + logoTracking = false; - game.OverlayActivationMode.Value = state == MenuState.Exit ? OverlayActivation.Disabled : OverlayActivation.UserTriggered; + if (game != null) + game.OverlayActivationMode.Value = state == MenuState.Exit ? OverlayActivation.Disabled : OverlayActivation.UserTriggered; - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.Both; + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; - logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); - logo.ScaleTo(1, 800, Easing.OutExpo); - }, buttonArea.Alpha * 150); + logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); + logo.ScaleTo(1, 800, Easing.OutExpo); + }, buttonArea.Alpha * 150); break; case MenuState.TopLevel: case MenuState.Play: @@ -359,8 +360,11 @@ namespace osu.Game.Screens.Menu if (impact) logo.Impact(); - game.OverlayActivationMode.Value = OverlayActivation.All; - game.Toolbar.State = Visibility.Visible; + if (game != null) + { + game.OverlayActivationMode.Value = OverlayActivation.All; + game.Toolbar.State = Visibility.Visible; + } }, 200); break; default: From aeeb03ff9cfaa77037a177137f612562539a8d80 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Wed, 6 Jun 2018 18:36:43 +0900 Subject: [PATCH 11/11] simpler temporary path generation --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 645c76f265..1c9696901c 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -264,7 +264,7 @@ namespace osu.Game.Tests.Beatmaps.IO private string createTemporaryBeatmap() { - var temp = Path.GetTempFileName() + Guid.NewGuid() + ".osz"; + var temp = Path.GetTempFileName() + ".osz"; File.Copy(osz_path, temp, true); Assert.IsTrue(File.Exists(temp)); return temp;