diff --git a/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionVisibilityAttribute.cs b/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionVisibilityAttribute.cs index 1077e58..72c35b0 100644 --- a/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionVisibilityAttribute.cs +++ b/MiraAPI/GameOptions/Attributes/Delegate/ModdedOptionVisibilityAttribute.cs @@ -80,7 +80,6 @@ public sealed class ModdedOptionVisibilityAttribute(string? memberName = null, T } var dynamicMethod = new DynamicMethod($"GetVisibility_{type.Name}_{field.Name}", typeof(bool), Type.EmptyTypes, type, true); - var il = dynamicMethod.GetILGenerator(); if (instanceGetter != null) diff --git a/MiraAPI/GameOptions/ModdedOptionsManager.cs b/MiraAPI/GameOptions/ModdedOptionsManager.cs index 9959832..4dc150f 100644 --- a/MiraAPI/GameOptions/ModdedOptionsManager.cs +++ b/MiraAPI/GameOptions/ModdedOptionsManager.cs @@ -164,11 +164,11 @@ public static class ModdedOptionsManager return; } - var setterOriginal = property.GetSetMethod(); + var setterOriginal = property.GetSetMethod(true); var setterPatch = typeof(ModdedOptionsManager).GetMethod(nameof(PropertySetterPatch)); PluginSingleton.Instance.Harmony.Patch(setterOriginal, postfix: new HarmonyMethod(setterPatch)); - var getterOriginal = property.GetGetMethod(); + var getterOriginal = property.GetGetMethod(true); var getterPatch = typeof(ModdedOptionsManager).GetMethod(nameof(PropertyGetterPatch)); PluginSingleton.Instance.Harmony.Patch(getterOriginal, prefix: new HarmonyMethod(getterPatch)); @@ -269,11 +269,11 @@ public static class ModdedOptionsManager return; } - var setterOriginal = property.GetSetMethod(); + var setterOriginal = property.GetSetMethod(true); var setterPatch = typeof(ModdedOptionsManager).GetMethod(nameof(PropertySetterPatch)); PluginSingleton.Instance.Harmony.Patch(setterOriginal, postfix: new HarmonyMethod(setterPatch)); - var getterOriginal = property.GetGetMethod(); + var getterOriginal = property.GetGetMethod(true); var getterPatch = typeof(ModdedOptionsManager).GetMethod(nameof(PropertyGetterPatch)); PluginSingleton.Instance.Harmony.Patch(getterOriginal, prefix: new HarmonyMethod(getterPatch)); @@ -283,11 +283,11 @@ public static class ModdedOptionsManager { var listIndex = listType.GetProperty("Item")!; - var listSetterOriginal = listIndex.GetSetMethod(); + var listSetterOriginal = listIndex.GetSetMethod(true); var listSetterPatch = typeof(ModdedOptionsManager).GetMethod(nameof(PropertyListSetterPatch)); PluginSingleton.Instance.Harmony.Patch(listSetterOriginal, postfix: new HarmonyMethod(listSetterPatch)); - var listGetterOriginal = listIndex.GetGetMethod(); + var listGetterOriginal = listIndex.GetGetMethod(true); var listGetterPatch = typeof(ModdedOptionsManager).GetMethod(nameof(PropertyListGetterPatch)); PluginSingleton.Instance.Harmony.Patch(listGetterOriginal, prefix: new HarmonyMethod(listGetterPatch)); }