From ef7f33a766c540a0c83e071daa568dda85aec992 Mon Sep 17 00:00:00 2001 From: Arif Hendika Rios Date: Thu, 10 Oct 2024 14:44:06 +0700 Subject: [PATCH] v0.0.3 --- AssetStore/StringStore.cs | 8 ++++---- AssetStore/TextureStore.cs | 8 ++++---- Core.cs | 2 +- FileLoader.cs | 4 ++-- Patches/IZEMgr_Patch.cs | 4 +++- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/AssetStore/StringStore.cs b/AssetStore/StringStore.cs index 9b03085..7f5d83d 100644 --- a/AssetStore/StringStore.cs +++ b/AssetStore/StringStore.cs @@ -1,5 +1,4 @@ -#if USE_TRANSLATE -using Il2CppTMPro; +using Il2CppTMPro; using MelonLoader; using UnityEngine; using Il2Cpp; @@ -7,6 +6,7 @@ namespace PVZ_Hyper_Fusion.AssetStore { +#if USE_TRANSLATE public static class StringStore { internal static Dictionary stringsDict = new Dictionary(); @@ -507,5 +507,5 @@ public static void LogAll() Log.LogInfo("String Entries: {0}", translationString.Count); } } -} -#endif \ No newline at end of file +#endif +} \ No newline at end of file diff --git a/AssetStore/TextureStore.cs b/AssetStore/TextureStore.cs index 62c7dd3..42c0759 100644 --- a/AssetStore/TextureStore.cs +++ b/AssetStore/TextureStore.cs @@ -1,9 +1,9 @@ -#if USE_TEXTURE -using System.Collections; +using System.Collections; using UnityEngine; namespace PVZ_Hyper_Fusion.AssetStore { +#if USE_TEXTURE public static class TextureStore { internal static Dictionary textureDict = new Dictionary(); @@ -49,5 +49,5 @@ public static void LogAll() } } } -} -#endif \ No newline at end of file +#endif +} \ No newline at end of file diff --git a/Core.cs b/Core.cs index 1c8cd2a..a1469ad 100644 --- a/Core.cs +++ b/Core.cs @@ -5,7 +5,7 @@ using Il2CppTMPro; using PVZ_Hyper_Fusion.AssetStore; -[assembly: MelonInfo(typeof(PVZ_Hyper_Fusion.Core), "PVZ Hyper Fusion", "0.0.2", "arifrios1st", null)] +[assembly: MelonInfo(typeof(PVZ_Hyper_Fusion.Core), "PVZ Hyper Fusion", "0.0.3", "arifrios1st", null)] [assembly: MelonGame("LanPiaoPiao", "PlantsVsZombiesRH")] namespace PVZ_Hyper_Fusion diff --git a/FileLoader.cs b/FileLoader.cs index 5892ea0..694ea1e 100644 --- a/FileLoader.cs +++ b/FileLoader.cs @@ -96,7 +96,7 @@ internal static void SaveStrings() string translationStringRegex = JsonSerializer.Serialize(StringStore.translationStringRegex, new JsonSerializerOptions { WriteIndented = true, - Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }); File.WriteAllText(Path.Combine(stringDir, "translation_regexs.json"), translationStringRegex); @@ -104,7 +104,7 @@ internal static void SaveStrings() string translationString = JsonSerializer.Serialize(StringStore.translationString, new JsonSerializerOptions { WriteIndented = true, - Encoder = JavaScriptEncoder.Create(UnicodeRanges.All) + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }); File.WriteAllText(Path.Combine(stringDir, "translation_strings.json"), translationString); diff --git a/Patches/IZEMgr_Patch.cs b/Patches/IZEMgr_Patch.cs index 6b7bda5..90fc5fe 100644 --- a/Patches/IZEMgr_Patch.cs +++ b/Patches/IZEMgr_Patch.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +#if USE_TRANSLATE +using HarmonyLib; using Il2Cpp; using Il2CppTMPro; using PVZ_Hyper_Fusion.AssetStore; @@ -24,3 +25,4 @@ public static void Start(IZEMgr __instance) } } } +#endif \ No newline at end of file