mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
fix issue with hiding/showing options
This commit is contained in:
1 parent
f462a116d7
commit
f20e7459a4
1 file changed
+12
-3
@@ -32,16 +32,25 @@ public static class GameOptionsMenuPatch
|
||||
var num = 2.1f;
|
||||
var filteredGroups =
|
||||
GameSettingMenuPatches.SelectedMod?.OptionGroups.Where(
|
||||
x => x.GroupVisible.Invoke() && x.AdvancedRole is null) ?? [];
|
||||
x => x.AdvancedRole is null) ?? [];
|
||||
|
||||
foreach (var group in filteredGroups)
|
||||
{
|
||||
var filteredOpts = group.Options.Where(x => x.Visible.Invoke()).ToList();
|
||||
if (filteredOpts.Count == 0 || group.Header is null)
|
||||
if (group.Options.Count == 0 || group.Header is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!group.GroupVisible.Invoke())
|
||||
{
|
||||
group.Header.gameObject.SetActive(false);
|
||||
foreach (var option in group.Options)
|
||||
{
|
||||
option.OptionBehaviour?.gameObject.SetActive(false);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
group.Header.gameObject.SetActive(true);
|
||||
group.Header.transform.localScale = Vector3.one * 0.63f;
|
||||
group.Header.transform.localPosition = new Vector3(-0.903f, num, -2f);
|
||||
|
||||
Reference in new issue
Block a user