From 0603be5937e1820e63a0929f9f48dc2f74da6016 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Tue, 23 May 2017 15:30:15 +0200 Subject: [PATCH 1/6] Unregister OnBeatmapChanged() when exiting song selection --- osu.Game/Screens/OsuScreen.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 6a0e37ca6f..162a22ab61 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -131,7 +131,12 @@ namespace osu.Game.Screens Background.Exit(); } - return base.OnExiting(next); + if (base.OnExiting(next)) + return true; + + beatmap.ValueChanged -= OnBeatmapChanged; + + return false; } } } From 8544b454437564f640af257d9b499a42f04fe16d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 May 2017 16:33:26 +0900 Subject: [PATCH 2/6] Update in line with framework --- osu-framework | 2 +- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 7 +++---- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 5 ++--- osu.Game/Overlays/ChatOverlay.cs | 8 ++++++-- osu.Game/Overlays/DirectOverlay.cs | 10 +++++++--- osu.Game/Overlays/Music/PlaylistItem.cs | 2 +- osu.Game/Overlays/Music/PlaylistList.cs | 4 ++-- .../Settings/Sections/General/LoginSettings.cs | 15 +++++++++++---- osu.Game/Overlays/Settings/SettingsItem.cs | 2 +- osu.Game/Overlays/Settings/SettingsSection.cs | 2 +- osu.Game/Overlays/Settings/SettingsSubsection.cs | 2 +- osu.Game/Overlays/SettingsOverlay.cs | 10 +++++++--- .../Screens/Select/Leaderboards/Leaderboard.cs | 2 +- 13 files changed, 44 insertions(+), 27 deletions(-) diff --git a/osu-framework b/osu-framework index 0f3db5da09..e5f0cf73c1 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 0f3db5da09d0e7c4d2ef3057030e018f34ba536e +Subproject commit e5f0cf73c1e0bbcbd04194bf175d73af47fc850a diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index fe1d255bba..42fff0f258 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -37,11 +37,10 @@ namespace osu.Game.Graphics.UserInterface this.inputManager = inputManager; } - protected override bool OnFocus(InputState state) + protected override void OnFocus(InputState state) { - var result = base.OnFocus(state); + base.OnFocus(state); BorderThickness = 0; - return result; } protected override void OnFocusLost(InputState state) @@ -56,6 +55,6 @@ namespace osu.Game.Graphics.UserInterface base.OnFocusLost(state); } - public override bool RequestingFocus => HoldFocus; + public override bool RequestsFocus => HoldFocus; } } diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 97c38f6b85..3512b4cdb1 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -45,11 +45,10 @@ namespace osu.Game.Graphics.UserInterface BorderColour = colour.Yellow; } - protected override bool OnFocus(InputState state) + protected override void OnFocus(InputState state) { BorderThickness = 3; - - return base.OnFocus(state); + base.OnFocus(state); } protected override void OnFocusLost(InputState state) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 5b2c01151c..a9970e5e95 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -167,11 +167,15 @@ namespace osu.Game.Overlays } } - protected override bool OnFocus(InputState state) + public override bool AcceptsFocus => true; + + protected override bool OnClick(InputState state) => true; + + protected override void OnFocus(InputState state) { //this is necessary as inputTextBox is masked away and therefore can't get focus :( InputManager.ChangeFocus(inputTextBox); - return false; + base.OnFocus(state); } protected override void PopIn() diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index b1bc7e0c04..b7f6572bcc 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -98,7 +98,7 @@ namespace osu.Game.Overlays new ScrollContainer { RelativeSizeAxes = Axes.Both, - ScrollDraggerVisible = false, + ScrollbarVisible = false, Children = new Drawable[] { new FillFlowContainer @@ -187,10 +187,14 @@ namespace osu.Game.Overlays panels.Children = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b)); } - protected override bool OnFocus(InputState state) + public override bool AcceptsFocus => true; + + protected override bool OnClick(InputState state) => true; + + protected override void OnFocus(InputState state) { InputManager.ChangeFocus(filter.Search); - return false; + base.OnFocus(state); } protected override void PopIn() diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 9b72cfce42..0618f96cac 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Music private bool matching = true; - public bool MatchingCurrentFilter + public bool MatchingFilter { set { diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index ffe59a9d93..eeb072fb00 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Music } } - public BeatmapSetInfo FirstVisibleSet => items.Children.FirstOrDefault(i => i.MatchingCurrentFilter)?.BeatmapSetInfo; + public BeatmapSetInfo FirstVisibleSet => items.Children.FirstOrDefault(i => i.MatchingFilter)?.BeatmapSetInfo; private void itemSelected(BeatmapSetInfo b) { @@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Music private class ItemSearchContainer : FillFlowContainer, IHasFilterableChildren { public string[] FilterTerms => new string[] { }; - public bool MatchingCurrentFilter + public bool MatchingFilter { set { diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 00ca50927e..1e22b26f1b 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -166,10 +166,14 @@ namespace osu.Game.Overlays.Settings.Sections.General if (form != null) inputManager.ChangeFocus(form); } - protected override bool OnFocus(InputState state) + public override bool AcceptsFocus => true; + + protected override bool OnClick(InputState state) => true; + + protected override void OnFocus(InputState state) { if (form != null) inputManager.ChangeFocus(form); - return base.OnFocus(state); + base.OnFocus(state); } private class LoginForm : FillFlowContainer @@ -235,10 +239,13 @@ namespace osu.Game.Overlays.Settings.Sections.General }; } - protected override bool OnFocus(InputState state) + public override bool AcceptsFocus => true; + + protected override bool OnClick(InputState state) => true; + + protected override void OnFocus(InputState state) { Schedule(() => { inputManager.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); }); - return base.OnFocus(state); } } diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index e592ca9e37..7cddefb755 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Settings public string[] FilterTerms => new[] { LabelText }; - public bool MatchingCurrentFilter + public bool MatchingFilter { set { diff --git a/osu.Game/Overlays/Settings/SettingsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs index 8b95c72412..e65b7f19d9 100644 --- a/osu.Game/Overlays/Settings/SettingsSection.cs +++ b/osu.Game/Overlays/Settings/SettingsSection.cs @@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings public IEnumerable FilterableChildren => Children.OfType(); public string[] FilterTerms => new[] { Header }; - public bool MatchingCurrentFilter + public bool MatchingFilter { set { diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 30abbc3805..44328ae867 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings public IEnumerable FilterableChildren => Children.OfType(); public string[] FilterTerms => new[] { Header }; - public bool MatchingCurrentFilter + public bool MatchingFilter { set { diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 474631fd1e..87f6d836af 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -138,10 +138,14 @@ namespace osu.Game.Overlays InputManager.ChangeFocus(null); } - protected override bool OnFocus(InputState state) + public override bool AcceptsFocus => true; + + protected override bool OnClick(InputState state) => true; + + protected override void OnFocus(InputState state) { InputManager.ChangeFocus(searchTextBox); - return false; + base.OnFocus(state); } private class SettingsSectionsContainer : SectionsContainer @@ -159,7 +163,7 @@ namespace osu.Game.Overlays public SettingsSectionsContainer() { - ScrollContainer.ScrollDraggerVisible = false; + ScrollContainer.ScrollbarVisible = false; Add(headerBackground = new Box { Colour = Color4.Black, diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index a7aa752d65..7d97581a29 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -74,7 +74,7 @@ namespace osu.Game.Screens.Select.Leaderboards scrollContainer = new ScrollContainer { RelativeSizeAxes = Axes.Both, - ScrollDraggerVisible = false, + ScrollbarVisible = false, Children = new Drawable[] { scrollFlow = new FillFlowContainer From b61452024ac664031f85288d8e738b4305d9c2f1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 May 2017 11:02:26 +0900 Subject: [PATCH 3/6] Add comment --- osu.Game/Screens/OsuScreen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 162a22ab61..3d8ead0fbb 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -134,6 +134,8 @@ namespace osu.Game.Screens if (base.OnExiting(next)) return true; + // while this is not necessary as we are constructing our own bindable, there are cases where + // the GC doesn't run as fast as expected and this is triggered post-exit. beatmap.ValueChanged -= OnBeatmapChanged; return false; From 61fb5d6ac8dee8818282b4d341e8535c819430a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 May 2017 11:04:18 +0900 Subject: [PATCH 4/6] Add issue URL to comment --- osu.Game/Screens/OsuScreen.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 3d8ead0fbb..de9c698f2a 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -136,6 +136,7 @@ namespace osu.Game.Screens // while this is not necessary as we are constructing our own bindable, there are cases where // the GC doesn't run as fast as expected and this is triggered post-exit. + // added to resolve https://github.com/ppy/osu/issues/829 beatmap.ValueChanged -= OnBeatmapChanged; return false; From 4fd7405fb86ab52d0d2bb5c30cb6c5d78f670b31 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 31 May 2017 01:57:32 -0300 Subject: [PATCH 5/6] Fix user dropdown menu item chevron alignment --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 5 +++-- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 14483f3bfb..481430c9cb 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - new OsuSpriteText { + Text = new OsuSpriteText { Text = text, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, @@ -85,6 +85,7 @@ namespace osu.Game.Graphics.UserInterface private Color4? accentColour; protected readonly TextAwesome Chevron; + protected readonly OsuSpriteText Text; protected override void FormatForeground(bool hover = false) { @@ -170,4 +171,4 @@ namespace osu.Game.Graphics.UserInterface } } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 00ca50927e..022fdb3a3c 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -338,8 +338,8 @@ namespace osu.Game.Overlays.Settings.Sections.General { public UserDropdownMenuItem(string text, UserAction current) : base(text, current) { - Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = UserDropdownHeader.LABEL_LEFT_MARGIN, Right = 5 }; - Chevron.Margin = new MarginPadding { Left = 2, Right = 3 }; + Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 }; + Text.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 }; CornerRadius = 5; } } From cd5734319144ad61cd161863dc684d87cdb1ede7 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 31 May 2017 02:03:13 -0300 Subject: [PATCH 6/6] Text -> Label --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 4 ++-- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 481430c9cb..6dadd63ac4 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - Text = new OsuSpriteText { + Label = new OsuSpriteText { Text = text, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, @@ -85,7 +85,7 @@ namespace osu.Game.Graphics.UserInterface private Color4? accentColour; protected readonly TextAwesome Chevron; - protected readonly OsuSpriteText Text; + protected readonly OsuSpriteText Label; protected override void FormatForeground(bool hover = false) { diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 022fdb3a3c..f336566680 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -339,7 +339,7 @@ namespace osu.Game.Overlays.Settings.Sections.General public UserDropdownMenuItem(string text, UserAction current) : base(text, current) { Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 }; - Text.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 }; + Label.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 }; CornerRadius = 5; } }