From 11cba0638da54b5c051967a3d13f0a9f5b054c31 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 18 Jul 2017 01:47:50 +0800 Subject: [PATCH 01/20] Load UserProfileOverlay with a lower depth. This introduces a new level, so other overlays' depth are changed together. --- osu.Game/OsuGame.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 6bec2cb184..ee95452519 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -173,13 +173,13 @@ namespace osu.Game //overlay elements LoadComponentAsync(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); + LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); LoadComponentAsync(social = new SocialOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add); - LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(settings = new SettingsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(musicController = new MusicController { - Depth = -2, + Depth = -3, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -187,14 +187,14 @@ namespace osu.Game LoadComponentAsync(notificationManager = new NotificationManager { - Depth = -2, + Depth = -3, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, overlayContent.Add); LoadComponentAsync(dialogOverlay = new DialogOverlay { - Depth = -4, + Depth = -5, }, overlayContent.Add); Logger.NewEntry += entry => @@ -221,7 +221,7 @@ namespace osu.Game LoadComponentAsync(Toolbar = new Toolbar { - Depth = -3, + Depth = -4, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, }, overlayContent.Add); From cd7c04c54d5947fba0ab3bfbeb4e39617bff6a8d Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 18 Jul 2017 12:28:03 +0800 Subject: [PATCH 02/20] Simplify misc null-coalescing expression. --- osu.Game/Screens/Play/Player.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c9ca91faa0..bcb8e0b721 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -122,8 +122,10 @@ namespace osu.Game.Screens.Play audio.Track.SetExclusive(track); adjustableSourceClock = track; } - - adjustableSourceClock = (IAdjustableClock)track ?? new StopwatchClock(); + else + { + adjustableSourceClock = new StopwatchClock(); + } decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; From 9cd895c24924cdce50fe8602e1bc43a5de54bf45 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 18 Jul 2017 15:55:21 +0800 Subject: [PATCH 03/20] Implement Ctrl+Enter in PlaySongSelect. --- osu.Game/Screens/Select/PlaySongSelect.cs | 37 ++++++++++++++++++++++- osu.Game/Screens/Select/SongSelect.cs | 4 +-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index f96fbb87cb..54636240cf 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -1,14 +1,18 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; +using System.Linq; using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Input; using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Mods; +using osu.Game.Rulesets.Mods; using osu.Game.Screens.Edit; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; @@ -18,8 +22,10 @@ namespace osu.Game.Screens.Select public class PlaySongSelect : SongSelect { private OsuScreen player; + private UserInputManager input; private readonly ModSelectOverlay modSelect; private readonly BeatmapDetailArea beatmapDetails; + private IEnumerable originalMods; public PlaySongSelect() { @@ -40,8 +46,10 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, UserInputManager input) { + this.input = input; + Footer.AddButton(@"mods", colours.Yellow, modSelect.ToggleVisibility, Key.F1, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); @@ -72,6 +80,9 @@ namespace osu.Game.Screens.Select { player = null; + modSelect.SelectedMods.Value = originalMods; + originalMods = null; + Beatmap.Track.Looping = true; base.OnResuming(last); @@ -105,6 +116,15 @@ namespace osu.Game.Screens.Select { if (player != null) return; + originalMods = modSelect.SelectedMods.Value; + if (input.CurrentState.Keyboard.ControlPressed) + if (findAutoMod(originalMods) == null) + { + var auto = findAutoMod(Ruleset.Value.CreateInstance().GetModsFor(ModType.Special)); + if (auto != null) + modSelect.SelectedMods.Value = originalMods.Concat(new[] { auto }); + } + Beatmap.Track.Looping = false; LoadComponentAsync(player = new PlayerLoader(new Player @@ -112,5 +132,20 @@ namespace osu.Game.Screens.Select Beatmap = Beatmap, //eagerly set this so it's present before push. }), l => Push(player)); } + + private Mod findAutoMod(IEnumerable mods) + { + foreach (var mod in mods) + { + if (mod is ModAutoplay) return mod; + var multimod = mod as MultiMod; + if (multimod != null) + { + var find = findAutoMod(multimod.Mods); + if (find != null) return find; + } + } + return null; + } } } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 68f239fb0a..9796431299 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Select { public abstract class SongSelect : OsuScreen { - private readonly Bindable ruleset = new Bindable(); + protected readonly Bindable Ruleset = new Bindable(); private BeatmapDatabase database; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); @@ -168,7 +168,7 @@ namespace osu.Game.Screens.Select database = beatmaps; if (osu != null) - ruleset.BindTo(osu.Ruleset); + Ruleset.BindTo(osu.Ruleset); database.BeatmapSetAdded += onBeatmapSetAdded; database.BeatmapSetRemoved += onBeatmapSetRemoved; From a0c4fcdb4b3ad44306d4bcbcebcf4c72f197bc14 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 18 Jul 2017 17:03:59 +0800 Subject: [PATCH 04/20] Move xml doc to the right class. --- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 3 +++ osu.Game/Graphics/UserInterface/SearchTextBox.cs | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index 42fff0f258..447daca75e 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -10,6 +10,9 @@ using System.Linq; namespace osu.Game.Graphics.UserInterface { + /// + /// A textbox which holds focus eagerly. + /// public class FocusedTextBox : OsuTextBox { protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255); diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index 0d852e4276..ecbd87f149 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -7,9 +7,6 @@ using OpenTK.Input; namespace osu.Game.Graphics.UserInterface { - /// - /// A textbox which holds focus eagerly. - /// public class SearchTextBox : FocusedTextBox { protected virtual bool AllowCommit => false; From ef2770b7181528ea28141fb6b7f4072fb9a959bb Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 18 Jul 2017 17:40:34 +0800 Subject: [PATCH 05/20] Bypass commit in SearchTextBox regardless of Shift and Ctrl. --- osu.Game/Graphics/UserInterface/SearchTextBox.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index ecbd87f149..a2cd2ba5ea 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -42,10 +42,16 @@ namespace osu.Game.Graphics.UserInterface case Key.Up: case Key.Down: return false; + } + } + + if (!AllowCommit) + { + switch (args.Key) + { case Key.KeypadEnter: case Key.Enter: - if (!AllowCommit) return false; - break; + return false; } } From c1a3e4a0085ef9877de8a78c6095937b6e8f3672 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Jul 2017 20:06:24 +0900 Subject: [PATCH 06/20] Remove unnecessary using --- osu.Game/Screens/Play/Player.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d42f228a5e..1d6a1306be 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -4,7 +4,6 @@ using OpenTK; using osu.Framework.Allocation; using osu.Framework.Audio; -using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; From c2e5788ed1375d7391cfb82a3c0c5fd70c6d0f76 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 24 Jul 2017 21:47:31 +0800 Subject: [PATCH 07/20] Make OsuScreen.Ruleset protected. --- osu.Game/Screens/OsuScreen.cs | 6 +++--- osu.Game/Screens/Select/SongSelect.cs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index d916614abd..0ab051f681 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -47,7 +47,7 @@ namespace osu.Game.Screens } } - private readonly Bindable ruleset = new Bindable(); + protected readonly Bindable Ruleset = new Bindable(); private SampleChannel sampleExit; @@ -64,7 +64,7 @@ namespace osu.Game.Screens } if (osuGame != null) - ruleset.BindTo(osuGame.Ruleset); + Ruleset.BindTo(osuGame.Ruleset); sampleExit = audio.Sample.Get(@"UI/melodic-1"); } @@ -77,7 +77,7 @@ namespace osu.Game.Screens { // we only want to apply these restrictions when we are inside a screen stack. // the use case for not applying is in visual/unit tests. - ruleset.Disabled = !AllowBeatmapRulesetChange; + Ruleset.Disabled = !AllowBeatmapRulesetChange; Beatmap.Disabled = !AllowBeatmapRulesetChange; } } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 286045b5d3..867b1e60c0 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -27,7 +27,6 @@ namespace osu.Game.Screens.Select { public abstract class SongSelect : OsuScreen { - protected readonly Bindable Ruleset = new Bindable(); private BeatmapDatabase database; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(); @@ -251,7 +250,7 @@ namespace osu.Game.Screens.Select } else { - ruleset.Value = beatmap.Ruleset; + Ruleset.Value = beatmap.Ruleset; if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID) sampleChangeDifficulty.Play(); From cb4563d1693d6a570de10021c269997e602d9848 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 24 Jul 2017 21:49:39 +0800 Subject: [PATCH 08/20] Revert "Load UserProfileOverlay with a lower depth." This reverts commit 11cba0638da54b5c051967a3d13f0a9f5b054c31. --- osu.Game/OsuGame.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index cd3d6ab7a0..1240fc4cb1 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -177,14 +177,14 @@ namespace osu.Game //overlay elements LoadComponentAsync(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); - LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); LoadComponentAsync(social = new SocialOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add); + LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(settings = new SettingsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); LoadComponentAsync(musicController = new MusicController { - Depth = -3, + Depth = -2, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -192,14 +192,14 @@ namespace osu.Game LoadComponentAsync(notificationManager = new NotificationManager { - Depth = -3, + Depth = -2, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, overlayContent.Add); LoadComponentAsync(dialogOverlay = new DialogOverlay { - Depth = -5, + Depth = -4, }, overlayContent.Add); Logger.NewEntry += entry => @@ -226,7 +226,7 @@ namespace osu.Game LoadComponentAsync(Toolbar = new Toolbar { - Depth = -4, + Depth = -3, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, }, overlayContent.Add); From 47b4ef5cd2c00034353f227d33bbc42159d8059f Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 24 Jul 2017 21:55:12 +0800 Subject: [PATCH 09/20] Handle control key with OnKeyUp/OnKeyDown. --- osu.Game/Screens/Select/PlaySongSelect.cs | 20 +++++++++++++++----- osu.Game/Screens/Select/SongSelect.cs | 1 - 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 6f85f541e7..d68e96f2fc 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -22,10 +22,10 @@ namespace osu.Game.Screens.Select public class PlaySongSelect : SongSelect { private OsuScreen player; - private UserInputManager input; private readonly ModSelectOverlay modSelect; private readonly BeatmapDetailArea beatmapDetails; private IEnumerable originalMods; + private bool controlPressed; public PlaySongSelect() { @@ -46,10 +46,8 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader] - private void load(OsuColour colours, UserInputManager input) + private void load(OsuColour colours) { - this.input = input; - Footer.AddButton(@"mods", colours.Yellow, modSelect.ToggleVisibility, Key.F1, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); @@ -111,12 +109,24 @@ namespace osu.Game.Screens.Select return false; } + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + controlPressed = state.Keyboard.ControlPressed; + return base.OnKeyDown(state, args); + } + + protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) + { + controlPressed = state.Keyboard.ControlPressed; + return base.OnKeyUp(state, args); + } + protected override void OnSelected() { if (player != null) return; originalMods = modSelect.SelectedMods.Value; - if (input.CurrentState.Keyboard.ControlPressed) + if (controlPressed) if (findAutoMod(originalMods) == null) { var auto = findAutoMod(Ruleset.Value.CreateInstance().GetModsFor(ModType.Special)); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 867b1e60c0..2879cd1ab1 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -9,7 +9,6 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Audio.Track; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; From 44fd0eb78bdcead6b2efee697a018562fa5ecc94 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Fri, 4 Aug 2017 00:09:41 +0800 Subject: [PATCH 10/20] Pass input state in OnSelected. --- osu.Game/Screens/Select/EditSongSelect.cs | 4 +++- osu.Game/Screens/Select/MatchSongSelect.cs | 4 +++- osu.Game/Screens/Select/PlaySongSelect.cs | 17 ++--------------- osu.Game/Screens/Select/SongSelect.cs | 12 ++++++------ 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/osu.Game/Screens/Select/EditSongSelect.cs b/osu.Game/Screens/Select/EditSongSelect.cs index 1a9d37f069..907c080729 100644 --- a/osu.Game/Screens/Select/EditSongSelect.cs +++ b/osu.Game/Screens/Select/EditSongSelect.cs @@ -1,12 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Input; + namespace osu.Game.Screens.Select { public class EditSongSelect : SongSelect { protected override bool ShowFooter => false; - protected override void OnSelected() => Exit(); + protected override void OnSelected(InputState state) => Exit(); } } diff --git a/osu.Game/Screens/Select/MatchSongSelect.cs b/osu.Game/Screens/Select/MatchSongSelect.cs index 282cd06126..2d3b198478 100644 --- a/osu.Game/Screens/Select/MatchSongSelect.cs +++ b/osu.Game/Screens/Select/MatchSongSelect.cs @@ -1,10 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Input; + namespace osu.Game.Screens.Select { public class MatchSongSelect : SongSelect { - protected override void OnSelected() => Exit(); + protected override void OnSelected(InputState state) => Exit(); } } diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index d68e96f2fc..d17e4d0421 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -25,7 +25,6 @@ namespace osu.Game.Screens.Select private readonly ModSelectOverlay modSelect; private readonly BeatmapDetailArea beatmapDetails; private IEnumerable originalMods; - private bool controlPressed; public PlaySongSelect() { @@ -109,24 +108,12 @@ namespace osu.Game.Screens.Select return false; } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) - { - controlPressed = state.Keyboard.ControlPressed; - return base.OnKeyDown(state, args); - } - - protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) - { - controlPressed = state.Keyboard.ControlPressed; - return base.OnKeyUp(state, args); - } - - protected override void OnSelected() + protected override void OnSelected(InputState state) { if (player != null) return; originalMods = modSelect.SelectedMods.Value; - if (controlPressed) + if (state?.Keyboard.ControlPressed == true) if (findAutoMod(originalMods) == null) { var auto = findAutoMod(Ruleset.Value.CreateInstance().GetModsFor(ModType.Special)); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 54068d0dec..cd5082bd11 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -106,7 +106,7 @@ namespace osu.Game.Screens.Select Origin = Anchor.CentreRight, SelectionChanged = carouselSelectionChanged, BeatmapsChanged = carouselBeatmapsLoaded, - StartRequested = carouselRaisedStart, + StartRequested = () => carouselRaisedStart(), }); Add(FilterControl = new FilterControl { @@ -143,7 +143,7 @@ namespace osu.Game.Screens.Select Add(Footer = new Footer { OnBack = Exit, - OnStart = carouselRaisedStart, + OnStart = () => carouselRaisedStart(), }); FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay()); @@ -193,7 +193,7 @@ namespace osu.Game.Screens.Select carousel.SelectNext(); } - private void carouselRaisedStart() + private void carouselRaisedStart(InputState state = null) { // if we have a pending filter operation, we want to run it now. // it could change selection (ie. if the ruleset has been changed). @@ -206,7 +206,7 @@ namespace osu.Game.Screens.Select selectionChangedDebounce = null; } - OnSelected(); + OnSelected(state); } private ScheduledDelegate selectionChangedDebounce; @@ -270,7 +270,7 @@ namespace osu.Game.Screens.Select carousel.SelectNextRandom(); } - protected abstract void OnSelected(); + protected abstract void OnSelected(InputState state); private void filterChanged(FilterCriteria criteria, bool debounce = true) { @@ -393,7 +393,7 @@ namespace osu.Game.Screens.Select { case Key.KeypadEnter: case Key.Enter: - carouselRaisedStart(); + carouselRaisedStart(state); return true; case Key.Delete: if (state.Keyboard.ShiftPressed) From eb9972581ea68395e85ce0455caf19200353808e Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Fri, 4 Aug 2017 00:25:24 +0800 Subject: [PATCH 11/20] Provide Autoplay mod in Ruleset. --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 ++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 ++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 ++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 ++ osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 ++ osu.Game/Rulesets/Ruleset.cs | 2 ++ osu.Game/Screens/Select/PlaySongSelect.cs | 28 ++++++----------------- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index df212f7df7..2902455808 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -83,6 +83,8 @@ namespace osu.Game.Rulesets.Catch } } + public override Mod GetAutoplayMod() => new ModAutoplay(); + public override string Description => "osu!catch"; public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o; diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 8be3870ebe..1b50b8809c 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -104,6 +104,8 @@ namespace osu.Game.Rulesets.Mania } } + public override Mod GetAutoplayMod() => new ModAutoplay(); + public override string Description => "osu!mania"; public override FontAwesome Icon => FontAwesome.fa_osu_mania_o; diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 8e8e186d40..efa6ae75d4 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -104,6 +104,8 @@ namespace osu.Game.Rulesets.Osu } } + public override Mod GetAutoplayMod() => new OsuModAutoplay(); + public override FontAwesome Icon => FontAwesome.fa_osu_osu_o; public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap); diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 303d936fb9..c244616d47 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -83,6 +83,8 @@ namespace osu.Game.Rulesets.Taiko } } + public override Mod GetAutoplayMod() => new TaikoModAutoplay(); + public override string Description => "osu!taiko"; public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o; diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index 0885fb05e5..bd53a80555 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -60,6 +60,8 @@ namespace osu.Game.Beatmaps { public override IEnumerable GetModsFor(ModType type) => new Mod[] { }; + public override Mod GetAutoplayMod() => new ModAutoplay(); + public override HitRenderer CreateHitRendererWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) { throw new NotImplementedException(); diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 3dbb39d894..316b3ad276 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -18,6 +18,8 @@ namespace osu.Game.Rulesets public abstract IEnumerable GetModsFor(ModType type); + public abstract Mod GetAutoplayMod(); + /// /// Attempt to create a hit renderer for a beatmap /// diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index d17e4d0421..7a4f7c404d 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -114,32 +114,18 @@ namespace osu.Game.Screens.Select originalMods = modSelect.SelectedMods.Value; if (state?.Keyboard.ControlPressed == true) - if (findAutoMod(originalMods) == null) - { - var auto = findAutoMod(Ruleset.Value.CreateInstance().GetModsFor(ModType.Special)); - if (auto != null) - modSelect.SelectedMods.Value = originalMods.Concat(new[] { auto }); - } + { + var auto = Ruleset.Value.CreateInstance().GetAutoplayMod(); + var autoType = auto.GetType(); + + if (originalMods.All(m => m.GetType() != autoType)) + modSelect.SelectedMods.Value = originalMods.Concat(new[] { auto }); + } Beatmap.Value.Track.Looping = false; Beatmap.Disabled = true; LoadComponentAsync(player = new PlayerLoader(new Player()), l => Push(player)); } - - private Mod findAutoMod(IEnumerable mods) - { - foreach (var mod in mods) - { - if (mod is ModAutoplay) return mod; - var multimod = mod as MultiMod; - if (multimod != null) - { - var find = findAutoMod(multimod.Mods); - if (find != null) return find; - } - } - return null; - } } } From f8448b8b199cd779ba01349a70ff5be81c4b75f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 15:37:31 +0900 Subject: [PATCH 12/20] Update to support new framework VisualTests structure --- osu-framework | 2 +- .../Beatmaps/TestWorkingBeatmap.cs | 2 +- .../Platform/TestStorage.cs | 2 +- osu.Desktop.Tests/Visual/OsuTestCase.cs | 34 ++++++++++ .../Visual}/TestCaseBeatSyncedContainer.cs | 27 ++++---- .../Visual}/TestCaseBeatmapDetailArea.cs | 9 +-- .../Visual}/TestCaseBeatmapDetails.cs | 9 ++- .../Visual}/TestCaseBeatmapOptionsOverlay.cs | 9 ++- .../Visual}/TestCaseBreadcrumbs.cs | 7 +- .../Visual}/TestCaseChatDisplay.cs | 5 +- .../Visual}/TestCaseContextMenu.cs | 9 ++- .../Visual}/TestCaseDialogOverlay.cs | 5 +- .../Visual}/TestCaseDirect.cs | 5 +- .../Visual}/TestCaseDrawableRoom.cs | 15 ++--- .../Visual}/TestCaseDrawings.cs | 5 +- .../Visual}/TestCaseGamefield.cs | 17 +++-- .../Visual}/TestCaseGraph.cs | 11 ++-- .../Visual}/TestCaseHitObjects.cs | 11 ++-- .../Visual}/TestCaseKeyCounter.cs | 17 +++-- .../Visual}/TestCaseLeaderboard.cs | 7 +- .../Visual}/TestCaseManiaHitObjects.cs | 7 +- .../Visual}/TestCaseManiaPlayfield.cs | 25 ++++--- .../Visual}/TestCaseMedalOverlay.cs | 5 +- .../Visual}/TestCaseMenuButtonSystem.cs | 7 +- .../Visual}/TestCaseMenuOverlays.cs | 5 +- .../Visual}/TestCaseMods.cs | 5 +- .../Visual}/TestCaseMusicController.cs | 5 +- .../Visual}/TestCaseNotificationOverlay.cs | 11 ++-- .../Visual}/TestCaseOnScreenDisplay.cs | 5 +- .../Visual}/TestCasePlaySongSelect.cs | 7 +- .../Visual}/TestCasePlayer.cs | 17 +++-- .../Visual}/TestCaseReplay.cs | 2 +- .../Visual}/TestCaseReplaySettingsOverlay.cs | 5 +- .../Visual}/TestCaseResults.cs | 5 +- .../Visual}/TestCaseRoomInspector.cs | 13 ++-- .../Visual}/TestCaseScoreCounter.cs | 7 +- .../Visual}/TestCaseScrollingHitObjects.cs | 9 ++- .../Visual}/TestCaseSettings.cs | 5 +- .../Visual}/TestCaseSkipButton.cs | 5 +- .../Visual}/TestCaseSocial.cs | 5 +- .../Visual}/TestCaseSongProgress.cs | 5 +- .../Visual}/TestCaseTabControl.cs | 7 +- .../Visual}/TestCaseTaikoHitObjects.cs | 9 ++- .../Visual}/TestCaseTaikoPlayfield.cs | 9 ++- .../Visual}/TestCaseTextAwesome.cs | 5 +- .../Visual}/TestCaseTwoLayerButton.cs | 5 +- .../Visual}/TestCaseUserPanel.cs | 7 +- .../Visual}/TestCaseUserProfile.cs | 5 +- osu.Desktop.Tests/VisualTests.cs | 22 ------- osu.Desktop.Tests/osu.Desktop.Tests.csproj | 66 +++++++++++++++++-- osu.Desktop.Tests/packages.config | 1 + .../AutomatedVisualTestGame.cs | 20 ------ osu.Desktop.VisualTests/Program.cs | 1 + osu.Desktop.VisualTests/VisualTestGame.cs | 2 +- .../osu.Desktop.VisualTests.csproj | 55 ++-------------- osu.Desktop/OsuTestBrowser.cs | 32 +++++++++ osu.Desktop/Program.cs | 12 +++- osu.Desktop/osu.Desktop.csproj | 23 +++++++ osu.sln | 33 ++++++++-- 59 files changed, 365 insertions(+), 317 deletions(-) rename {osu.Desktop.VisualTests => osu.Desktop.Tests}/Beatmaps/TestWorkingBeatmap.cs (91%) rename {osu.Desktop.VisualTests => osu.Desktop.Tests}/Platform/TestStorage.cs (91%) create mode 100644 osu.Desktop.Tests/Visual/OsuTestCase.cs rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseBeatSyncedContainer.cs (96%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseBeatmapDetailArea.cs (78%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseBeatmapDetails.cs (92%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseBeatmapOptionsOverlay.cs (86%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseBreadcrumbs.cs (86%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseChatDisplay.cs (77%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseContextMenu.cs (94%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseDialogOverlay.cs (92%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseDirect.cs (96%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseDrawableRoom.cs (95%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseDrawings.cs (92%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseGamefield.cs (93%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseGraph.cs (90%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseHitObjects.cs (94%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseKeyCounter.cs (93%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseLeaderboard.cs (95%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseManiaHitObjects.cs (93%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseManiaPlayfield.cs (95%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseMedalOverlay.cs (82%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseMenuButtonSystem.cs (81%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseMenuOverlays.cs (90%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseMods.cs (90%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseMusicController.cs (88%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseNotificationOverlay.cs (93%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseOnScreenDisplay.cs (88%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCasePlaySongSelect.cs (93%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCasePlayer.cs (90%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseReplay.cs (90%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseReplaySettingsOverlay.cs (88%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseResults.cs (90%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseRoomInspector.cs (95%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseScoreCounter.cs (93%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseScrollingHitObjects.cs (95%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseSettings.cs (80%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseSkipButton.cs (75%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseSocial.cs (94%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseSongProgress.cs (91%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseTabControl.cs (88%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseTaikoHitObjects.cs (92%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseTaikoPlayfield.cs (95%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseTextAwesome.cs (88%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseTwoLayerButton.cs (72%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseUserPanel.cs (92%) rename {osu.Desktop.VisualTests/Tests => osu.Desktop.Tests/Visual}/TestCaseUserProfile.cs (92%) delete mode 100644 osu.Desktop.Tests/VisualTests.cs delete mode 100644 osu.Desktop.VisualTests/AutomatedVisualTestGame.cs create mode 100644 osu.Desktop/OsuTestBrowser.cs diff --git a/osu-framework b/osu-framework index 96daf2053a..e5beb4f01f 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 96daf2053a8a19fe221fef2557674ca5bee808fb +Subproject commit e5beb4f01fce0b46e87bc59d60398fedc1932737 diff --git a/osu.Desktop.VisualTests/Beatmaps/TestWorkingBeatmap.cs b/osu.Desktop.Tests/Beatmaps/TestWorkingBeatmap.cs similarity index 91% rename from osu.Desktop.VisualTests/Beatmaps/TestWorkingBeatmap.cs rename to osu.Desktop.Tests/Beatmaps/TestWorkingBeatmap.cs index b45574b761..084cfab309 100644 --- a/osu.Desktop.VisualTests/Beatmaps/TestWorkingBeatmap.cs +++ b/osu.Desktop.Tests/Beatmaps/TestWorkingBeatmap.cs @@ -5,7 +5,7 @@ using osu.Framework.Audio.Track; using osu.Framework.Graphics.Textures; using osu.Game.Beatmaps; -namespace osu.Desktop.VisualTests.Beatmaps +namespace osu.Desktop.Tests.Beatmaps { public class TestWorkingBeatmap : WorkingBeatmap { diff --git a/osu.Desktop.VisualTests/Platform/TestStorage.cs b/osu.Desktop.Tests/Platform/TestStorage.cs similarity index 91% rename from osu.Desktop.VisualTests/Platform/TestStorage.cs rename to osu.Desktop.Tests/Platform/TestStorage.cs index f711ddac24..39e4d8049f 100644 --- a/osu.Desktop.VisualTests/Platform/TestStorage.cs +++ b/osu.Desktop.Tests/Platform/TestStorage.cs @@ -8,7 +8,7 @@ using SQLite.Net.Interop; using SQLite.Net.Platform.Generic; using SQLite.Net.Platform.Win32; -namespace osu.Desktop.VisualTests.Platform +namespace osu.Desktop.Tests.Platform { public class TestStorage : DesktopStorage { diff --git a/osu.Desktop.Tests/Visual/OsuTestCase.cs b/osu.Desktop.Tests/Visual/OsuTestCase.cs new file mode 100644 index 0000000000..6bd8187b45 --- /dev/null +++ b/osu.Desktop.Tests/Visual/OsuTestCase.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using osu.Framework.Desktop.Platform; +using osu.Framework.Testing; +using osu.Game; + +namespace osu.Desktop.Tests.Visual +{ + [TestFixture] + public abstract class OsuTestCase : TestCase + { + [Test] + public override void RunTest() + { + using (var host = new HeadlessGameHost()) + host.Run(new OsuTestCaseTestRunner(this)); + } + + public class OsuTestCaseTestRunner : OsuGameBase + { + private readonly OsuTestCase testCase; + + public OsuTestCaseTestRunner(OsuTestCase testCase) + { + this.testCase = testCase; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Add(new TestCaseTestRunner.TestRunner(testCase)); + } + } + } +} diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.Tests/Visual/TestCaseBeatSyncedContainer.cs similarity index 96% rename from osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs rename to osu.Desktop.Tests/Visual/TestCaseBeatSyncedContainer.cs index 50d1df9964..130a034133 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.Tests/Visual/TestCaseBeatSyncedContainer.cs @@ -1,24 +1,23 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; -using osu.Framework.Graphics; -using osu.Framework.Timing; -using osu.Game.Overlays; -using osu.Framework.Graphics.Containers; -using osu.Game.Graphics.Containers; -using osu.Framework.Audio.Track; -using osu.Game.Beatmaps.ControlPoints; -using osu.Framework.Graphics.Shapes; -using OpenTK.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Framework.Lists; using System; +using osu.Framework.Audio.Track; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Lists; +using osu.Framework.Timing; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Overlays; +using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseBeatSyncedContainer : TestCase + internal class TestCaseBeatSyncedContainer : OsuTestCase { public override string Description => @"Tests beat synced containers."; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs b/osu.Desktop.Tests/Visual/TestCaseBeatmapDetailArea.cs similarity index 78% rename from osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs rename to osu.Desktop.Tests/Visual/TestCaseBeatmapDetailArea.cs index e0a503bc76..23b4ece4ec 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs +++ b/osu.Desktop.Tests/Visual/TestCaseBeatmapDetailArea.cs @@ -1,14 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; +using NUnit.Framework; using osu.Framework.Graphics; -using osu.Framework.Testing; using osu.Game.Screens.Select; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseBeatmapDetailArea : TestCase + [TestFixture] + internal class TestCaseBeatmapDetailArea : OsuTestCase { public override string Description => @"Beatmap details in song select"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs b/osu.Desktop.Tests/Visual/TestCaseBeatmapDetails.cs similarity index 92% rename from osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs rename to osu.Desktop.Tests/Visual/TestCaseBeatmapDetails.cs index 111bc03377..11a15cf56f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs +++ b/osu.Desktop.Tests/Visual/TestCaseBeatmapDetails.cs @@ -1,15 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics; -using osu.Framework.Testing; -using osu.Game.Screens.Select; using System.Linq; +using osu.Framework.Graphics; using osu.Game.Beatmaps; +using osu.Game.Screens.Select; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseBeatmapDetails : TestCase + internal class TestCaseBeatmapDetails : OsuTestCase { public override string Description => "BeatmapDetails tab of BeatmapDetailArea"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs b/osu.Desktop.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs similarity index 86% rename from osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs rename to osu.Desktop.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs index c9c1740856..3265f8ec76 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs @@ -1,15 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Graphics; -using OpenTK.Input; -using osu.Framework.Testing; using osu.Game.Graphics; using osu.Game.Screens.Select.Options; +using OpenTK.Graphics; +using OpenTK.Input; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseBeatmapOptionsOverlay : TestCase + internal class TestCaseBeatmapOptionsOverlay : OsuTestCase { public override string Description => @"Beatmap options in song select"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBreadcrumbs.cs b/osu.Desktop.Tests/Visual/TestCaseBreadcrumbs.cs similarity index 86% rename from osu.Desktop.VisualTests/Tests/TestCaseBreadcrumbs.cs rename to osu.Desktop.Tests/Visual/TestCaseBreadcrumbs.cs index f2dd454d65..10e0c784ab 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBreadcrumbs.cs +++ b/osu.Desktop.Tests/Visual/TestCaseBreadcrumbs.cs @@ -1,13 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; -using osu.Game.Graphics.UserInterface; using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseBreadcrumbs : TestCase + internal class TestCaseBreadcrumbs : OsuTestCase { public override string Description => @"breadcrumb > control"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs b/osu.Desktop.Tests/Visual/TestCaseChatDisplay.cs similarity index 77% rename from osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs rename to osu.Desktop.Tests/Visual/TestCaseChatDisplay.cs index 751b979bad..ae051a1e40 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseChatDisplay.cs @@ -1,13 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Framework.Graphics.Containers; using osu.Game.Overlays; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseChatDisplay : TestCase + internal class TestCaseChatDisplay : OsuTestCase { public override string Description => @"Testing chat api and overlay"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs b/osu.Desktop.Tests/Visual/TestCaseContextMenu.cs similarity index 94% rename from osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs rename to osu.Desktop.Tests/Visual/TestCaseContextMenu.cs index 0b4e8a5799..f0894f794a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseContextMenu.cs +++ b/osu.Desktop.Tests/Visual/TestCaseContextMenu.cs @@ -1,19 +1,18 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseContextMenu : TestCase + internal class TestCaseContextMenu : OsuTestCase { public override string Description => @"Menu visible on right click"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs b/osu.Desktop.Tests/Visual/TestCaseDialogOverlay.cs similarity index 92% rename from osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs rename to osu.Desktop.Tests/Visual/TestCaseDialogOverlay.cs index 6924817827..df15350453 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseDialogOverlay.cs @@ -1,14 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Game.Graphics; using osu.Game.Overlays; using osu.Game.Overlays.Dialog; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseDialogOverlay : TestCase + internal class TestCaseDialogOverlay : OsuTestCase { public override string Description => @"Display dialogs"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDirect.cs b/osu.Desktop.Tests/Visual/TestCaseDirect.cs similarity index 96% rename from osu.Desktop.VisualTests/Tests/TestCaseDirect.cs rename to osu.Desktop.Tests/Visual/TestCaseDirect.cs index 4a5ff1b576..b78ea02767 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDirect.cs +++ b/osu.Desktop.Tests/Visual/TestCaseDirect.cs @@ -3,14 +3,13 @@ using System.Collections.Generic; using osu.Framework.Allocation; -using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Overlays; using osu.Game.Rulesets; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - public class TestCaseDirect : TestCase + public class TestCaseDirect : OsuTestCase { public override string Description => @"osu!direct overlay"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs b/osu.Desktop.Tests/Visual/TestCaseDrawableRoom.cs similarity index 95% rename from osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs rename to osu.Desktop.Tests/Visual/TestCaseDrawableRoom.cs index 38cf03d60e..04d551afe4 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs +++ b/osu.Desktop.Tests/Visual/TestCaseDrawableRoom.cs @@ -1,19 +1,18 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics; -using osu.Framework.Testing; -using osu.Game.Screens.Multiplayer; -using osu.Game.Online.Multiplayer; -using osu.Game.Users; using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; +using osu.Game.Online.Multiplayer; using osu.Game.Rulesets; +using osu.Game.Screens.Multiplayer; +using osu.Game.Users; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseDrawableRoom : TestCase + internal class TestCaseDrawableRoom : OsuTestCase { public override string Description => @"Select your favourite room"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs b/osu.Desktop.Tests/Visual/TestCaseDrawings.cs similarity index 92% rename from osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs rename to osu.Desktop.Tests/Visual/TestCaseDrawings.cs index 63ec06963c..81fd8cad03 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs +++ b/osu.Desktop.Tests/Visual/TestCaseDrawings.cs @@ -2,13 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using osu.Framework.Testing; using osu.Game.Screens.Tournament; using osu.Game.Screens.Tournament.Teams; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseDrawings : TestCase + internal class TestCaseDrawings : OsuTestCase { public override string Description => "Tournament drawings"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.Tests/Visual/TestCaseGamefield.cs similarity index 93% rename from osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs rename to osu.Desktop.Tests/Visual/TestCaseGamefield.cs index 0b08065241..9d61c9ab0c 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseGamefield.cs @@ -1,28 +1,27 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; +using System.Collections.Generic; +using osu.Desktop.Tests.Beatmaps; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; -using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets; using osu.Game.Rulesets.Catch.UI; using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Taiko.UI; -using System.Collections.Generic; -using osu.Desktop.VisualTests.Beatmaps; -using osu.Framework.Allocation; -using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseGamefield : TestCase + internal class TestCaseGamefield : OsuTestCase { private RulesetStore rulesets; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGraph.cs b/osu.Desktop.Tests/Visual/TestCaseGraph.cs similarity index 90% rename from osu.Desktop.VisualTests/Tests/TestCaseGraph.cs rename to osu.Desktop.Tests/Visual/TestCaseGraph.cs index d969decaa5..13342d1ff1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGraph.cs +++ b/osu.Desktop.Tests/Visual/TestCaseGraph.cs @@ -1,15 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework.Graphics; -using osu.Framework.Testing; -using osu.Game.Graphics.UserInterface; using System.Linq; +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseGraph : TestCase + internal class TestCaseGraph : OsuTestCase { public override string Description => "graph"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.Tests/Visual/TestCaseHitObjects.cs similarity index 94% rename from osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs rename to osu.Desktop.Tests/Visual/TestCaseHitObjects.cs index 33841cae90..df5f9f65b8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.Tests/Visual/TestCaseHitObjects.cs @@ -1,24 +1,23 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; +using System.Collections.Generic; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; -using System.Collections.Generic; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseHitObjects : TestCase + internal class TestCaseHitObjects : OsuTestCase { private readonly FramedClock framedClock; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.Tests/Visual/TestCaseKeyCounter.cs similarity index 93% rename from osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs rename to osu.Desktop.Tests/Visual/TestCaseKeyCounter.cs index f65dbe7a64..efb662d3b9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.Tests/Visual/TestCaseKeyCounter.cs @@ -1,22 +1,21 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; -using osu.Framework.Graphics; -using OpenTK.Input; -using osu.Framework.Graphics.UserInterface; using osu.Framework.Configuration; +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using OpenTK; -using OpenTK.Graphics; -using osu.Framework.MathUtils; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.MathUtils; using osu.Game.Screens.Play; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseKeyCounter : TestCase + internal class TestCaseKeyCounter : OsuTestCase { public override string Description => @"Tests key counter"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs b/osu.Desktop.Tests/Visual/TestCaseLeaderboard.cs similarity index 95% rename from osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs rename to osu.Desktop.Tests/Visual/TestCaseLeaderboard.cs index 12d01ecc79..5f8ee8795c 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs +++ b/osu.Desktop.Tests/Visual/TestCaseLeaderboard.cs @@ -1,18 +1,17 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; using osu.Framework.Graphics; -using osu.Framework.Testing; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Select.Leaderboards; using osu.Game.Users; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseLeaderboard : TestCase + internal class TestCaseLeaderboard : OsuTestCase { public override string Description => @"From song select"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs b/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs similarity index 93% rename from osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs rename to osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs index 30346e90c9..7dcc48c778 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Desktop.Tests/Visual/TestCaseManiaHitObjects.cs @@ -3,15 +3,14 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Testing; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; -using OpenTK.Graphics; using OpenTK; +using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseManiaHitObjects : TestCase + internal class TestCaseManiaHitObjects : OsuTestCase { public TestCaseManiaHitObjects() { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs b/osu.Desktop.Tests/Visual/TestCaseManiaPlayfield.cs similarity index 95% rename from osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs rename to osu.Desktop.Tests/Visual/TestCaseManiaPlayfield.cs index adaae91815..ed0e5d81e9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseManiaPlayfield.cs @@ -1,25 +1,24 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Input; -using osu.Framework.Testing; -using osu.Framework.Graphics; -using osu.Game.Rulesets.Mania.UI; using System; -using OpenTK; -using osu.Game.Rulesets.Mania.Objects.Drawables; -using osu.Game.Rulesets.Mania.Objects; -using osu.Framework.Configuration; -using OpenTK.Input; -using osu.Framework.Timing; -using osu.Framework.Extensions.IEnumerableExtensions; using System.Linq; +using osu.Framework.Configuration; +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Graphics; +using osu.Framework.Input; +using osu.Framework.Timing; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Timing; +using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Timing; +using OpenTK; +using OpenTK.Input; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseManiaPlayfield : TestCase + internal class TestCaseManiaPlayfield : OsuTestCase { public override string Description => @"Mania playfield"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMedalOverlay.cs b/osu.Desktop.Tests/Visual/TestCaseMedalOverlay.cs similarity index 82% rename from osu.Desktop.VisualTests/Tests/TestCaseMedalOverlay.cs rename to osu.Desktop.Tests/Visual/TestCaseMedalOverlay.cs index 1533f2141e..747f2190b0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMedalOverlay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseMedalOverlay.cs @@ -1,13 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Game.Overlays; using osu.Game.Users; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseMedalOverlay : TestCase + internal class TestCaseMedalOverlay : OsuTestCase { public override string Description => @"medal get!"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs b/osu.Desktop.Tests/Visual/TestCaseMenuButtonSystem.cs similarity index 81% rename from osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs rename to osu.Desktop.Tests/Visual/TestCaseMenuButtonSystem.cs index ea2f0464c4..3c7ee343bb 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs +++ b/osu.Desktop.Tests/Visual/TestCaseMenuButtonSystem.cs @@ -1,15 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Shapes; using osu.Game.Screens.Menu; using OpenTK.Graphics; -using osu.Framework.Graphics.Shapes; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseMenuButtonSystem : TestCase + internal class TestCaseMenuButtonSystem : OsuTestCase { public override string Description => @"Main menu button system"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMenuOverlays.cs b/osu.Desktop.Tests/Visual/TestCaseMenuOverlays.cs similarity index 90% rename from osu.Desktop.VisualTests/Tests/TestCaseMenuOverlays.cs rename to osu.Desktop.Tests/Visual/TestCaseMenuOverlays.cs index 0187c0e629..1f4ad9d3da 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMenuOverlays.cs +++ b/osu.Desktop.Tests/Visual/TestCaseMenuOverlays.cs @@ -3,12 +3,11 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Logging; -using osu.Framework.Testing; using osu.Game.Screens.Play; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseMenuOverlays : TestCase + internal class TestCaseMenuOverlays : OsuTestCase { public override string Description => @"Tests pause and fail overlays"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMods.cs b/osu.Desktop.Tests/Visual/TestCaseMods.cs similarity index 90% rename from osu.Desktop.VisualTests/Tests/TestCaseMods.cs rename to osu.Desktop.Tests/Visual/TestCaseMods.cs index 1604be603a..f48030067d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMods.cs +++ b/osu.Desktop.Tests/Visual/TestCaseMods.cs @@ -4,14 +4,13 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Mods; -using osu.Framework.Testing; using osu.Game.Rulesets; using osu.Game.Screens.Play.HUD; using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseMods : TestCase + internal class TestCaseMods : OsuTestCase { public override string Description => @"Mod select overlay and in-game display"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs b/osu.Desktop.Tests/Visual/TestCaseMusicController.cs similarity index 88% rename from osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs rename to osu.Desktop.Tests/Visual/TestCaseMusicController.cs index 292e31de75..8d71527a21 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs +++ b/osu.Desktop.Tests/Visual/TestCaseMusicController.cs @@ -5,15 +5,14 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game; using osu.Game.Beatmaps; using osu.Game.Overlays; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseMusicController : TestCase + internal class TestCaseMusicController : OsuTestCase { public override string Description => @"Tests music controller ui."; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseNotificationOverlay.cs b/osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs similarity index 93% rename from osu.Desktop.VisualTests/Tests/TestCaseNotificationOverlay.cs rename to osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs index 3b9c251670..b9e492593f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseNotificationOverlay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs @@ -2,17 +2,18 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; using osu.Framework.Graphics; -using osu.Framework.Testing; +using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; using osu.Game.Overlays; -using System.Linq; using osu.Game.Overlays.Notifications; -using osu.Framework.Graphics.Containers; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseNotificationOverlay : TestCase + [TestFixture] + internal class TestCaseNotificationOverlay : OsuTestCase { public override string Description => @"I handle notifications"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseOnScreenDisplay.cs b/osu.Desktop.Tests/Visual/TestCaseOnScreenDisplay.cs similarity index 88% rename from osu.Desktop.VisualTests/Tests/TestCaseOnScreenDisplay.cs rename to osu.Desktop.Tests/Visual/TestCaseOnScreenDisplay.cs index f2b4ed7918..0b7a822e1d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseOnScreenDisplay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseOnScreenDisplay.cs @@ -3,12 +3,11 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; -using osu.Framework.Testing; using osu.Game.Overlays; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseOnScreenDisplay : TestCase + internal class TestCaseOnScreenDisplay : OsuTestCase { private FrameworkConfigManager config; private Bindable frameSyncMode; diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.Tests/Visual/TestCasePlaySongSelect.cs similarity index 93% rename from osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs rename to osu.Desktop.Tests/Visual/TestCasePlaySongSelect.cs index 51c78ff442..379100b543 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.Tests/Visual/TestCasePlaySongSelect.cs @@ -2,8 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using osu.Desktop.VisualTests.Platform; -using osu.Framework.Testing; +using osu.Desktop.Tests.Platform; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Database; @@ -11,9 +10,9 @@ using osu.Game.Rulesets; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Filter; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCasePlaySongSelect : TestCase + internal class TestCasePlaySongSelect : OsuTestCase { private readonly BeatmapManager manager; diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.Tests/Visual/TestCasePlayer.cs similarity index 90% rename from osu.Desktop.VisualTests/Tests/TestCasePlayer.cs rename to osu.Desktop.Tests/Visual/TestCasePlayer.cs index f38cabd618..f5d02d3f2b 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.Tests/Visual/TestCasePlayer.cs @@ -2,22 +2,21 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Desktop.Tests.Beatmaps; using osu.Framework.Allocation; -using osu.Framework.Testing; +using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps; -using OpenTK; +using osu.Game.Rulesets; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Objects; -using osu.Game.Screens.Play; -using OpenTK.Graphics; -using osu.Desktop.VisualTests.Beatmaps; using osu.Game.Rulesets.Osu.UI; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets; +using osu.Game.Screens.Play; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCasePlayer : TestCase + internal class TestCasePlayer : OsuTestCase { protected Player Player; private RulesetStore rulesets; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs b/osu.Desktop.Tests/Visual/TestCaseReplay.cs similarity index 90% rename from osu.Desktop.VisualTests/Tests/TestCaseReplay.cs rename to osu.Desktop.Tests/Visual/TestCaseReplay.cs index e00a912278..9b2f59e444 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseReplay.cs @@ -6,7 +6,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.Play; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { internal class TestCaseReplay : TestCasePlayer { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseReplaySettingsOverlay.cs b/osu.Desktop.Tests/Visual/TestCaseReplaySettingsOverlay.cs similarity index 88% rename from osu.Desktop.VisualTests/Tests/TestCaseReplaySettingsOverlay.cs rename to osu.Desktop.Tests/Visual/TestCaseReplaySettingsOverlay.cs index 00a9774067..ab865dcab0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseReplaySettingsOverlay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -2,14 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play; using osu.Game.Screens.Play.ReplaySettings; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseReplaySettingsOverlay : TestCase + internal class TestCaseReplaySettingsOverlay : OsuTestCase { public override string Description => @"Settings visible in replay/auto"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.Tests/Visual/TestCaseResults.cs similarity index 90% rename from osu.Desktop.VisualTests/Tests/TestCaseResults.cs rename to osu.Desktop.Tests/Visual/TestCaseResults.cs index 288fff346f..a0622b302a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.Tests/Visual/TestCaseResults.cs @@ -4,15 +4,14 @@ using System; using System.Collections.Generic; using osu.Framework.Allocation; -using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; using osu.Game.Users; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseResults : TestCase + internal class TestCaseResults : OsuTestCase { private BeatmapManager beatmaps; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs b/osu.Desktop.Tests/Visual/TestCaseRoomInspector.cs similarity index 95% rename from osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs rename to osu.Desktop.Tests/Visual/TestCaseRoomInspector.cs index 043f072b25..db557baed2 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs +++ b/osu.Desktop.Tests/Visual/TestCaseRoomInspector.cs @@ -1,18 +1,17 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; -using osu.Framework.Graphics; -using osu.Game.Screens.Multiplayer; -using osu.Game.Online.Multiplayer; -using osu.Game.Users; using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Game.Beatmaps; +using osu.Game.Online.Multiplayer; using osu.Game.Rulesets; +using osu.Game.Screens.Multiplayer; +using osu.Game.Users; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseRoomInspector : TestCase + internal class TestCaseRoomInspector : OsuTestCase { public override string Description => @"from the multiplayer lobby"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs b/osu.Desktop.Tests/Visual/TestCaseScoreCounter.cs similarity index 93% rename from osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs rename to osu.Desktop.Tests/Visual/TestCaseScoreCounter.cs index fc29e8481e..ac96deb209 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs +++ b/osu.Desktop.Tests/Visual/TestCaseScoreCounter.cs @@ -1,17 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; -using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play.HUD; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseScoreCounter : TestCase + internal class TestCaseScoreCounter : OsuTestCase { public override string Description => @"Tests multiple counters"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs b/osu.Desktop.Tests/Visual/TestCaseScrollingHitObjects.cs similarity index 95% rename from osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs rename to osu.Desktop.Tests/Visual/TestCaseScrollingHitObjects.cs index 43f30a96b0..efc129a678 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScrollingHitObjects.cs +++ b/osu.Desktop.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -1,23 +1,22 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Testing; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - public class TestCaseScrollingHitObjects : TestCase + public class TestCaseScrollingHitObjects : OsuTestCase { public override string Description => "SpeedAdjustmentContainer/DrawableTimingSection"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSettings.cs b/osu.Desktop.Tests/Visual/TestCaseSettings.cs similarity index 80% rename from osu.Desktop.VisualTests/Tests/TestCaseSettings.cs rename to osu.Desktop.Tests/Visual/TestCaseSettings.cs index 3d21f0e3b1..7b35009aef 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSettings.cs +++ b/osu.Desktop.Tests/Visual/TestCaseSettings.cs @@ -1,12 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Game.Overlays; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseSettings : TestCase + internal class TestCaseSettings : OsuTestCase { public override string Description => @"Tests the settings overlay"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs b/osu.Desktop.Tests/Visual/TestCaseSkipButton.cs similarity index 75% rename from osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs rename to osu.Desktop.Tests/Visual/TestCaseSkipButton.cs index 1f81226a8e..0e73314850 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs +++ b/osu.Desktop.Tests/Visual/TestCaseSkipButton.cs @@ -1,12 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Game.Screens.Play; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseSkipButton : TestCase + internal class TestCaseSkipButton : OsuTestCase { public override string Description => @"Skip skip skippediskip"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSocial.cs b/osu.Desktop.Tests/Visual/TestCaseSocial.cs similarity index 94% rename from osu.Desktop.VisualTests/Tests/TestCaseSocial.cs rename to osu.Desktop.Tests/Visual/TestCaseSocial.cs index 34209119bd..da60c82cea 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSocial.cs +++ b/osu.Desktop.Tests/Visual/TestCaseSocial.cs @@ -1,13 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Game.Overlays; using osu.Game.Users; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - public class TestCaseSocial : TestCase + public class TestCaseSocial : OsuTestCase { public override string Description => @"social browser overlay"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs b/osu.Desktop.Tests/Visual/TestCaseSongProgress.cs similarity index 91% rename from osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs rename to osu.Desktop.Tests/Visual/TestCaseSongProgress.cs index 3368224be1..fceb773ae6 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs +++ b/osu.Desktop.Tests/Visual/TestCaseSongProgress.cs @@ -4,14 +4,13 @@ using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.MathUtils; -using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Rulesets.Objects; using osu.Game.Screens.Play; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseSongProgress : TestCase + internal class TestCaseSongProgress : OsuTestCase { public override string Description => @"With fake data"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.Tests/Visual/TestCaseTabControl.cs similarity index 88% rename from osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs rename to osu.Desktop.Tests/Visual/TestCaseTabControl.cs index c0c01a6daa..4bdea2615d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs +++ b/osu.Desktop.Tests/Visual/TestCaseTabControl.cs @@ -2,15 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using OpenTK; -using osu.Framework.Testing; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Select.Filter; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - public class TestCaseTabControl : TestCase + public class TestCaseTabControl : OsuTestCase { public override string Description => @"Filter for song select"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.Tests/Visual/TestCaseTaikoHitObjects.cs similarity index 92% rename from osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs rename to osu.Desktop.Tests/Visual/TestCaseTaikoHitObjects.cs index d98e39ae7b..565c8f64c1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.Tests/Visual/TestCaseTaikoHitObjects.cs @@ -2,15 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Testing; -using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseTaikoHitObjects : TestCase + internal class TestCaseTaikoHitObjects : OsuTestCase { public override string Description => "Taiko hit objects"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs similarity index 95% rename from osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs rename to osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs index 8ca129eb91..903d91389d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.Tests/Visual/TestCaseTaikoPlayfield.cs @@ -1,22 +1,21 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; +using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; -using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects.Drawables; using osu.Game.Rulesets.Taiko.UI; -using System; +using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseTaikoPlayfield : TestCase + internal class TestCaseTaikoPlayfield : OsuTestCase { private const double default_duration = 300; private const float scroll_time = 1000; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs b/osu.Desktop.Tests/Visual/TestCaseTextAwesome.cs similarity index 88% rename from osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs rename to osu.Desktop.Tests/Visual/TestCaseTextAwesome.cs index 504b59f007..b98c0f700d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs +++ b/osu.Desktop.Tests/Visual/TestCaseTextAwesome.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Testing; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; @@ -10,9 +9,9 @@ using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseTextAwesome : TestCase + internal class TestCaseTextAwesome : OsuTestCase { public override string Description => @"Tests display of icons"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs b/osu.Desktop.Tests/Visual/TestCaseTwoLayerButton.cs similarity index 72% rename from osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs rename to osu.Desktop.Tests/Visual/TestCaseTwoLayerButton.cs index 0c35a4b8aa..ac641d75a2 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs +++ b/osu.Desktop.Tests/Visual/TestCaseTwoLayerButton.cs @@ -1,12 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseTwoLayerButton : TestCase + internal class TestCaseTwoLayerButton : OsuTestCase { public override string Description => @"Mostly back button"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.Tests/Visual/TestCaseUserPanel.cs similarity index 92% rename from osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs rename to osu.Desktop.Tests/Visual/TestCaseUserPanel.cs index 22cdf42f7d..b42fd3136d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.Tests/Visual/TestCaseUserPanel.cs @@ -1,15 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Testing; using osu.Framework.Graphics; -using osu.Game.Users; using osu.Framework.Graphics.Containers; +using osu.Game.Users; using OpenTK; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseUserPanel : TestCase + internal class TestCaseUserPanel : OsuTestCase { public override string Description => @"Panels for displaying a user's status"; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs b/osu.Desktop.Tests/Visual/TestCaseUserProfile.cs similarity index 92% rename from osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs rename to osu.Desktop.Tests/Visual/TestCaseUserProfile.cs index d7a2c8e47d..e5955441dc 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserProfile.cs +++ b/osu.Desktop.Tests/Visual/TestCaseUserProfile.cs @@ -3,13 +3,12 @@ using System; using System.Linq; -using osu.Framework.Testing; using osu.Game.Overlays; using osu.Game.Users; -namespace osu.Desktop.VisualTests.Tests +namespace osu.Desktop.Tests.Visual { - internal class TestCaseUserProfile : TestCase + internal class TestCaseUserProfile : OsuTestCase { public override string Description => "Tests user's profile page."; diff --git a/osu.Desktop.Tests/VisualTests.cs b/osu.Desktop.Tests/VisualTests.cs deleted file mode 100644 index 6ef924e873..0000000000 --- a/osu.Desktop.Tests/VisualTests.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using NUnit.Framework; -using osu.Desktop.VisualTests; -using osu.Framework.Desktop.Platform; - -namespace osu.Desktop.Tests -{ - [TestFixture] - public class VisualTests - { - [Test] - public void TestVisualTests() - { - using (var host = new HeadlessGameHost()) - { - host.Run(new AutomatedVisualTestGame()); - } - } - } -} diff --git a/osu.Desktop.Tests/osu.Desktop.Tests.csproj b/osu.Desktop.Tests/osu.Desktop.Tests.csproj index f940e4be9e..5058d2eed5 100644 --- a/osu.Desktop.Tests/osu.Desktop.Tests.csproj +++ b/osu.Desktop.Tests/osu.Desktop.Tests.csproj @@ -1,4 +1,4 @@ - + @@ -41,6 +41,10 @@ $(SolutionDir)\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll True + + $(SolutionDir)\packages\ppy.OpenTK.3.0\lib\net45\OpenTK.dll + True + False $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll @@ -55,15 +59,67 @@ $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {65DC628F-A640-4111-AB35-3A5652BC1E17} osu.Framework.Desktop + + {007b2356-ab6f-4bd9-96d5-116fc2dce69a} + osu.Framework.Testing + {C76BF5B3-985E-4D39-95FE-97C9C879B83A} osu.Framework @@ -72,10 +128,6 @@ {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} osu.Game.Resources - - {69051C69-12AE-4E7D-A3E6-460D2E282312} - osu.Desktop.VisualTests - {58F6C80C-1253-4A0E-A465-B8C85EBEADF3} osu.Game.Rulesets.Catch @@ -118,4 +170,4 @@ --> - \ No newline at end of file + diff --git a/osu.Desktop.Tests/packages.config b/osu.Desktop.Tests/packages.config index 7bd35a3abe..ed487e5cd5 100644 --- a/osu.Desktop.Tests/packages.config +++ b/osu.Desktop.Tests/packages.config @@ -6,6 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste + diff --git a/osu.Desktop.VisualTests/AutomatedVisualTestGame.cs b/osu.Desktop.VisualTests/AutomatedVisualTestGame.cs deleted file mode 100644 index b08588b29c..0000000000 --- a/osu.Desktop.VisualTests/AutomatedVisualTestGame.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Testing; -using osu.Game; - -namespace osu.Desktop.VisualTests -{ - public class AutomatedVisualTestGame : OsuGameBase - { - protected override void LoadComplete() - { - base.LoadComplete(); - - // Have to construct this here, rather than in the constructor, because - // we depend on some dependencies to be loaded within OsuGameBase.load(). - Add(new TestRunner(new TestBrowser())); - } - } -} \ No newline at end of file diff --git a/osu.Desktop.VisualTests/Program.cs b/osu.Desktop.VisualTests/Program.cs index 03d1588b78..62465c69d2 100644 --- a/osu.Desktop.VisualTests/Program.cs +++ b/osu.Desktop.VisualTests/Program.cs @@ -4,6 +4,7 @@ using System; using osu.Framework.Desktop; using osu.Framework.Platform; +using osu.Framework.VisualTests; namespace osu.Desktop.VisualTests { diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index 5c5bcd9e21..7655f6a59d 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Platform; -using osu.Framework.Testing; +using osu.Framework.VisualTests; using osu.Game; using osu.Game.Screens.Backgrounds; diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 1f4fd80ca6..bfbd8993f6 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -1,4 +1,4 @@ - + {69051C69-12AE-4E7D-A3E6-460D2E282312} @@ -155,6 +155,10 @@ {007b2356-ab6f-4bd9-96d5-116fc2dce69a} osu.Framework.Testing + + {1f02f11c-2c66-4d25-bbb5-5c752aad3e62} + osu.Framework.VisualTestBrowser + {c76bf5b3-985e-4d39-95fe-97c9c879b83a} osu.Framework @@ -185,55 +189,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -258,4 +215,4 @@ - \ No newline at end of file + diff --git a/osu.Desktop/OsuTestBrowser.cs b/osu.Desktop/OsuTestBrowser.cs new file mode 100644 index 0000000000..d2beefc654 --- /dev/null +++ b/osu.Desktop/OsuTestBrowser.cs @@ -0,0 +1,32 @@ +using osu.Framework.Platform; +using osu.Framework.Testing; +using osu.Game; +using osu.Game.Screens.Backgrounds; + +namespace osu.Desktop +{ + internal class OsuTestBrowser : OsuGameBase + { + protected override void LoadComplete() + { + base.LoadComplete(); + + LoadComponentAsync(new BackgroundScreenDefault { Depth = 10 }, AddInternal); + + // Have to construct this here, rather than in the constructor, because + // we depend on some dependencies to be loaded within OsuGameBase.load(). + Add(new TestBrowser()); + } + + public override void SetHost(GameHost host) + { + base.SetHost(host); + + host.UpdateThread.InactiveHz = host.UpdateThread.ActiveHz; + host.DrawThread.InactiveHz = host.DrawThread.ActiveHz; + host.InputThread.InactiveHz = host.InputThread.ActiveHz; + + host.Window.CursorState |= CursorState.Hidden; + } + } +} \ No newline at end of file diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 3b63239525..0ef458924a 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Linq; using osu.Framework.Desktop; using osu.Framework.Desktop.Platform; using osu.Game.IPC; @@ -33,7 +34,16 @@ namespace osu.Desktop } else { - host.Run(new OsuGameDesktop(args)); + switch (args.First() ?? string.Empty) + { + case "--tests": + host.Run(new OsuTestBrowser()); + break; + default: + host.Run(new OsuGameDesktop(args)); + break; + } + } return 0; } diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 82fbefec7a..a85add0ecb 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -90,6 +90,20 @@ Properties\app.manifest + + true + bin\VisualTests\ + DEBUG + true + 0 + true + full + AnyCPU + false + 6 + prompt + AllRules.ruleset + $(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll @@ -195,6 +209,10 @@ {65dc628f-a640-4111-ab35-3a5652bc1e17} osu.Framework.Desktop + + {007B2356-AB6F-4BD9-96D5-116FC2DCE69A} + osu.Framework.Testing + {c76bf5b3-985e-4d39-95fe-97c9c879b83a} osu.Framework @@ -203,6 +221,10 @@ {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} osu.Game.Resources + + {230ac4f3-7783-49fb-9aec-b83cda3b9f3d} + osu.Desktop.Tests + {c92a607b-1fdd-4954-9f92-03ff547d9080} osu.Game.Rulesets.Osu @@ -226,6 +248,7 @@ + diff --git a/osu.sln b/osu.sln index 317cfe7da4..3799c890b9 100644 --- a/osu.sln +++ b/osu.sln @@ -17,8 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework.Desktop", "osu-framework\osu.Framework.Desktop\osu.Framework.Desktop.csproj", "{65DC628F-A640-4111-AB35-3A5652BC1E17}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.VisualTests", "osu.Desktop.VisualTests\osu.Desktop.VisualTests.csproj", "{69051C69-12AE-4E7D-A3E6-460D2E282312}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Osu", "osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" @@ -43,62 +41,84 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU + VisualTests|Any CPU = VisualTests|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.Build.0 = Release|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.Build.0 = Release|Any CPU + {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.Release|Any CPU.Build.0 = Release|Any CPU + {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Debug|Any CPU.Build.0 = Debug|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release|Any CPU.ActiveCfg = Release|Any CPU {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.Release|Any CPU.Build.0 = Release|Any CPU + {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Debug|Any CPU.Build.0 = Debug|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Release|Any CPU.ActiveCfg = Release|Any CPU {65DC628F-A640-4111-AB35-3A5652BC1E17}.Release|Any CPU.Build.0 = Release|Any CPU - {69051C69-12AE-4E7D-A3E6-460D2E282312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69051C69-12AE-4E7D-A3E6-460D2E282312}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69051C69-12AE-4E7D-A3E6-460D2E282312}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69051C69-12AE-4E7D-A3E6-460D2E282312}.Release|Any CPU.Build.0 = Release|Any CPU + {65DC628F-A640-4111-AB35-3A5652BC1E17}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {65DC628F-A640-4111-AB35-3A5652BC1E17}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Debug|Any CPU.Build.0 = Debug|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Release|Any CPU.ActiveCfg = Release|Any CPU {54377672-20B1-40AF-8087-5CF73BF3953A}.Release|Any CPU.Build.0 = Release|Any CPU + {54377672-20B1-40AF-8087-5CF73BF3953A}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {54377672-20B1-40AF-8087-5CF73BF3953A}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Debug|Any CPU.Build.0 = Debug|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release|Any CPU.ActiveCfg = Release|Any CPU {C92A607B-1FDD-4954-9F92-03FF547D9080}.Release|Any CPU.Build.0 = Release|Any CPU + {C92A607B-1FDD-4954-9F92-03FF547D9080}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {C92A607B-1FDD-4954-9F92-03FF547D9080}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Debug|Any CPU.Build.0 = Debug|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release|Any CPU.ActiveCfg = Release|Any CPU {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.Release|Any CPU.Build.0 = Release|Any CPU + {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {58F6C80C-1253-4A0E-A465-B8C85EBEADF3}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Debug|Any CPU.Build.0 = Debug|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release|Any CPU.ActiveCfg = Release|Any CPU {F167E17A-7DE6-4AF5-B920-A5112296C695}.Release|Any CPU.Build.0 = Release|Any CPU + {F167E17A-7DE6-4AF5-B920-A5112296C695}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {F167E17A-7DE6-4AF5-B920-A5112296C695}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Debug|Any CPU.Build.0 = Debug|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F4582B-7687-4621-9CBE-5C24197CB536}.Release|Any CPU.Build.0 = Release|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {48F4582B-7687-4621-9CBE-5C24197CB536}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.Release|Any CPU.Build.0 = Release|Any CPU + {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BAEA2F74-0315-4667-84E0-ACAC0B4BF785}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU {007B2356-AB6F-4BD9-96D5-116FC2DCE69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {007B2356-AB6F-4BD9-96D5-116FC2DCE69A}.Debug|Any CPU.Build.0 = Debug|Any CPU {007B2356-AB6F-4BD9-96D5-116FC2DCE69A}.Release|Any CPU.ActiveCfg = Release|Any CPU {007B2356-AB6F-4BD9-96D5-116FC2DCE69A}.Release|Any CPU.Build.0 = Release|Any CPU + {007B2356-AB6F-4BD9-96D5-116FC2DCE69A}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {007B2356-AB6F-4BD9-96D5-116FC2DCE69A}.VisualTests|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -109,7 +129,6 @@ Global {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {D9A367C9-4C1A-489F-9B05-A0CEA2B53B58} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {65DC628F-A640-4111-AB35-3A5652BC1E17} = {7A75DFA2-DE65-4458-98AF-26AF96FFD6DC} - {69051C69-12AE-4E7D-A3E6-460D2E282312} = {80683232-505E-41EA-A37C-2CFCF1C88C57} {54377672-20B1-40AF-8087-5CF73BF3953A} = {80683232-505E-41EA-A37C-2CFCF1C88C57} {C92A607B-1FDD-4954-9F92-03FF547D9080} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} {58F6C80C-1253-4A0E-A465-B8C85EBEADF3} = {0D37A2AD-80A4-464F-A1DE-1560B70F1CE3} From e6ef50c4e464a14c93f96424e7b4aabdcd43cf75 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 15:40:28 +0900 Subject: [PATCH 13/20] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index e5beb4f01f..9ae8979ef7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e5beb4f01fce0b46e87bc59d60398fedc1932737 +Subproject commit 9ae8979ef7ef0968c90cdbce40a04969d43633c7 From 104c25266d61b0cc0f840a8b4e6552afa3b47dc9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 15:48:42 +0900 Subject: [PATCH 14/20] Add missing licence headers --- osu.Desktop.Tests/Visual/OsuTestCase.cs | 5 ++++- osu.Desktop/OsuTestBrowser.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Desktop.Tests/Visual/OsuTestCase.cs b/osu.Desktop.Tests/Visual/OsuTestCase.cs index 6bd8187b45..e54f7dbeb5 100644 --- a/osu.Desktop.Tests/Visual/OsuTestCase.cs +++ b/osu.Desktop.Tests/Visual/OsuTestCase.cs @@ -1,4 +1,7 @@ -using NUnit.Framework; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using NUnit.Framework; using osu.Framework.Desktop.Platform; using osu.Framework.Testing; using osu.Game; diff --git a/osu.Desktop/OsuTestBrowser.cs b/osu.Desktop/OsuTestBrowser.cs index d2beefc654..50af9bd317 100644 --- a/osu.Desktop/OsuTestBrowser.cs +++ b/osu.Desktop/OsuTestBrowser.cs @@ -1,4 +1,7 @@ -using osu.Framework.Platform; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Platform; using osu.Framework.Testing; using osu.Game; using osu.Game.Screens.Backgrounds; From 7e89b1021df0b2ffbd7717d3926379b298ff9d80 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 15:58:59 +0900 Subject: [PATCH 15/20] FirstOrDefault --- osu.Desktop/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 0ef458924a..1fab92e020 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -34,7 +34,7 @@ namespace osu.Desktop } else { - switch (args.First() ?? string.Empty) + switch (args.FirstOrDefault() ?? string.Empty) { case "--tests": host.Run(new OsuTestBrowser()); From fc97fdb8c1887f67c9289421c088afd0f2c2586a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 16:07:25 +0900 Subject: [PATCH 16/20] Use a common build directory between both build ccnfigurations There's no need to build to VisualTests when they share everything --- osu.Desktop/osu.Desktop.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index a85add0ecb..8ffa6b62f7 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -92,7 +92,7 @@ true - bin\VisualTests\ + bin\Debug\ DEBUG true 0 From 74facb32b4b7c0315fe574fbed276a26eab73d3d Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Fri, 4 Aug 2017 15:34:11 +0800 Subject: [PATCH 17/20] Use removeAutoModOnResume as a field. --- osu.Game/Screens/Select/PlaySongSelect.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 7a4f7c404d..3eb44bd2f3 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using System.Linq; using OpenTK.Input; using osu.Framework.Allocation; @@ -12,7 +11,6 @@ using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Mods; -using osu.Game.Rulesets.Mods; using osu.Game.Screens.Edit; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; @@ -24,7 +22,7 @@ namespace osu.Game.Screens.Select private OsuScreen player; private readonly ModSelectOverlay modSelect; private readonly BeatmapDetailArea beatmapDetails; - private IEnumerable originalMods; + private bool removeAutoModOnResume; public PlaySongSelect() { @@ -76,8 +74,12 @@ namespace osu.Game.Screens.Select { player = null; - modSelect.SelectedMods.Value = originalMods; - originalMods = null; + if (removeAutoModOnResume) + { + var autoType = Ruleset.Value.CreateInstance().GetAutoplayMod().GetType(); + modSelect.SelectedMods.Value = modSelect.SelectedMods.Value.Where(m => m.GetType() != autoType).ToArray(); + } + removeAutoModOnResume = false; Beatmap.Value.Track.Looping = true; @@ -112,14 +114,17 @@ namespace osu.Game.Screens.Select { if (player != null) return; - originalMods = modSelect.SelectedMods.Value; if (state?.Keyboard.ControlPressed == true) { var auto = Ruleset.Value.CreateInstance().GetAutoplayMod(); var autoType = auto.GetType(); - if (originalMods.All(m => m.GetType() != autoType)) - modSelect.SelectedMods.Value = originalMods.Concat(new[] { auto }); + var mods = modSelect.SelectedMods.Value; + if (mods.All(m => m.GetType() != autoType)) + { + modSelect.SelectedMods.Value = mods.Concat(new[] { auto }); + removeAutoModOnResume = true; + } } Beatmap.Value.Track.Looping = false; From 17900f33539a0d0791372eba9ad4c71a771e607f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 4 Aug 2017 17:15:09 +0930 Subject: [PATCH 18/20] Update VSCode with new configurations. --- .vscode/launch.json | 24 ++++++------------------ .vscode/tasks.json | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b3b86da42f..f1083179b8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,34 +1,22 @@ { "version": "0.2.0", - "configurations": [ - { - "name": "VisualTests (debug)", + "configurations": [{ + "name": "osu! (VisualTests)", "windows": { "type": "clr" }, "type": "mono", "request": "launch", - "program": "${workspaceRoot}/osu.Desktop.VisualTests/bin/Debug/osu!.exe", + "program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe", + "args": [ + "--tests" + ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug)", "runtimeExecutable": null, "env": {}, "console": "internalConsole" }, - { - "name": "VisualTests (release)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/osu.Desktop.VisualTests/bin/Release/osu!.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, { "name": "osu! (debug)", "windows": { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b0fd5fbb0d..3db43ca9bb 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,35 +2,41 @@ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", - "problemMatcher": "$msCompile", - "isShellCommand": true, "command": "msbuild", + "type": "shell", "suppressTaskName": true, - "showOutput": "silent", "args": [ "/property:GenerateFullPaths=true", "/property:DebugType=portable", + "/verbosity:minimal", "/m" //parallel compiling support. ], - "tasks": [ - { + "tasks": [{ "taskName": "Build (Debug)", - "isBuildCommand": true + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$msCompile" + ] }, { "taskName": "Build (Release)", "args": [ "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" ] }, - { - "taskName": "Clean All", - "dependsOn": ["Clean (Debug)", "Clean (Release)"] - }, { "taskName": "Clean (Debug)", "args": [ "/target:Clean" + ], + "problemMatcher": [ + "$msCompile" ] }, { @@ -38,6 +44,19 @@ "args": [ "/target:Clean", "/property:Configuration=Release" + ], + "problemMatcher": [ + "$msCompile" + ] + }, + { + "taskName": "Clean All", + "dependsOn": [ + "Clean (Debug)", + "Clean (Release)" + ], + "problemMatcher": [ + "$msCompile" ] } ] From e8021c2b92da8b3b72b58d31145d162fe54c5082 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 17:20:05 +0900 Subject: [PATCH 19/20] Move line inside if --- osu.Game/Screens/Select/PlaySongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 3eb44bd2f3..662e1d55a2 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -78,8 +78,8 @@ namespace osu.Game.Screens.Select { var autoType = Ruleset.Value.CreateInstance().GetAutoplayMod().GetType(); modSelect.SelectedMods.Value = modSelect.SelectedMods.Value.Where(m => m.GetType() != autoType).ToArray(); + removeAutoModOnResume = false; } - removeAutoModOnResume = false; Beatmap.Value.Track.Looping = true; From 083248872beaeccfdb88e5e2b3ee841bb10caa69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Aug 2017 17:36:31 +0900 Subject: [PATCH 20/20] Revert all changes on OsuGame --- osu.Game/OsuGame.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 5fd04a92ab..8d8c5cf26e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -186,12 +186,11 @@ namespace osu.Game LoadComponentAsync(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(social = new SocialOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add); - LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(settings = new SettingsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); LoadComponentAsync(musicController = new MusicController { - Depth = -2, + Depth = -3, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -199,14 +198,14 @@ namespace osu.Game LoadComponentAsync(notificationOverlay = new NotificationOverlay { - Depth = -2, + Depth = -3, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }, overlayContent.Add); LoadComponentAsync(dialogOverlay = new DialogOverlay { - Depth = -4, + Depth = -5, }, overlayContent.Add); Logger.NewEntry += entry => @@ -233,7 +232,7 @@ namespace osu.Game LoadComponentAsync(Toolbar = new Toolbar { - Depth = -3, + Depth = -4, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, }, overlayContent.Add);