mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-13 05:37:27 +08:00
Merge branch 'v1-dev' into v1-dev
This commit is contained in:
@@ -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
32
AquaMai/Fix/FontFix.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user