Fix song select touch handler causing crashes when song select is suspended

This commit is contained in:
Bartłomiej Dach 2023-10-31 13:54:18 +01:00
parent ef555ed0cf
commit c588f434e5
No known key found for this signature in database
1 changed files with 7 additions and 3 deletions

View File

@ -32,14 +32,18 @@ protected override void LoadComplete()
{
base.LoadComplete();
ruleset.BindValueChanged(_ => updateState());
mods.BindValueChanged(_ => updateState());
touchActive.BindValueChanged(_ => updateState());
ruleset.BindValueChanged(_ => Scheduler.AddOnce(updateState));
mods.BindValueChanged(_ => Scheduler.AddOnce(updateState));
mods.BindDisabledChanged(_ => Scheduler.AddOnce(updateState));
touchActive.BindValueChanged(_ => Scheduler.AddOnce(updateState));
updateState();
}
private void updateState()
{
if (mods.Disabled)
return;
var touchDeviceMod = ruleset.Value.CreateInstance().GetTouchDeviceMod();
if (touchDeviceMod == null)