From 70f148f0b4ab7cc2eb7fc9a78cd4bb33fce082ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 15 Aug 2017 09:30:46 +0900 Subject: [PATCH 1/6] Fix icons on skip button --- osu.Game/Screens/Play/SkipButton.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index a67cf4e5ea..3cf371f1e1 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -227,9 +227,9 @@ namespace osu.Game.Screens.Play Direction = FillDirection.Horizontal, Children = new[] { - new SpriteIcon { Icon = FontAwesome.fa_chevron_right }, - new SpriteIcon { Icon = FontAwesome.fa_chevron_right }, - new SpriteIcon { Icon = FontAwesome.fa_chevron_right }, + new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right }, + new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right }, + new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_right }, } }, new OsuSpriteText From 97ac8e1a64b2bacf8697423ad124965ede65dbc6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 14 Aug 2017 11:03:03 +0900 Subject: [PATCH 2/6] Update usages of IsAlive/IsLoaded in line with framework changes --- osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs | 2 +- osu.Game/Screens/BackgroundScreen.cs | 2 +- osu.Game/Screens/Play/KeyCounterCollection.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs index b9e492593f..1e46fbda35 100644 --- a/osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs +++ b/osu.Desktop.Tests/Visual/TestCaseNotificationOverlay.cs @@ -68,7 +68,7 @@ namespace osu.Desktop.Tests.Visual while (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3) { - var p = progressingNotifications.FirstOrDefault(n => n.IsLoaded && n.State == ProgressNotificationState.Queued); + var p = progressingNotifications.FirstOrDefault(n => n.IsAlive && n.State == ProgressNotificationState.Queued); if (p == null) break; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 8b9441ea65..680f987274 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; accentColour = value; - if (LoadState == LoadState.Loaded) + if (LoadState == LoadState.Ready) Schedule(reloadTexture); } } diff --git a/osu.Game/Screens/BackgroundScreen.cs b/osu.Game/Screens/BackgroundScreen.cs index c5bbf04075..5b07ca6020 100644 --- a/osu.Game/Screens/BackgroundScreen.cs +++ b/osu.Game/Screens/BackgroundScreen.cs @@ -37,7 +37,7 @@ namespace osu.Game.Screens } // Make sure the in-progress loading is complete before pushing the screen. - while (screen.LoadState < LoadState.Loaded) + while (screen.LoadState < LoadState.Ready) Thread.Sleep(1); base.Push(screen); diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 01e20fdbd7..63c29a8f78 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -108,7 +108,7 @@ namespace osu.Game.Screens.Play } } - public override bool HandleInput => receptor?.IsAlive != true; + public override bool HandleInput => receptor == null; private Receptor receptor; From a74ebdfe568bfd94a20756ac880981279e2a159e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 15 Aug 2017 14:30:25 +0900 Subject: [PATCH 3/6] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 2a56eb0619..4a213a02aa 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 2a56eb0619adf654ed4927af1a4b227596c87494 +Subproject commit 4a213a02aa09b0fd8bd119eb391549ca1fa00f95 From 6ded194c5317cc6bdae056c377433bb394c8f05e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 15 Aug 2017 14:30:50 +0900 Subject: [PATCH 4/6] Remove all usage of DI to retrieve InputManager Uses GetContainingInputManager instead, as per framework changes. --- osu.Game/Graphics/Containers/ParallaxContainer.cs | 9 +++++++-- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 10 +--------- osu.Game/Overlays/Music/PlaylistOverlay.cs | 6 ++---- .../Settings/Sections/General/LoginSettings.cs | 15 +++++---------- osu.Game/Screens/Select/FilterControl.cs | 8 ++------ osu.Game/Screens/Select/SongSelect.cs | 8 ++++---- 6 files changed, 21 insertions(+), 35 deletions(-) diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index ec9d30f244..3e0ed4b059 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -34,9 +34,8 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; [BackgroundDependencyLoader] - private void load(UserInputManager input, OsuConfigManager config) + private void load(OsuConfigManager config) { - this.input = input; parallaxEnabled = config.GetBindable(OsuSetting.MenuParallax); parallaxEnabled.ValueChanged += delegate { @@ -48,6 +47,12 @@ namespace osu.Game.Graphics.Containers }; } + protected override void LoadComplete() + { + base.LoadComplete(); + input = GetContainingInputManager(); + } + private bool firstUpdate = true; protected override void Update() diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index 447daca75e..4817212f7a 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -28,18 +28,10 @@ namespace osu.Game.Graphics.UserInterface { focus = value; if (!focus && HasFocus) - inputManager.ChangeFocus(null); + GetContainingInputManager().ChangeFocus(null); } } - private InputManager inputManager; - - [BackgroundDependencyLoader] - private void load(UserInputManager inputManager) - { - this.inputManager = inputManager; - } - protected override void OnFocus(InputState state) { base.OnFocus(state); diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index 942633b35e..2681c8bbb8 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -31,12 +31,10 @@ namespace osu.Game.Overlays.Music private readonly Bindable beatmapBacking = new Bindable(); public IEnumerable BeatmapSets; - private InputManager inputManager; [BackgroundDependencyLoader] - private void load(OsuGameBase game, BeatmapManager beatmaps, OsuColour colours, UserInputManager inputManager) + private void load(OsuGameBase game, BeatmapManager beatmaps, OsuColour colours) { - this.inputManager = inputManager; this.beatmaps = beatmaps; Children = new Drawable[] @@ -102,7 +100,7 @@ namespace osu.Game.Overlays.Music protected override void PopIn() { filter.Search.HoldFocus = true; - Schedule(() => inputManager.ChangeFocus(filter.Search)); + Schedule(() => GetContainingInputManager().ChangeFocus(filter.Search)); this.ResizeTo(new Vector2(1, playlist_height), transition_duration, Easing.OutQuint); this.FadeIn(transition_duration, Easing.OutQuint); diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index d07f156673..3f8b6186c4 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -57,12 +57,9 @@ namespace osu.Game.Overlays.Settings.Sections.General Spacing = new Vector2(0f, 5f); } - private InputManager inputManager; - [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, APIAccess api, UserInputManager inputManager) + private void load(OsuColour colours, APIAccess api) { - this.inputManager = inputManager; this.colours = colours; api?.Register(this); @@ -174,7 +171,7 @@ namespace osu.Game.Overlays.Settings.Sections.General break; } - if (form != null) inputManager.ChangeFocus(form); + if (form != null) GetContainingInputManager().ChangeFocus(form); } public override bool AcceptsFocus => true; @@ -183,7 +180,7 @@ namespace osu.Game.Overlays.Settings.Sections.General protected override void OnFocus(InputState state) { - if (form != null) inputManager.ChangeFocus(form); + if (form != null) GetContainingInputManager().ChangeFocus(form); base.OnFocus(state); } @@ -192,7 +189,6 @@ namespace osu.Game.Overlays.Settings.Sections.General private TextBox username; private TextBox password; private APIAccess api; - private InputManager inputManager; private void performLogin() { @@ -201,9 +197,8 @@ namespace osu.Game.Overlays.Settings.Sections.General } [BackgroundDependencyLoader(permitNulls: true)] - private void load(APIAccess api, OsuConfigManager config, UserInputManager inputManager) + private void load(APIAccess api, OsuConfigManager config) { - this.inputManager = inputManager; this.api = api; Direction = FillDirection.Vertical; Spacing = new Vector2(0, 5); @@ -256,7 +251,7 @@ namespace osu.Game.Overlays.Settings.Sections.General protected override void OnFocus(InputState state) { - Schedule(() => { inputManager.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); }); + Schedule(() => { GetContainingInputManager().ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); }); } } diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 838e6f7123..e83613125b 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -153,7 +153,7 @@ namespace osu.Game.Screens.Select { searchTextBox.HoldFocus = false; if (searchTextBox.HasFocus) - inputManager.ChangeFocus(searchTextBox); + GetContainingInputManager().ChangeFocus(searchTextBox); } public void Activate() @@ -163,13 +163,9 @@ namespace osu.Game.Screens.Select private readonly Bindable ruleset = new Bindable(); - private InputManager inputManager; - [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, OsuGame osu, UserInputManager inputManager) + private void load(OsuColour colours, OsuGame osu) { - this.inputManager = inputManager; - sortTabs.AccentColour = colours.GreenLight; if (osu != null) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 8f545240c8..afab9e8746 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -156,11 +156,11 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader(permitNulls: true)] - private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, UserInputManager input) + private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours) { if (Footer != null) { - Footer.AddButton(@"random", colours.Green, () => triggerRandom(input), Key.F2); + Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2); Footer.AddButton(@"options", colours.Blue, BeatmapOptions.ToggleVisibility, Key.F3); BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue); @@ -267,9 +267,9 @@ namespace osu.Game.Screens.Select } } - private void triggerRandom(UserInputManager input) + private void triggerRandom() { - if (input.CurrentState.Keyboard.ShiftPressed) + if (GetContainingInputManager().CurrentState.Keyboard.ShiftPressed) carousel.SelectPreviousRandom(); else carousel.SelectNextRandom(); From 143ff695efd03e163c558f5bebbbeb70cb0d81b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 15 Aug 2017 17:44:04 +0900 Subject: [PATCH 5/6] Remove unused using statements --- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 1 - osu.Game/Overlays/Music/PlaylistOverlay.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index 4817212f7a..dbbb069f7c 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -3,7 +3,6 @@ using OpenTK.Graphics; using OpenTK.Input; -using osu.Framework.Allocation; using osu.Framework.Input; using System; using System.Linq; diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index 2681c8bbb8..83e92c5554 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -6,7 +6,6 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Input; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; From 7d00365154592294e2bb3be3ec6953e63df5bed3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 16 Aug 2017 12:12:25 +0900 Subject: [PATCH 6/6] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 4a213a02aa..fc13a4c2f1 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 4a213a02aa09b0fd8bd119eb391549ca1fa00f95 +Subproject commit fc13a4c2f1eff443ffe7d5ff3ca5caa17b98ffbf