36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
using System.Reflection.Emit;
|
|
|
|
using HarmonyLib;
|
|
|
|
internal class Dayuppy_ZoomMapPatches
|
|
{
|
|
[HarmonyPatch]
|
|
public class XUiC_MapAreaUpdate
|
|
{
|
|
private static IEnumerable<MethodInfo> TargetMethods()
|
|
{
|
|
yield return AccessTools.Method(typeof(XUiC_MapArea), nameof(XUiC_MapArea.Update));
|
|
yield return AccessTools.Method(typeof(XUiC_MapArea), "onMapScrolled");
|
|
}
|
|
|
|
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
|
{
|
|
List<CodeInstruction> codes = new List<CodeInstruction>(instructions);
|
|
|
|
float newMaxZoomOut = 50f;
|
|
|
|
for(int i = 0; i < codes.Count; i++)
|
|
{
|
|
if(codes[i].opcode == OpCodes.Ldc_R4 && codes[i].operand is 6.15f)
|
|
{
|
|
codes[i].operand = newMaxZoomOut;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return codes;
|
|
}
|
|
}
|
|
} |