Deselect items that are gone due to merge or destruction

This commit is contained in:
Tyfon
2024-06-21 16:29:27 -07:00
parent 26ba6810ad
commit e33a0c7bbf
2 changed files with 46 additions and 9 deletions

View File

@@ -103,10 +103,20 @@ namespace UIFixes
__instance.TransferItemsScreen.GetOrAddComponent<DrawMultiSelect>();
__instance.ScavengerInventoryScreen.GetOrAddComponent<DrawMultiSelect>();
if (Settings.ShowMultiSelectDebug.Value)
void ToggleDebug()
{
Singleton<PreloaderUI>.Instance.GetOrAddComponent<MultiSelectDebug>();
}
if (Settings.ShowMultiSelectDebug.Value)
{
Singleton<PreloaderUI>.Instance.GetOrAddComponent<MultiSelectDebug>();
}
else
{
var debug = Singleton<PreloaderUI>.Instance.GetComponent<MultiSelectDebug>();
UnityEngine.Object.Destroy(debug);
}
};
ToggleDebug();
Settings.ShowMultiSelectDebug.SettingChanged += (s, a) => ToggleDebug();
}
}