From 84e3f4085e9e1f582ed278af42b2483a3a01cc8f Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Sun, 18 May 2025 14:44:13 -0400 Subject: [PATCH] fix role settings bug --- .../Patches/Options/GameSettingMenuPatches.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs index 9332afe5..9b8d3a2b 100644 --- a/MiraAPI/Patches/Options/GameSettingMenuPatches.cs +++ b/MiraAPI/Patches/Options/GameSettingMenuPatches.cs @@ -411,6 +411,21 @@ internal static class GameSettingMenuPatches private static void CleanupTab(GameOptionsMenu settings, RolesSettingsMenu roles) { + if (roles.roleChances != null) + { + CleanupRoleSettings(roles); + } + + if (settings.Children != null) + { + CleanupSettings(settings); + } + + if (_modifiersTab?.Children?.Count > 0) + { + CleanupSettings(_modifiersTab); + } + void CleanupRoleSettings(RolesSettingsMenu rolesMenu) { if (rolesMenu.advancedSettingChildren != null) @@ -467,20 +482,5 @@ internal static class GameSettingMenuPatches gameOptMenu.scrollBar.ScrollToTop(); } } - - if (roles.roleChances != null && SelectedMod?.InternalRoles.Count > 0) - { - CleanupRoleSettings(roles); - } - - if (settings.Children != null && SelectedMod?.InternalOptionGroups.Count > 0) - { - CleanupSettings(settings); - } - - if (_modifiersTab?.Children?.Count > 0) - { - CleanupSettings(_modifiersTab); - } } }