From 462dab3c90d762de0c9c0918d93fe90472956a06 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2024 02:13:39 +0900 Subject: [PATCH] Remove unnecessary bindable --- osu.Game/Screens/Play/HUD/DefaultSongProgressBar.cs | 11 +++++++---- osu.Game/Screens/Play/HUD/SongProgressBar.cs | 9 +-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/DefaultSongProgressBar.cs b/osu.Game/Screens/Play/HUD/DefaultSongProgressBar.cs index 05c8c6c46b..d5a6a75793 100644 --- a/osu.Game/Screens/Play/HUD/DefaultSongProgressBar.cs +++ b/osu.Game/Screens/Play/HUD/DefaultSongProgressBar.cs @@ -86,11 +86,14 @@ namespace osu.Game.Screens.Play.HUD }; } - protected override void LoadComplete() + public override bool Interactive { - base.LoadComplete(); - - InteractiveBindable.BindValueChanged(i => handleBase.FadeTo(i.NewValue ? 1 : 0, 200), true); + get => base.Interactive; + set + { + base.Interactive = value; + handleBase.FadeTo(value ? 1 : 0, 200); + } } protected override void Update() diff --git a/osu.Game/Screens/Play/HUD/SongProgressBar.cs b/osu.Game/Screens/Play/HUD/SongProgressBar.cs index ea2e5b2891..40c4e587b9 100644 --- a/osu.Game/Screens/Play/HUD/SongProgressBar.cs +++ b/osu.Game/Screens/Play/HUD/SongProgressBar.cs @@ -3,7 +3,6 @@ using System; using osu.Framework.Allocation; -using osu.Framework.Bindables; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; using osu.Framework.Threading; @@ -35,13 +34,7 @@ namespace osu.Game.Screens.Play.HUD /// /// Whether the progress bar should allow interaction, ie. to perform seek operations. /// - public bool Interactive - { - get => InteractiveBindable.Value; - set => InteractiveBindable.Value = value; - } - - protected readonly BindableBool InteractiveBindable = new BindableBool(); + public virtual bool Interactive { get; set; } public double StartTime { get; set; }