Skip to content

Commit

Permalink
Add IDs to harmony hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Sep 14, 2021
1 parent 8842f58 commit d1f5385
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/AIHS2_Core_Screencap/ScreenshotManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private static class Hooks
{
public static void Apply()
{
var h = Harmony.CreateAndPatchAll(typeof(Hooks));
var h = Harmony.CreateAndPatchAll(typeof(Hooks), GUID);

var msvoType = Type.GetType("UnityEngine.Rendering.PostProcessing.MultiScaleVO, Unity.Postprocessing.Runtime");
h.Patch(AccessTools.Method(msvoType, "PushAllocCommands"), transpiler: new HarmonyMethod(typeof(Hooks), nameof(AoBandingFix)));
Expand Down
2 changes: 1 addition & 1 deletion src/AI_ConfigurationManager/AI.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private void Start()

if (!Constants.InsideStudio)
{
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper));
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper), GUID);
// Main game is handled by the hooks, Update is only for studio
enabled = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/AI_SliderUnlocker/AI.SliderUnlocker.Hair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal static class HairUnlocker
{
public static void Init()
{
Harmony.CreateAndPatchAll(typeof(HairUnlocker));
Harmony.CreateAndPatchAll(typeof(HairUnlocker), nameof(HairUnlocker));
}

// Fix first pos value limit
Expand Down
2 changes: 1 addition & 1 deletion src/AI_SliderUnlocker/AI.SliderUnlocker.VoicePitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class VoicePitchUnlocker

public static void Init()
{
Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker));
Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker));
}

[HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)]
Expand Down
2 changes: 1 addition & 1 deletion src/Core_ExtensibleSaveFormat/Core.ExtendedSave.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static partial class Hooks

internal static void InstallHooks()
{
Harmony.CreateAndPatchAll(typeof(Hooks));
Harmony.CreateAndPatchAll(typeof(Hooks), GUID);
}

#region ChaFile
Expand Down
2 changes: 1 addition & 1 deletion src/Core_Screencap/Core.ScreenshotManager.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static partial class Hooks
/// <summary> Chara card Render/Downsample rate.</summary>
private static int CardRenderRate => ScreenshotManager.CardDownscalingRate.Value;

public static void InstallHooks() => Harmony.CreateAndPatchAll(typeof(Hooks));
public static void InstallHooks() => Harmony.CreateAndPatchAll(typeof(Hooks), ScreenshotManager.GUID);
/// <summary>
/// Cancel the vanilla screenshot
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Core_Screencap/Renderers/I360Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void Init()
paddingX = Shader.PropertyToID("_PaddingX");
ab.Unload(false);

Harmony.CreateAndPatchAll(typeof(I360Render));
Harmony.CreateAndPatchAll(typeof(I360Render), nameof(I360Render));
}

// Fix mirrors messing up the capture by blindly inverting culling
Expand Down
2 changes: 1 addition & 1 deletion src/Core_Sideloader/Core.Sideloader.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static partial class Hooks
{
internal static void InstallHooks()
{
var harmony = Harmony.CreateAndPatchAll(typeof(Hooks));
var harmony = Harmony.CreateAndPatchAll(typeof(Hooks), GUID);
#if KK || KKS
harmony.Patch(typeof(GlobalMethod).GetMethod(nameof(GlobalMethod.LoadAllFolder), AccessTools.all).MakeGenericMethod(typeof(Object)),
null, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(LoadAllFolderPostfix), AccessTools.all)));
Expand Down
2 changes: 1 addition & 1 deletion src/Core_Sideloader/Core.Sideloader.ListLoader.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static partial class Lists
{
internal static partial class Hooks
{
internal static void InstallHooks() => Harmony.CreateAndPatchAll(typeof(Hooks));
internal static void InstallHooks() => Harmony.CreateAndPatchAll(typeof(Hooks), "Sideloader.ListLoader");

[HarmonyPrefix, HarmonyPatch(typeof(ChaListControl), nameof(ChaListControl.CheckItemID), typeof(int), typeof(int))]
private static bool CheckItemIDHook(int category, int id, ref byte __result, ChaListControl __instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static partial class Hooks

internal static void InstallHooks()
{
Harmony.CreateAndPatchAll(typeof(Hooks));
Harmony.CreateAndPatchAll(typeof(Hooks), "Sideloader.UniversalAutoResolver");

ExtendedSave.CardBeingLoaded += ExtendedCardLoad;
ExtendedSave.CardBeingSaved += ExtendedCardSave;
Expand Down
2 changes: 1 addition & 1 deletion src/Core_SliderUnlocker/Core.SliderUnlocker.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static partial class Hooks
{
public static void InstallHooks()
{
var hi = Harmony.CreateAndPatchAll(typeof(Hooks));
var hi = Harmony.CreateAndPatchAll(typeof(Hooks), SliderUnlocker.GUID);

#if !PH && !HS
var nomF = typeof(ChaFileDefine).GetField("cf_SteamShapeLimit", AccessTools.all);
Expand Down
2 changes: 1 addition & 1 deletion src/EC_ConfigurationManager/EC.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private void Start()
_manager = GetComponent<ConfigurationManager.ConfigurationManager>();
_manager.OverrideHotkey = true;

Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper));
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper), GUID);
}

[HarmonyPostfix, HarmonyPatch(typeof(ConfigScene), nameof(ConfigScene.Start))]
Expand Down
2 changes: 1 addition & 1 deletion src/HS2_ConfigurationManager/HS2.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void Start()
bool mainGame = Application.productName == Constants.GameProcessName;
if (mainGame)
{
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper));
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper), GUID);
//Main game is handled by the hooks, disable this plugin to prevent Update from running
enabled = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/HS2_SliderUnlocker/HS2.SliderUnlocker.Hair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal static class HairUnlocker
{
public static void Init()
{
Harmony.CreateAndPatchAll(typeof(HairUnlocker));
Harmony.CreateAndPatchAll(typeof(HairUnlocker), nameof(HairUnlocker));
}

// Fix first pos value limit
Expand Down
2 changes: 1 addition & 1 deletion src/HS2_SliderUnlocker/HS2.SliderUnlocker.VoicePitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class VoicePitchUnlocker

public static void Init()
{
Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker));
Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker));
}

[HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)]
Expand Down
2 changes: 1 addition & 1 deletion src/KKS_ConfigurationManager/KKS_ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private void Start()
bool mainGame = Application.productName == Constants.GameProcessName;
if (mainGame)
{
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper));
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper), GUID);
//Main game is handled by the hooks, disable this plugin to prevent Update from running
enabled = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/KKS_SliderUnlocker/KKS.SliderUnlocker.VoicePitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static class VoicePitchUnlocker

public static void Init()
{
Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker));
Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker));
}

[HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)]
Expand Down
2 changes: 1 addition & 1 deletion src/KK_ConfigurationManager/KK.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void Start()
bool mainGame = Application.productName == Constants.GameProcessName || Application.productName == Constants.GameProcessNameSteam;
if (mainGame)
{
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper));
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper), GUID);
//Main game is handled by the hooks, disable this plugin to prevent Update from running
enabled = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/KK_SliderUnlocker/KK.SliderUnlocker.VoicePitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static class VoicePitchUnlocker

public static void Init()
{
var harmony = Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker));
var harmony = Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker));

var iteratorType = typeof(CvsChara).GetNestedType("<SetInputText>c__Iterator0", AccessTools.all);
var iteratorMethod = AccessTools.Method(iteratorType, "MoveNext");
Expand Down
2 changes: 1 addition & 1 deletion src/PH_ConfigurationManager/PH.ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void Start()
if (Constants.InsideStudio)
return;

Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper));
Harmony.CreateAndPatchAll(typeof(ConfigurationManagerWrapper), GUID);
enabled = false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/PH_ExtensibleSaveFormat/ExtendedSave.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static partial class Hooks
{
internal static void InstallHooks()
{
var h = Harmony.CreateAndPatchAll(typeof(Hooks));
var h = Harmony.CreateAndPatchAll(typeof(Hooks), GUID);

// Just some casual prefix patches overriding the whole method, if it exists we need to patch it instead of the original method
foreach (var typeToPatch in new[]
Expand Down

0 comments on commit d1f5385

Please sign in to comment.