Ensure tool is always set back to select tool when beatmap becomes untimed

This commit is contained in:
Dean Herbert 2021-07-19 17:08:40 +09:00
parent bde35d9f21
commit b29209d13f
1 changed files with 11 additions and 0 deletions

View File

@ -6,6 +6,7 @@
using System.Collections.Specialized;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
@ -67,6 +68,8 @@ public abstract class HitObjectComposer<TObject> : HitObjectComposer, IPlacement
private FillFlowContainer togglesCollection;
private IBindable<bool> hasTiming;
protected HitObjectComposer(Ruleset ruleset)
{
Ruleset = ruleset;
@ -160,6 +163,14 @@ protected override void LoadComplete()
base.LoadComplete();
inputManager = GetContainingInputManager();
hasTiming = EditorBeatmap.HasTiming.GetBoundCopy();
hasTiming.BindValueChanged(timing =>
{
// it's important this is performed before the similar code in EditorRadioButton disables the button.
if (!timing.NewValue)
setSelectTool();
});
}
public override Playfield Playfield => drawableRulesetWrapper.Playfield;