Merge branch 'v1-dev' into v1-dev

This commit is contained in:
凌莞~(=^▽^=)
2024-10-04 19:23:16 +08:00
committed by GitHub
15 changed files with 4801 additions and 58 deletions

View File

@@ -47,14 +47,6 @@ public class BasicFix
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(NetHttpClient), "CheckServerHash")]
private static bool CheckServerHash(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(GameManager), "CalcSpecialNum")]
private static bool CalcSpecialNum(ref int __result)
@@ -81,4 +73,12 @@ public class BasicFix
break;
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(NetHttpClient), "CheckServerHash")]
private static bool CheckServerHash(ref bool __result)
{
__result = true;
return false;
}
}

32
AquaMai/Fix/FontFix.cs Normal file
View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using HarmonyLib;
using MelonLoader;
using TMPro;
using UnityEngine;
using UnityEngine.TextCore.LowLevel;
namespace AquaMai.Fix;
public class FontFix
{
private static TMP_FontAsset fontAsset;
private static List<TMP_FontAsset> fixedFonts = [];
public static void DoCustomPatch(HarmonyLib.Harmony h)
{
var font = new Font(@"C:\Windows\Fonts\msyhbd.ttc");
fontAsset = TMP_FontAsset.CreateFontAsset(font, 90, 9, GlyphRenderMode.SDFAA, 8192, 8192);
}
[HarmonyPatch(typeof(TextMeshProUGUI), "Awake")]
[HarmonyPostfix]
public static void PostFix(TextMeshProUGUI __instance)
{
if (fixedFonts.Contains(__instance.font)) return;
# if DEBUG
MelonLogger.Msg($"[FontFix] Fixing font: {__instance.font.name}");
# endif
__instance.font.fallbackFontAssetTable.Add(fontAsset);
fixedFonts.Add(__instance.font);
}
}