target non public getters and setters

This commit is contained in:
Az committed 2026-10-15 03:10:38 -04:00
1 parent f08a00ded7
commit 7ed3944ad1
2 files changed
+6 -7

No files matched your search

@@ -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)
+6 -6
View File
@@ -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<MiraApiPlugin>.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<MiraApiPlugin>.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<MiraApiPlugin>.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<MiraApiPlugin>.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<MiraApiPlugin>.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<MiraApiPlugin>.Instance.Harmony.Patch(listGetterOriginal, prefix: new HarmonyMethod(listGetterPatch));
}