Apply role menu toggle

This commit is contained in:
Atony committed 2026-08-12 23:17:29 -05:00
1 parent 54bfd3002b
commit a57f40fa79
2 files changed
+7 -2

No files matched your search

+4 -1
View File
@@ -61,7 +61,6 @@ public static class GameModeOption
Values.Add(mode.ID, CustomStringName.CreateAndRegister(mode.ColoredName));
}
[HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.CreateSettings))]
[HarmonyPostfix]
private static void CreateSettingsPatch(GameOptionsMenu __instance)
@@ -124,6 +123,10 @@ public static class GameModeOption
{
Info($"Game mode changed to {option.GetInt()}");
RpcSyncGamemode(PlayerControl.LocalPlayer, option.GetInt());
if (GameSettingMenu.Instance && CustomGameModeManager.ActiveMode != null)
{
GameSettingMenu.Instance.RoleSettingsButton.gameObject.SetActive(CustomGameModeManager.ActiveMode.ShowNormalRoleSettings);
}
return false;
}
return true;
+3 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Il2CppInterop.Runtime.Attributes;
using MiraAPI.GameModes;
using MiraAPI.GameOptions;
using MiraAPI.Modifiers;
using MiraAPI.PluginLoading;
@@ -404,7 +405,8 @@ public class MenuState(IntPtr cppPtr) : MonoBehaviour(cppPtr)
if (CurrentModIdx == 0)
{
Gsm.GameSettingsButton.gameObject.SetActive(true);
Gsm.RoleSettingsButton.gameObject.SetActive(true);
Gsm.RoleSettingsButton.gameObject.SetActive(
CustomGameModeManager.ActiveMode != null && CustomGameModeManager.ActiveMode.ShowNormalRoleSettings);
}
else
{