mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Apply role menu toggle
This commit is contained in:
1 parent
54bfd3002b
commit
a57f40fa79
2 files changed
+7
-2
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user