From 85b949a58babad4f236321a44885da187ea621ca Mon Sep 17 00:00:00 2001 From: henryz Date: Mon, 3 Nov 2025 16:00:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87=E9=99=90=E5=88=B6v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HsMod/Patcher.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/HsMod/Patcher.cs b/HsMod/Patcher.cs index a65b3e14..46e5d85b 100644 --- a/HsMod/Patcher.cs +++ b/HsMod/Patcher.cs @@ -313,10 +313,23 @@ public static bool PatchAspectRatioWithinLimit(ref bool __result, int width, int { __result = true; return false; - } - - //命令行修改分辨率,阻止炉石自修改 - [HarmonyPrefix] + } + //移除分辨率限制V2 + [HarmonyPrefix] + [HarmonyPatch(typeof(ResizeManagerV2), "Update")] + public static void PatchUpdate(object __instance) + { + // 反射拿私有字段 m_minResolutionResizeDelay + var f = AccessTools.Field(__instance.GetType(), "m_minResolutionResizeDelay"); + if (f != null) + { + f.SetValue(__instance, Time.time + 10.0f); + } + // 不用 return false,继续跑原方法即可 + } + + //命令行修改分辨率,阻止炉石自修改 + [HarmonyPrefix] [HarmonyPatch(typeof(Screen), "SetResolution", new Type[] { typeof(int), typeof(int), typeof(bool) })] public static bool PatchSetResolution(ref int width, ref int height, ref bool fullscreen) { From c8c41aa0fec7916448f725c3fe2b48185a04513a Mon Sep 17 00:00:00 2001 From: Pik-4 <88079004+Pik-4@users.noreply.github.com> Date: Mon, 3 Nov 2025 19:18:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E8=BE=A8?= =?UTF-8?q?=E7=8E=87=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HsMod/Patcher.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/HsMod/Patcher.cs b/HsMod/Patcher.cs index 46e5d85b..30a367fb 100644 --- a/HsMod/Patcher.cs +++ b/HsMod/Patcher.cs @@ -315,18 +315,13 @@ public static bool PatchAspectRatioWithinLimit(ref bool __result, int width, int return false; } //移除分辨率限制V2 - [HarmonyPrefix] - [HarmonyPatch(typeof(ResizeManagerV2), "Update")] - public static void PatchUpdate(object __instance) - { - // 反射拿私有字段 m_minResolutionResizeDelay - var f = AccessTools.Field(__instance.GetType(), "m_minResolutionResizeDelay"); - if (f != null) - { - f.SetValue(__instance, Time.time + 10.0f); - } - // 不用 return false,继续跑原方法即可 - } + [HarmonyPrefix] + [HarmonyPatch(typeof(ResizeManagerV2), "Update")] + public static bool PatchResizeManagerV2Update(ref float ___m_minResolutionResizeDelay) + { + ___m_minResolutionResizeDelay = UnityEngine.Time.time + 114514; + return true; + } //命令行修改分辨率,阻止炉石自修改 [HarmonyPrefix]