From 7cff413ab016a4f2dcdffbfcb060f3d5e2fd1718 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 11 Oct 2017 20:25:12 +0300 Subject: [PATCH 1/4] Fix wrong beatmap selection in song-select menu on deleting selected beatmap --- osu.Game/Screens/Select/BeatmapCarousel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index c72f599955..245dfb091c 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -375,6 +375,9 @@ private void removeGroup(BeatmapGroup group) if (group == null) return; + if (selectedGroup == group) + SelectNext(); + groups.Remove(group); panels.Remove(group.Header); foreach (var p in group.BeatmapPanels) @@ -383,9 +386,6 @@ private void removeGroup(BeatmapGroup group) scrollableContent.Remove(group.Header); scrollableContent.RemoveRange(group.BeatmapPanels); - if (selectedGroup == group) - SelectNext(); - computeYPositions(); } From 502940ddf3cb372457de78d2bb6d532e7ef2e2d6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 14 Oct 2017 05:05:38 +0300 Subject: [PATCH 2/4] Fix deleting last visible beatmap doesn't trigger selecting null beatmap --- osu.Game/Screens/Select/BeatmapCarousel.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 245dfb091c..326b632630 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -181,13 +181,18 @@ public void SelectBeatmap(BeatmapInfo beatmap, bool animated = true) public Action HideDifficultyRequested; + private void selectNullBeatmap() + { + selectedGroup = null; + selectedPanel = null; + SelectionChanged?.Invoke(null); + } + public void SelectNext(int direction = 1, bool skipDifficulties = true) { if (groups.All(g => g.State == BeatmapGroupState.Hidden)) { - selectedGroup = null; - selectedPanel = null; - SelectionChanged?.Invoke(null); + selectNullBeatmap(); return; } @@ -376,7 +381,12 @@ private void removeGroup(BeatmapGroup group) return; if (selectedGroup == group) - SelectNext(); + { + if (getVisibleGroups().Count() == 1) + selectNullBeatmap(); + else + SelectNext(); + } groups.Remove(group); panels.Remove(group.Header); From 22d222354cc89ba786f11a8923d6b0265f58391a Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Thu, 26 Oct 2017 18:45:20 +1030 Subject: [PATCH 3/4] Change SettingsItem to use GetBoundCopy to ensure it has the right class for numeric bindables --- osu.Game/Overlays/Settings/SettingsItem.cs | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 5a0f25f7e0..e03fc91aa7 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -80,7 +80,7 @@ public virtual Bindable Bindable controlWithCurrent?.Current.BindTo(bindable); if (ShowsDefaultIndicator) { - restoreDefaultValueButton.Bindable.BindTo(bindable); + restoreDefaultValueButton.Bindable = bindable.GetBoundCopy(); restoreDefaultValueButton.Bindable.TriggerChange(); } } @@ -134,7 +134,17 @@ private void load(OsuColour colours) private class RestoreDefaultValueButton : Box, IHasTooltip { - internal readonly Bindable Bindable = new Bindable(); + private Bindable bindable; + internal Bindable Bindable + { + get { return bindable; } + set + { + bindable = value; + bindable.ValueChanged += newValue => UpdateState(); + bindable.DisabledChanged += disabled => UpdateState(); + } + } private Color4 buttonColour; @@ -142,9 +152,6 @@ private class RestoreDefaultValueButton : Box, IHasTooltip public RestoreDefaultValueButton() { - Bindable.ValueChanged += value => UpdateState(); - Bindable.DisabledChanged += disabled => UpdateState(); - RelativeSizeAxes = Axes.Y; Width = SettingsOverlay.CONTENT_MARGINS; Alpha = 0f; @@ -160,8 +167,8 @@ public RestoreDefaultValueButton() protected override bool OnClick(InputState state) { - if (!Bindable.Disabled) - Bindable.SetDefault(); + if (bindable != null && !bindable.Disabled) + bindable.SetDefault(); return true; } @@ -186,8 +193,10 @@ internal void SetButtonColour(Color4 buttonColour) internal void UpdateState() { - var colour = Bindable.Disabled ? Color4.Gray : buttonColour; - this.FadeTo(Bindable.IsDefault ? 0f : hovering && !Bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint); + if (bindable == null) + return; + var colour = bindable.Disabled ? Color4.Gray : buttonColour; + this.FadeTo(bindable.IsDefault ? 0f : hovering && !bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint); this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint); } } From 1afe2c18be781e28c3566317f4c5aa7083f0b5da Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 4 Nov 2017 19:42:28 +0300 Subject: [PATCH 4/4] Fix osu! deleting beatmaps on startup if MenuMusic is disabled --- osu.Game/Screens/Menu/Intro.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index fb06edb0b0..d767d4eb12 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -99,7 +99,9 @@ private void load(AudioManager audio, OsuConfigManager config, BeatmapManager be welcome = audio.Sample.Get(@"welcome"); seeya = audio.Sample.Get(@"seeya"); - beatmaps.Delete(setInfo); + + if (setInfo.Protected) + beatmaps.Delete(setInfo); } protected override void OnEntering(Screen last)