Upload from upload_mods.ps1
This commit is contained in:
36
Dayuppy/Harmony/Inactive/Harmony_ZoomMapPatch.cs
Normal file
36
Dayuppy/Harmony/Inactive/Harmony_ZoomMapPatch.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user