mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
harmony fix annotation
This commit is contained in:
1 parent
c9ebb9348c
commit
55dac36e7d
5 files changed
+26
-13
No files matched your search
@@ -59,7 +59,8 @@ namespace MiraAPI.Patches
|
||||
/* /// <summary>
|
||||
/// Trigger hudstart on current custom gamemode
|
||||
/// </summary>
|
||||
[HarmonyPostfix, HarmonyPatch("OnGameStart")]
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("OnGameStart")]
|
||||
public static void GameStartPatch(HudManager __instance)
|
||||
{
|
||||
CustomGameModeManager.ActiveMode.HudStart(__instance);
|
||||
|
||||
@@ -13,7 +13,8 @@ namespace MiraAPI.Patches.Options;
|
||||
[HarmonyPatch(typeof(GameOptionsMenu))]
|
||||
public static class GameOptionsMenuPatch
|
||||
{
|
||||
[HarmonyPrefix, HarmonyPatch(nameof(GameOptionsMenu.CreateSettings))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(GameOptionsMenu.CreateSettings))]
|
||||
public static bool SettingsPatch(GameOptionsMenu __instance)
|
||||
{
|
||||
if (GameSettingMenuPatches.currentSelectedMod == 0) return true;
|
||||
@@ -98,7 +99,8 @@ public static class GameOptionsMenuPatch
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(nameof(GameOptionsMenu.Initialize))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(GameOptionsMenu.Initialize))]
|
||||
public static bool InitPatch(GameOptionsMenu __instance)
|
||||
{
|
||||
if (__instance.Children == null || __instance.Children.Count == 0)
|
||||
|
||||
@@ -7,7 +7,8 @@ namespace MiraAPI.Patches.Options
|
||||
[HarmonyPatch]
|
||||
public static class OptionsPatches
|
||||
{
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(ToggleOption), nameof(ToggleOption.Initialize))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ToggleOption), nameof(ToggleOption.Initialize))]
|
||||
public static bool ToggleInit(ToggleOption __instance)
|
||||
{
|
||||
if (!__instance.IsCustom()) return true;
|
||||
@@ -16,13 +17,15 @@ namespace MiraAPI.Patches.Options
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(ToggleOption), nameof(ToggleOption.UpdateValue))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ToggleOption), nameof(ToggleOption.UpdateValue))]
|
||||
public static bool ToggleUpdate(ToggleOption __instance)
|
||||
{
|
||||
return !__instance.IsCustom();
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(NumberOption), nameof(NumberOption.Initialize))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(NumberOption), nameof(NumberOption.Initialize))]
|
||||
public static bool NumberInit(NumberOption __instance)
|
||||
{
|
||||
if (!__instance.IsCustom()) return true;
|
||||
@@ -31,13 +34,15 @@ namespace MiraAPI.Patches.Options
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(NumberOption), nameof(NumberOption.UpdateValue))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(NumberOption), nameof(NumberOption.UpdateValue))]
|
||||
public static bool NumberUpdate(NumberOption __instance)
|
||||
{
|
||||
return !__instance.IsCustom();
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(StringOption), nameof(StringOption.Initialize))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(StringOption), nameof(StringOption.Initialize))]
|
||||
public static bool StringInit(StringOption __instance)
|
||||
{
|
||||
if (!__instance.IsCustom()) return true;
|
||||
@@ -47,7 +52,8 @@ namespace MiraAPI.Patches.Options
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(typeof(StringOption), nameof(StringOption.UpdateValue))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(StringOption), nameof(StringOption.UpdateValue))]
|
||||
public static bool StringUpdate(StringOption __instance)
|
||||
{
|
||||
return !__instance.IsCustom();
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace MiraAPI.Patches.Options
|
||||
[HarmonyPatch(typeof(RolesSettingsMenu))]
|
||||
public static class RoleSettingMenuPatches
|
||||
{
|
||||
[HarmonyPrefix, HarmonyPatch(nameof(RolesSettingsMenu.SetQuotaTab))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(RolesSettingsMenu.SetQuotaTab))]
|
||||
public static bool PatchStart(RolesSettingsMenu __instance)
|
||||
{
|
||||
__instance.roleChances = new Il2CppSystem.Collections.Generic.List<RoleOptionSetting>();
|
||||
@@ -66,7 +67,8 @@ namespace MiraAPI.Patches.Options
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix, HarmonyPatch(nameof(RolesSettingsMenu.Update))]
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(nameof(RolesSettingsMenu.Update))]
|
||||
public static bool UpdatePatch()
|
||||
{
|
||||
if (GameSettingMenuPatches.currentSelectedMod == 0)
|
||||
|
||||
@@ -17,7 +17,8 @@ public static class TaskAdderPatch
|
||||
public static TaskFolder RolesFolder;
|
||||
public static System.Collections.Generic.Dictionary<string, string> ModsFolders = new System.Collections.Generic.Dictionary<string, string>();
|
||||
|
||||
[HarmonyPostfix, HarmonyPatch(typeof(TaskAdderGame), nameof(TaskAdderGame.Begin))]
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(TaskAdderGame), nameof(TaskAdderGame.Begin))]
|
||||
public static void AddRolesFolder(TaskAdderGame __instance)
|
||||
{
|
||||
RolesFolder = Object.Instantiate(__instance.RootFolderPrefab, __instance.transform);
|
||||
@@ -42,7 +43,8 @@ public static class TaskAdderPatch
|
||||
__instance.GoToRoot();
|
||||
}
|
||||
|
||||
[HarmonyPostfix, HarmonyPatch(typeof(TaskAddButton), "Role", MethodType.Setter)]
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(TaskAddButton), "Role", MethodType.Setter)]
|
||||
public static void RoleGetterPatch(TaskAddButton __instance)
|
||||
{
|
||||
if (__instance.role is ICustomRole lpRole)
|
||||
|
||||
Reference in new issue
Block a user