From 09a2b287f9a227aa07b89463ac8c9948af6f9660 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Tue, 22 Jan 2019 18:29:30 +0100 Subject: [PATCH 1/9] Fix Tooltip not updating in special case When the Bindvalue of the Sliderbar gets changed by a line like "Bindable.Value = ..." the sliderbar will only update the nubs but wont run any methods which contain the updateToolTipText(T value) function. Example scenario: Two interlinked sliderbars which change the value of each other in certain cases. --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index e0f38a13d0..23766e22a1 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,6 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); + CurrentNumber.ValueChanged += _ => updateTooltipText(_); } protected override bool OnHover(HoverEvent e) @@ -126,7 +127,6 @@ namespace osu.Game.Graphics.UserInterface { base.OnUserChange(value); playSample(value); - updateTooltipText(value); } private void playSample(T value) From 3f96231b2f65fa700bb33c7363f7897fb294ee66 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Tue, 22 Jan 2019 19:34:26 +0100 Subject: [PATCH 2/9] convert to method group --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 23766e22a1..84e1882dea 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); - CurrentNumber.ValueChanged += _ => updateTooltipText(_); + CurrentNumber.ValueChanged += updateTooltipText; } protected override bool OnHover(HoverEvent e) From cabcfffdeb2960df5cb1fc4b0fee19e26253350b Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 01:16:37 +0100 Subject: [PATCH 3/9] Fix autoplay rewind/skip usable when UI hidden --- osu.Game/Screens/Play/HUDOverlay.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index dac05c23b1..8d50b58c3b 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -102,6 +102,7 @@ namespace osu.Game.Screens.Play { showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); + showHud.ValueChanged += v => Progress.AllowSeeking = v; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) From f01ba17d1f3ee0f73666a63ce315d3fe1cd78646 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:12:40 +0100 Subject: [PATCH 4/9] add check if replay is loaded before allowseeking can be overwitten --- osu.Game/Screens/Play/SongProgress.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 336f9cc430..a892b9afd6 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,7 +125,7 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; - + if (!replayLoaded) return; allowSeeking = value; updateBarVisibility(); } From 12503b4d074b1243a4fb986a0db87918c1106571 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:37:17 +0100 Subject: [PATCH 5/9] revert and make VisibilityContainer not AlwaysPresent --- osu.Game/Screens/Play/HUDOverlay.cs | 2 -- osu.Game/Screens/Play/SongProgress.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 8d50b58c3b..cbd36d75c6 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -48,7 +48,6 @@ namespace osu.Game.Screens.Play { visibilityContainer = new Container { RelativeSizeAxes = Axes.Both, - AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated Children = new Drawable[] { new Container { Anchor = Anchor.TopCentre, @@ -102,7 +101,6 @@ namespace osu.Game.Screens.Play { showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); - showHud.ValueChanged += v => Progress.AllowSeeking = v; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index a892b9afd6..328f54423d 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,7 +125,6 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; - if (!replayLoaded) return; allowSeeking = value; updateBarVisibility(); } From 13ba9d64d09a8fa2a8aa28bce02691368c23a655 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:56:00 +0100 Subject: [PATCH 6/9] revert empty line --- osu.Game/Screens/Play/SongProgress.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 328f54423d..336f9cc430 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,6 +125,7 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; + allowSeeking = value; updateBarVisibility(); } From 47181cf5d76c42904e7eb01653b960e36d57e94e Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 03:21:09 +0100 Subject: [PATCH 7/9] add back update in onUserChange --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 84e1882dea..294d7da40f 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -127,6 +127,7 @@ namespace osu.Game.Graphics.UserInterface { base.OnUserChange(value); playSample(value); + updateTooltipText(value); } private void playSample(T value) From fe5d34a6573895d70184fa96079eddbfa2508e61 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 03:25:56 +0100 Subject: [PATCH 8/9] replace as requested --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 294d7da40f..9db7af48b2 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); - CurrentNumber.ValueChanged += updateTooltipText; + CurrentNumber.BindValueChanged(updateTooltipText, true); } protected override bool OnHover(HoverEvent e) From 260011fc13a4066584ca834e1a994905aa4bae22 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 04:05:03 +0100 Subject: [PATCH 9/9] remove manual update misunderstood that earlier --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 9db7af48b2..26a5c11d5d 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -94,7 +94,6 @@ namespace osu.Game.Graphics.UserInterface protected override void LoadComplete() { - updateTooltipText(Current.Value); base.LoadComplete(); CurrentNumber.BindValueChanged(updateTooltipText, true); }