diff --git a/.gram/settings.jsonc b/.gram/settings.jsonc new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.idea.PvZ Fusion Translator/.idea/material_theme_project_new.xml b/.idea/.idea.PvZ Fusion Translator/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..301d842 --- /dev/null +++ b/.idea/.idea.PvZ Fusion Translator/.idea/material_theme_project_new.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/BepInEx/AssetStore/AudioStore.cs b/BepInEx/AssetStore/AudioStore.cs deleted file mode 100644 index 6bc8c04..0000000 --- a/BepInEx/AssetStore/AudioStore.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using UnityEngine; -using AudioImportLib.BepInEx; -using BepInEx.Logging; -using System.Runtime; -using System.Runtime.InteropServices; -using System.Reflection; -using System.IO; -using BepInEx; -using BepInEx.Configuration; - -namespace PvZ_Fusion_Translator__BepInEx_ -{ - internal class AudioStore - { - public static Dictionary AudioClips = []; - public static Dictionary AudioClipNames = []; - public static ManualLogSource Log = Core.Log; - - public static ConfigEntry LogSounds; - public static ConfigEntry category; - - private static bool overrideEnabled; - public static string customAudioPath = Path.Combine(Paths.PluginPath, "PvZ_Fusion_Translator", "[Custom Audios]"); - private static readonly string[] allowedExts = [".wav", ".mp3", ".ogg"]; - -#if AUDIO_TESTING - public Canvas Canvas { get; set; } - public RectTransform songRectTransform { get; private set; } -#endif - - public static void Init() - { - LoadAudios(); - } - public static void LoadAudios() - { - try - { - // Clear existing dictionaries to prevent duplicate key errors - AudioClips.Clear(); - AudioClipNames.Clear(); - - if (!Directory.Exists(customAudioPath)) - Directory.CreateDirectory(customAudioPath); - - string[] audioFiles = Directory.GetFiles(customAudioPath, "*", SearchOption.AllDirectories); - var ovrClip = audioFiles.SingleOrDefault(f => Path.GetFileNameWithoutExtension(f) == "REPLACE_ALL"); - if (ovrClip == null) - { - foreach (string file in audioFiles) - { - if (!allowedExts.Contains(Path.GetExtension(file))) - continue; - - AudioClip clip = AudioImportLib.BepInEx.API.LoadAudioClip(file); - AudioClips.Add(clip.name, clip); - Log.LogInfo("Added Override: " + clip.name); - } - } - else - { - AudioClip clip = AudioImportLib.BepInEx.API.LoadAudioClip(ovrClip); - AudioClips.Add(clip.name, clip); - overrideEnabled = true; - Log.LogInfo("Added Override: " + clip.name); - } - } - catch (Exception ex) - { - Log.LogError($"Error loading audio clips: {ex.Message}"); - } - } - -#if AUDIO_TESTING - public static void InitializeCanvas() - { - - Transform canvasTransform; - - if (canvas != null) return; // Prevent duplicate canvas creation - - canvas = new GameObject("AudioSourceCanvas").AddComponent(); - canvas.renderMode = RenderMode.ScreenSpaceOverlay; - - CanvasScaler scaler = canvas.gameObject.AddComponent(); - scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; - scaler.referenceResolution = new Vector2(1920, 1080); - - canvas.gameObject.AddComponent(); - - // Add a RectTransform for positioning text - GameObject songTextObject = new GameObject("SongText"); - songTextObject.transform.SetParent(canvas.transform); - - songRectTransform = songTextObject.AddComponent(); - songRectTransform.anchorMin = new Vector2(1, 1); // Top-right corner - songRectTransform.anchorMax = new Vector2(1, 1); - songRectTransform.pivot = new Vector2(1, 1); - songRectTransform.anchoredPosition = new Vector2(-20, -20); // Adjust margin - - // Add a TextMeshPro component for the text - var textComponent = songTextObject.AddComponent(); - textComponent.alignment = TextAlignmentOptions.Right; - textComponent.fontSize = 24; - textComponent.color = Color.white; - textComponent.text = "Current Song: None"; // Placeholder - } - - - public static void AudioSources() - { - if (!Directory.Exists(customAudioPath)) - Directory.CreateDirectory(customAudioPath); - string path = Path.Combine(customAudioPath, "audio_source.json"); - if (!File.Exists(path)) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - return; - } - string json; - json = File.ReadAllText(path); - - AudioClipNames = JsonSerializer.Deserialize>(json); - } - - public static (string, string) GetAudioSource(string clipName) - { - if (AudioClipNames.TryGetValue(clipName, out var audioSource)) - { - return audioSource; - } - else - { - return ("Music", "Source Unknown"); - } - } - - - public static void UpdateAudioSourceText(string clipName, string sourceName) - { - if (songRectTransform == null) InitializeCanvas(); - - var textComponent = songRectTransform.GetComponent(); - if (textComponent != null) - { - textComponent.text = $"Current Song: {clipName}\nSource: {sourceName}"; - } - } -#endif - - [HarmonyPatch(typeof(AudioSource), "Play", [])] - public class AudioSource_Patch - { - public static void Prefix(AudioSource __instance) - { - if (Utils.customAudio) - { - if (__instance.clip == null) - return; - - string audioClipName = overrideEnabled ? "REPLACE_ALL" : __instance.clip.name; - - if (AudioClips.TryGetValue(audioClipName, out AudioClip replaceClip)) - { - __instance.pitch = 1; - - __instance.clip = replaceClip; - } - } - } - } - } -} \ No newline at end of file diff --git a/BepInEx/AssetStore/CheckSumStore.cs b/BepInEx/AssetStore/CheckSumStore.cs deleted file mode 100644 index 7ff0704..0000000 --- a/BepInEx/AssetStore/CheckSumStore.cs +++ /dev/null @@ -1,862 +0,0 @@ -#if OBFUSCATE -using System.Security.Cryptography; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.IO; -using static Newtonsoft.Json.JsonConvert; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; -using System.Collections.Generic; -using System; - -namespace PvZ_Fusion_Translator__BepInEx_.AssetStore -{ - internal class CheckSumStore - { - private static Dictionary modifiedCheckSums = new Dictionary(); - - private static Dictionary checkSums = new Dictionary() - { - #if !RELEASE || RELEASE - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_CloseButton" , "G/++rbb7GMZv51CxHKdVINtAji/x9zyyhlcbCCWyP2s=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_CloseButtonHighlight" , "nNygYVELdiLcY0xbk0I1uX92NRazxns+I1u7p0M/e4w=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundDay" , "pExENxFbAGfBzLByFps1SX9AN1H6cL0QQK0jOFn3qu8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundNight" , "n3LXi5yONzLVTc0eNStQtLdlcEsihCi5iImxbB7rMdY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundNightPool" , "fe6efxJzsAn3i75Wg7WrCyAFVQhMKXnzh+uThkCJXV4=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundPool" , "yKlIHtnBPI8tiUnlRCHYcCnqwarpiuzfOj4H3yGn40o=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundRoof" , "cYTj11LkhWuJxO8j4h+s6+AG4JtgfZ2jfL4P/rWzGfc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_Imitater" , "9BD3A5dWXxgklYK4TTQ/G7d8A8OtZHgZrnq3hIrSlDY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_IndexBack" , "KqSOHoWk3g/Vd1vtwL1X5X33ft8TkxHnupydPB/f8lI=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_IndexButton" , "GWE8iGEa9rVJW3TGG0j2la9VwlxrJ/LfnLu0OMKxMZg=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_IndexButtonHighlight" , "kbz2ezXWjIGUC7Q0k3cagXMuRLpnU7l4xGiX7WdSMJE=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_PlantCard" , "lLnAYniK6sDgRW62t1Q/GGh9zIWkBOia+oFzntBBjx8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieBack" , "r3fcC00ZRR8vQUTsPRj339mQZi4/pFcL4rewSbRtM7E=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieCard" , "Fp2qKy2IpiEkA1hZrgXgrxyOA6hteIEQ8sqPrOkaaI4=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieWindow" , "mRlpQuXwIiUhKwkZXcK8sDZ6aQKnl43Y5Pbw5NMsKmk=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieWindow2" , "GPvh5nRvUqJMjRHwhqC4SUUB3BUKfCgTk6AWO8eGq/M=" }, - { "Dumps\\Default Textures [Do Not Remove]\\CursorClick" , "r7q8kCmXo9FHCC00VPswxjsGba2OMpE4UzBByode7KI=" }, - { "Dumps\\Default Textures [Do Not Remove]\\CursorDefault" , "xUv6VFWl/tzVsUa5heAlzlOyFjdzXsX9kT7EobZTIFQ=" }, - { "Dumps\\Default Textures [Do Not Remove]\\garden_new" , "jkDprxF6ApST91S4TzAGyzj2MC9umC8XCaasbstkBt8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\MainMenu" , "e2lbkFcEN6hqwDk3A0SHZJu7PwEcol1u/QZtvpq71gc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\MainMenutravel" , "fvORSzOzZ6sNDHL3qC/eA7tExSe/TsLIBswcuuFgFZ4=" }, - { "Dumps\\Default Textures [Do Not Remove]\\plant" , "ophzSlF5tmOXKn/2lHZUYiE4pMibPTqBvfQMnuBSzb8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Present" , "YHoZLVSxMkA8c2u2RCP1tJbFFZZxeulpuGTGp7AtpWA=" }, - { "Dumps\\Default Textures [Do Not Remove]\\PresentOpen" , "TL+KhicnGWIIOcEyMdTErS1SyBO5citeF37g3CxRiuo=" }, - { "Dumps\\Default Textures [Do Not Remove]\\PresentOpenZ" , "Ij60phw5j3rhjwMyGiVUOuvp0lelEJqtYQHEECc6l14=" }, - { "Dumps\\Default Textures [Do Not Remove]\\PresentZ" , "fZF3EH0YB37P7j1LBJN9jIwniyCy1Oe2Tw2BsSGc4iA=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedBank" , "BjG7XCi4XIPZO+NHAgksjgSUoO3JPJrL7BGFEWNaQ0A=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Background" , "RB2fot78wqAGxeIIBuG8ZEnytADs/yxhdh3Jre74nMo=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button" , "/KtMBXY5AmPsmt98HVMAuoDrocKr7s/+g7/6wfMJIxY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button2" , "JYwHTIvcmX8NS1wxlb7u1nMPG4BRA2mgm6R2IM/9NXk=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button2_Glow" , "NRov8DgO5+9rqTXQASV8izLAp302/o5ufZgVrvb7aig=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button_Disabled" , "nvfQ1CN+p9h1rUqVhOOLAlCmsdehs2qgVz6kmWERGkU=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button_Glow" , "Wg8LhHovWpNtScBLZbhcjgqQcr4C2pehb3QS2bpmO1Y=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedfog" , "SN9MPqY76N6ucf+vzs22J+2Bs23+1Tl56f7GrT3Z9Yc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedlinkage" , "kqQiioaMU/fAv9+eTzdzV7KizreB80Qio2e9cyWtaOY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedp" , "i7wDlTSmSBueQ2sCWU7usRbfGoncupi6+plQrjv9A8w=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacketSilhouette" , "AVSM7MUReK4oLDUajmkWjQqT577of/ZhaAepDOQk54o=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Larger" , "C7ZuQNW+xi8YNyYtz09aAXOYP/t56u01WwgYo7FT0Tc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Night" , "YVCLQ3WeIUjevo0Wtf2xAOnDGAAzjl44bRHS1T5ProE=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Other" , "kiidD0VdJ/U0xYxtM7f9uvUYsK2VHFIZU3750doVtHc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Pool" , "8MQOevWJrWgIsnWhYi2xt61yxoJARcINzSYzRG7yrnM=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedroof" , "zluDS1sgaJ4iHXt4PfJ3tqi+LVduGKB9+WLdWZZH0ik=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seeds" , "JNHpZfk3qR+yWd4fhWsdNF+JxtfTOjTAKxLs61X0+co=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_almanac_shadow" , "SdZZ5VOq567+489ffjHcTbgWj3KjI01YKZgdUGj9yis=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Flower3" , "kIzmQGfYT3nCObTtM+C6F7WgE8oCj4M+Qq2II0n2IXw=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf1" , "OwGYCIlBbK5j1dZxBjHlPkvswRy+QHgYVXvmOYoMt6E=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf2" , "0ea/nJV5ziIA2Aher2Exfgz6lDuGDjqHf6Ra/bsmMrg=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf3" , "nzELmsj1XUXJmOhMLixHLBzW5TGhZCkwoAOaRpRJlYw=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf4" , "pXEZUhFqr2KC1pCQLB6MwwJhBM5ZI2teGOvYPgr011U=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf5" , "SeX0iGZoN8ZbhKZSkonw9I7MS3lBVHVqzko1hX80LUg=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaves" , "Fny+WEQ2N1yzFhdAPhR/zoK0P2HY4GDckluVL6u6Kz0=" }, - { "Dumps\\Default Textures [Do Not Remove]\\ShovelBank" , "Pas2yhjcl+HVwsIm68o9PRjAR72y5lTQm85e2vuYgBE=" }, - - // English - { "Localization\\English\\Textures\\Game\\FinalWave" , "0O9Esd6GUDRmYE9NtcuIvmRzZU6RKUeR4U6Xiy5qi6o=" }, - { "Localization\\English\\Textures\\Game\\FlagMeterLevelProgress" , "CzuBH4sm7Nid4zloZF3i0bpNcA9ILPhrmOxVYI4IggA=" }, - { "Localization\\English\\Textures\\Game\\HugeWave" , "n9O7b5CuD9Yu+ccecqsmm4ofp10MAw6eoZmIxnX8WwM=" }, - { "Localization\\English\\Textures\\Game\\StartPlant" , "IIz47Bh/4MjFKaZaHx5PAxz97YukBkSqHv8nnN7tMLM=" }, - { "Localization\\English\\Textures\\Game\\StartReady" , "lhaXbwp0oHTrX1JFyJE8hnabkzj4bgNyWdFDMn32cbo=" }, - { "Localization\\English\\Textures\\Game\\StartSet" , "WPtmG9W8kFZQthgaycm6P17wmnqWW55CnU2JjsOGJkU=" }, - { "Localization\\English\\Textures\\Logo\\标题合集" , "IfcPnZSGmfNl1jdd4RiGaD2o3XHs/K0R7HKKLzcFftE=" }, - { "Localization\\English\\Textures\\Menu\\NewAdv" , "6UYMHlQ5SdT+gX7cJLy0iwyCXdxblrjdNe2l/OCeDcc=" }, - { "Localization\\English\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Adventure_button" , "7PPDxa4AOg4Q/ioviwKYKx2ftu82+zlvJdbeqWlGaBQ=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "+Drt7kOZRfinB9t8BsklSl8Np6NxDPJ21XvYuVoiwbY=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Almanac" , "Th6/Pun/NEn6797dnzdq8XnCqY9/oIORszG6K3xSFbo=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "hp6y9BUvolJ0bQdU1FY1Oyt57fizZFx8Q3zXYR4t/BI=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenges_button" , "LDMp8hCkHDSIrN9F92K93txxjFZ69qKyfG429oRyGfc=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "rSB360yGYMYQyNUJYb2xMCgGmSFAl7plLTr1BDMA8W8=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenge_button" , "0DWLUXJ5RYKci+loCThNfHEpk7tKV08vifffcK8owNg=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "AXW4pkVR9twu7/SJYvqScPeNswIoefGCBJXDf7SsXFA=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Help1" , "bwLeNCc4/VtLyocaVQhB++/7t2l4ngYQg+3r95RSMDs=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Help2" , "B7p5vi9AyiidPL4nvBTVdL+WhUbsKzHEIHyWWAut1KU=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Options1" , "TJEiHNySrGFxBP85FeP3hl4TcLCVjX1VXYt0navnK04=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Options2" , "SehcWmqt2cxQhPlcJqUKGeRyl0VgxGymyrVKLyGH9LA=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Quit1" , "zbJL06XIJDi1PjiR52BZCmNSYaRCWLb13owTgv9hVw0=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Quit2" , "diLLwcdEED5M+H4Y35Rnyu+W+R6FU7qVDs7DteLWFtw=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "9JoXGZoVFEVUJR+s/mEye3rkTIYwGLZCiajp12bAP/g=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "b2xzl7F7FEkFZpxGKwEwasmF5BkxaZJArAhcnPQ+Ng4=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_WoodSign1" , "RhYg1ymYR4mEqL0do6dIqRxts+BG9GlB4d5dc+gMjsU=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_WoodSign2" , "aV7MGtWrsnh5O2ikBof66Y4n+w9xhbQbkOObNP2GysY=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "bov/KzSszIVUaDK3x1AFJZU5kbiBArl+tBybTxi7cS4=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_ZenGarden" , "8x4Y+E/DvSPrr1sY1k3trPVtqLrRuUUVWktfLIx5qTI=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "ldiEJGQVyYvquwZuPy/aYNf+Am24dG6iILuw/1k3dNQ=" }, - { "Localization\\English\\Textures\\Menu\\SZW" , "2FoSx111GS6QF3dQoUlqhsbVbDSB0MrnUFKilgsIyzo=" }, - { "Localization\\English\\Textures\\Menu\\thanks" , "bffGVtPUS70M8mNXyKDE9aU+XqGMLITegGGOaPMVL84=" }, - { "Localization\\English\\Textures\\Menu\\travel" , "vy+5i0dx1+DIECxAsVv/co8gIwM9zk8djIKCHbG9ykI=" }, - { "Localization\\English\\Textures\\Menu\\钥匙经典" , "PAPsrNZRY9UetFgFnEwZKdN1TgNbCrU7ZtaPZVzBxvg=" }, - { "Localization\\English\\Textures\\Particles\\Doom" , "FqBUBeIvzyyXL+cqO4Fi6CKI5gZW5QXfHYPTOYoeteM=" }, - { "Localization\\English\\Textures\\Particles\\ExplosionPowie" , "cuikfX+3LOtSw3EPB6DnjANO5bKkoYCMdWSm+StmW70=" }, - { "Localization\\English\\Textures\\Particles\\ExplosionSpudow" , "4pJ/gZsuKRsAbUL1YWsaaJC9NxrzhqUiQe6glK07ydU=" }, - { "Localization\\English\\Textures\\Particles\\guang" , "kh0dcDxOXgh8+Eq1TmKdJug5PdR+nzZrK5iS5Nkw7Gw=" }, - { "Localization\\English\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - { "Localization\\English\\Textures\\Particles\\SunExplosionPowie" , "3bSjOYpanuLnsl58oYUzOAXt94nony6Drq8qdpfRSGQ=" }, - - { "Localization\\English\\Strings\\translation_regexs" , "rjxlsJwClOAJERCe9XmYJB1q+TX6h0p5zDHqCyu/9wE=" }, - { "Localization\\English\\Strings\\translation_strings" , "zsQF+z4URSZY7yuqTfuOIdc/sfcq6g1Hi6ZeedfBFS4=" }, - - { "Localization\\English\\Almanac\\LawnStringsTranslate" , "7BFCUmTVKh5MdefAGxiqgbVtWHcyq9Jg/e8jCWcGI2A=" }, - { "Localization\\English\\Almanac\\ZombieStringsTranslate" , "4KU0HKBDqw5VPbvDqzByDS4nGSG0UAHZ6ek7iv0FOUA=" }, - { "Localization\\English\\Almanac\\AchievementsTextTranslate" , "Y0rNgt02JEkiv/jacilOR0NgACVjqyWpQNQrF9t9PIs=" }, - - // French - { "Localization\\French\\Strings\\translation_regexs" , "Pv4R3N7SkRz8Ksp9DkHR+xMn3Tv7+t57FAwEYDveH4U=" }, - { "Localization\\French\\Strings\\translation_strings" , "atzVMZyXEHG93wcM7Uqz0tTHsWK+dxc1csQxLhHF5wA=" }, - - { "Localization\\French\\Textures\\Game\\FinalWave" , "VTTPmIlVoXW7tU/sQyTlZZq2dy3qOlVs7cmPQYd2PMU=" }, - { "Localization\\French\\Textures\\Game\\FlagMeterLevelProgress" , "DVG5/OyuPfwy7dNOE8NCKmqZK0tKpwsr7As0df3c+0Y=" }, - { "Localization\\French\\Textures\\Game\\StartPlant" , "RkTaTLEoVW4TnXBg+UL3YlG+sdqg+WhP934sTpLlzzk=" }, - { "Localization\\French\\Textures\\Game\\StartReady" , "8/MDcBU6dbIHN1vESmyp27QWxIbifrZZn4IDxKldW3c=" }, - { "Localization\\French\\Textures\\Game\\StartSet" , "8+doc0lYZ2a3W3qpbMSeRturIOWpmyhHw9COvM4Ctkk=" }, - { "Localization\\French\\Textures\\Menu\\NewAdv" , "4noYYWThghcWgV9BCO4WJjEGqHg+SblIoCoCKgTXdAo=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Adventure_button" , "ZRxJ77hv8I2NmSiK6LTDgnOG9obBh+ueMa3R/NDCd5I=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "MoCVUnQ+U8HdUtA4haA7Cx3CmlC/hvVuvYc9bakMtW0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Almanac" , "8txwE7D0UbRCH0hzukyZBACcCn1f9yiXLvhzBIkfKCg=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "WoiG0xkTP5oLEYBWOwnf+kkvbY3jD/xTVYgjBQ6/RLQ=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenges_button" , "3NEwHpNoT1jEl+4gDpOYQ/9osW9rvdfdmiJ0ALIV8Uw=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "RD2hIoFhO7AU6nmtrp5iJwjptYy6ociYKGUJxNsYHd0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenge_button" , "eQO5Wj2FOU2kLRMmI6Hhp3lir/hmYhOGrct5dL6utI0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "3cetfrmDbZHx1uumNbBApG5p8I2T8spnrqVhPqSxkI8=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Help1" , "2yINgPeQqUy6b/mzw/2mFfTxWUlzQrJoYC4Yz/VoGy0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Help2" , "aaUDGQU1+0ltVD4OF2Luc/6pXK7LZ4B5jL9BtSNRnjo=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Options1" , "Lpt1mXltCSkn+9BeMOT+CzTxcQ7cwUtFem+I1tWHdqE=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Options2" , "MNNGXO8AboJJf9tMKXLpIB6j1foAj6bcHopNhHcpRVo=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Quit1" , "6NILc8MqiGcQ3ttSKGfDOEOgvUnIUNO/DWBIeNi4/pM=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Quit2" , "rwTFCgy3kNLCcBM5J6EjguUP4NuvfkDNJjks94eaP/g=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "UYwa4CPhRF8CiWro6Y22GfFQOlk8xCQ6Mldkgk4Jn0c=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "MzBfCyymyT0E4mGUdhps7O6IHJdHtwNtGoi3kRAS8Ok=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_WoodSign1" , "T2Ci2ItAeYw0hMbOP87XJefKbaye8Fhv5tN4H3V7TFg=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_WoodSign2" , "KnPecN+vhvShgMagZGtPKPzMLcc+N3Kqsrlt51YiKRU=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "v2L4jFj8hcIeJzle9LA0OLcCKwXXYdPVBucdslPTlF8=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_ZenGarden" , "ngbC53eTpHs9VaU1qViFJeJVCNhoZcvojiFpeqrXjMc=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "F/nkF7zPU6FyWpOaxMim7/NbS6mH23er3ihfF2tVUSk=" }, - { "Localization\\French\\Textures\\Menu\\SZW" , "Z0uAEbNYk36lyCsPXGXnmjO0L3C1E68aA54stVpbYYs=" }, - { "Localization\\French\\Textures\\Menu\\thanks" , "bzYfnWlAyBzLCflijFAld5m0LBmzDS5vyCbUJs+cn0U=" }, - { "Localization\\French\\Textures\\Menu\\travel" , "Ca4e7HNOAXOUzKQAw+1+H1JRI14D1yLEn5cdXHmFcMo=" }, - { "Localization\\French\\Textures\\Menu\\钥匙经典" , "E+VDMHWhhtf9MwVo8SB9b2eDTE1v3u5Wd5DxoM935fo=" }, - { "Localization\\French\\Textures\\Particles\\Doom" , "q/QV2mCopjFnbwQUUTvoPtcyGV/UAwuxjB9v+GDm3OE=" }, - { "Localization\\French\\Textures\\Particles\\ExplosionPowie" , "mqTy7LXjfh1v7kEtwHzIckWjm/4P97dCs4CbyvzOESU=" }, - { "Localization\\French\\Textures\\Particles\\ExplosionSpudow" , "zFpkHlUNR9jWL/H8FQWy8habmtvu2wtMi/PpClRax2c=" }, - { "Localization\\French\\Textures\\Particles\\Sproing" , "FSStD7Lw1uNrSHqZkZCKrY+hcA6O1DOMKe/6R+jqNdk=" }, - - { "Localization\\French\\Almanac\\LawnStringsTranslate" , "sjZ1qRYGKM3sKMimzIlfmd3e2T5gIV38wy3bU75pLjU=" }, - { "Localization\\French\\Almanac\\ZombieStringsTranslate" , "k6XiNRnACedQuAMhh2CHx9jwMfPEJTbG/UZpubs7EM8=" }, - { "Localization\\French\\Almanac\\AchievementsTextTranslate" , "cFzYB+rYT5//+JpvEHa8Or97RYJZdAI0zK3Pr0Fw9hU=" }, - - // Italian - { "Localization\\Italian\\Strings\\translation_regexs" , "Fr7kZcK4cwoN6WsCARX06Od+PkzCv/FTetj7ME0cIok=" }, - { "Localization\\Italian\\Strings\\translation_strings" , "gXM9MZ66TBCflwXl3hMvH46U70kU2w3i4o0EQAd6Xp8=" }, - - { "Localization\\Italian\\Textures\\Game\\FinalWave" , "J7mSpIXvwo0JbrS8RLLWr8jS5KwRcMoDT6aSIVykhiU=" }, - { "Localization\\Italian\\Textures\\Game\\FlagMeterLevelProgress" , "pwnHiUlgXSYUhEXhBWe1XUeeWfYTb0oTY9/UlerGPuU=" }, - { "Localization\\Italian\\Textures\\Game\\StartPlant" , "6OqWQtc8U0Qm8qyhkdhgOmLhR3yGVnLOFhZ6ZrDIjy4=" }, - { "Localization\\Italian\\Textures\\Game\\StartReady" , "3QPcKBCGX8TLM8xCqCDJqY0uCsRg0vUxGzmTkvfXujM=" }, - { "Localization\\Italian\\Textures\\Game\\StartSet" , "VS5T89S8Do4xqRwxSBt9kjV9o/minfu3M//piKAJVkQ=" }, - { "Localization\\Italian\\Textures\\Menu\\NewAdv" , "UEsXovFnKuglsJ9S59cnJjDnhfDyTAXtLtVEnw9oOD8=" }, - { "Localization\\Italian\\Textures\\Menu\\options_menuback" , "WjWI+u05cf2sNThCp2EaWE58r2HwXRIP1gfwvwNo84k=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Adventure_button" , "s4XJiAhMaWGMpyzt/fGQG/dESF2XeQQ9x+1FQWyLkiU=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "NrVoP4kXJ8zaw9/cdm2oRPo08C3oCa24xCO23d11UBo=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Almanac" , "cOdUtbMj5hqPyHoYfORNboSUikAGyoNtKO7DicYANRI=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "ComYfg7rKwHPcmZENPfQP5T9TFQ0ARRmVye2nGAc+3A=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenges_button" , "DMY8d7mlP2ZmBHZz6BjYM1SEFlkFWp9VuIbB7+bMVwk=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "/OvCfFYFwlvf+DefR1/XYIAQ7djymbF4EK1kiLJzXHU=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenge_button" , "0XDQd6EaJkRSnYezFxhMFFAse/i2ZlRVmW+Fn9kSWnY=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "UfKNb+QqlwzBdu1eORqEeDB9lVVKmGMpqRSExUAUAak=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Help1" , "RoyqJT79KbODd3PfK28pDvvnhcps9XVDxNNT1GjXu38=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Help2" , "UQdoBeSlI04NXh+VYjUyN9l3gT5p/CDRAU1jUsFqerU=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Options1" , "3ebMHMsiekRjU3Rnc5t+yIkeHNpyZi8/Oulst4WWacg=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Options2" , "PFlm0Sdy/1Kajr32uINpR6i7YXQ54a8dq0+OI0R8zec=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Quit1" , "bPWwEE74Tdb583NcXB8e5W/meXVvmwuWkuajv+/R5Ro=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Quit2" , "vBdX54EEKdZkJgiFcCQPtzRPoj0NSKTq7UA7rWDSTBg=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "ZPkJ309XC1P5w3x4IPhItEeLd5WVlU0mIaBoHX3b5Bg=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "8VuUajuH7+8MJqROk/3XFQOEx541qi89ykuQCNaJ+L0=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_ZenGarden" , "1tP+grtgWPu5HtvUa2ox+9assN+Wgj63wBkJoskr6K8=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "sZuiY1fbj5mg0TXaMok/qJFwoYf3+OxkN+Bk3pbTjs8=" }, - { "Localization\\Italian\\Textures\\Menu\\SZW" , "6cXREWl13sjqgdz3Zf5kT1N7bCoIc7LyrHg3WNMVTyE=" }, - { "Localization\\Italian\\Textures\\Menu\\thanks" , "I2nKJztoIdeVy/CyGYN/r/DB+Gvv3geaFxOdtMdf3ao=" }, - { "Localization\\Italian\\Textures\\Particles\\Doom" , "8E+/HlnnJa52eoBgLYjMyjBCsb5bhc/rTnsJKs2hucA=" }, - { "Localization\\Italian\\Textures\\Particles\\ExplosionPowie" , "u2bgHV+XPb4gSz8CagwJdbKWszej9uoIcbM1Z5GRto8=" }, - { "Localization\\Italian\\Textures\\Particles\\ExplosionSpudow" , "CciMCMupOdEov98dK59e2wF2izCwW8jpBkwQE/EV/JY=" }, - { "Localization\\Italian\\Textures\\Particles\\Sproing" , "nYlKAmcK0rADsk4KS7FaQ3FZBfl+IGQuXb7O1GCML6Y=" }, - - { "Localization\\Italian\\Almanac\\LawnStringsTranslate" , "npd2sE+VJ46XdwqP4cx+Jg7/mgxFiUUgpxEKxDrBUKk=" }, - { "Localization\\Italian\\Almanac\\ZombieStringsTranslate" , "GEhXXOMNHS12b+dR5Q6cxYrORjjyywpkPEKB3QzCn+I=" }, - { "Localization\\Italian\\Almanac\\AchievementsTextTranslate" , "Z4YUscuIUlrlLiaYWHTEvNjztVt291fLjJjkfc/lYBE=" }, - - // German - { "Localization\\German\\Strings\\translation_regexs" , "v3wwSqcUG/g71BrZXhYkpxDYebHeO52n1I8QjjlOuUw=" }, - { "Localization\\German\\Strings\\translation_strings" , "LGDwWtGeEnEvv31TnvXdkVUEs5od34WPNQ0od7WKy60=" }, - - { "Localization\\German\\Textures\\Game\\FinalWave" , "+MHS0Xz4nzGw+0knMtj5vJYSxaaT0KH/g8DWXUOv788=" }, - { "Localization\\German\\Textures\\Game\\FlagMeterLevelProgress" , "M0XScRnevh24JLXF48cG2GecSHlbP4vGUerW0xk63OA=" }, - { "Localization\\German\\Textures\\Game\\StartPlant" , "ab42rVDpP/bDtBjg9LvrfVmEf3E2Bry1pwOnMo8vF+A=" }, - { "Localization\\German\\Textures\\Game\\StartReady" , "7vV3VLAlAKbjXTBzaxlN+ulcOimET/gMvohDzyjFXoI=" }, - { "Localization\\German\\Textures\\Game\\StartSet" , "nNyPtyTiTsCPalXr/MgQob6EEb8kgyPZjMWmbXu3YFw=" }, - { "Localization\\German\\Textures\\Menu\\NewAdv" , "Lx7kxZzwBLios8g7raYwDDPcz2X48SshJaWuklBYUDc=" }, - { "Localization\\German\\Textures\\Menu\\options_menuback" , "WjWI+u05cf2sNThCp2EaWE58r2HwXRIP1gfwvwNo84k=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Adventure_button" , "8NsCGe3aSbZ00AJFlELTtD1hOJlu+RojAAvvD77ICpw=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "LcyIKu9BsVtJapQUrpkdefPiA+JTYkak3fg87Tx45JU=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Almanac" , "JrkVQQByD5XSa77HI5+MVGkrc+3nTDyKEP+Kuij6gPo=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "zUlJJqGxLiwafOpBogGO+zX621Q3EnetL+u5vROt6JQ=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenges_button" , "SWZKSjn8ytu5outezry04hHXcTmQD+f6KlWn4nlIZCA=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "9S0JmpQLSGprElTl2MzQoSuT+Eemhj7vaQ20lwi8Ynw=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenge_button" , "VRVyZIq8PBKunX8767vh70F/SA85Cifao+kvi7HMIHE=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "WIH6pTlcbWqOMk+H2OYsBft0jVBwYT7hhWiiWaZzT8s=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Help1" , "t9KLP/pCP5dWxWp7nAPjon/4224sE+yY2sX+MhqRJ1Q=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Help2" , "KZ7sZ8Q9Jus9Su3Tu3FLWmWJssq/RPnuOO/eQ7HgaXI=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Options1" , "nqTlln74GhHYs6GKAqcsoS7AzDnOD1jOjvfBBzMOEyo=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Options2" , "xtg2c+bnhPszl8u8BTma6O/xMxiZ/asBAA5jRCbWtek=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Quit1" , "xyxc8phjdNVui7E7RHFSSlu8OGIXw8HW2QpBCrKokmQ=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Quit2" , "PBuRnBbzOk257Jm2i3ISLoz3oeDzy6LNurXaf9LKV2E=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "92BwDgaXMJZXqrcCxdIm8XcZai1NuGH0amcno5E2uU0=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "YzxTyUcR2OvQ1ctFTKq3kd47A0tgiXp/kPQC/hgdom4=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_WoodSign1" , "T0wrDENK1CD3OgeosDNa4ab28lsSi9JmM7v8wbxB4bs=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_WoodSign2" , "9SZQ6SvrqFn5kPXbF1JD7F5uMfvGyV0xkar2qCvb2UM=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "jJD+LiAoEzsnPJeUFt2Gpf+e2P8JjKpnfLDDPh6Zcho=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_ZenGarden" , "5Z6wqSVe04hmNHCPdPrDlJrXqgblhY6OG843O19GVmw=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "z6YuoHbmClwoKeBjsLa0wypSdcB3QrEh2wzzYnDk6Ek=" }, - { "Localization\\German\\Textures\\Menu\\SZW" , "op9D5nHLxn/WZ/TVVaeji8hj9qRQl1DeuHZF/rj/ZMA=" }, - { "Localization\\German\\Textures\\Menu\\thanks" , "myLBgPcIux3cNkPd833r01ZqJsCqBTty31xJE68ZD28=" }, - { "Localization\\German\\Textures\\Menu\\travel" , "ASg2t1qO64hqGJMqDTQ8da8KotTKpkGtzKIaKuO1MqU=" }, - { "Localization\\German\\Textures\\Menu\\钥匙经典" , "KuqwMj6aedb2J7e8rVQpMa5Ie97lAFbGuwGFZq3POJo=" }, - { "Localization\\German\\Textures\\Particles\\Doom" , "rY5dss0ZrDcUHYVTddyesRpU+r0HoF5eiBM4iDMhHhY=" }, - { "Localization\\German\\Textures\\Particles\\ExplosionPowie" , "Gu4iuRPXhL3KAlUjBjbBOpjPthKXlViQ+8lw2sreTNY=" }, - { "Localization\\German\\Textures\\Particles\\ExplosionSpudow" , "z0h6r4O2FdV1r4CbGVd4nmEpGHZeo8dM2wV9suiZq8o=" }, - { "Localization\\German\\Almanac\\AchievementsTextTranslate" , "12tsG4qJrdtX0dxUOa532CyrC+cF403BfFg3fsjRO+I=" }, - { "Localization\\German\\Almanac\\LawnStringsTranslate" , "Vqqn/gcnY7SIPEVbIxSBi6DXSVBwMyVCQvhOs4KCoJQ=" }, - { "Localization\\German\\Almanac\\ZombieStringsTranslate" , "RlBdepGFFohgICk5idOkRFo9t8FxUuiMw4hoo6eYs0Y=" }, - - // Spanish - { "Localization\\Spanish\\Strings\\translation_regexs" , "4QFp251QrntXDcXjGrGYje8gvuKNHAxVp4FfLm0uHI4=" }, - { "Localization\\Spanish\\Strings\\translation_strings" , "BT+eTs1l2eWCDb+5CGgJJmjyAGqTulKOh2VuDIkwxTE=" }, - - { "Localization\\Spanish\\Textures\\Game\\FinalWave" , "fcYpg8VM7fWplgQdj87NOj5jtGgCPzvW4c2fJOUiJIs=" }, - { "Localization\\Spanish\\Textures\\Game\\FlagMeterLevelProgress" , "4MdtfTqEleDpziEenobp9O5cP3L/nZk18gdT9xW2O9c=" }, - { "Localization\\Spanish\\Textures\\Game\\HugeWave" , "n9O7b5CuD9Yu+ccecqsmm4ofp10MAw6eoZmIxnX8WwM=" }, - { "Localization\\Spanish\\Textures\\Game\\StartPlant" , "s7phwlweOMyWGCtCtFoLSMSC/VQSxFPVoB9T+RZQyhk=" }, - { "Localization\\Spanish\\Textures\\Game\\StartReady" , "DRI5gg//9pDb5dOaR0PhlBzuhP2lryhT6aeklSCUTxY=" }, - { "Localization\\Spanish\\Textures\\Game\\StartSet" , "eiX7QvBlF+EcJrXsOxqOkzu0VF/6hb04uNRRHRA/RMA=" }, - { "Localization\\Spanish\\Textures\\Logo\\标题合集" , "zt6CxJgEU+kegWGRKzQKwJynE91Nbpk9hgSby2zHW/o=" }, - { "Localization\\Spanish\\Textures\\Menu\\MainMenu" , "ZTaVNrPrxtSad5bo89RQVNXxaprYLZuGsl6dvuAoJR4=" }, - { "Localization\\Spanish\\Textures\\Menu\\MainMenutravel" , "w7iF3kfdiOg8EdbPKZlfxfObZXSAdqAMzfDMtM+4Dd8=" }, - { "Localization\\Spanish\\Textures\\Menu\\NewAdv" , "itgAdOEzcDj7sUA11u4xX3BwY7vssEdui606FpUUrEk=" }, - { "Localization\\Spanish\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Adventure_button" , "yE5gPHXKy3xnVBFtSTC0zjhfl0tCrc6sHPK8AiiO/s0=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "gwHOCHLV9NAvvChiQt5X95UOLaStVZogt4DWAokvACg=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Almanac" , "xfqV6GfWdsrPhlVIduoQ6x5QWnci7DRO0E8qC6lItDA=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "a7NCRdhsKTG4/8CLniWG2j/3MbUh68YmT1QJWAVNCDI=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenges_button" , "LDMp8hCkHDSIrN9F92K93txxjFZ69qKyfG429oRyGfc=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "rSB360yGYMYQyNUJYb2xMCgGmSFAl7plLTr1BDMA8W8=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenge_button" , "OT8c2V3GBYxsCMO2nHs7+DbKkdHupmjujVexo/jm1us=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "utQuQr3NQGeGxfmtc3CC7s86/jTGH3SipAkDrAXVbxY=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Help1" , "+W/tytQsNLMSqPE3QnC43MgqBsU0H9XNrjk4RHundLA=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Help2" , "WNPFp01iipCzzArymTAcu4VLz5E+Hcm/bnjMZZ0eQ60=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_LevelNumbers" , "ES369OPOoW1RsrCvYQbKaUt0GF3zXXgUd3ZPnjDWXhc=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Options1" , "zOkXmvvFsyjLO/nq0Dgl88rTSrJWwBPMp6QiAobyqMw=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Options2" , "MycGypHA2qhq7cgAk97vlPX1gfxmeXoMxQ0FaKwQpkA=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Quit1" , "jtBCpgu/bShFN1ykigQtCjLb+U9aABHugP/8ezHmYxU=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Quit2" , "bbTsQCx08UTWFdM/0csjqYB8rSvCJJm3hZMWSDFmeI4=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Store" , "6gVEuBsk1/udDoEATm2tgmWMCkdme0+oxngcJAKrmP4=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "grdusCpWrRqZfBuNB1Dj7bKFzyQk3xFReAqoAEKYFhY=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "s6uGdZuYk0R0xmSa8KsCsZAziQC3F6AWyZaL+vqPi2Y=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "5iaDwlH8qBI3YyWWjyJ/azvzoOMuThRgYykZeAu55/I=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_WoodSign1" , "EzxodXEKdnZDB+CRtpfAMzlGaoqBoXhO79UprQAErmw=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_WoodSign2" , "vibMNgMtv+f43drQs5FWDYv/WaUn6VC3RVZv0qioywc=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "esQplw+1F5GBRJA2KPKbZWTQvPEpQp+d2oyym7Bz2OQ=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_ZenGarden" , "6TrN8Qb2J40RES+YBsBdk9b9A1yy81/+0ZCGSfOqmQM=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "zr7f1egwQiGj+qJiAM11sWpvRVgGkj1E3q2Tpa6t82Y=" }, - { "Localization\\Spanish\\Textures\\Menu\\SZW" , "zXZkY8n4Xa4BRXd2P7CrPeV/oyoImKa3aHZN0AQxrDA=" }, - { "Localization\\Spanish\\Textures\\Menu\\thanks" , "a38UKni0HkBOxxZOz8YLEuRomcdqRxH+cUxIiZv+57s=" }, - { "Localization\\Spanish\\Textures\\Menu\\travel" , "gyGKFv33M2THt9HsNOGXrzayuTk2O6eW7SpR+gq+6Ac=" }, - { "Localization\\Spanish\\Textures\\Menu\\钥匙经典" , "2x/0/QLjwKGhOFxClKDi+wmB+d0n3/B9Y48pW8Kr/uc=" }, - { "Localization\\Spanish\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - - { "Localization\\Spanish\\Almanac\\LawnStringsTranslate" , "EyMLq+zINvouAEcKNy8fPEu0YIJ98NSLqpMs1NX/U1Y=" }, - { "Localization\\Spanish\\Almanac\\ZombieStringsTranslate" , "tVcpi3GfFH/0aqsaeCuzszFYi6s1IxzO6Zw7wnB0flU=" }, - { "Localization\\Spanish\\Almanac\\AchievementsTextTranslate" , "9PRacAZIbZjZZfc6/qoAggpiW2yZfKjWY7C4im+a2xg=" }, - - // Portuguese - { "Localization\\Portuguese\\Strings\\translation_regexs" , "rzeZrvBSmqIGxLs/jHRAJycnkaoKthMidVOItF2PrbY=" }, - { "Localization\\Portuguese\\Strings\\translation_strings" , "j+vbHq7c9x5Rarc0yFX5eSQmHHtdXsgRqpCxJ9SGKi4=" }, - - { "Localization\\Portuguese\\Textures\\Game\\FinalWave" , "MK0QFrw4Fco5s9xq+8quKs1Li+SinkQuh2OxfZA4gqo=" }, - { "Localization\\Portuguese\\Textures\\Game\\FlagMeterLevelProgress" , "YnkJry/FceiULgkq9RJleesNqgLp/SeKiE5MJA7Kplk=" }, - { "Localization\\Portuguese\\Textures\\Game\\HugeWave" , "jRqYPyzJm7kTbLeaSosHlGLWoUjF1mWqtVNdwtAcvuY=" }, - { "Localization\\Portuguese\\Textures\\Game\\StartPlant" , "7IkydSAOydpjYX1+LSb+Fpt0M0KRmVcwdvjGgXJYMKg=" }, - { "Localization\\Portuguese\\Textures\\Game\\StartReady" , "xoyag2YhVyujDnM/xAq9Xtym8HGKl/h1GCda1mfM3PM=" }, - { "Localization\\Portuguese\\Textures\\Game\\StartSet" , "92OXIRhqJJhmdtb0W/WMNVi1t5hdEzpiwzfX/7p4vRI=" }, - { "Localization\\Portuguese\\Textures\\Logo\\标题合集" , "Ac0MlmlulBOa2w5peHxP7KhJFPAGObirxua3kWLlstY=" }, - { "Localization\\Portuguese\\Textures\\Menu\\MainMenu" , "LNnYLNOJryrvG5XIO+ObgE3Nohxjo9n07UjaGjfVHSQ=" }, - { "Localization\\Portuguese\\Textures\\Menu\\MainMenutravel" , "ZwjI2ybianrOFPEfrLP/38t6y4QB7D6B8hAfr7fvSQ8=" }, - { "Localization\\Portuguese\\Textures\\Menu\\NewAdv" , "gxMOlYYsojAuEQkjdLIM46dkx4ssCH+ncPdK3QBlAFk=" }, - { "Localization\\Portuguese\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "6yGbPdJMpbrmHUm9VSCVKHQxJ1sy0YgM42EhxRr1FLQ=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "rdyOJvSoNOHM6uNuL6ehbayGUaOUE/CWs8ZzbzOCafs=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Almanac" , "+5i+4oc5FJDlzzC86ewxR6aaGt2pB6snfvsCpJGL3gw=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "NBmzBkLDe+lMK/wxbV3p2L2hhByBUBP8onsYXO8Pxnk=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "mAy8FXDBpR1tsmwAkNvYB+kg8KKZLxmOtVP3d3DWiJ0=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "jbM14CqEIK+GnRKoKUna7P78p4c74g8NNPEbp01f0VY=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "TXWmZyG1TjBnem8kcFVv93RfUnYHf8CqV1n5BQyTGLo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "qUrCJfUYlEO32SCoPx89AzteV5hba2xzEjqCcNI2cJo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Flower3" , "KQThbd2XxKVgA/b9DE8RKwYoNRGTCvOOlGfIlmdnNFI=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Help1" , "gJxez2SDkvOvUtS7q3E6xlnQWWWeG28KaXJSG5pqqeg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Help2" , "FHAsPhSc3efXrwoZuiN3APOgXJQNf45znFcaoyZ7ZBE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_LevelNumbers" , "ES369OPOoW1RsrCvYQbKaUt0GF3zXXgUd3ZPnjDWXhc=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Options1" , "FQKd+uBul2bwIcr6nmNq1N3X25C8MRgjyGBy26OuR3g=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Options2" , "xZN/+5sa+0b2eDmS7WV2rw/IV6zglPmF9qan62eJHAg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Quit1" , "dLesJNU0+2/ep6cJnQBA2iUEgIOtve2ozeK9lBher/8=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Quit2" , "hvq+IpGRu+1Kvjz7g8797qjUIkMx8q3qcMyvJDnhMP4=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Store" , "WuaJyUo+GX7vDJ+R+MA6XRKF39j7lNZYOMCy+8wNzYE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "bDeLuhI74R/OTEAAqiIkJJfVyywn4s80lTrgGFNTzLA=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Survival_button" , "mAy8FXDBpR1tsmwAkNvYB+kg8KKZLxmOtVP3d3DWiJ0=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Survival_highlight" , "jbM14CqEIK+GnRKoKUna7P78p4c74g8NNPEbp01f0VY=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "1mherm3clK7CvLh9GpVqMII32w+w54mKZE7Z9fkkZZo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "3PVn0DR/33yNI2bjQnDDSSiFRUI+q+1j5lfk/R6JgxI=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "EqYk1lM+BEqgaAqOJXF2HRPkYTgc9j2iMyjcd7/w/Vg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "0iGZDDOUZGqqbMV0CNnjMPVNbNXmvyrJlDIkJ0SV2jE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "r2YuP2O+mEVhGmapNpFRX8NTx1uY43oaU7kgZyzUhok=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "Ga88gKhsCeLtSoTYheuB6aPx5s34u9SqicGbLI/G6Ng=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "0xCUMxGOkVjkgU+fzmlzzSzC+acBGxKhmMjXT+idOk0=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SZW" , "UVGfrlWecM6jEtNJPqjZ+zI66w3euAdOMNl1EPfKpxo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\thanks" , "eHFnd+JUF/r6YRbpTtjmbs6Pywp92asO6TD/rLmO6Eg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\travel" , "qmw+h5LBEWpIGaSe3HZF0XYUScF2VnGQxKWoD4cR2Pw=" }, - { "Localization\\Portuguese\\Textures\\Menu\\钥匙经典" , "g1DKaF3XxYSuiROmemzDz5C2cUcAQ7jPzuoV+nbC/Tw=" }, - { "Localization\\Portuguese\\Textures\\Particles\\Doom" , "FqBUBeIvzyyXL+cqO4Fi6CKI5gZW5QXfHYPTOYoeteM=" }, - { "Localization\\Portuguese\\Textures\\Particles\\ExplosionPowie" , "PHe2TsElYp9UvabT8sxF38JZc+4Hiz78HJyqH/Tzt3M=" }, - { "Localization\\Portuguese\\Textures\\Particles\\ExplosionSpudow" , "Hc/nhkiBIHrZzgdX8+zPYBVoGgNj8177Eqn/S/CvhUs=" }, - { "Localization\\Portuguese\\Textures\\Particles\\guang" , "zpzEG5fPPVYI3tf4DXE0hu3j5BlwIPSAKgcbpr/0wlw=" }, - { "Localization\\Portuguese\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - { "Localization\\Portuguese\\Textures\\Particles\\SunExplosionPowie" , "Cx5JShdk8H2FKNujBTOylSR0708YuufHqWUZiV+sG6c=" }, - - { "Localization\\Portuguese\\Almanac\\LawnStringsTranslate" , "WilEedYB6brtG2gExyru8VCIPjYiH8KOvCZ3dXkSaUc=" }, - { "Localization\\Portuguese\\Almanac\\ZombieStringsTranslate" , "ihC0adgxNlZjMrbLFMrYbprM2fY5Po4GfxaGvLJiDaU=" }, - { "Localization\\Portuguese\\Almanac\\AchievementsTextTranslate" , "2gd4zJcz6giTsKjIyjIca3DkWOipeedtbQpX26AJnkE=" }, - - // Javanese - { "Localization\\Javanese\\Strings\\translation_regexs" , "ci3jGT0t5FHqstahiDanSlnoXjHtfNLKD1JV2ZmbARQ=" }, - { "Localization\\Javanese\\Strings\\translation_strings" , "r84OFD0SmodV4abyygiyDmwPcfDZTPPvZ5XA+sYHAIA=" }, - { "Localization\\Javanese\\Textures\\Game\\FinalWave" , "ZuqUOUgNV8tNZ0vzyn0ME2VOYbD1TuksAP900r94QP8=" }, - { "Localization\\Javanese\\Textures\\Game\\FlagMeterLevelProgress" , "bZUyDcbcLtz+uG7pnXncJEgBQn6dkE0HUuO0py5Qqtg=" }, - { "Localization\\Javanese\\Textures\\Game\\HugeWave" , "yNfz9nK3LRYy307H6xe9fbIkBM1WryMNkpUpX/AjaY8=" }, - { "Localization\\Javanese\\Textures\\Game\\StartPlant" , "vx2ZKMq6MPzgi/wQkTCHS3q2MKGfDSV/nR0Y6wcV1RM=" }, - { "Localization\\Javanese\\Textures\\Game\\StartReady" , "U/G1MHSRD5N3XYuLz4aj5DAnj2OSIL7lTLSakoTd8o8=" }, - { "Localization\\Javanese\\Textures\\Game\\StartSet" , "uX5YiWkb7Fh5TmEJAyj5llaUEPIv8HoIgtLhQ4cenMo=" }, - { "Localization\\Javanese\\Textures\\Logo\\标题合集" , "uAh1wGHTmqL+eelty5vhYB6aeXxyt0j4PMXgyDsWg6c=" }, - { "Localization\\Javanese\\Textures\\Menu\\MainMenu" , "OZ1gfSCjvhys6N8eeM0OZKX/z/FDLtX6HW3MA/UqgLs=" }, - { "Localization\\Javanese\\Textures\\Menu\\MainMenutravel" , "V7dmKMS/Ta7LUobEgFudX3hVXCs8GBulEYJUIkvn+do=" }, - { "Localization\\Javanese\\Textures\\Menu\\NewAdv" , "y9AUQwwNxsOnkPM5LY5DT80cQ/X6WmNsGmzzo1VZdyY=" }, - { "Localization\\Javanese\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "5nPBRgfdFD0RWQ8j26FXzQBN630hSr+VRyKXr/9ALAM=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "39n+opclWXQEDzKDrsg2r0B5ZtCx7eMcryp13eJvZ1A=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Almanac" , "MAucz/pmIdNnun4hLfp0PDrjESlsAZ/iL49NCYl6feQ=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "Fea3OWEPntAYCFCP1DK0lrqQByQTQJ7TNWhS1wRfk3I=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "xdoeNs/98lT4BKon8Bcwk7m1S+fGbLeHgZISD9qVt1A=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "91z8WbCI7XptpUtaN7mJ1BWz+0JNRMYNbDcoxzb7YhA=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "6W1spOrj4FB/SgOb8851XRMAnXoudOjNyl6z4Egw/rs=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "2MhlockgUB7+YVxv096GrbPItf5IVWtuAiv/o65Dx3E=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Help1" , "TrxevH4mjIf4iCFdUXk/Skwq7Asg1dxteTGzqOjQk6o=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Help2" , "s8i2Ca+iB8CGihGdlzqFxZ8PYO7tdm4ODH3GiSqIyMA=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Options1" , "JmwncgGiBynAVjnGkPd0EKXh+MYkUhbpy7H90MYnfTE=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Options2" , "FBzi7WpQje1t1uadDIjcDCwVe994I+ICfmdx96NqrM4=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Quit1" , "N4yS6t5+p52vU93MbHeLgFik9uureOGgJFL8G4FwKho=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Quit2" , "NPtds1JqdvoLtHiAYxzyeM4RyvcrcYLu1HMSnO3252g=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_StartAdventure_Button1" , "fIaIRMLy8g56ifWSPZmKH6CCQLia550aovyHGJIRUBQ=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_StartAdventure_Highlight" , "n0+5ijqYlRWC/3l2JSqtZPnMDbFp7TLSeZefohaEqg8=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Store" , "6JxQIrwb++ekCR47/hQKyahxmMt0ntFDa8A6qETcs3M=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "8SnyShbhGdphCX4dqfWjuoQIZvlnpDsT7a9mrS6RLEs=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Survival_button" , "/mMMNvV2V0X7oSVyKWhLryEO7Bo+eCgDiHozjd4I3/I=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Survival_highlight" , "pNX/YY+qV9RmVt2dcXLTZ+magOEhQNxtxYCUQ4a+S4A=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "IlFeFIlDFW5QAMWwRrgwt9kvStq7pJXNYnWfa3o3zmo=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "aHyZVtF7SxvC8i5Cvj6eARj4+YrB64TZ5njk9whfdgk=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "aJ7MmKsDxiIuExTTP+b26x548jJC9PR2l5An3/Xdlv4=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "5G3x/AWLBZY10RKKdlll4yD9YFzTNqke1GJuTQk0nCo=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "S6vvweA+KTaP0m90S3lu8oitt0/kfc/XasW740bkeGs=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "kgnex+VH/1wjfCM0gLUPRQ16Nb/jeBOBwz7Uz+tBrKU=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "cHufQXgZze8hFwdw5M1gzd/kgtMrFQGIaforUAQeVUk=" }, - { "Localization\\Javanese\\Textures\\Menu\\SZW" , "kJM+ICVWg9rIbVDkhX63KdViIjnVYH4IGC8rqvmnAQI=" }, - { "Localization\\Javanese\\Textures\\Menu\\thanks" , "UPSssI3shIEOMFKQKhRALT2SHpmBTMgHmxpBbRJmPIM=" }, - { "Localization\\Javanese\\Textures\\Menu\\travel" , "s0AOJiMph12ZnPEYyXZ66EbfBHl8xlwhHh70nlW3kkU=" }, - { "Localization\\Javanese\\Textures\\Menu\\钥匙经典" , "5VCHANL1SD1xv+QsPdIDIGeq1Ksw2Q0O9Z5fH1ilCBE=" }, - { "Localization\\Javanese\\Textures\\Particles\\Doom" , "OE2mWsoMv7SEqRWQJWzJ+A/5gQXeRtogIph28cHJyLI=" }, - { "Localization\\Javanese\\Textures\\Particles\\ExplosionPowie" , "P2jrh7tf2d/9EWHoMScwpkpm9ZSvd+ZACEJqSzen7lw=" }, - { "Localization\\Javanese\\Textures\\Particles\\ExplosionSpudow" , "PXVMwcdcn2pL3mN7O3JEMFvI78XGb/POvZ3Sh26bbOw=" }, - { "Localization\\Javanese\\Textures\\Particles\\guang" , "fWG+wb2CZqaSsaLhiscKXHpqWiyG7Z2qXtHhBzumlSU=" }, - { "Localization\\Javanese\\Textures\\Particles\\Sproing" , "+CRy8k+5wzAdG5wVPM3sTYny3hCmPURD42qnTOIv898=" }, - { "Localization\\Javanese\\Textures\\Particles\\SunExplosionPowie" , "ifNQQNn0abUE11stJvwS5wZQm2Y9kPhQx7bXtF0EnCs=" }, - - { "Localization\\Javanese\\Almanac\\LawnStringsTranslate" , "5JgLhxOJA5v4dmZIlUuj5IhDJAijMQov7xNm4mhcKTw=" }, - { "Localization\\Javanese\\Almanac\\ZombieStringsTranslate" , "XpsMKQ0tZON0zeC0NAjZZqC/4SgSBFieYpDBMit2WFo=" }, - { "Localization\\Javanese\\Almanac\\AchievementsTextTranslate" , "g+5/ND/fdGs4fX7mX88GFp1vdI5lAicu4UcOhjLWoO8=" }, - - // Vietnamese - { "Localization\\Vietnamese\\Strings\\translation_regexs" , "jkmDo2/shz/L1entNc/VMTHSwITTe1lDSWkXwu21HY0=" }, - { "Localization\\Vietnamese\\Strings\\translation_strings" , "DEcePF0ruVJLmtTWVL6cgpg6R14ha8loB7E1sEf6r1M=" }, - - { "Localization\\Vietnamese\\Textures\\Game\\FinalWave" , "Ut9Z9amTQgL3Pdcza22zTjKANBKZ9iGQGwuiV9yia90=" }, - { "Localization\\Vietnamese\\Textures\\Game\\FlagMeterLevelProgress" , "4pMjKlDTK/eLQtYWZy1yjgAsDizgOQLZZcA6lYdDbqA=" }, - { "Localization\\Vietnamese\\Textures\\Game\\StartPlant" , "Vu7L6nDEl62NmhpQF+79hPc/Os3iJogr1N3DGUPv/Nw=" }, - { "Localization\\Vietnamese\\Textures\\Game\\StartReady" , "z3YlFfGkneA4LSSqqtlpnwNLJq3h7gwtl1ZvcxdgUxE=" }, - { "Localization\\Vietnamese\\Textures\\Game\\StartSet" , "snzA81WMzGmssVb862bG95eMRmDGn8t3tBEtj0M/OL4=" }, - { "Localization\\Vietnamese\\Textures\\Logo\\标题合集" , "xqL8p6JTWYSMJmWxxOsA6ToA9bdeA1PrFSWsfarm2uw=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\NewAdv" , "HgyAiO6/YX6jfqzcfW08m/EeXqFRsaGQlIv09U3kHyM=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "vkeO+XAUZURjHfog5dqM2EWmx4Q/Hkgm2lxKWWuEn84=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "bmw+kDo75C0h/xHg7U01xvGQqzjHBjgOvYjuZDLdOU8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Almanac" , "1gsF1/5A/Wwg7X7NmYVvJi3vaavEqbAMDy96vLCElf0=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "Euqlx4l5PGWP/VDni40lyo6XONI7UH+jjT9NGbIdaSI=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "anKXed+ijHNf2PnlyRHOdnPNHujFsjwehPuS096dDS8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "Fva/m+l9o97nj/niIO3eXfVP+I9hCK+Mhm0nrB/ZgBw=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "wSZkmGAeFCCEj0US6ZJaJACCwRuj6Tj5JNirlbkmCcc=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "NFH6cDojgh8QeUFF9EMBi+yBVCj2Pi20Up1qQH3EycU=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Help1" , "Y3CrU9B+tdD80MgmCUoWmpvmByahXIvI5tzUjPZZlQ4=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Help2" , "lYbzNUtHudgFvpoEaIQZ420RBmFJmxjrwNmVrq1V1KA=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Options1" , "PmdPi4VkTI/Dlal5s82jQ3xay2F9xA5n5pfcz0ad4bk=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Options2" , "31itkFsIYHeaNMjwiHXiOkeC4pA4onVejVbvMR9dhS4=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Quit1" , "AuhF4Z+C9UE6huKECVBDMRSs1sUEOCsX2yJRPFJ19do=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Quit2" , "JsbRYVZk+KV1870Nt8rlWb6Le2YLKXU8Gc8NXMCfg3o=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "GXlUgJI9mP+YYqwBU/e+0LeFh9VsCgRLepK3yYLd5JA=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "U5t2Fhn17ahAzH7h+nkgpEpEVf7qBBoGfHd3d9tYnVY=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "2xGQ6lS/KxIwjmv3iu5cWBPGucSLBqcT7bdp8KCDC80=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "nMB8AT0nDCBG0aHPxmTKIvVNMvhVm8wli2zU22edZR8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "QhWvlqpFpjF0GYW3LTRaF7hjogvFH0CjtIGZNS1Q0rc=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "2PjsUHvJWhcAdG/Wq6xydshRL0ufXkj61IQ1QBnAcjo=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "xQ3G4RgOY+/pR4ZjmPkY92Ei/qURxbSmXF3dEGpkuYU=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SZW" , "0Rfvp6ZzoeqC0CN53g7VD1VjqTNY6pRbZyfJhPk16s8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\thanks" , "9+56vhTLNddtzyzVQfaKvf7pUwBwQQYYleVVh8j2P2Q=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\travel" , "Vz1TbErS6YBlJK3xGVltUi+M2wLINDwv675IfMYK774=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\钥匙经典" , "3vVVP4TSpnN+GhcKIorkVC6NiSXU90gQUhUFkp5JV9k=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\Doom" , "wGdj1YC7DgQ9gO+0qOUM3GvWkZvmSmFcdZPRuC0xWg4=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\ExplosionPowie" , "NLVTBUV+qnJSN8iDyN0/X5mCLuMf/gNf0eqQSNgyR/4=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\ExplosionSpudow" , "87XKk/0oU6tGGyCe1/2KzBHucjYc6fpEl6C5MQGz1bI=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\guang" , "4hMjrrMrOOkLgHlLzuIieJGzwy/SzmY/JI6KDKxA9EU=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\Sproing" , "Kt9TlS9eDVObwbNh9iy00bB5WjXufKPZv7i+mxUG9mw=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\SunExplosionPowie" , "DGdHTnCA+6ovq0sE5TwBEayKAuF5cb+MEOv8xX5hmFU=" }, - - { "Localization\\Vietnamese\\Almanac\\LawnStringsTranslate" , "CM3FWxA/MKhudP9bRjsTNY0ozLJ1K0nOVs/awEvOrnA=" }, - { "Localization\\Vietnamese\\Almanac\\ZombieStringsTranslate" , "yFHjQbsTxaw621AXaHzJLDulElVB1YlKI+nUxvjJuus=" }, - { "Localization\\Vietnamese\\Almanac\\AchievementsTextTranslate" , "Pyeukawk/N5uiUBKDs/erVzIzA+uqZZhtP2amyCKKdY=" }, - - // Indonesian - { "Localization\\Indonesian\\Strings\\translation_regexs" , "4hmtjqn06LLDtClO8mlg13blxXj1hPwWdaSjygj7/2I=" }, - { "Localization\\Indonesian\\Strings\\translation_strings" , "qc4bxqtaJeZBI6nxL4jnf+VpQu/xpJKs/89IYfDcNC8=" }, - { "Localization\\Indonesian\\Textures\\Game\\FinalWave" , "EKjMvK+krWb8AEnvhL02z4ETUR4GEbtEspU8xTL0XJY=" }, - { "Localization\\Indonesian\\Textures\\Game\\FlagMeterLevelProgress" , "bZUyDcbcLtz+uG7pnXncJEgBQn6dkE0HUuO0py5Qqtg=" }, - { "Localization\\Indonesian\\Textures\\Game\\HugeWave" , "kHSyCA4DjKiacui1Z2Vij0VSKr3UqI7FeiZp6MiYeRI=" }, - { "Localization\\Indonesian\\Textures\\Game\\StartPlant" , "lraovY3Nx09xinbn9lF3g5OQPBmBzwkCS9EX3PeKrKA=" }, - { "Localization\\Indonesian\\Textures\\Game\\StartReady" , "WwJG+GIHjqZ/3PWlt7MmATmn8gegir5JdWLHSDOyONk=" }, - { "Localization\\Indonesian\\Textures\\Game\\StartSet" , "wnAy+G4MWwVp11UL9OovumPhS+bFoIw188yt7djqd5o=" }, - { "Localization\\Indonesian\\Textures\\Logo\\标题合集" , "i+dOUq/gv+NF4PbSsElYnsoi8WnrHFgTMCA+lEXwH9E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\FlagMeterLevelProgress" , "CzuBH4sm7Nid4zloZF3i0bpNcA9ILPhrmOxVYI4IggA=" }, - { "Localization\\Indonesian\\Textures\\Menu\\MainMenu" , "OZ1gfSCjvhys6N8eeM0OZKX/z/FDLtX6HW3MA/UqgLs=" }, - { "Localization\\Indonesian\\Textures\\Menu\\MainMenutravel" , "V7dmKMS/Ta7LUobEgFudX3hVXCs8GBulEYJUIkvn+do=" }, - { "Localization\\Indonesian\\Textures\\Menu\\NewAdv" , "y9AUQwwNxsOnkPM5LY5DT80cQ/X6WmNsGmzzo1VZdyY=" }, - { "Localization\\Indonesian\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Adventure_button" , "IZnCr7uu/muNeugOXMVymHMd5wJ+nfANiohpPnXKleo=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "qiAu0iMOKYUs9XDLgZ7LgVd+KiR0Xn0t0jtVNmjl2Yw=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Almanac" , "MAucz/pmIdNnun4hLfp0PDrjESlsAZ/iL49NCYl6feQ=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "Fea3OWEPntAYCFCP1DK0lrqQByQTQJ7TNWhS1wRfk3I=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenges_button" , "BTltkx67dDWnRIL/TaXUKcUYiQFT01zF0IicWldAV+E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "GCd2qh/rfLbLserDnSzPekRvxIS6W9q+FeNWfkEqTcg=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenge_button" , "6W1spOrj4FB/SgOb8851XRMAnXoudOjNyl6z4Egw/rs=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "2MhlockgUB7+YVxv096GrbPItf5IVWtuAiv/o65Dx3E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Help1" , "F3na7RpFGvO8bF5lvQbvJanJQmUqPEO5+vkKo4Cx220=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Help2" , "imagpCvSovqC6SkeR3BAJqH1u9ssin0C6jwIhx0wGpc=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Options1" , "DMwpZW09/p4CFkgsAqMPExEXzQYOb1TAWKURN4LOYc4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Options2" , "s6wcmSMPErvL/4QuRE7ZYWtCg6Nl6A3FeVL1pK8cOrQ=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Quit1" , "fNNNbsaNEYP3bl3KwlypWIDZNCpm4wVDYUDsjzBw1zU=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Quit2" , "Qm2506IHHfwXKMkqS3gS39hjjZnV3AP2IHJlOrhYpCI=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Store" , "6gVEuBsk1/udDoEATm2tgmWMCkdme0+oxngcJAKrmP4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "grdusCpWrRqZfBuNB1Dj7bKFzyQk3xFReAqoAEKYFhY=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Survival_button" , "0DWLUXJ5RYKci+loCThNfHEpk7tKV08vifffcK8owNg=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Survival_highlight" , "AXW4pkVR9twu7/SJYvqScPeNswIoefGCBJXDf7SsXFA=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "Q24q+w0RftOK+HcQTDvjG5xDpIEYMdecJyGTNGoh9+U=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "S2IYcVmWghuxAVeaV67EnZ1ZjxyLuEmqLRhknUAQ9dQ=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_WoodSign1" , "aJ7MmKsDxiIuExTTP+b26x548jJC9PR2l5An3/Xdlv4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_WoodSign2" , "h5NWhUBnM+ro6J6xs7UDPEmT6055qZP49ppF4wIxePw=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "tu3PiZyJK6CcwaV78aQpqXcE5aLaHA9rPpgzMAbcEAk=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_ZenGarden" , "MAMBtit0msOsty3zZ1yczih8NsF+4nA7fw7BkYMjCk0=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "B17BIhLDvt00Opiag4nqg9a6SvClVr3LlCjzMLI00iY=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SZW" , "OWT6LXWuE7Tr3nH6wYMuUfh1+K9y4TRqtb570pm7veU=" }, - { "Localization\\Indonesian\\Textures\\Menu\\thanks" , "APJpvesl3m2b09ru53RG0MJWcbpia+teT/SnPrnO55E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\travel" , "YP1AGn+G7iYrZ5NQy08TbVxMjFfH7HzdyAMJtwEQ5L4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\钥匙经典" , "5VCHANL1SD1xv+QsPdIDIGeq1Ksw2Q0O9Z5fH1ilCBE=" }, - { "Localization\\Indonesian\\Textures\\Particles\\Doom" , "8vtJfi6ngoltUJQbyCLvp0RnoRZbbVN+piV6lwR8KgU=" }, - { "Localization\\Indonesian\\Textures\\Particles\\ExplosionPowie" , "mmL5xtnIBT3ffswqXHMiz0rXmbj85rCmiWGNnzQq1oM=" }, - { "Localization\\Indonesian\\Textures\\Particles\\ExplosionSpudow" , "PXVMwcdcn2pL3mN7O3JEMFvI78XGb/POvZ3Sh26bbOw=" }, - { "Localization\\Indonesian\\Textures\\Particles\\guang" , "fWG+wb2CZqaSsaLhiscKXHpqWiyG7Z2qXtHhBzumlSU=" }, - { "Localization\\Indonesian\\Textures\\Particles\\Sproing" , "+CRy8k+5wzAdG5wVPM3sTYny3hCmPURD42qnTOIv898=" }, - { "Localization\\Indonesian\\Textures\\Particles\\SunExplosionPowie" , "ifNQQNn0abUE11stJvwS5wZQm2Y9kPhQx7bXtF0EnCs=" }, - - { "Localization\\Indonesian\\Almanac\\LawnStringsTranslate" , "E/P7S2V3xWCnG/DZfW8shpV1ieJUvPf07U/TyJ9LPok=" }, - { "Localization\\Indonesian\\Almanac\\ZombieStringsTranslate" , "twHrylFgPp+RBQ6l10+QHIxgs/mI7p8lRC9etNsAKSU=" }, - { "Localization\\Indonesian\\Almanac\\AchievementsTextTranslate" , "eRZlZgKN2EtZV9BWYOPHPZHBuhLiHzYC3f/wDcwFnR4=" }, - - // Russian - { "Localization\\Russian\\Strings\\translation_regexs" , "6ASIdaFZLLTSdckI4evzynZY3CtCfTuG/BS0ENft/9I=" }, - { "Localization\\Russian\\Strings\\translation_strings" , "mRs9Kx+QyCO5PUScMWyr1P1f3cIMscK0pWjVP4iinL8=" }, - - { "Localization\\Russian\\Textures\\Game\\FinalWave" , "IOhfHr8EBtJYfpWWtELBUtmJNoxv1TdBFrhEfFPshVc=" }, - { "Localization\\Russian\\Textures\\Game\\FlagMeterLevelProgress" , "bGKyk8MpfsaYt95/NQ8kboA0Uxt6ay5PoL0l0RHZ/+M=" }, - { "Localization\\Russian\\Textures\\Game\\HugeWave" , "w1dq1brhzL0eGwj9GJS0vQZDgYVbWjDxRBx60xToKBc=" }, - { "Localization\\Russian\\Textures\\Game\\StartPlant" , "PIOtRaWW0ZdFMNBgyA3Ca4H4rMSLMvfXFvaY/ZZ/oEo=" }, - { "Localization\\Russian\\Textures\\Game\\StartReady" , "zUT1GiCxMDAPlxCyuYPmmztGxDCVdtjiB7C2+Qffpkg=" }, - { "Localization\\Russian\\Textures\\Game\\StartSet" , "ut3aHNTGhzVBNlvHTFIuyj+6SED8Pu9rOpIWKI0V8MQ=" }, - { "Localization\\Russian\\Textures\\Logo\\标题合集" , "qocM9muRdJBmjrs9yTHTknMLWX27aPY7AdMMdLIzd7c=" }, - { "Localization\\Russian\\Textures\\Menu\\NewAdv" , "PIDRlOMsgrLxpp51rWt//B2cBdmNKKEYTvuMUN0wFvI=" }, - { "Localization\\Russian\\Textures\\Menu\\options_menuback" , "HZfWszRsYXntilq2RRoQg6cYPNF7Api0ppAHYJ46wy4=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Adventure_button" , "UGbQ44kL1zXnsJcAr4vrZZu0hDSTEbtdKM2shtebg4w=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "drv1AX+e4D/mA+1IqymPQ5RllTfRatuI+a2/2YJD+GE=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Almanac" , "BdotPdigckPxfrORVW5EJucskfLdK06icpH+Q8mS9fs=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "XoTbNX+410xOdf6MX3BZiVlzD3MsWaqpF8KXZyxduXo=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenges_button" , "pcno2qw/DBMHX3VzGUHErYSAiQyGWseDJGjwHWZI//w=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "Bi5w/0q4C9CpWCjZGLLTHQek530srsp0/Kom4W29IG8=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenge_button" , "kfAEG09yl5h6dV0vHmPl6o72+Wu3kzvBXtyw62E1puk=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "VvP4urY9+U0EPEa19fByOzOX4yKuNzD7eLTuxlEBW2M=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Help1" , "jFKhKseKeZ+y1b1lLYBqfsM5GRGv6JVUa+Jo8sb9p0I=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Help2" , "c1xqKGKKyJhznB5vZpT8FkiSD/luKAEOVH7ZSr/rpp8=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Options1" , "BirUdLzY2B3sedbxZ1eqTwSo/l2UW+obPk+oZhhiSUw=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Options2" , "SLSw+97otiN10CyE6nX6QqHmiOjQR8aYuBUveZ8Lx9c=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Quit1" , "B5L16JYjqNJSD5pA9vhEq/C4gzFkz7VYnzcORjOytxA=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Quit2" , "+7s74lMPYaJu+U+572MRvmOolp33Q5xmu/TMOmRvlZc=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_StartAdventure_Button1" , "f+NFEqcMvJj20nysVA7mlGmFkJZAmmef+Gi8yUvwses=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_StartAdventure_Highlight" , "f+NFEqcMvJj20nysVA7mlGmFkJZAmmef+Gi8yUvwses=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Store" , "N+M6I8pUzeEaetRaE1Wjh2j4g7a1uwrBnqR+7zbsxxQ=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "QiFOWjJqdoRZMbXfTuKJwTdm5a3E6vm0rGkXwMaMCYs=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "ta02SAcbm7ErKiwz4vpZzrtuptJComb4X2DAwx8GiJw=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "28+kPzJUSqm5KKrUlA5GOAy5+q//1bknEniSze/Bb6M=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_WoodSign1" , "8CV21tQ/HxANofuuTatQO1Ul8zXQYwo1rfzU6iozCiU=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_WoodSign2" , "bG6o/CpJPm9XBfWq/m3f1cquTAOr5fbwRNtx7XEPcqg=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "v7BbNSzfQIVYLVrYSOIO2i1NbplOiQjYyQcR4rR8OJw=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_ZenGarden" , "WsYKxhTcuqTFT9jbeOne+W3/opToTbzZFnq7uGulJfQ=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "aGRi1WWchHxPisQdbkX9xmsALia6I1jo8JpysSHb4BQ=" }, - { "Localization\\Russian\\Textures\\Menu\\SZW" , "eaqxoi1/FlIyUCfEpJnFgl1xoSwqP1XRHFIaobQzD1A=" }, - { "Localization\\Russian\\Textures\\Menu\\thanks" , "Juq3A9M9V/jScckNECv+JB2U7W+y6YivxELZV/nN3JE=" }, - { "Localization\\Russian\\Textures\\Menu\\travel" , "8lXVCidvQOeh8y9kG7xN51Ch9VyL8ThZah/OI1RxN6c=" }, - { "Localization\\Russian\\Textures\\Menu\\钥匙经典" , "wwcruWy65C8iXjA+SY1dvx/hrSQ/KvVkX4OOOZ6lS/s=" }, - { "Localization\\Russian\\Textures\\Particles\\Doom" , "OWddkj4pnY9xmSIuQIL0vb6F091j8UY2PEC4tZ6P3p8=" }, - { "Localization\\Russian\\Textures\\Particles\\ExplosionPowie" , "KbPmKOHVvOH9njUEBWb6SJPEdGOLbpAG0CpliNyUefA=" }, - { "Localization\\Russian\\Textures\\Particles\\ExplosionSpudow" , "k1C6TaoPE0ZRw79UAjDwlRaLjf4Q/b2N6JM9SN1I5fc=" }, - { "Localization\\Russian\\Textures\\Particles\\guang" , "+Xd4hpZk2VEhgHr9HATWRhjEbg4WlmXkh5DA+gXevIs=" }, - { "Localization\\Russian\\Textures\\Particles\\Sproing" , "i33iY8w5LR7Kdqf2vVQ7UmE9SrWZ+5AGepTy5QINyHE=" }, - { "Localization\\Russian\\Textures\\Particles\\SunExplosionPowie" , "BCXJtvwnDvIzc7cFnxN3wxR7t2o1rqa6hulW54PJLrc=" }, - - { "Localization\\Russian\\Almanac\\LawnStringsTranslate" , "NwYjBl+2v0brh38S4AJpHHWDK/1hCJ5VVqY+Cf5jYkU=" }, - { "Localization\\Russian\\Almanac\\ZombieStringsTranslate" , "ejVysCnTehbMFkjAXN7n7NqWespRHmv5cXYM0hMlK0U=" }, - { "Localization\\Russian\\Almanac\\AchievementsTextTranslate" , "ST45TjReYXrBOfT3r2YeDakJm1SN/jtH/5z0Qp6Ms4c=" }, - - // Japanese - { "Localization\\Japanese\\Strings\\translation_regexs" , "YXerYuvclj9na6pQOefuVfJVER28OAb2EkG/kMLqrGQ=" }, - { "Localization\\Japanese\\Strings\\translation_strings" , "hXi0RiHTbzptiAHqko0CRwDDWW9zoRSdQpOXpd4U3BI=" }, - - { "Localization\\Japanese\\Textures\\Game\\FinalWave" , "tyOrI4m+7b595JZufjhesTYXqiSWuNg4Dlm0fN/ZzVg=" }, - { "Localization\\Japanese\\Textures\\Game\\FlagMeterLevelProgress" , "J8Gnugo3MCdQCFNaw91nOWKiYEJltD7EpScPvgJjVdQ=" }, - { "Localization\\Japanese\\Textures\\Game\\StartPlant" , "8+rIjUEkUtyYRsu9ZHsM6B26fT87U6BYHtjhef+sZSc=" }, - { "Localization\\Japanese\\Textures\\Game\\StartReady" , "G0wx/YkdgSZju5xUluqrq554u7ywOGxRPjQwfEEHwSo=" }, - { "Localization\\Japanese\\Textures\\Game\\StartSet" , "4jSRsYZN+mA3pMZQtjtxxo7z8PYpjyM4Ja1coeOERmQ=" }, - { "Localization\\Japanese\\Textures\\Menu\\NewAdv" , "9CgysaFPLkL+h3CB5zLiUxj7Z7xSZCTQKFr/pAvjW4I=" }, - { "Localization\\Japanese\\Textures\\Menu\\options_menuback" , "KcUX62UuqoR0UKas1yijEQP56fWbagBIpSwFIr4df+k=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "nqJjYCKTGCWuIHwSSRDpsJkPK7quA/4UgfX+EZsadsI=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "/oarc88nswGdHzRI7+ol5XUH8pqEudTJ/l4mtWr6ugw=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Almanac" , "GsHU22IdE1GMx+6eDcJoQ/+LJDJwLG3sovrPion7/68=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "7aHSIocT5JbGVTh7addi0+WrON9G6LPv2xmuDy/tPRg=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "ljfdR00zwozWSwI85JwzGAGQgjXL1sCNpr/+juvcx0M=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "hkii/10+OmfcVLNOB3ATpI5iHpPhw7mgiVRAs+kDsHc=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "tf/14faCSFk7b9vFFn64FAAUpLGZVmfInI4K0Qmx9aM=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "1ZC0zr0P3WkXzKvZ17YwkLID/6YYdTx9PZQimMSos6o=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Help1" , "8OR4iqxkdQ3PsxbobY+JaN/w0lXNc2A+Kbec/VJ/QVY=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Help2" , "i60mg9eK5WzjUA0iZfQtvDWq7HImRV14xNqfLzFmELo=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Options1" , "YJZBgCXj/ZH4F8zPo+t4dAGmGMSiDAcybs2xuu1LTiw=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Options2" , "yIbcIgBPjVP3JKNiF6dBPdJ90Yd+fKC+99KUjTfHOqQ=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Quit1" , "hkDaVb8qUDLKPp1MIyGY6x4teZAVev56kjJ7KihPMss=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Quit2" , "Tx8u8J/YpKF0lEd436EJfOMzXVzSWlsWDHBh5s73MU0=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "hn9D4J0aBhdrM23YNrZJXd2qbQrePLru5gCYBR34xgo=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "+RQ4US+xJ23ieUzvO3sBzHJBEmCz5wZz7Gv6UmFjtdk=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "78kL8cLZGoQdNcZjPbXFAkhN9A0zyCun8ieAOUvva3k=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "Fkn7CvIOoeB8QrUUtj2HySgUg5ZR+zvry6jythPN2BY=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "S2xZmAOn82/7uJ0q5Ej4tc59cheMme02Eb/CBjQjULI=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "AE/8V2mkM15VErDDjg0g497fF4S3GYdSDRi9pDq0S+Q=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "KiN9KORVPhugq/laYeo+78CNeNW3CEVpVmi2J2WTNT8=" }, - { "Localization\\Japanese\\Textures\\Menu\\SZW" , "4jkQn+T+/oceMqVHefAyo7G/8LQ/3jZuF41rnEaFVy8=" }, - { "Localization\\Japanese\\Textures\\Menu\\thanks" , "aoTr0qV9HPJLz4WImY9FpU6mbB6Jy2WfOeXULgDWdlc=" }, - { "Localization\\Japanese\\Textures\\Menu\\travel" , "MwowpcnQ4BXqoE6I8n2iP6ZzmVSMNaUpyBkPIkaI2hE=" }, - { "Localization\\Japanese\\Textures\\Menu\\钥匙经典" , "FeQQRbKmP9uOZ37BtcHNjWH46zSe1tCrexTrnWcKX50=" }, - { "Localization\\Japanese\\Textures\\Particles\\Doom" , "x/jlt63Ryze1+Dhjm9A1M65LkwrpuN0tTwn6wq7OtPg=" }, - { "Localization\\Japanese\\Textures\\Particles\\ExplosionPowie" , "uEPr3YXyamejZGcJ9QYxkQ6GOnqK3Ddv5HsgBJCIyl0=" }, - { "Localization\\Japanese\\Textures\\Particles\\ExplosionSpudow" , "4wZzRVJGrKmZDuJXuA8O/0mvLJS08DrhfWiRk6Arb/M=" }, - { "Localization\\Japanese\\Textures\\Particles\\Sproing" , "pKet1LadsHBdq8mOR3IOtOngBHyfxdFLp2hipu8I4ZU=" }, - - { "Localization\\Japanese\\Almanac\\LawnStringsTranslate" , "D4riwyc3qc5fWLhnspeXCgCip2cb5k1/t0PlEPJ7wdY=" }, - { "Localization\\Japanese\\Almanac\\ZombieStringsTranslate" , "AzhgHGtIesVnO8aGJnpnY/C8+5eua2Z3wN887spfz7U=" }, - { "Localization\\Japanese\\Almanac\\AchievementsTextTranslate" , "PAk0G69Abd/8mqXxsrg1dChYjb3/Hmgp2UD9fqVnqXw=" }, - - // Korean - { "Localization\\Korean\\Strings\\translation_regexs" , "zWV/cHF92F+GrFwlSkGXyep2jqBDG5LAiGwyDtcG2rU=" }, - { "Localization\\Korean\\Strings\\translation_strings" , "qXdtfjxdZcK4Oe6ptsZd3Vg4rIavfM06ZkmMfmR8G1M=" }, - - { "Localization\\Korean\\Textures\\Game\\FinalWave" , "7I9i/6CVcPOhoL2n3/NUNOedbaIyQqlsj5U+jVQauu4=" }, - { "Localization\\Korean\\Textures\\Game\\FlagMeterLevelProgress" , "yMpBQDYecmFimlzSnsO8vdyEPp0Q6O5lAg0DWFS1m6M=" }, - { "Localization\\Korean\\Textures\\Game\\StartPlant" , "yGZNl/ELOvk/XqMp5pIhwrSLkAa/T+2pWcYb/tVC8CY=" }, - { "Localization\\Korean\\Textures\\Game\\StartReady" , "aNTSN8/FwAmu63eHs7wzdoDCnw3h3KWQ4SCiPtBoTdQ=" }, - { "Localization\\Korean\\Textures\\Game\\StartSet" , "PcrGZLSUL2xrPGTMzZJBc/xC05UdlWoCeHP8vNm8BjQ=" }, - { "Localization\\Korean\\Textures\\Menu\\NewAdv" , "LidoBW/vXZhokFRjg8MRy7daY4wehQ9vd3dBLwTsFLU=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Adventure_button" , "XvILct+pOLn9Ke3VvtlZPo4Zpob6wgAaNwb5w1+i3z0=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "WTyEd+cIWl3fBF1guKAQuMvDdMDwFnsgyZXoklVRTdg=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Almanac" , "7DLBjkU41YWjh6up42n+2DU+UU4jzBcuCyIjoIQhK1E=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "1oUnvwRL6Jr+AwwXJKAB/jcmpWl+0UP69js6vIKZ9uY=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenges_button" , "qoPxgGKWuHKCg3pEmvkauWfmXFZWR0spWcoK6AvLysc=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "840p+IAAw8KPwkoNmvcWcOWwhpTzTtcLixzWr+MunS0=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenge_button" , "FwlC3AOwWWeiqereusDpkRatqnKKN3c/xq5iPAhVo5Q=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "RZPSyMMXOr7W5aOWcr5xSR9XiANkWWVk6/OUnxxpUpI=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Help1" , "Akybqv0glw81aMYpGoosQ3PR7Ukhq+cD+ZlEUkLC5Yw=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Help2" , "6RZFnrYjpZM932niXc1qmRtAJm97GlDHzh3Q9c1u5b0=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Options1" , "D7hYM4ZPRbA395EUkLhG4jf7lfJqSUalp7oZJQ9/BEs=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Options2" , "1Z3SHvyiFsK7Wy9I2tFONcVYjF50Ho4L2+CbePFqng8=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Quit1" , "eD9BNRKQU7qei+eAsCSIidMwvwEhuBLPcpZkb/Q/Ag8=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Quit2" , "scNdtWjkMrgtwBdXiS809HfOY+2+ycPqUAgH6RcFOfk=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "QPWZp3PBXeJK8y9Pu7euFoRNVsywdr5tCC6gOsKmlL8=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "VGJtLoUZ4+EYlQUMHSOAUFYPwFr30w5/NLyl0G4Ba2Q=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_WoodSign1" , "CPf6iaNv3ftvdOMQwm/gJ8hXE/13KeS+GHzEBl6DrpM=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_WoodSign2" , "8Lr0ONZOInR+ZHz9ZQHHdr6e4jkARbxkDIm181Q/yWM=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "8JALSm+TKjNzIAtOd6DXJjkjc0bqEBXhPqlTO6sKZ0c=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_ZenGarden" , "b8bJJeKpQJhesrxy3c3JconWq1RJkMwkOBOi1JcKkUA=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "CwZAzOBJFFY9AG2tvPN58JggPNNEws9zEbcgMlsWEpc=" }, - { "Localization\\Korean\\Textures\\Menu\\SZW" , "ONrElpWA/7WkJq833t+slKToiieJtZhbz2dv2QSuQB0=" }, - { "Localization\\Korean\\Textures\\Menu\\thanks" , "HYnZf9x5uNG5tu5jga94X9+rILjt40bnKSR1qjkXF8M=" }, - { "Localization\\Korean\\Textures\\Menu\\travel" , "T/ngmCI6ilQ6k/pV2XZloY5OICc0bbKz0iwg/mcXpPw=" }, - { "Localization\\Korean\\Textures\\Menu\\钥匙经典" , "iO5Z+/6R8Pz1GoIh+TX5KWkCFJsOxfYYrMSV//9UJ34=" }, - { "Localization\\Korean\\Textures\\Particles\\Doom" , "FqBUBeIvzyyXL+cqO4Fi6CKI5gZW5QXfHYPTOYoeteM=" }, - { "Localization\\Korean\\Textures\\Particles\\ExplosionPowie" , "cuikfX+3LOtSw3EPB6DnjANO5bKkoYCMdWSm+StmW70=" }, - { "Localization\\Korean\\Textures\\Particles\\ExplosionSpudow" , "4pJ/gZsuKRsAbUL1YWsaaJC9NxrzhqUiQe6glK07ydU=" }, - { "Localization\\Korean\\Textures\\Particles\\guang" , "kh0dcDxOXgh8+Eq1TmKdJug5PdR+nzZrK5iS5Nkw7Gw=" }, - { "Localization\\Korean\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - { "Localization\\Korean\\Textures\\Particles\\SunExplosionPowie" , "3bSjOYpanuLnsl58oYUzOAXt94nony6Drq8qdpfRSGQ=" }, - - { "Localization\\Korean\\Almanac\\LawnStringsTranslate" , "KRMiSTM91FoCR9sTGJU6hvsh0+sBMyHfqXwTSSea27M=" }, - { "Localization\\Korean\\Almanac\\ZombieStringsTranslate" , "xHI2LAW0JSEZN010GZPhPB60N0Csfbev2Mk5RwWFYyQ=" }, - { "Localization\\Korean\\Almanac\\AchievementsTextTranslate" , "J4/ZjY7vFNvwsMBx5eIwP7syuLD/+D7OaTY+YbUnq6s=" }, - - // Custom Textures - { "[Custom Textures]\\Almanac_GroundDay" , "ruvrVDVaICj+5PzN5FIcLTma+GtTb2AuKkHA42jTVBw=" }, - { "[Custom Textures]\\Almanac_GroundNight" , "uwrsmHM/IFY1n+AkYYmgEhoWRoaefOjP6sQMCWLtJ2s=" }, - { "[Custom Textures]\\Almanac_GroundNightPool" , "MQrZAvJDWs7k0c8cQjeNp5WNfB1Yns54Wqib63Glhsg=" }, - { "[Custom Textures]\\Almanac_GroundPool" , "fgHaxsX/KUXzAuRTLE7itRtmjPJ8YPo01Sy6Y2O5XWU=" }, - { "[Custom Textures]\\Almanac_PlantCard" , "1Spu2IG3EoCLn0MhAwMxydN2E8xcffFVfnKGk0KowLY=" }, - { "[Custom Textures]\\Almanac_ZombieBack" , "PUxcz+EA7ehsPkyA3gsicvaANh+7vX56yKbrCNFd8cI=" }, - { "[Custom Textures]\\Almanac_ZombieCard" , "S3QeUIrxZ3BJiovEyHBz0AYIoVzT2mQ1JA5hN3Ke8B0=" }, - { "[Custom Textures]\\Almanac_ZombieWindow" , "0JHTUpc1HdZ8/s/4NVKnchFmyrUaXgTgv3kUwS18zKo=" }, - { "[Custom Textures]\\Almanac_ZombieWindow2" , "NA9+T0M/4BihrNsGQVQCyxX2IO8xuyIKCm1PT6aB/vc=" }, - { "[Custom Textures]\\CursorClick" , "cELLXJkEQM+ULhcuL3GXdJ6Lw9iJF0grx3NuSfI3iGE=" }, - { "[Custom Textures]\\CursorDefault" , "AfBSPF65+ZXswrGKH5NRB/b5oa4WR5vuIet3xQ9/hqc=" }, - { "[Custom Textures]\\plant" , "JqOyre0JXBHjvWqUafUaBEfym62ZVhte6sP68TDn4xQ=" }, - { "[Custom Textures]\\SeedChooser_Background" , "RBVMr9F/IJiTVV9G9iZyUQguN6c+fQGb1BUoyuAKbyY=" }, - { "[Custom Textures]\\seedfog" , "l4gO/839bvGY3zk1/JPHPrZiD5sqVq0dCnCflUr/ilQ=" }, - { "[Custom Textures]\\seedp" , "amr82tmtplngahLPlu4wdPlq5adTKqUMXZoZ9qJ6u1U=" }, - { "[Custom Textures]\\SeedPacketSilhouette" , "W6vow+euXzdwjAufkJuRtdaIEiEPmbeeOkOHiQBNmHA=" }, - { "[Custom Textures]\\SeedPacket_Larger" , "+TZxcpkpyz49vmlkTAYyohpQuneLwrw1eJdYpbN6wAs=" }, - { "[Custom Textures]\\SeedPacket_Night" , "0pv9hCIOuoj9wfH2FP18kNwLkYUz0wuxVs3zl3OiHC0=" }, - { "[Custom Textures]\\SeedPacket_Other" , "Y/xlegVxGFn6Dt1nsDAEFSnslM3lyQ6WyCSl7RfwA5k=" }, - { "[Custom Textures]\\SeedPacket_Pool" , "4m5EDn8xfUtrZ/qENCISIRbZVQEjgk9UN1//AelB1Tw=" }, - { "[Custom Textures]\\seedroof" , "z9o/8qUJkgtys4WmPRvCt/wJz056+0Fjvfvk6pHwbLo=" }, - - { "Localization\\Spanish\\Textures\\[Custom Textures]\\CursorClick" , "4sKy7/xqFJqS/HVR1jUgMNvcPQdv6argIePfdcRhoIk=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\CursorDefault" , "zuNjht1GXgF/fOKCnW7KnOOaccjHRDB9m6giJvkKz1Q=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\garden_new" , "siziOyP+M2D5mI5ugtsjNI1O+zKcRqlHBDGrnSU1EV4=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\Present" , "glh2PeOuG8W1jQBiX8Xh0/4owPMGxFFXdOIc2siZ8Uo=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\PresentOpen" , "9DQZ4GIEeqoATt6MA55HEvQrBueZ3FN9raMdqOIhOUI=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\PresentOpenZ" , "BORx+RuCJUu8FLzDqdZcBFKFzMDbKB0KDZIkk4SnEmM=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\PresentZ" , "3VQDMgCU5gz1uGzQzRSatXOHd50q9nHozgkicb9wEQU=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SeedBank" , "ffJswlQikAaPhUily+jKz59tjUUsysRTyPetub7pVw4=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SeedChooser_Background" , "Z3jzRdTSxhpLU9HqeYhcDz+CfP1SerwzYteBh2gEX8M=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\seeds" , "Yaqa1lY4mMxmksslr1WjcV3vYAwrcLT6AVVHEvHS6Mw=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf1" , "wAoIJKiNxAuEkhFW9QjUAXCbdQmq0Q5DtztG+1VWjig=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf2" , "hRe+ceHzLid2ltXXaJsfLg3YHkb0xSwvgFh62XqUnpg=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf3" , "sU5tHuXpjZGsDd0I5BMPmsHj0W4flayrCEhr36iudp8=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf4" , "UnezQl5tm4gUZ3DwYCzRM85siS2dZWuo0HHx09fc/LU=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf5" , "a73hDOb3r3gZAgpklCB2EkFjUaUbKJBXKhGT3tYosP0=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaves" , "ll3lRI+y441evcV9CJoFufhI5VQeC2eIew9AFSW8xEU=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\ShovelBank" , "DUCNzvvDjIp8Kr8Clyx4eWwApiHiD8RmP+W05Mre+fI=" }, - - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundDay" , "HqSlvHQOonZvcid0jFZAj7az/P8uwKXZMT4Ukwyc8j0=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundNight" , "qt947+pENaA91x4lYAYsNLcR6Xd6I1vNh/USyk45arw=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundNightPool" , "A92M4I2N2OfpN/y4R40ATVBrI2U+StgZQjIr0iVCEeU=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundPool" , "AmrvO/C5ggUeHr5+WOh16GWJ0jM1nXR+Vj/A87CRZ3U=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundRoof" , "ftdvDcMiDrdIBIoOTcxU6b9qT+GmPEkH2+tG2HA8blk=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_PlantCard" , "1Spu2IG3EoCLn0MhAwMxydN2E8xcffFVfnKGk0KowLY=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieBack" , "PUxcz+EA7ehsPkyA3gsicvaANh+7vX56yKbrCNFd8cI=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieCard" , "S3QeUIrxZ3BJiovEyHBz0AYIoVzT2mQ1JA5hN3Ke8B0=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow" , "0JHTUpc1HdZ8/s/4NVKnchFmyrUaXgTgv3kUwS18zKo=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow2" , "NA9+T0M/4BihrNsGQVQCyxX2IO8xuyIKCm1PT6aB/vc=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\plant" , "Q5VaxJhSrv/z55FH7YmLBovhYV3zLux887J0IdOpwnc=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedChooser_Background" , "jnVWbr791bRlpO5CYQ5ZC2WPH4d7j8O4ODW41hA88nk=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\seedfog" , "fyjLtioDqCumbQuOl+4jgUYFqK+cATeOzoNl1qgRttI=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\seedp" , "8qE/ZB7wdjFq6bNr6jWeCsVhhUD+JWORmpXryejDmjI=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacketSilhouette" , "W6vow+euXzdwjAufkJuRtdaIEiEPmbeeOkOHiQBNmHA=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Larger" , "TtCGi5F02Qx/ix9OXY86bMNjHCdch1E7De9wMTp3JIs=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Night" , "3QSOoNwMue9tK30JgCea/K2pGDlDv+Ibhp0NKRoZHN0=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Other" , "7tjrV9SIzPaSEpMspdF7tKANXMu6ggeuj4XSy/UVACM=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Pool" , "U4zfEwx/0mUqIgUYvuQ10T+tWTqJ54V3RUJiA1+FJts=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\seedroof" , "1W6A3m32iSQZ5WhJHK11tys1OQOvYLgdNGlUOe7wgnY=" }, - - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_IndexBack" , "S8wmWen4Za178Mkwwu8DJkKvvB2c2CRJbaRjIW/zvhw=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_PlantCard" , "O2UWyplpXK69pTFXYDSA5KiRyKAZ22LCDN71GIb5ZDg=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieBack" , "L91uR40W1iPLqBd+ouENStDe9RN+xUOZtbF048MiD1U=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieCard" , "3QvRtOtCpI6sqh26+Zbr9vTR9RB8oSXy4m7iS2snZUI=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow" , "+LHsQLlwsYWEVS11F+SustquGoxjbGiyrs58XwyeYMw=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow2" , "e51IJA1bz9dDEvmXtO6CeL6/M6KMXDvojCbTz2MtnLk=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\garden_new" , "WxH9rTrIHkmQeu0ALKfFuI6JvXo1uKQlwvgIc72+lhI=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\plant" , "ZkLNZASMXf7P0621AH2sFm3rbulCrs7otMLrrxiaqsA=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedBank" , "+5f20e56ArqQ3Mt2BXtpSM2vO7SV+mWOzIBalIEh4Ew=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Background" , "kjv++O/zFxvPVoObxFTLXsH2MIp3zae4UJ8zu8kVOhY=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Button" , "9d5FghH0XRShLwjivvcKtVqmlOQLZC/RqfT+Urv8PJo=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Button_Disabled" , "iTsQO62+/80kG4jELlTnB/AXA8wvQKnqCgvQS4pDVlY=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Button_Glow" , "cFJCF740SGrFKt7c5OOAcRSVdW5ZZ6sBuE+T3JSwgOU=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedfog" , "JFjRJErflXFgxgxXXGHr6fjLaVIpoYSS0hlWa5Fi09c=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedlinkage" , "3IAYdQXkrWvDMBpg5Zw4ZRU39zuY9OAd3lVhwp07aMk=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedp" , "oaPa7rvvRy+pP3yUvA82hSNJ9/LQIZ+RVGPfCYvaLUg=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacketSilhouette" , "ca+mkPyRnAjVIZZRieUCHFV2t3qiJnX2YQnd/z3iTvs=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Larger" , "mFoaC4FBXiufdw/aG0SCLlxzpE1umDx3robELsUPhi8=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Night" , "KZEvxdx4nQnrYVPv8FY4DbVDAQBCjlllMnxXQHJ1gkE=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Other" , "EP7WPPrYdZvxAhRig/FBJWHEw67amJuOO9JO0Kqzh14=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Pool" , "8eLUx9OWZORq3ItJcbQltcsyc6oPAW9PThEHoul/LY0=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedroof" , "HhNxpjbMgvt2FZdZZ7kfl546x6+5B4B97DgSH80wkMg=" }, - - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_IndexBack" , "DagukR2bViPz88Iu2B5w4QDMs4ykui/BYdk+lyaTK2o=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_PlantCard" , "O2UWyplpXK69pTFXYDSA5KiRyKAZ22LCDN71GIb5ZDg=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieBack" , "L91uR40W1iPLqBd+ouENStDe9RN+xUOZtbF048MiD1U=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieCard" , "3QvRtOtCpI6sqh26+Zbr9vTR9RB8oSXy4m7iS2snZUI=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieWindow" , "+LHsQLlwsYWEVS11F+SustquGoxjbGiyrs58XwyeYMw=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieWindow2" , "e51IJA1bz9dDEvmXtO6CeL6/M6KMXDvojCbTz2MtnLk=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\garden_new" , "WxH9rTrIHkmQeu0ALKfFuI6JvXo1uKQlwvgIc72+lhI=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\plant" , "ZkLNZASMXf7P0621AH2sFm3rbulCrs7otMLrrxiaqsA=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedBank" , "+5f20e56ArqQ3Mt2BXtpSM2vO7SV+mWOzIBalIEh4Ew=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Background" , "kjv++O/zFxvPVoObxFTLXsH2MIp3zae4UJ8zu8kVOhY=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Button" , "9d5FghH0XRShLwjivvcKtVqmlOQLZC/RqfT+Urv8PJo=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Button_Disabled" , "iTsQO62+/80kG4jELlTnB/AXA8wvQKnqCgvQS4pDVlY=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Button_Glow" , "cFJCF740SGrFKt7c5OOAcRSVdW5ZZ6sBuE+T3JSwgOU=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedfog" , "JFjRJErflXFgxgxXXGHr6fjLaVIpoYSS0hlWa5Fi09c=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedlinkage" , "3IAYdQXkrWvDMBpg5Zw4ZRU39zuY9OAd3lVhwp07aMk=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedp" , "oaPa7rvvRy+pP3yUvA82hSNJ9/LQIZ+RVGPfCYvaLUg=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Larger" , "mFoaC4FBXiufdw/aG0SCLlxzpE1umDx3robELsUPhi8=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Night" , "KZEvxdx4nQnrYVPv8FY4DbVDAQBCjlllMnxXQHJ1gkE=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Other" , "EP7WPPrYdZvxAhRig/FBJWHEw67amJuOO9JO0Kqzh14=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Pool" , "8eLUx9OWZORq3ItJcbQltcsyc6oPAW9PThEHoul/LY0=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedroof" , "HhNxpjbMgvt2FZdZZ7kfl546x6+5B4B97DgSH80wkMg=" }, - #endif - }; - - static string GetCheckSum(string filename) - { - using (var md5 = SHA256.Create()) - { - byte[] bytes = md5.ComputeHash(File.ReadAllBytes(filename)); - return Convert.ToBase64String(bytes); - } - } - - public static void SaveCheckSum() - { - string stringDir = GetAssetDir(AssetType.Dumps); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - string checkSumString = JsonSerializer.Serialize(checkSums, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - File.WriteAllText(Path.Combine(stringDir, "MD5.json"), checkSumString); - } - - public static void SaveModifiedChecksum() - { - string stringDir = GetAssetDir(AssetType.Dumps); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - string modifiedCheckSumString = JsonSerializer.Serialize(modifiedCheckSums, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - File.WriteAllText(Path.Combine(stringDir, "Modified_MD5.json"), modifiedCheckSumString); - } - - public static bool IsModified(string filepath) - { - string fileName = Path.GetFileNameWithoutExtension(filepath); - string directory = Path.GetDirectoryName(filepath); - string slicedFilePath = directory.Substring(directory.IndexOf("PvZ_Fusion_Translator\\") + "PvZ_Fusion_Translator\\".Length); - string slicedKey = Path.Combine(slicedFilePath, fileName); - - #if DEBUG - if (!checkSums.ContainsKey(slicedKey)) - { - checkSums.Add(slicedKey, GetCheckSum(filepath)); - SaveCheckSum(); - modifiedCheckSums.Add(slicedKey, GetCheckSum(filepath)); - SaveModifiedChecksum(); - } - else - { - if ((checkSums[slicedKey] != GetCheckSum(filepath))) - { - checkSums[slicedKey] = GetCheckSum(filepath); - modifiedCheckSums.Add(slicedKey, GetCheckSum(filepath)); - SaveModifiedChecksum(); - } - } - #elif RELEASE - if (!checkSums.ContainsKey(slicedKey) | (checkSums[slicedKey] != GetCheckSum(filepath))) - { - return true; - } - #endif - return false; - } - - public static void ConvertMD5Json() - { - string stringDir = GetAssetDir(AssetType.Dumps); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - string checksumDumpPath = Path.Combine(stringDir, "MD5.json"); - string checksumConvertPath = Path.Combine(stringDir, "MD5Convert.txt"); - string json = File.ReadAllText(checksumDumpPath); - Dictionary dictionary = DeserializeObject>(json); - - using StreamWriter writer = new StreamWriter(checksumConvertPath); - foreach (var kvp in dictionary) - { - string checksumKey = kvp.Key.Replace("\\", "\\\\"); - writer.WriteLine($"{{ \"{kvp.Key}\" , \"{kvp.Value}\" }},"); - } - - Log.LogDebug($"MD5.json converted to MD5Convert.json at {checksumConvertPath}"); - } - } -} -#endif \ No newline at end of file diff --git a/BepInEx/AssetStore/FontStore.cs b/BepInEx/AssetStore/FontStore.cs deleted file mode 100644 index 5be4dd3..0000000 --- a/BepInEx/AssetStore/FontStore.cs +++ /dev/null @@ -1,193 +0,0 @@ -using TMPro; -using System.Collections.Generic; -using System.IO; - -namespace PvZ_Fusion_Translator__BepInEx_.AssetStore -{ - public static class FontStore - { - internal static Dictionary fontAssetDict = []; - internal static Dictionary fontAssetDictSecondary = []; - - internal static void Init() - { - // Clear existing dictionaries to prevent duplicate key errors - fontAssetDict.Clear(); - fontAssetDictSecondary.Clear(); - - string fontsDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Fonts]"); - -#if MULTI_LANGUAGE - foreach (string file in Directory.GetFiles(fontsDir)) - { - string fileName = Path.GetFileNameWithoutExtension(file); - string fileExtension = Path.GetExtension(file); - - if (fileExtension == ".ttf" || fileExtension == ".otf") - { - if (!fileName.EndsWith("_Almanac") && !fileName.EndsWith("_Fallback")) - { - string fontPath = Path.Combine("PvZ_Fusion_Translator", "[Custom Fonts]", fileName + fileExtension); - - TMP_FontAsset fontAsset = FontHandler.LoadTMPFont(fontPath, true); - fontAsset.name = fileName; - if (!fontAssetDict.ContainsKey(fileName)) - { - fontAssetDict.Add(fileName, fontAsset); - } - - Log.LogInfo($"Font for language '{fileName}' loaded"); - } - } - } - - InitFallback(); -#else - string defaultFontDir = Path.Combine("PvZ_Fusion_Translator", "[Custom Fonts]", "English.ttf"); - - TMP_FontAsset defaultFont = FontHandler.LoadTMPFont(defaultFontDir, true); - fontAssetDict.Add("English", defaultFont); -#endif - } - - internal static void InitFallback() - { - string fontsDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Fonts]"); - foreach (string file in Directory.GetFiles(fontsDir)) - { - string fileName = Path.GetFileNameWithoutExtension(file); - string fileExtension = Path.GetExtension(file); - - if (fileExtension == ".ttf" || fileExtension == ".otf") - { - if (fileName.EndsWith("_Almanac") || fileName.EndsWith("_Fallback")) - { - string fallbackPath = Path.Combine("PvZ_Fusion_Translator", "[Custom Fonts]", fileName + fileExtension); - TMP_FontAsset fallbackFont = FontHandler.LoadTMPFont(fallbackPath, true); - fallbackFont.name = fileName; - - string fileNameLanguage = fileName.Replace("_Fallback", "").Replace("_Almanac", ""); - - if (fontAssetDictSecondary.ContainsKey(fileNameLanguage)) - { - if (fileName.EndsWith("_Fallback")) - { - if (!fontAssetDictSecondary.ContainsKey(fileNameLanguage + "_Almanac")) - { - fontAssetDictSecondary.Add(fileNameLanguage + "_Almanac", fontAssetDictSecondary[fileNameLanguage]); - } - fontAssetDictSecondary.Remove(fileNameLanguage); - } - else - { - if (!fontAssetDictSecondary.ContainsKey(fileNameLanguage + "_Fallback")) - { - fontAssetDictSecondary.Add(fileNameLanguage + "_Fallback", fontAssetDictSecondary[fileNameLanguage]); - } - fontAssetDictSecondary.Remove(fileNameLanguage); - } - if (!fontAssetDictSecondary.ContainsKey(fileName)) - { - fontAssetDictSecondary.Add(fileName, fallbackFont); - } - } - else - { - if (!fontAssetDictSecondary.ContainsKey(fileNameLanguage)) - { - fontAssetDictSecondary.Add(fileNameLanguage, fallbackFont); - } - } - - // Log.LogInfo($"Fallback font for language '{fileNameLanguage}' loaded"); - } - } - } - AddFallback(); - } - - public static void AddFallback() - { - foreach (var lang in fontAssetDict.Keys) - { - if (fontAssetDict[lang].fallbackFontAssetTable == null) - { - fontAssetDict[lang].fallbackFontAssetTable = new Il2CppSystem.Collections.Generic.List(); - } - - if (fontAssetDictSecondary.ContainsKey(lang)) - { - fontAssetDict[lang].fallbackFontAssetTable.Add(fontAssetDictSecondary[lang]); - Log.LogInfo("Fallback font for language '" + lang + "' added"); - continue; - } - if (fontAssetDictSecondary.ContainsKey(lang + "_Almanac")) - { - fontAssetDict[lang].fallbackFontAssetTable.Add(fontAssetDictSecondary[lang + "_Almanac"]); - Log.LogInfo("Fallback font for language '" + lang + "' added"); - continue; - } - if (fontAssetDictSecondary.ContainsKey(lang + "_Fallback")) - { - fontAssetDict[lang].fallbackFontAssetTable.Add(fontAssetDictSecondary[lang + "_Fallback"]); - Log.LogInfo("Fallback font for language '" + lang + "' added"); - continue; - } - } - } - -#if MULTI_LANGUAGE - public static TMP_FontAsset LoadTMPFont(string language) - { - if (fontAssetDict.TryGetValue(language, out TMP_FontAsset font)) - { - TMP_FontAsset fontAsset = font; - if (fontAsset.fallbackFontAssetTable != null) - { - // Log.LogInfo("Fallback font for language '" + language + "' loaded. The name of the FB Font is" + fontAsset.fallbackFontAssetTable[0].name); - } - return fontAsset; - } - return fontAssetDict.GetValueOrDefault("English"); - } -#else - public static TMP_FontAsset LoadTMPFont() - { - TMP_FontAsset defaultFont = fontAssetDict["English"]; - return defaultFont; - } -#endif - - public static TMP_FontAsset LoadTMPFontAlmanac(string language) - { - if (fontAssetDictSecondary.ContainsKey(language)) - { - if (fontAssetDictSecondary.TryGetValue(language, out TMP_FontAsset almanacAsset)) - { - return almanacAsset; - } - } - if (fontAssetDictSecondary.ContainsKey(language + "_Almanac")) - { - if (fontAssetDictSecondary.TryGetValue(language + "_Almanac", out TMP_FontAsset almanacAsset)) - { - return almanacAsset; - } - } - - return fontAssetDict.GetValueOrDefault("English"); - } - -#if MULTI_LANGUAGE - public static void Reload() - { - // Get the current language - string currentLanguage = Utils.Language.ToString(); - - // Load the font for the current language - _ = LoadTMPFont(currentLanguage); - } -#endif - - } -} \ No newline at end of file diff --git a/BepInEx/AssetStore/StringStore.cs b/BepInEx/AssetStore/StringStore.cs deleted file mode 100644 index 0fc5372..0000000 --- a/BepInEx/AssetStore/StringStore.cs +++ /dev/null @@ -1,411 +0,0 @@ -using TMPro; -using System.Text.RegularExpressions; -using UnityEngine; -using System.Collections.Generic; -using System.IO; - -namespace PvZ_Fusion_Translator__BepInEx_.AssetStore -{ - public static class StringStore - { - internal static Dictionary stringsDict = []; - - public static Dictionary translationStringRegex = new(); - - public static Dictionary translationString = new(); - - public static Dictionary> patchesStore = new() - { - { "Difficulty", new Dictionary - { - { "English" , "Difficulty:" }, - { "French" , "Difficulté:" }, - { "Italian" , "Difficoltà:" }, - { "German" , "Schwierigkeit:" }, - { "Spanish" , "Dificultad:" }, - { "Portuguese" , "Dificuldade:" }, - { "Filipino" , "Ang Hirap:" }, - { "Vietnamese" , "Độ Khó:" }, - { "Indonesian" , "Kesulitan:" }, - { "Russian" , "Сложность:" }, - { "Japanese" , "困難:" }, - { "Korean", "난이도:" }, - { "Javanese" , "Kesulitan:" }, - { "Polish", "Trudność:"}, - { "Hungarian", "Nehézség:"}, - { "Arabic", "صعوبة:"}, - // { "Ukrainian" , "Складність:" }, - // { "Slovak" , "Náročnosť:" }, - } - }, - { "Zombies", new Dictionary - { - { "English" , "Zombies:" }, - { "French" , "Les Zombies:" }, - { "Italian" , "Zombi:" }, - { "German" , "Zombies:" }, - { "Spanish" , "Zombis:" }, - { "Portuguese" , "Zumbis:" }, - { "Filipino" , "Mga Zombie:" }, - { "Vietnamese" , "Thây Ma:" }, - { "Indonesian" , "Zombi:" }, - { "Russian" , "Зомби:" }, - { "Japanese" , "ゾンビ:" }, - { "Korean", "좀비:" }, - { "Javanese" , "Mayit:" }, - { "Polish" , "Zombi:" }, - { "Hungarian" , "Zombik:" }, - { "Arabic" , "الزومبي:" }, - // { "Ukrainian" , "Зомбі:" }, - // { "Slovak" , "Zombíci:"} - } - } - - }; - - internal static void Init() - { - FileLoader.LoadStrings(); - } - - internal static void Reload() - { - translationString.Clear(); - translationStringRegex.Clear(); - FileLoader.LoadStrings(); - } - - public static TextMeshPro TranslateText(TextMeshPro originalTMP, bool isLog = false) - { - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - - string translatedText = TranslateText(originalTMP.text); - originalTMP.font = fontAsset; - originalTMP.text = translatedText; - - return originalTMP; - } - - public static TextMeshProUGUI TranslateText(TextMeshProUGUI originalTMP, bool isLog = false) - { - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - - string translatedText = TranslateText(originalTMP.text); - originalTMP.font = fontAsset; - originalTMP.text = translatedText; - - return originalTMP; - } - - public static string TranslateText(string originalText, bool isLog = false) - { - string text = DoTranslateText(originalText, false); - string checkText; - #if DEBUG - Regex regex = new("\\p{IsCJKUnifiedIdeographs}+"); - Match match = regex.Match(text); - - if(match.Success) - { - // Log.LogDebug("Untranslated String: " + match.Value); - FileLoader.DumpUntranslatedStrings(text); - } - #endif - checkText = text; - - return checkText; - - } - - public static string TranslateText(string originalText, string pattern, bool isLog = false) - { - if (TestRegex(originalText, pattern) && translationStringRegex.ContainsKey(pattern)) - { - // Extract dynamic parts from the original text - var regex = new Regex(pattern); - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - if (isLog) - Log.LogDebug("Text found in translationStringRegex {0}: {1}", match, groupCount); - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = translationString.ContainsKey(groupValue) - ? translationString[groupValue] - : groupValue; - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - return string.Format(translationStringRegex[pattern], [.. dynamicParts]); - } - else - { - if (isLog) - Log.LogDebug($"Text '{originalText}' not translated"); -#if DEBUG - FileLoader.DumpUntranslatedStrings(originalText); -#endif - return originalText; - } - } - - public static string TranslateColorText(string originalText, bool isLog = false) - { - string pattern = @"(]*>.*?)"; - if (TestRegex(originalText, pattern)) - { - return DoTranslateText(originalText, isLog); - } - return originalText; - } - - public static string DoTranslateText(string originalText, bool isLog = false) - { - if (string.IsNullOrEmpty(originalText)) - { - if (isLog) - Log.LogError("Text Null or Empty"); - - return string.Empty; - } - - if (translationString.ContainsKey(originalText)) - { - if (isLog) - Log.LogDebug($"Text '{originalText} found in translationString"); - return translationString[originalText]; - } - - // Regex-based dynamic translation - foreach (var entry in translationStringRegex) - { - if (TestRegex(originalText, entry.Key)) - { - // Extract dynamic parts from the original text - var regex = new Regex(entry.Key); - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - if (isLog) - Log.LogDebug("Text found in translationStringRegex {0}: {1}", match, groupCount); - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = translationString.ContainsKey(groupValue) - ? translationString[groupValue] - : groupValue; - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - return string.Format(entry.Value, [.. dynamicParts]); - } - } - - if (isLog) - Log.LogDebug($"Text '{originalText}' not translated"); - return originalText; - } - - public static bool TestRegex(string originalText, string pattern) - { - return Regex.IsMatch(originalText, pattern); - } - - private static TextAlignmentOptions TextAnchorToTMPAlignment(TextAnchor anchor) - { - return anchor switch - { - TextAnchor.UpperLeft => TextAlignmentOptions.TopLeft, - TextAnchor.UpperCenter => TextAlignmentOptions.Top, - TextAnchor.UpperRight => TextAlignmentOptions.TopRight, - TextAnchor.MiddleLeft => TextAlignmentOptions.MidlineLeft, - TextAnchor.MiddleCenter => TextAlignmentOptions.Center, - TextAnchor.MiddleRight => TextAlignmentOptions.MidlineRight, - TextAnchor.LowerLeft => TextAlignmentOptions.BottomLeft, - TextAnchor.LowerCenter => TextAlignmentOptions.Bottom, - TextAnchor.LowerRight => TextAlignmentOptions.BottomRight, - _ => TextAlignmentOptions.Center - }; - } - - public static TextMeshProUGUI ConvertToTextMeshPro(UnityEngine.UI.Text oldText, TMP_FontAsset fontAsset, bool isLog = false) - { - if (oldText == null) - { - Log.LogError("UnityEngine.UI.Text component is null."); - return null; - } - - if (fontAsset == null) - { - Log.LogError("TMP_FontAsset is null. Conversion cannot proceed."); - return null; - } - - // Log.LogInfo($"Converting UnityEngine.UI.Text: {oldText.name}"); - - GameObject textObject = oldText.gameObject; - - // Preserve text content and settings - string originalText = oldText.text; - originalText = TranslateText(originalText, isLog); - TextAnchor alignment = oldText.alignment; - Color color = oldText.color; - - // Remove old Text component - UnityEngine.Object.DestroyImmediate(oldText); - - // Add TextMeshProUGUI component - TextMeshProUGUI newTMP = textObject.AddComponent(); - if (newTMP == null) - { - Log.LogError($"Failed to add TextMeshProUGUI to object: {textObject.name}"); - return null; - } - - // Configure TextMeshProUGUI - newTMP.text = originalText; - newTMP.color = color; - newTMP.alignment = TextAnchorToTMPAlignment(alignment); - newTMP.font = fontAsset; - - // Log.LogInfo($"Successfully converted {textObject.name} to TextMeshProUGUI."); - - return newTMP; - } - - public static void TranslateTextTransform(Transform baseTransform, bool isAutoTextContainer = false, bool isLog = false) - { - if (!baseTransform) return; - -#if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); -#else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); -#endif - - if (fontAsset == null) - { -#if MULTI_LANGUAGE - Log.LogError($"Font for language '{currentLanguage}' not found. Translation aborted."); -#else - Log.LogError("Font not found. Translation aborted."); -#endif - return; - } - - // Local function for processing transforms - void ProcessTextTransform(Transform textTransform) - { - if (!textTransform) return; - - // Handle TextMeshPro components - TextMeshPro textTMP = textTransform.GetComponent(); - if (textTMP) - { - textTMP.text = TranslateText(textTMP.text, isLog); - textTMP.autoSizeTextContainer = isAutoTextContainer; - textTMP.font = fontAsset; - } - - TextMeshProUGUI textTMPUGUI = textTransform.GetComponent(); - if (textTMPUGUI) - { - textTMPUGUI.text = TranslateText(textTMPUGUI.text, isLog); - textTMPUGUI.enableAutoSizing = isAutoTextContainer; - textTMPUGUI.font = fontAsset; - } - - // Handle UnityEngine.UI.Text components - UnityEngine.UI.Text textUI = textTransform.GetComponent(); - if (textUI) - { - ConvertToTextMeshPro(textUI, fontAsset, isLog); - } - } - - // Process specific text paths - ProcessTextTransform(baseTransform.Find("text")); - ProcessTextTransform(baseTransform.Find("text1")); - // ProcessTextTransform(baseTransform.Find("text2")); - - Transform shadowTransform = baseTransform.Find("text/shadow"); - if (shadowTransform) ProcessTextTransform(shadowTransform); - - shadowTransform = baseTransform.Find("text1/shadow"); - if (shadowTransform) ProcessTextTransform(shadowTransform); - -#if TESTING - Transform childTransform = baseTransform.GetChild(0); - if (childTransform) ProcessTextTransform(childTransform); -#endif - } - - public static void TranslateTextUI(TextMeshPro textTMP, bool? isAutoTextContainer = null, bool isLog = false) - { - string currentLanguage = Utils.Language.ToString(); - if (textTMP) - { - textTMP.text = TranslateText(textTMP.text, isLog); - if (isAutoTextContainer!=null) textTMP.autoSizeTextContainer = isAutoTextContainer.Value; - textTMP.font = FontStore.LoadTMPFont(currentLanguage); - } - } - public static void TranslateTextUI(TextMeshProUGUI textTMP, bool? isAutoTextContainer = null, bool isLog = false) - { - string currentLanguage = Utils.Language.ToString(); - if (textTMP) - { - string origText = textTMP.text; - - textTMP.text = TranslateText(origText, isLog) == "" ? origText : TranslateText(origText, isLog); - if (isAutoTextContainer != null) textTMP.autoSizeTextContainer = isAutoTextContainer.Value; - if (origText != textTMP.text) - textTMP.font = FontStore.LoadTMPFont(currentLanguage); - } - } - - public static void TranslateTextUI(TMP_InputField TextInput) - { - string currentLanguage = Utils.Language.ToString(); - if (TextInput) - { - string oriText = TextInput.m_Text; - TextInput.m_Text = TranslateText(oriText); - TextInput.m_OriginalText = TranslateText(oriText); - TextInput.fontAsset = FontStore.LoadTMPFont(currentLanguage); - } - } - - public static void LogAll() - { - Log.LogInfo("Logging all StringStore entries."); - Log.LogInfo("Regex Entries: {0}", translationStringRegex.Count); - Log.LogInfo("String Entries: {0}", translationString.Count); - } - } -} \ No newline at end of file diff --git a/BepInEx/AssetStore/TextureStore.cs b/BepInEx/AssetStore/TextureStore.cs deleted file mode 100644 index 1be856c..0000000 --- a/BepInEx/AssetStore/TextureStore.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Collections.Generic; -using System.Collections; -using UnityEngine; -using System.IO; - -namespace PvZ_Fusion_Translator__BepInEx_.AssetStore -{ - public static class TextureStore - { - internal static Dictionary textureDict = []; - - internal static Dictionary spriteDict = []; - - internal static void Init() => FileLoader.LoadTextures(); - - internal static void Reload() - { - textureDict.Clear(); - #if MULTI_LANGUAGE - RestoreTextures(); - #endif - if(!Utils.customTextures) - { - FileLoader.LoadDefaultTextures(); - } - FileLoader.LoadTextures(); - } - - public static IEnumerator ReplaceTexturesCoroutine() - { - if (!Utils.customTextures) - { - FileLoader.LoadDefaultTextures(); - } - while (true) - { - ReplaceTextures(); - yield return new WaitForSeconds(0.5f); // Adjust this interval as needed - } - } - - public static void ReplaceTextures() - { - Texture2D[] textures = Resources.FindObjectsOfTypeAll(); - foreach (Texture2D texture in textures) - { - if (texture.name.StartsWith("replaced_")) - continue; - - Utils.TryReplaceTexture2D(texture); - } - } - - #if MULTI_LANGUAGE - public static void RestoreTextures() - { - Texture2D[] textures = Resources.FindObjectsOfTypeAll(); - foreach (Texture2D texture in textures) - { - if (texture != null) - { - texture.name = texture.name.Replace("replaced_", ""); - } - } - } - #endif - - public static void LogAll() - { - Log.LogInfo("Logging all TextureStore entries."); - foreach (KeyValuePair entry in textureDict) - { - Log.LogInfo("TextureDict Entry: " + entry.Key + " | " + entry.Value); - } - } - } -} diff --git a/BepInEx/AssetStore/WarningStore.cs b/BepInEx/AssetStore/WarningStore.cs deleted file mode 100644 index 16e7a4b..0000000 --- a/BepInEx/AssetStore/WarningStore.cs +++ /dev/null @@ -1,218 +0,0 @@ -using System.Runtime.CompilerServices; - -using TMPro; -using UnityEngine; -using UnityEngine.TextCore.Text; -using System.IO; -using System.Collections.Generic; - -namespace PvZ_Fusion_Translator__BepInEx_.AssetStore -{ - public static class WarningStore - { - #if MULTI_LANGUAGE - private static Dictionary warningMessages = new() - { - { "English", ("The only valid source of this translation is from this community:\n" + - "discord.gg/DPAC5ZVJ8T. If you got this anywhere else like \n" + - "Plants Hybrid and superhybrid.online, they stole it.\n" + - "Stray away from other sources as they may contain viruses.\n" + - "Please visit our community for future updates.", - "Okay! Got it.") }, - { "French", ("La seule source valide pour cette traduction provient de cette\n" + - "communauté :discord.gg/DPAC5ZVJ8T. Si vous l'avez obtenue \n" + - "ailleurs, comme Plants Hybrid ou superhybrid.online, ils l'ont volée.\n" + - "Évitez les autres sources, car elles peuvent contenir des virus.\n" + - "Veuillez visiter notre communauté pour les mises à jour futures.", - "D'accord !") }, - { "Italian", ("L'unica fonte valida di questa traduzione è questa community:\n" + - "discord.gg/DPAC5ZVJ8T. Se l'hai ottenuta altrove, come \n" + - "Plants Hybrid e superhybrid.online, l'hanno rubata.\n" + - "Evita altre fonti, potrebbero contenere virus.\n" + - "Visita la nostra community per aggiornamenti futuri.", - "Va bene! Ho capito.") }, - { "German", ("Die einzige gültige Quelle für diese Übersetzung stammt aus\n" + - "dieser Community: discord.gg/DPAC5ZVJ8T. Wenn Sie diese \n" + - "irgendwo anders gefunden haben, z. B. bei Plants Hybrid oder \n" + - "superhybrid.online, dann haben sie sie gestohlen.\n" + - "Meiden Sie andere Quellen, da diese Viren enthalten könnten.\n" + - "Bitte besuchen Sie unsere Community für zukünftige Updates.", - "Okay, verstanden!") }, - { "Spanish", ("La única fuente válida de esta traducción proviene de esta\n" + - "comunidad: discord.gg/DPAC5ZVJ8T. Si la obtuvo en cualquier\n" + - "otro lugar como Plants Hybrid o superhybrid.online, la robaron.\n" + - "Manténgase alejado de otras fuentes, ya que podrían contener virus.\n" + - "Por favor, visite nuestra comunidad para futuras actualizaciones.", - "¡Entendido!") }, - { "Portuguese", ("O lugar original e seguro dessa tradução vem daqui:\n" + - "discord.gg/DPAC5ZVJ8T. Se você baixou ela de qualquer \n" + - "lugar como Plants Hybrid ou superhybrid.online, eles\n" + - "roubaram. Evite baixar deles, pode conter vírus.\n" + - "Por favor, visite nossa comunidade para atualizações futuras.", - "Okay, entendido.") }, - { "Filipino", ("Ang tanging opisyal na source ng pagsasaling ito ay mula\n" + - "lamang dito: discord.gg/DPAC5ZVJ8T. Kung nakuha nmo ito kahit \n" + - "saan pa tulad ng Plants Hybrid at superhybrid.online, ito ay ninakaw. \n" + - "Lumayo sa ibang source dahil posibleng may kasamang virus.\n" + - "Paki-bisita ang aming komunidad para sa mga darating na update." , - "Naiintindihan!") }, - { "Vietnamese", ("Nguồn duy nhất hợp lệ của bản dịch này là từ cộng\n" + - "đồng này: discord.gg/DPAC5ZVJ8T. Nếu bạn nhận \n" + - "được nó ở bất cứ nơi nào khác như Plants Hybrid \n" + - "hoặc superhybrid.online, họ đã ăn cắp nó.\n" + - "Tránh xa các nguồn khác vì chúng có thể chứa \n" + - "virus. Hãy ghé thăm cộng đồng của chúng tôi để \n" + - "cập nhật trong tương lai.", - "Đồng ý!") }, - { "Indonesian", ("Satu-satunya sumber resmi dari terjemahan ini adalah \n" + - "komunitas kami: discord.gg/DPAC5ZVJ8T. Jika Anda \n" + - "mendapatkannya dari sumber lain seperti Plants Hybrid \n" + - "dan superhybrid.online, mereka mencurinya. \n" + - "Jauhi sumber lain karena mungkin ada virus.\n" + - "Silakan kunjungi komunitas kami untuk pembaruan berikutnya.", - "Oke! Mengerti.") }, - { "Russian", ("Единственный проверенный источник этого перевода —\n" + - "сообщество discord.gg/DPAC5ZVJ8T.\n" + - "Или же его замена https://t.me/nekoshkindom\n" + - "Если вы скачали этот мод где-либо ещё, возможно он содержит вирусы.\n" + - "Программист перевода: LancerX0.\n" + - "Переводчик: Nekosha.", "Хорошо!") }, - { "Japanese", ("この翻訳の唯一の有効なソースは、このコミュニティからです:\n" + - "discord.gg/DPAC5ZVJ8T.Plants Hybridやsuperhybrid.online、\n" + - "YoutubeのBlue Flyが作っているもの、他のどこかでこれを入手した場合、\n" + - "彼らはそれを盗んだことになります。ウイルスが含まれている可能性があるので、\n" + - "他のソースからは離れてください。今後のアップデートについては、\n私たちのコミュニティをご覧ください。", - "了解しました!") }, - { "Korean", ("이 번역은 Bloom(discord.gg/DPAC5ZVJ8T)에서만\n" + - "제공됩니다. Bloom 디스코드 이외의 다른서드 파티 사이트, \n" + - "예를 들어 Plants Hybrid 및 superhybrid.online, 또는\n" + - "유튜브 Blue Fly등에서 제공하는 파일은 무단으로 재배포된 것이며,\n" + - "이런 사이트들에는 바이러스가 포함되어 있을 가능성이 높습니다. \n향후 업데이트를 위해 저희 디스코드를 방문해 주세요.", - "확인") }, - { "Javanese" , ("Sumber mung sing sah kanggo terjemahan iki saka komunitas iki:\n" + - "discord.gg/DPAC5ZVJ8T. Yen sampeyan nemokake iki ing papan\n" + - "liya kaya Plants Hybrid lan superhybrid.online, iku dicolong.\n" + - "Aja nyedhaki sumber liya amarga bisa ngandhut virus. Mangga\n" + - "ngunjungi komunitas kita kanggo nganyari ing mangsa ngarep.", - "Oke! Ngertos.") }, - { "Polish" , ("Jedynym wiarygodnym źródłem tego tłumaczenia jest ta społeczność:\n" + - "discord.gg/DPAC5ZVJ8T. Jeśli znalazłeś to gdziekolwiek indziej, np. \n" + - "Plants Hybrid i superhybrid.online, ukradli to.\n" + - "Omijaj inne źródła, ponieważ mogą zawierać wirusy.\n" + - "Odwiedź naszą społeczność, aby uzyskać przyszłe aktualizacje.", - "Okay! Rozumiem.") }, - { "Hungarian" , ("Ennek a fordításnak az egyetlen érvényes forrása ebből a közösségből származik:\n" + - "discord.gg/DPAC5ZVJ8T. Ha ezt valahol máshol szerezted, például \n" + - "Plants Hybrid és superhybrid.online oldalakon, akkor ők lopták.\n" + - "Kerüld a többi forrást, mert vírusokat tartalmazhatnak.\n" + - "Kérjük, látogass el közösségünkbe a jövőbeli frissítésekért.", - "Oké! Értem.") }, - { "Arabic" , ("The only valid source of this translation is from this community:\n" + - "discord.gg/DPAC5ZVJ8T. If you got this anywhere else like \n" + - "Plants Hybrid and superhybrid.online, they stole it.\n" + - "Stray away from other sources as they may contain viruses.\n" + - "Please visit our community for future updates.", - "Okay! Got it.") }, - // { "OTHER" , ("A única fonte válida dessa tradução é desta\ncomunidade: discord.gg/DPAC5ZVJ8T. Se você obteve \nisso em qualquer lugar como Plants Hybrid\ne superhybrid.online,ou Blue Fly do Youtube,\nelses roubaram. Fique longe de sites falsos. Por favor,\nvisite nossa comunidade para futuras atualizações.", "¡Okei! Entendido.") } - // { "OTHER" , ("Ang translation na ito ay galing dito lamang:\ndiscord.gg/DPAC5ZVJ8T. Pag nakuha niyo ito sa iba pa\nkagaya ng Plants Hybrid o superhybrid.online, anumang\nginawagawa ng Blue Fly mula sa Youtube, o anumang\nSub2Unlock links, scam sila. MAG INGAT dahil\nkasi baka may virus 'jan. Join kayo sa discord namin!\nFilipino Translation by ColinPogi" , "Tayo magsi-laro!") } - }; - #else - public static string warningMessage = "La única fuente válida de esta traducción proviene de esta\ncomunidad: discord.gg/DPAC5ZVJ8T. Si la obtuvo en cualquier\notro lugar como Plants Hybrid o superhybrid.online, la robaron.\nManténgase alejado de otras fuentes, ya que podrían contener virus.\nPor favor, visite nuestra comunidad para futuras actualizaciones."; - public static string okayButton = "¡Entendido!"; - #endif - - #if MULTI_LANGUAGE - public static (string, string) GetWarningMessage(Utils.LanguageEnum language) - { - if (warningMessages.TryGetValue(language.ToString(), out var message)) - { - - return message; - } - else - { - return warningMessages["English"]; // Default to English if language code is not found - } - } - #endif - - public static void WarningLoad(NoticeMenu noticeMenu) - { - //GameAPP.theGameStatus = GameStatus.OpenOptions; - //GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("UI/Prefabs/NoticePauseMenu"), GameAPP.canvas.transform); - //gameObject.name = "WarningMessage"; - //TextMeshProUGUI warning = gameObject.transform.GetChild(0).GetChild(0).GetComponent(); - //TextMeshProUGUI warningShadow = gameObject.transform.GetChild(0).GetChild(1).GetComponent(); - //Transform button = gameObject.transform.GetChild(1); - //warning.transform.position = new Vector3(0.7f, 0.4f, 0f); - //warningShadow.transform.position = new Vector3(0.7f, 0.4f, 0f); - - #if MULTI_LANGUAGE - var (warningMessage, okayButton) = WarningStore.GetWarningMessage(Utils.Language); - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - Transform warningTransform = noticeMenu.transform.FindChild("窗口"); - Transform warningTextTransform = warningTransform.FindChild("文字"); - Transform warningTextShadowTransform = warningTransform.FindChild("文字2"); - - Transform[] array = [warningTextTransform, warningTextShadowTransform]; - - for (int i = 0; i < array.Length; i++) - { - if (array[i] != null) - { - array[i].GetComponent().text = warningMessage; - array[i].GetComponent().font = fontAsset; - } - } - #endif - - //warning.text = warningMessage; - //warningShadow.text = warningMessage; - //warning.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - //warningShadow.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - - //button.GetComponent().buttonNumber = 10; - //button.GetChild(0).GetComponent().text = okayButton; - //button.GetChild(0).GetComponent().font = FontStore.LoadTMPFont(Utils.Language.ToString()); - //button.GetChild(1).GetComponent().text = okayButton; - //gameObject.SetActive(false); - //gameObject.SetActive(true); - } - - #if MULTI_LANGUAGE - - public static bool isWarningMessageLoaded = false; - - public static void WarningReload(Utils.LanguageEnum language, NoticeMenu noticeMenu) - { - // Log.LogInfo("Current Language is " + Utils.OldLanguage); - // Log.LogInfo("Changed Language to " + language); - - if (Utils.OldLanguage.ToString() == language.ToString() && Utils.OldLanguage.ToString() != "English") - { - return; - } - if (!isWarningMessageLoaded) - { - WarningLoad(noticeMenu); - isWarningMessageLoaded = true; - } - - return; - } - #else - - public static bool isWarningMessageLoaded = false; - - public static void WarningReload() - { - if (!WarningStore.isWarningMessageLoaded) - { - WarningStore.WarningLoad(); - WarningStore.isWarningMessageLoaded = true; - } - } - #endif - } -} \ No newline at end of file diff --git a/BepInEx/Core.cs b/BepInEx/Core.cs deleted file mode 100644 index 6d58a9d..0000000 --- a/BepInEx/Core.cs +++ /dev/null @@ -1,185 +0,0 @@ -using BepInEx; -using BepInEx.Configuration; -using BepInEx.Logging; -using BepInEx.Unity.IL2CPP; -using BepInEx.Unity.IL2CPP.Utils; -using TMPro; -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_.Patches.Managers; -using System; -using System.IO; -using System.Reflection; -using UnityEngine; - -[BepInPlugin("PVZFusionTranslator_BepInEx", "PvZ Fusion Translator", "3.1.1")] -[BepInProcess("PlantsVsZombiesRH.exe")] -public class Core : BasePlugin -{ - public string modsDirectory => Path.Combine(Paths.PluginPath, "PvZ_Fusion_Translator"); - - private static DateTime dtStart; - private static DateTime? dtStartToast; - private static string toast_txt; - - public new static ManualLogSource Log; - public static Core Instance { get; private set; } - public static MonoBehaviour MonoInstance { get; private set; } - - private Coroutine replaceTextureRoutine = null; - - public ConfigEntry configDefaultTextures; - public ConfigEntry configDefaultAudio; - public ConfigEntry configLanguage; - - private static float lastCheck = 0f; - private static float checkTime = 0f; - private static float checkInterval = 2f; - private static bool stringreloaded = false; - - public override void Load() - { - Log = base.Log; - Instance = this; - LoadConfig(); - MonoInstance = AddComponent(); - Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); - dtStart = DateTime.Now; - - FileLoader.LoadLanguage(); - - AudioStore.Init(); - TextureStore.Init(); - StringStore.Init(); - FontStore.Init(); - Utils.RegisterPlantIndices(); - - //Utils.RegisterRecipeLinks(); - //PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects.Zombie_Patch.LoadHPStrings(); - - InitCoroutine(); - } - - public override bool Unload() - { - if (replaceTextureRoutine != null) - { - MonoInstance.StopCoroutine(replaceTextureRoutine); - Log.LogDebug("Coroutine Stopped"); - } - FileLoader.SaveLanguage(); - - #if OBFUSCATE && !RELEASE - CheckSumStore.ConvertMD5Json(); - #endif - - return true; - } - public void InitCoroutine() - { - replaceTextureRoutine = MonoInstance.StartCoroutine(TextureStore.ReplaceTexturesCoroutine()); - } - public static void ShowToast(string message) - { - toast_txt = message; - dtStartToast = DateTime.Now; - } - - public void OnUpdate() - { - ModFeatures.OnLateUpdate(); - - if (Input.GetKeyDown(KeyCode.Insert)) - { - Log.LogInfo("Insert press"); - Utils.OpenSaveDirectory(); - } - - if (Input.GetKeyDown(KeyCode.Delete)) - { - Log.LogInfo("del del"); - Utils.OpenTrello(); - } - if (TowerManager.Instance != null) - { - TowerManager_Patch.UpdateText(); - } - if (Input.GetKeyDown(KeyCode.RightShift)) - { - stringreloaded = !stringreloaded; - } - Core.DebugStringReload(); - } - - public static void DebugStringReload() - { - if (stringreloaded == true) - { - checkTime += Time.deltaTime; - if (checkTime >= checkInterval) - { - StringStore.Reload(); - ShowToast("Strings Reloaded!"); - checkTime = 0f; - } - } - } - - public void OnGUI() - { - #if DEBUG - if (dtStartToast != null) - { - try - { - GUI.Button(new Rect(10f, 10f, 200f, 20f), "\n" + toast_txt + "\n"); - } - catch(Exception e) - { - Log.LogError(e); - } - - TimeSpan? timeSpan = DateTime.Now - dtStartToast; - TimeSpan t = new TimeSpan(0, 0, 2); - if (timeSpan > t) - { - dtStartToast = null; - } - } - #endif - } - - private void LoadConfig() - { - string mainCategory = "PvZ_Fusion_Translator"; - - if(Config.TryGetEntry(new ConfigDefinition(mainCategory, "DefaultTextures"), out configDefaultTextures) == false) - { - configDefaultTextures = Config.Bind(new ConfigDefinition(mainCategory, "DefaultTextures"), false, new ConfigDescription("Use Default Textures + Translation Textures", new AcceptableValueList(true, false))); - } - bool defaultTextures = Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultTextures"), out configDefaultTextures); - - if (Config.TryGetEntry(new ConfigDefinition(mainCategory, "DefaultAudio"), out configDefaultAudio) == false) - { - configDefaultAudio = Config.Bind(new ConfigDefinition(mainCategory, "DefaultAudio"), false, new ConfigDescription("Use Default Audio", new AcceptableValueList(true, false))); - } - bool defaultAudio = Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultAudio"), out configDefaultAudio); - - if (Config.TryGetEntry(new ConfigDefinition(mainCategory, "Language"), out configLanguage) == false) - { - configLanguage = Config.Bind(new ConfigDefinition(mainCategory, "Language"), "English", new ConfigDescription("Load the Game in this Language", new AcceptableValueList("English", "French", "Italian", "German", "Spanish", "Portuguese", "Indonesian", "Vietnamese", "Javanese", "Russian", "Japanese", "Korean"))); - } - bool language = Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "Language"), out configLanguage); - } -} - -public class UnityCoroutineHelper : MonoBehaviour -{ - public static UnityCoroutineHelper Instance { get; private set; } - - public void Awake() - { - Instance = this; - } -} \ No newline at end of file diff --git a/BepInEx/FileLoader.cs b/BepInEx/FileLoader.cs deleted file mode 100644 index b410aee..0000000 --- a/BepInEx/FileLoader.cs +++ /dev/null @@ -1,382 +0,0 @@ -using BepInEx.Configuration; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_.Patches.OtherManagers; -using System; -using System.Collections.Generic; -using System.IO; -using System.Text.Encodings.Web; -using System.Text.Json; -using UnityEngine; -using UnityEngine.Rendering; - -namespace PvZ_Fusion_Translator__BepInEx_ -{ - internal static class FileLoader - { - internal enum AssetType - { - Textures, - Strings, - Dumps, - Almanac, - Sprites - } - - public static string GetAssetDir(AssetType assetType, Utils.LanguageEnum? language = null) - { - string languagePath = language.HasValue ? ("Localization" + Path.DirectorySeparatorChar + language.ToString()) : string.Empty; - return Path.Combine(Core.Instance.modsDirectory, languagePath, assetType.ToString()); - } - // private static string GetAssetDir(AssetType assetType) => Path.Combine(Core.Instance.modsDirectory, assetType.ToString()); - -#if MULTI_LANGUAGE - internal static void LoadStrings() => LoadStrings(Utils.Language); - - internal static void LoadStrings(Utils.LanguageEnum language) -#else - internal static void LoadStrings(bool isLog = false) -#endif - { -#if MULTI_LANGUAGE - string stringDir = GetAssetDir(AssetType.Strings, Utils.Language); -#else - string stringDir = GetAssetDir(AssetType.Strings); -#endif - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - try - { - foreach (string filepath in Directory.EnumerateFiles(stringDir, "*.json", SearchOption.AllDirectories)) - { - -#if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } -#endif - - string fileName = Path.GetFileNameWithoutExtension(filepath); - StringStore.stringsDict[fileName] = filepath; -#if DEBUG - Log.LogInfo("Loading File : " + filepath); -#endif - string jsonString = File.ReadAllText(filepath); - if (fileName.EndsWith("_strings")) - { - Dictionary dictionary = System.Text.Json.JsonSerializer.Deserialize>(jsonString); - foreach (var (key, value) in dictionary) - { - StringStore.translationString[key] = value; - } - } - else if (fileName.EndsWith("_regexs")) - { - Dictionary dictionary = System.Text.Json.JsonSerializer.Deserialize>(jsonString); - foreach (var (key, value) in dictionary) - { - StringStore.translationStringRegex[key] = value; - } - } - } - SaveStrings(); - DumpJson(); - } - catch (Exception e) - { - Log.LogError("Error loading string."); - Log.LogError(e.GetType() + " " + e.Message); - } - Log.LogInfo("Strings loaded successfully."); - } - - - internal static void LoadTextures() - { - - // Default or Custom Texturse -> English Textures -> Localized Textures - try - { - if (Utils.customTextures) - { - LoadCustomTextures(); - } - else - { - LoadDefaultTextures(); - } - } - catch (Exception e) - { - Log.LogError("Error loading texture setting."); - Log.LogError($"{e.GetType()} {e.Message}"); - } - -#if MULTI_LANGUAGE - if (Utils.Language != Utils.LanguageEnum.English) - { - LoadLocalizedTextures(Utils.LanguageEnum.English); - } - LoadLocalizedTextures(Utils.Language); -#else - LoadLocalizedTextures(); -#endif - - Log.LogInfo("Textures loaded successfully."); - } - - internal static void LoadLocalizedTextures(Utils.LanguageEnum? language = null) - { - ConfigEntry defaultTextureEntry; - Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultTextures"), out defaultTextureEntry); - - string textureDir = GetAssetDir(AssetType.Textures, language); - - if (!Directory.Exists(textureDir)) - { - Directory.CreateDirectory(textureDir); - } - try - { - foreach (string filepath in Directory.EnumerateFiles(textureDir, "*.png", SearchOption.AllDirectories)) - { - if (filepath.Contains("[Custom Textures]", StringComparison.OrdinalIgnoreCase) && defaultTextureEntry.Value) - { - continue; - } - -#if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } -#endif - -#if DEBUG - Log.LogDebug("Loading File : " + filepath); -#endif - - Texture2D texture2D = Utils.LoadImage(filepath); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - - internal static void LoadDefaultTextures() - { - if (Core.Instance.configDefaultTextures.Value) - { - string textureDefaultDir = Path.Combine(Core.Instance.modsDirectory, AssetType.Dumps.ToString(), "Default Textures [Do Not Remove]"); - if (!Directory.Exists(textureDefaultDir)) - { - Directory.CreateDirectory(textureDefaultDir); - } - try - { - foreach (string filepath in Directory.EnumerateFiles(textureDefaultDir, "*.png", SearchOption.AllDirectories)) - { - -#if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } -#endif - - Texture2D texture2D = Utils.LoadImage(filepath); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - } - - internal static void LoadCustomTextures() - { - string texturePackDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Textures]"); - - if (!Directory.Exists(texturePackDir)) - { - Directory.CreateDirectory(texturePackDir); - } - try - { - foreach (string filepath in Directory.EnumerateFiles(texturePackDir, "*.png", SearchOption.AllDirectories)) - { -#if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } -#endif - - Texture2D texture2D = Utils.LoadImage(filepath); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = filepath; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - - internal static void SaveStrings() - { -#if MULTI_LANGUAGE - string stringDir = GetAssetDir(AssetType.Strings, Utils.Language); -#else - string stringDir = GetAssetDir(AssetType.Strings); -#endif - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - - string translationStringRegex = System.Text.Json.JsonSerializer.Serialize(StringStore.translationStringRegex, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - - File.WriteAllText(Path.Combine(stringDir, "translation_regexs.json"), translationStringRegex); - - string translationString = System.Text.Json.JsonSerializer.Serialize(StringStore.translationString, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - - File.WriteAllText(Path.Combine(stringDir, "translation_strings.json"), translationString); - } - - public static void DumpJson() - { - string dumpDir = GetAssetDir(AssetType.Dumps); - - if (!Directory.Exists(dumpDir)) - { - Directory.CreateDirectory(dumpDir); - } - string LawnStrings = Resources.Load("LawnStrings").text; - string ZombieStrings = Resources.Load("ZombieStrings").text; - string AbyssBuffData = Resources.Load("AbyssBuffData").text; - File.WriteAllText(Path.Combine(dumpDir, "LawnStrings.json"), LawnStrings); - File.WriteAllText(Path.Combine(dumpDir, "ZombieStrings.json"), ZombieStrings); - File.WriteAllText(Path.Combine(dumpDir, "AbyssBuffData.json"), AbyssBuffData); - - Dictionary achievementsList = new Dictionary(); - foreach (var entry in AchievementClip.achievementsText) - { - var key = entry.Key; - var value = entry.Value; - achievementsList.Add(key, new AchievementObject(key, value.Item1, value.Item2)); - } - File.WriteAllText(Path.Combine(dumpDir, "AchievementsText.json"), JsonSerializer.Serialize(achievementsList, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - -//#if DEBUG - public static void DumpUntranslatedStrings(string text) - { - string dumpDir = GetAssetDir(AssetType.Dumps); - string jsonFile = Path.Combine(dumpDir, "UntranslatedStrings.json"); - - if (!Directory.Exists(dumpDir)) - { - Directory.CreateDirectory(dumpDir); - } - - if (!File.Exists(jsonFile)) - { - File.WriteAllText(jsonFile, "{}"); // Initialize empty JSON object - } - - string json = File.ReadAllText(jsonFile); - var untranslatedStrings = JsonSerializer.Deserialize>(json); - - if (!untranslatedStrings.ContainsKey(text)) - { - untranslatedStrings[text] = text; - var options = new JsonSerializerOptions - { - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - WriteIndented = true - }; - File.WriteAllText(jsonFile, JsonSerializer.Serialize(untranslatedStrings, options)); - } - } -//#endif - -#if MULTI_LANGUAGE - internal static void LoadLanguage() - { - try - { - // Load the language preference as a string and parse it into the enum - ConfigEntry languageEntry; - Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "Language"), out languageEntry); - string languageName = languageEntry.Value; - if (Enum.TryParse(languageName, out Utils.LanguageEnum loadedLanguage)) - { - Utils.Language = loadedLanguage; - } - else - { - Log.LogWarning($"Invalid language '{languageName}' found in preferences. Falling back to English."); - Utils.Language = Utils.LanguageEnum.English; // Default fallback - } - Log.LogWarning($"Loaded language {languageName}"); - } - catch (Exception e) - { - Log.LogError("Error loading language setting."); - Log.LogError($"{e.GetType()} {e.Message}"); - } - Log.LogInfo($"Language has been loaded: {Utils.Language}"); - } - - internal static void SaveLanguage() - { - try - { - // Save the current language as a string - ConfigEntry languageEntry; - Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "Language"), out languageEntry); - languageEntry.Value = Utils.Language.ToString(); - Core.Instance.Config.Save(); - - // Ensure changes are written to the config file - // MelonPreferences.Save(); - } - catch (Exception e) - { - Log.LogError("Error saving language setting."); - Log.LogError($"{e.GetType()} {e.Message}"); - } - // Log.LogInfo($"Language has been saved: {Utils.Language}"); - } -#endif - } -} diff --git a/BepInEx/FontHandler.cs b/BepInEx/FontHandler.cs deleted file mode 100644 index 44869f9..0000000 --- a/BepInEx/FontHandler.cs +++ /dev/null @@ -1,45 +0,0 @@ -using BepInEx; -using PvZ_Fusion_Translator__BepInEx_; -using System.IO; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_ -{ - public static class FontHandler - { - public static Font LoadFont(this string pathFromModsFolder, bool throwException) - { - string fontFilePath = Path.Combine(Paths.PluginPath, pathFromModsFolder); - if (!File.Exists(fontFilePath)) - { - if (throwException) - Log.LogWarning($"Font not found at path: '{fontFilePath}'."); - return null; - } - - Font font = new Font(); - Font.Internal_CreateFontFromPath(font, fontFilePath); // Default size, adjust as needed - return font; - } - - public static TMP_FontAsset ConvertToTMP(this Font font) - { - TMP_FontAsset fontAsset = TMP_FontAsset.CreateFontAsset(font); - if (fontAsset == null) - { - Log.LogWarning($"Failed to create TMP_FontAsset from font '{font.name}'."); - return null; - } - return fontAsset; - } - - public static TMP_FontAsset LoadTMPFont(this string pathFromModsFolder, bool throwException) - { - Font font = pathFromModsFolder.LoadFont(throwException); - if (font == null) - return null; - return font.ConvertToTMP(); - } - } -} \ No newline at end of file diff --git a/BepInEx/Log.cs b/BepInEx/Log.cs deleted file mode 100644 index b9407bf..0000000 --- a/BepInEx/Log.cs +++ /dev/null @@ -1,25 +0,0 @@ -using BepInEx.Logging; - -namespace PvZ_Fusion_Translator__BepInEx_ -{ - internal static class Log - { - private static readonly ManualLogSource Logger = BepInEx.Logging.Logger.CreateLogSource("PvZ_Fusion_Translator"); - - public static void LogDebug(object txt) => Logger.LogDebug(txt); - public static void LogDebug(string txt) => Logger.LogDebug(txt); - public static void LogDebug(string txt, params object[] args) => Logger.LogDebug(string.Format(txt, args)); - - public static void LogInfo(object txt) => Logger.LogInfo(txt); - public static void LogInfo(string txt) => Logger.LogInfo(txt); - public static void LogInfo(string txt, params object[] args) => Logger.LogInfo(string.Format(txt, args)); - - public static void LogWarning(object txt) => Logger.LogWarning(txt); - public static void LogWarning(string txt) => Logger.LogWarning(txt); - public static void LogWarning(string txt, params object[] args) => Logger.LogWarning(string.Format(txt, args)); - - public static void LogError(object txt) => Logger.LogError(txt); - public static void LogError(string txt) => Logger.LogError(txt); - public static void LogError(string txt, params object[] args) => Logger.LogError(string.Format(txt, args)); - } -} \ No newline at end of file diff --git a/BepInEx/ModFeatures.cs b/BepInEx/ModFeatures.cs deleted file mode 100644 index b63a432..0000000 --- a/BepInEx/ModFeatures.cs +++ /dev/null @@ -1,80 +0,0 @@ -//#if DEBUG -using System; -using System.Collections.Generic; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_ -{ - public static class ModFeatures - { - public enum ModType - { - ReloadStrings, - ReloadTextures, - } - - private class ModFeature - { - public string Name { get; private set; } - public ModType ModType { get; private set; } - public KeyCode KeyCode { get; private set; } - public bool IsActive { get; set; } - - public ModFeature(string name, ModType modType, KeyCode keyCode, bool defaultValue = false) - { - Name = name; - ModType = modType; - KeyCode = keyCode; - IsActive = defaultValue; - } - - public void ToggleFeature() - { - if (ModType == ModType.ReloadStrings) - { - StringStore.Reload(); - Core.ShowToast("Strings Reloaded!"); - return; - } - - if (ModType == ModType.ReloadTextures) - { - TextureStore.Reload(); - Core.ShowToast("Textures Reloaded!"); - return; - } - } - } - - private static readonly Dictionary featureLists = new() - { - { ModType.ReloadStrings, new ModFeature("Reload Strings", ModType.ReloadStrings, KeyCode.Home, true) }, - { ModType.ReloadTextures, new ModFeature("Reload Textures", ModType.ReloadTextures, KeyCode.End, true) }, - }; - - public static void ToggleFeature(ModType modType) - { - if (!featureLists.ContainsKey(modType)) - return; - - featureLists[modType].ToggleFeature(); - } - - public static void OnLateUpdate() - { - foreach (var feature in featureLists.Values) - { - if (feature.KeyCode != KeyCode.None && Enum.IsDefined(typeof(KeyCode), feature.KeyCode)) - { - if (Input.GetKeyDown(feature.KeyCode)) - { - Log.LogDebug(feature.KeyCode); - feature.ToggleFeature(); - } - } - } - } - } -} -//#endif \ No newline at end of file diff --git a/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs b/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs deleted file mode 100644 index 2687306..0000000 --- a/BepInEx/Patches/BaseTextObjects/InGameText_Patch.cs +++ /dev/null @@ -1,62 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_.Patches.Managers; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(InGameText))] - public static class InGameText_Patch - { - [HarmonyPatch(nameof(InGameText.ShowText), new Type[] { typeof(string), typeof(float), typeof(bool), typeof(bool) })] - [HarmonyPrefix] - private static void ShowText_Pre(InGameText __instance, ref string text) => text = StringStore.TranslateText(text, true); - - [HarmonyPatch(nameof(InGameText.ShowText), new Type[] { typeof(string), typeof(float), typeof(bool), typeof(bool) })] - [HarmonyPostfix] - private static void ShowText_Post(InGameText __instance) - { - #if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - - foreach (TextMeshProUGUI txt in __instance.textMeshes) - { - string travelMatch = TravelMgr_Patch.MatchTravelBuff(txt.text); - string originalText = txt.text; - - if (txt.gameObject.name.Contains("shadow")) - { - continue; - } - - if (travelMatch != "") - { - txt.text = travelMatch; - if (txt.gameObject.name.Contains("main")) - { - originalText = txt.text; - Transform shadowText = txt.transform.parent.Find("Text_shadow"); - if (shadowText != null) - { - shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); - } - } - } - else if(System.Text.RegularExpressions.Regex.Match(txt.text, @"(]*>.*?)", System.Text.RegularExpressions.RegexOptions.Singleline).Success) - { - txt.text = StringStore.TranslateColorText(txt.text); - } - else - { - txt.text = StringStore.TranslateText(txt.text, true); - } - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs b/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs deleted file mode 100644 index c8046b6..0000000 --- a/BepInEx/Patches/BaseTextObjects/TMP_InputField_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TMP_InputField))] - public static class TMP_InputField_Patch - { - [HarmonyPatch(nameof(TMP_InputField.OnEnable))] - [HarmonyPostfix] - private static void OnEnable(TMP_InputField __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - string text = StringStore.TranslateText(__instance.text); - __instance.m_Text = StringStore.TranslateText(text); - __instance.m_OriginalText = StringStore.TranslateText(text); - __instance.m_TextComponent.text = StringStore.TranslateText(text); - } - } - } -} diff --git a/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs b/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs deleted file mode 100644 index bf02d9a..0000000 --- a/BepInEx/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs +++ /dev/null @@ -1,97 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_.Patches.Managers; -using UnityEngine.UI; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TextMeshProUGUI))] - public static class TextMeshProUGUI_Patch - { - [HarmonyPatch(nameof(TextMeshProUGUI.OnEnable))] - [HarmonyPostfix] - private static void OnEnable(TextMeshProUGUI __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - if(__instance.transform.parent.parent != null) - { - if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) - { - return; - } - } - - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = false; - - if (__instance.name.StartsWith("LevelName")) - { - __instance.text = __instance.text.Replace("\n", " "); - - if (__instance.name == "LevelName2" || __instance.name == "LevelName3") - { - TowerManager_Patch.updatedText.Add(__instance.transform); - } - } - if (__instance.transform.parent != null && __instance.transform.parent.name.StartsWith("Window")) - { - __instance.fontSizeMin = 10; - __instance.fontSize = 12; - } - - // __instance.ForceMeshUpdate(); - } - } - - [HarmonyPatch(nameof(TextMeshProUGUI.Awake))] - [HarmonyPostfix] - private static void Awake(TextMeshProUGUI __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - if (__instance.transform.parent.parent != null) - { - if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) - { - return; - } - } - - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = false; - - if (__instance.transform.parent != null && __instance.transform.parent.name.StartsWith("Window")) - { - __instance.fontSizeMin = 10; - __instance.fontSize = 12; - } - - if (__instance.text == "Полный Хаос" && __instance.transform.parent.parent.Find("Image").GetComponent().activeSprite.name == "Present") - { - __instance.text += "\nБесконечно"; - } - - // __instance.ForceMeshUpdate(); - } - } - } - [HarmonyPatch(typeof(TMP_SubMeshUI))] - public static class TMP_SubMeshUI_Patch - { - [HarmonyPatch(nameof(TMP_SubMeshUI.OnEnable))] - [HarmonyPostfix] - public static void OnEnable(TMP_SubMeshUI __instance) - { - if (!string.IsNullOrEmpty(__instance.textComponent.text)) - { - string text = StringStore.TranslateText(__instance.textComponent.text); - __instance.m_TextComponent.text = StringStore.TranslateText(text); - __instance.textComponent.text = StringStore.TranslateText(text); - } - } - } -} diff --git a/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs b/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs deleted file mode 100644 index 0497378..0000000 --- a/BepInEx/Patches/BaseTextObjects/TextMeshPro_Patch.cs +++ /dev/null @@ -1,30 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TextMeshPro))] - public static class TextMeshPro_Patch - { - [HarmonyPatch(nameof(TextMeshPro.OnEnable))] - [HarmonyPostfix] - private static void OnEnable(TextMeshPro __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - if (__instance.transform.parent.name.StartsWith("AlmanacHelp") || __instance.transform.parent.name.StartsWith("CardBank")) - { - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = false; - return; - } else if (!(__instance.transform.name.Contains("AlmanacZombie") || __instance.transform.name.Contains("AlmanacPlant") || __instance.transform.name.Contains("Name") || __instance.transform.name.Contains("Tips") || __instance.transform.parent.name.Contains("Signboard") || __instance.transform.parent.name.Contains("text"))) - { - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = true; - } - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/AbyssBuffMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssBuffMenu_Patch.cs deleted file mode 100644 index 7e29e91..0000000 --- a/BepInEx/Patches/GameObjects/AbyssBuffMenu_Patch.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.IO; -using System.Text.Json; -using System.Text.RegularExpressions; -using HarmonyLib; -//using MelonLoader.TinyJSON; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_; -using TMPro; -using UnityEngine.TextCore.Text; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AbyssBuffMenu))] - public static class AbyssBuffMenu_Patch - { - public static Dictionary abyssBuffData = new Dictionary(); - - [HarmonyPatch(nameof(AbyssBuffMenu.Awake))] - [HarmonyPostfix] - public static void Post_Awake(AbyssBuffMenu __instance) - { - LoadAbyssBuffData(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - - TranslateWindows(__instance, fontAsset); - } - - [HarmonyPatch(nameof(AbyssBuffMenu.SelectWindow))] - [HarmonyPostfix] - public static void Post_SelectWindow(AbyssBuffMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - TranslateWindows(__instance, fontAsset); - } - - [HarmonyPatch(nameof(AbyssBuffMenu.SetFavorite))] - [HarmonyPostfix] - public static void Post_SetFavorite(AbyssBuffMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - public static void TranslateWindows(AbyssBuffMenu __instance, TMP_FontAsset fontAsset) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - if (abyssBuffData.ContainsKey(text.text)) - { - text.text = abyssBuffData[text.text]; - } - else - { - string translatedRegex = TranslateAbyssBuffRegex(text.text); - if (translatedRegex != null) - { - text.text = translatedRegex; - } - } - - text.font = fontAsset; - } - } - - public static void LoadAbyssBuffData() - { - abyssBuffData.Clear(); - - string abyssBuffText = File.ReadAllText(Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), "abyss_buffs.json")); - abyssBuffData = JsonSerializer.Deserialize>(abyssBuffText); - } - - public static string TranslateAbyssBuffRegex(string originalText) - { - foreach (var x in abyssBuffData) - { - if (x.Key.Contains("{value}")) - { - string pattern = Regex.Escape(x.Key).Replace("\\{value}", "(\\d+)"); - if (Regex.IsMatch(originalText, pattern)) - { - var regex = new Regex(pattern); - var match = regex.Match(originalText); - - return String.Format(x.Value.Replace("value", "0"), match.Groups[1].Value); - } - } - } - - return null; - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs b/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs deleted file mode 100644 index 28e7733..0000000 --- a/BepInEx/Patches/GameObjects/AbyssCheckInBag_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -//using HarmonyLib; -//using System; -//using PvZ_Fusion_Translator__BepInEx_.AssetStore; -//using UnityEngine; -//using UnityEngine.TextCore.Text; -//using UnityEngine.UI; - -//namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -//{ - -// [HarmonyPatch(typeof(AbyssCheckInBag))] -// public static class AbyssCheckInBag_Patch -// { -// [HarmonyPatch(nameof(AbyssCheckInBag.MoveFromBag))] -// [HarmonyPostfix] -// private static void MoveFromBag(AbyssCheckInBag __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } - -// [HarmonyPatch(nameof(AbyssCheckInBag.SellIcon))] -// [HarmonyPostfix] -// private static void SellIcon(AbyssCheckInBag __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } -// } -//} diff --git a/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs deleted file mode 100644 index 411a415..0000000 --- a/BepInEx/Patches/GameObjects/AbyssDevelopMenu_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -//using System.Text.RegularExpressions; -//using HarmonyLib; -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using TMPro; -//using PvZ_Fusion_Translator__BepInEx_.AssetStore; -//using UnityEngine.TextCore.Text; - -//namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(AbyssDevelopMenu))] -// public static class AbyssDevelopMenu_Patch -// { - -// [HarmonyPatch(nameof(AbyssDevelopMenu.UpdateInfo))] -// [HarmonyPostfix] -// private static void UpdateInfo(AbyssDevelopMenu __instance) -// { -// __instance.currentMoney.text = StringStore.TranslateText(__instance.currentMoney.text); -// __instance.upgradeTextInfo.text = StringStore.TranslateText(__instance.upgradeTextInfo.text); - -// TextMeshProUGUI upgradeCostText = __instance.transform.FindChild("UpgradeCost").GetComponent(); -// TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - -// string regexStr = "([^\\s]+)\n当前等级:([^\\s]+)\n\n升级条件:\n([^\\s]+)\n\n升级消耗:([^\\s]+)"; - -// Regex regex = new Regex(regexStr); - -// if (regex.IsMatch(upgradeCostText.text)) -// { -// Match match = regex.Match(upgradeCostText.text); -// int groupCount = match.Groups.Count; - -// List dynamicParts = []; - -// for (int i = 1; i < groupCount; i++) -// { -// string groupValue = match.Groups[i].Value; -// string translatedValue = StringStore.translationString.ContainsKey(groupValue) ? StringStore.translationString[groupValue] : groupValue; -// dynamicParts.Add(translatedValue); -// } - -// upgradeCostText.text = string.Format(StringStore.translationStringRegex[regexStr], [.. dynamicParts]); -// upgradeCostText.font = fontAsset; -// } -// } -// } -//} diff --git a/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs deleted file mode 100644 index 55bfcb7..0000000 --- a/BepInEx/Patches/GameObjects/AbyssMenu_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using Unity.VisualScripting; -using UnityEngine; -using System.Text.RegularExpressions; -using UnityEngine.UI; -using PvZ_Fusion_Translator__BepInEx_; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AbyssMenu))] - public static class AbyssMenu_Patch - { - [HarmonyPatch(nameof(AbyssMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AbyssMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.levelInfo) - { - txt.text = StringStore.TranslateText(txt.text, false); - txt.font = fontAsset; - } - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - [HarmonyPatch(nameof(AbyssMenu.UpdateLevelInfo))] - [HarmonyPostfix] - private static void UpdateLevelInfo(AbyssMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.levelInfo) - { - txt.text = StringStore.TranslateText(txt.text, pattern: "第(\\d+)关\n场景:([^\\s]+)\n总波数:(\\d+)波\n特殊环境:([^\\s]+)\n难度:(\\d+)"); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/AbyssSelectBuffWindow_Patch.cs b/BepInEx/Patches/GameObjects/AbyssSelectBuffWindow_Patch.cs deleted file mode 100644 index 7beb3ea..0000000 --- a/BepInEx/Patches/GameObjects/AbyssSelectBuffWindow_Patch.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Text.RegularExpressions; -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AbyssSelectBuffWindow))] - public static class AbyssSelectBuffWindow_Patch - { - [HarmonyPatch(nameof(AbyssSelectBuffWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(AbyssSelectBuffWindow __instance) - { - TranslateBuffWindow(__instance); - } - - [HarmonyPatch(nameof(AbyssSelectBuffWindow.SetBuff))] - [HarmonyPostfix] - private static void SetBuff(AbyssSelectBuffWindow __instance) - { - TranslateBuffWindow(__instance); - } - - public static void TranslateBuffWindow(AbyssSelectBuffWindow __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - AbyssBuffMenu_Patch.LoadAbyssBuffData(); - - foreach (TextMeshProUGUI titleText in __instance.titleText) - { - if (AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(titleText.text)) - { - if (titleText.name.Contains("shadow")) - { - titleText.text = Utils.RemoveColorTags(AbyssBuffMenu_Patch.abyssBuffData[titleText.text]); - } - else - { - titleText.text = AbyssBuffMenu_Patch.abyssBuffData[titleText.text]; - } - } - titleText.font = fontAsset; - } - - string translatedIntroduceText = (AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(__instance.introduce.text)) ? AbyssBuffMenu_Patch.abyssBuffData[__instance.introduce.text] : AbyssBuffMenu_Patch.TranslateAbyssBuffRegex(__instance.introduce.text); - - if (translatedIntroduceText != null) - { - __instance.introduce.text = translatedIntroduceText; - __instance.introduce.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs deleted file mode 100644 index d8731ce..0000000 --- a/BepInEx/Patches/GameObjects/AbyssSettlementMenu_Patch.cs +++ /dev/null @@ -1,55 +0,0 @@ -//using HarmonyLib; -//using System; -//using System.Collections.Generic; -//using TMPro; -//using PvZ_Fusion_Translator__BepInEx_.AssetStore; -//using Unity.VisualScripting; -//using UnityEngine; -//using System.Text.RegularExpressions; - -//namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(AbyssSettlementMenu))] -// public static class AbyssSettlementMenu_Patch -// { - -// [HarmonyPatch(nameof(AbyssSettlementMenu.InitSettle))] -// [HarmonyPostfix] -// private static void InitSettle(AbyssSettlementMenu __instance) -// { -// TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - -// string[] regexStrList = [ -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)" -// ]; - -// foreach(string regexStr in regexStrList) -// { -// Regex regex = new Regex(regexStr); - -// if (regex.IsMatch(__instance.settleInfo.text)) -// { -// Match match = regex.Match(__instance.settleInfo.text); -// int groupCount = match.Groups.Count; - -// List dynamicParts = []; - -// for (int i = 1; i < groupCount; i++) -// { -// string groupValue = match.Groups[i].Value; -// string translatedValue = StringStore.translationString.ContainsKey(groupValue) ? StringStore.translationString[groupValue] : groupValue; -// dynamicParts.Add(translatedValue); -// } - -// __instance.settleInfo.text = string.Format(StringStore.translationStringRegex[regexStr], [.. dynamicParts]); -// __instance.settleInfo.font = fontAsset; -// } -// } -// } -// } -//} diff --git a/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs b/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs deleted file mode 100644 index a1c5f65..0000000 --- a/BepInEx/Patches/GameObjects/AbyssStoreMenu_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AbyssStoreMenu))] - public static class AbyssStoreMenu_Patch - { - [HarmonyPatch(nameof(AbyssStoreMenu.Update))] - [HarmonyPostfix] - private static void UpdateInfo(AbyssStoreMenu __instance) - { - __instance.yourMoney.text = StringStore.TranslateText(__instance.yourMoney.text); - } - } -} diff --git a/BepInEx/Patches/GameObjects/AdvantureEvolutionMenu_Patch.cs b/BepInEx/Patches/GameObjects/AdvantureEvolutionMenu_Patch.cs deleted file mode 100644 index 23fe212..0000000 --- a/BepInEx/Patches/GameObjects/AdvantureEvolutionMenu_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AdvantureEvolutionMenu))] - public static class AdvantureEvolutionMenu_Patch - { - [HarmonyPatch(nameof(AdvantureEvolutionMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureEvolutionMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/AdvantureHelpMenu_Patch.cs b/BepInEx/Patches/GameObjects/AdvantureHelpMenu_Patch.cs deleted file mode 100644 index 7ba5af7..0000000 --- a/BepInEx/Patches/GameObjects/AdvantureHelpMenu_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AdvantureHelpMenu))] - public static class AdvantureHelpMenu_Patch - { - [HarmonyPatch(nameof(AdvantureHelpMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureHelpMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/AdvantureMenu2_Patch.cs b/BepInEx/Patches/GameObjects/AdvantureMenu2_Patch.cs deleted file mode 100644 index f0926c1..0000000 --- a/BepInEx/Patches/GameObjects/AdvantureMenu2_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AdvantureMenu2))] - public static class AdvantureMenu2_Patch - { - [HarmonyPatch(nameof(AdvantureMenu2.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureMenu2 __instance) - { - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureMenu2.AdjustDifficulty))] - [HarmonyPostfix] - private static void AdjustDifficulty(AdvantureMenu2 __instance) - { - __instance.difficulty.text = StringStore.TranslateText(__instance.difficulty.text); - } - } -} diff --git a/BepInEx/Patches/GameObjects/AdvantureMenu_Patch.cs b/BepInEx/Patches/GameObjects/AdvantureMenu_Patch.cs deleted file mode 100644 index 7360d02..0000000 --- a/BepInEx/Patches/GameObjects/AdvantureMenu_Patch.cs +++ /dev/null @@ -1,63 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AdvantureMenu))] - public static class AdvantureMenu_Patch - { - [HarmonyPatch(nameof(AdvantureMenu.Start))] - [HarmonyPostfix] - private static void Start(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.ChangeDifficulty))] - [HarmonyPostfix] - private static void ChangeDifficulty(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.GetChapterDifficulty))] - [HarmonyPostfix] - private static void GetChapterDifficulty(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.UpdateChapterDifficulty))] - [HarmonyPostfix] - private static void UpdateChapterDifficulty(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.UpdateStarCount))] - [HarmonyPostfix] - private static void UpdateStarCount(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - public static void TranslateAdvantureMenu(AdvantureMenu __instance) - { - bool hasSBString = StringStore.translationString.ContainsKey(__instance.difficulty.text + "_SB"); - __instance.difficulty.text = Utils.RemoveSizeTags(hasSBString ? StringStore.TranslateText(__instance.difficulty.text + "_SB") : StringStore.TranslateText(__instance.difficulty.text)); - __instance.chapterDifficulty.text = StringStore.TranslateText(__instance.chapterDifficulty.text); - __instance.starCount.text = StringStore.TranslateText(__instance.starCount.text); - - foreach (TextMeshProUGUI text in __instance.title) - { - text.text = StringStore.TranslateText(text.text); - } - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/AdvantureMissionMenu_Patch.cs b/BepInEx/Patches/GameObjects/AdvantureMissionMenu_Patch.cs deleted file mode 100644 index a26a9e3..0000000 --- a/BepInEx/Patches/GameObjects/AdvantureMissionMenu_Patch.cs +++ /dev/null @@ -1,55 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AdvantureMissionMenu))] - public static class AdvantureMissionMenu_Patch - { - [HarmonyPatch(nameof(AdvantureMissionMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureMissionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.contant.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - //foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - //{ - // text.text = StringStore.TranslateText(text.text); - //} - } - - [HarmonyPatch(nameof(AdvantureMissionMenu.InitText))] - [HarmonyPostfix] - private static void InitText(AdvantureMissionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.contant.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - //foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - //{ - // text.text = StringStore.TranslateText(text.text); - //} - } - - [HarmonyPatch(nameof(AdvantureMissionMenu.SwitchAward))] - [HarmonyPostfix] - private static void SwitchAward(AdvantureMissionMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.contant.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - //foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - //{ - // text.text = StringStore.TranslateText(text.text); - //} - } - } -} diff --git a/BepInEx/Patches/GameObjects/AdvantureStarMenu_Patch.cs b/BepInEx/Patches/GameObjects/AdvantureStarMenu_Patch.cs deleted file mode 100644 index 1d9541a..0000000 --- a/BepInEx/Patches/GameObjects/AdvantureStarMenu_Patch.cs +++ /dev/null @@ -1,60 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AdvantureStarMenu))] - public static class AdvantureStarMenu_Patch - { - [HarmonyPatch(nameof(AdvantureStarMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureStarMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.GetNodes))] - [HarmonyPostfix] - private static void GetNodes(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.UpdateStarText))] - [HarmonyPostfix] - private static void UpdateStarText(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.InitTalents))] - [HarmonyPostfix] - private static void InitTalents(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.ResetAward))] - [HarmonyPostfix] - private static void ResetAward(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/AlmanacPlantMenu_Patch.cs b/BepInEx/Patches/GameObjects/AlmanacPlantMenu_Patch.cs deleted file mode 100644 index 3dbb2e6..0000000 --- a/BepInEx/Patches/GameObjects/AlmanacPlantMenu_Patch.cs +++ /dev/null @@ -1,88 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.UI; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; -using static PvZ_Fusion_Translator__BepInEx_.Utils; -using static PvZ_Fusion_Translator__BepInEx_.Log; -using static AlmanacPlantBank; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacPlantMenu))] - public static class AlmanacPlantMenu_Patch - { - [HarmonyPatch(nameof(AlmanacPlantMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AlmanacPlantMenu __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren(true)) - { - bool isPlantName = text.gameObject.name.Contains("Name") && text.transform.parent.name != "Background"; - if (text.gameObject.name != "Description" && !isPlantName) - { - text.text = StringStore.TranslateText(text.text); - text.font = font; - text.autoSizeTextContainer = true; - } - } - - // skin button resize - - AlmanacPlantWindow window = __instance.window; - GameObject skinButton = window.skinButton; - GameObject skinTextObj = skinButton.transform.GetChild(0).gameObject; - GameObject skinShadowTextObj = skinTextObj.transform.GetChild(0).gameObject; - TextMeshProUGUI skinShadowText = skinShadowTextObj.GetComponent(); - skinShadowText.text = StringStore.TranslateText("换肤_S"); - skinButton.transform.localScale /= 1.75f; - skinButton.transform.localPosition = new Vector3(0.0f, 111.345f, 0.0f); - skinButton.transform.GetChild(1).Translate(new Vector3(-0.35f, 0)); - skinButton.transform.GetChild(2).Translate(new Vector3(0.35f, 0)); - } - - [HarmonyPatch(nameof(AlmanacPlantMenu.SearchChanged))] - [HarmonyPrefix] - public static bool SearchChanged(AlmanacPlantMenu __instance, ref TMP_InputField inputField) - { - string search = inputField.text; - if (search != StringStore.TranslateText("搜索") && search != "") - { - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); - - string json; - json = File.ReadAllText(path); - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - - PlantData plantData = JsonUtility.FromJson(json); - - Il2CppSystem.Collections.Generic.List searchedPlants = new(); - - foreach (PlantInfo plantInfo in plantData.plants) - { - if (plantInfo.name.ToLower().Contains(search.ToLower())) - { - searchedPlants.Add((PlantType)plantInfo.seedType); - } - } - - __instance.ShowPlants(searchedPlants); - - return false; - } - - return true; - } - } -} - diff --git a/BepInEx/Patches/GameObjects/AlmanacPlantWindow_Patch.cs b/BepInEx/Patches/GameObjects/AlmanacPlantWindow_Patch.cs deleted file mode 100644 index 5dc2db1..0000000 --- a/BepInEx/Patches/GameObjects/AlmanacPlantWindow_Patch.cs +++ /dev/null @@ -1,189 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System; -using UnityEngine; -using UnityEngine.UI; -using System.IO; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; -using static PvZ_Fusion_Translator__BepInEx_.Log; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacPlantWindow))] - public static class AlmanacPlantWindow_Patch - { - [HarmonyPatch(nameof(AlmanacPlantWindow.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(AlmanacPlantWindow __instance) - { - try - { - if (__instance == null) - { - Log.LogWarning("[AlmanacPlantWindow_Patch] __instance is null"); - return; - } - - if (__instance.showedPlantName == null || __instance.showedPlantIntroduce == null || __instance.plantTextContent == null) - { - Log.LogWarning("[AlmanacPlantWindow_Patch] Required UI components are null"); - return; - } - - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogWarning($"[AlmanacPlantWindow_Patch] LawnStringsTranslate.json not found at: {path}"); - return; - } - - string json; - json = File.ReadAllText(path); - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary != null && - (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || - FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage))) - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = almanacFontAsset != null; - - TMP_FontAsset fontAsset = null; - fontAsset = (hasAlmanacFont) ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) : FontStore.LoadTMPFont(Utils.Language.ToString()); - - AlmanacPlantBank.PlantData plantData = null; - - plantData = JsonUtility.FromJson(json); - - - bool foundMatch = false; - foreach (AlmanacPlantBank.PlantInfo plantInfo in plantData.plants) - { - if (plantInfo == null) continue; - if (plantInfo.seedType == (int)__instance.currentPlantType) - { - foundMatch = true; - try - { - if (__instance.showedPlantName != null) - { - foreach (TextMeshProUGUI text in __instance.showedPlantName) - { - if (text == null) continue; - text.autoSizeTextContainer = false; - string plantName = plantInfo.name ?? ""; - text.text = $"{Utils.RemoveSizeTags(plantName)} ({plantInfo.seedType})"; - text.font = fontAsset; - text.fontSizeMax = 21; - } - } - - if (__instance.showedPlantIntroduce != null) - { - string info = plantInfo.info ?? ""; - string introduce = plantInfo.introduce ?? ""; - char[] toTrim = Environment.NewLine.ToCharArray(); - __instance.showedPlantIntroduce.text = Utils.RemoveSizeTags(plantInfo.info) + "\n\n" + Utils.RemoveSizeTags(plantInfo.introduce) + "\n\n" + Utils.RemoveSizeTags(plantInfo.cost).TrimStart(toTrim) + "\n\n"; - __instance.showedPlantIntroduce.font = fontAsset; - __instance.showedPlantIntroduce.margin = new Vector4(6, 2, 12, 0); - __instance.showedPlantIntroduce.enableWordWrapping = true; - __instance.showedPlantIntroduce.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.showedPlantIntroduce.ForceMeshUpdate(); - - if (__instance.plantTextContent != null) - { - float textHeight = __instance.showedPlantIntroduce.preferredHeight; - __instance.plantTextContent.sizeDelta = new Vector2(__instance.plantTextContent.sizeDelta.x, textHeight); - } - } - } - catch (Exception ex) - { - Log.LogError($"[AlmanacPlantWindow_Patch] Error updating plant info: {ex.Message}"); - } - break; - } - } - - if (!foundMatch && File.Exists(moddedPath)) - { - try - { - string moddedJson = File.ReadAllText(moddedPath); - if (!string.IsNullOrEmpty(moddedJson)) - { - AlmanacPlantBank.PlantData moddedPlantData = JsonUtility.FromJson(moddedJson); - if (moddedPlantData != null && moddedPlantData.plants != null) - { - foreach (AlmanacPlantBank.PlantInfo plantInfo in moddedPlantData.plants) - { - if (plantInfo == null) continue; - if (plantInfo.seedType == (int)__instance.currentPlantType) - { - try - { - if (__instance.showedPlantName != null) - { - foreach (TextMeshProUGUI text in __instance.showedPlantName) - { - if (text == null) continue; - text.autoSizeTextContainer = false; - string plantName = plantInfo.name ?? ""; - text.text = $"{Utils.RemoveSizeTags(plantName)} ({plantInfo.seedType})"; - text.font = fontAsset; - text.fontSizeMax = 21; - } - } - - if (__instance.showedPlantIntroduce != null) - { - string info = plantInfo.info ?? ""; - string introduce = plantInfo.introduce ?? ""; - char[] toTrim = Environment.NewLine.ToCharArray(); - __instance.showedPlantIntroduce.text = Utils.RemoveSizeTags(plantInfo.info) + "\n\n" + Utils.RemoveSizeTags(plantInfo.introduce) + "\n\n" + Utils.RemoveSizeTags(plantInfo.cost).TrimStart(toTrim) + "\n\n"; - __instance.showedPlantIntroduce.font = fontAsset; - __instance.showedPlantIntroduce.margin = new Vector4(6, 2, 12, 0); - __instance.showedPlantIntroduce.enableWordWrapping = true; - __instance.showedPlantIntroduce.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.showedPlantIntroduce.ForceMeshUpdate(); - - if (__instance.plantTextContent != null) - { - float textHeight = __instance.showedPlantIntroduce.preferredHeight; - __instance.plantTextContent.sizeDelta = new Vector2(__instance.plantTextContent.sizeDelta.x, textHeight); - } - } - } - catch (Exception ex) - { - Log.LogError($"[AlmanacPlantWindow_Patch] Error updating modded plant info: {ex.Message}"); - } - break; - } - } - } - } - } - catch (Exception ex) - { - Log.LogWarning($"[AlmanacPlantWindow_Patch] Error reading ModdedPlantsTranslate.json: {ex.Message}"); - } - } - } - catch (Exception ex) - { - Log.LogError($"[AlmanacPlantWindow_Patch] Unexpected error in UpdateText: {ex.Message}\n{ex.StackTrace}"); - } - } - } -} - diff --git a/BepInEx/Patches/GameObjects/AlmanacZombieMenu_Patch.cs b/BepInEx/Patches/GameObjects/AlmanacZombieMenu_Patch.cs deleted file mode 100644 index e85aef2..0000000 --- a/BepInEx/Patches/GameObjects/AlmanacZombieMenu_Patch.cs +++ /dev/null @@ -1,31 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using static PvZ_Fusion_Translator__BepInEx_.Log; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacZombieMenu))] - public static class AlmanacZombieMenu_Patch - { - [HarmonyPatch(nameof(AlmanacZombieMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AlmanacZombieMenu __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren(true)) - { - bool isZombieName = text.gameObject.name.Contains("Name") && text.transform.parent.name != "Background"; - if (text.gameObject.name != "Description" && !isZombieName) - { - text.text = StringStore.TranslateText(text.text); - text.font = font; - text.autoSizeTextContainer = true; - } - } - } - } -} - diff --git a/BepInEx/Patches/GameObjects/AlmanacZombieWindow_Patch.cs b/BepInEx/Patches/GameObjects/AlmanacZombieWindow_Patch.cs deleted file mode 100644 index f20926a..0000000 --- a/BepInEx/Patches/GameObjects/AlmanacZombieWindow_Patch.cs +++ /dev/null @@ -1,187 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System; -using UnityEngine; -using UnityEngine.UI; -using System.IO; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; -using static PvZ_Fusion_Translator__BepInEx_.Log; -using PvZ_Fusion_Translator__BepInEx_.Patches.Managers; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacZombieWindow))] - public static class AlmanacZombieWindow_Patch - { - [HarmonyPatch(nameof(AlmanacZombieWindow.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(AlmanacZombieWindow __instance) - { - try - { - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedZombiesTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogWarning($"[AlmanacZombieWindow_Patch] ZombieStringsTranslate.json not found at: {path}"); - return; - } - - string json; - json = File.ReadAllText(path); - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary != null && - (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || - FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage))) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = almanacFontAsset != null; - } - - TMP_FontAsset fontAsset = null; - fontAsset = (hasAlmanacFont) ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) : FontStore.LoadTMPFont(Utils.Language.ToString()); - - ZombieAlmanacData zombieAlmanacData = null; - zombieAlmanacData = JsonUtility.FromJson(json); - var zombieDataDic = ZombieDataManager.zombieDataDic; - - bool foundMatch = false; - foreach (ZombieInfo zombieInfo in zombieAlmanacData.zombies) - { - if (zombieInfo == null) continue; - if (zombieInfo.theZombieType == __instance.currentZombieType) - { - foundMatch = true; - try - { - if (__instance.showedZombieName != null) - { - foreach (TextMeshProUGUI text in __instance.showedZombieName) - { - if (text == null) continue; - text.autoSizeTextContainer = false; - string zombieName = zombieInfo.name ?? ""; - text.text = $"{Utils.RemoveSizeTags(zombieName)} ({(int)zombieInfo.theZombieType})"; - text.font = fontAsset; - text.fontSizeMax = 21; - } - } - - if (__instance.showedZombieIntroduce != null) - { - string info = zombieInfo.info ?? ""; - string introduce = zombieInfo.introduce ?? ""; - - ZombieDataManager.ZombieData zombieData = zombieDataDic[__instance.currentZombieType]; - - string spawnInfo = ""; - string spawnInfoFormat = StringStore.translationStringRegex["出怪等级: (\\d+)\\n出怪权重: (\\d+)"]; - if(spawnInfoFormat != null) - { - spawnInfo = string.Format(spawnInfoFormat, new object[] { zombieData.summonLevel, zombieData.summonWeight }) + "\n\n"; - } - - __instance.showedZombieIntroduce.text = Utils.RemoveSizeTags(info) + "\n\n" + spawnInfo + Utils.RemoveSizeTags(introduce) + "\n\n"; - __instance.showedZombieIntroduce.font = fontAsset; - __instance.showedZombieIntroduce.margin = new Vector4(3, 2, 12, 0); - __instance.showedZombieIntroduce.enableWordWrapping = true; - __instance.showedZombieIntroduce.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.showedZombieIntroduce.ForceMeshUpdate(); - - if (__instance.zombieTextContent != null) - { - float textHeight = __instance.showedZombieIntroduce.preferredHeight; - __instance.zombieTextContent.sizeDelta = new Vector2(__instance.zombieTextContent.sizeDelta.x, textHeight); - } - } - } - catch (Exception ex) - { - Log.LogError($"[AlmanacZombieWindow_Patch] Error updating zombie info: {ex.Message}"); - } - break; - } - } - - if (!foundMatch && File.Exists(moddedPath)) - { - try - { - string moddedJson = File.ReadAllText(moddedPath); - if (!string.IsNullOrEmpty(moddedJson)) - { - ZombieAlmanacData moddedZombieData = JsonUtility.FromJson(moddedJson); - if (moddedZombieData != null && moddedZombieData.zombies != null) - { - foreach (ZombieInfo zombieInfo in moddedZombieData.zombies) - { - if (zombieInfo == null) continue; - if (zombieInfo.theZombieType == __instance.currentZombieType) - { - try - { - if (__instance.showedZombieName != null) - { - foreach (TextMeshProUGUI text in __instance.showedZombieName) - { - if (text == null) continue; - text.autoSizeTextContainer = false; - string zombieName = zombieInfo.name ?? ""; - text.text = $"{Utils.RemoveSizeTags(zombieName)} ({(int)zombieInfo.theZombieType})"; - text.font = fontAsset; - text.fontSizeMax = 21; - } - } - - if (__instance.showedZombieIntroduce != null) - { - string info = zombieInfo.info ?? ""; - string introduce = zombieInfo.introduce ?? ""; - __instance.showedZombieIntroduce.text = Utils.RemoveSizeTags(info) + "\n\n" + Utils.RemoveSizeTags(introduce) + "\n\n"; - __instance.showedZombieIntroduce.font = fontAsset; - __instance.showedZombieIntroduce.margin = new Vector4(3, 2, 12, 0); - __instance.showedZombieIntroduce.enableWordWrapping = true; - __instance.showedZombieIntroduce.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.showedZombieIntroduce.ForceMeshUpdate(); - - if (__instance.zombieTextContent != null) - { - float textHeight = __instance.showedZombieIntroduce.preferredHeight; - __instance.zombieTextContent.sizeDelta = new Vector2(__instance.zombieTextContent.sizeDelta.x, textHeight); - } - } - } - catch (Exception ex) - { - Log.LogError($"[AlmanacZombieWindow_Patch] Error updating modded zombie info: {ex.Message}"); - } - break; - } - } - } - } - } - catch (Exception ex) - { - Log.LogWarning($"[AlmanacZombieWindow_Patch] Error reading ModdedZombiesTranslate.json: {ex.Message}"); - } - } - } - catch (Exception ex) - { - Log.LogError($"[AlmanacZombieWindow_Patch] Unexpected error in UpdateText: {ex.Message}\n{ex.StackTrace}"); - } - } - } -} - diff --git a/BepInEx/Patches/GameObjects/Almanac_Patch.cs b/BepInEx/Patches/GameObjects/Almanac_Patch.cs deleted file mode 100644 index 5ae5678..0000000 --- a/BepInEx/Patches/GameObjects/Almanac_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(Almanac))] - public static class Almanac_Patch - { - [HarmonyPatch(nameof(Almanac.Awake))] - [HarmonyPostfix] - private static void Awake(Almanac __instance) - { - TranslateAlmanacMenu(__instance); - } - - [HarmonyPatch(nameof(Almanac.OldAlmanac))] - [HarmonyPostfix] - private static void OldAlmanac(Almanac __instance) - { - TranslateAlmanacMenu(__instance); - } - - [HarmonyPatch(nameof(Almanac.AnimSwitch))] - [HarmonyPostfix] - private static void AnimSwitch(Almanac __instance) - { - TranslateAlmanacMenu(__instance); - } - - public static void TranslateAlmanacMenu(Almanac __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - if (text.text == "关闭") - { - text.text = StringStore.TranslateText("合上"); - } - else - { - text.text = StringStore.TranslateText(text.text); - } - text.font = font; - } - } - } -} - diff --git a/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs b/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs deleted file mode 100644 index 7d7bd47..0000000 --- a/BepInEx/Patches/GameObjects/BaseMenu_Patch.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HarmonyLib; -using System.Collections.Generic; -using System.Linq; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(BaseMenu))] - public static class BaseMenu_Patch - { - [HarmonyPatch(nameof(BaseMenu.Awake))] - [HarmonyPostfix] - private static void Awake(BaseMenu __instance) - { - TranslateBaseMenu(__instance, "Level"); - TranslateBaseMenu(__instance, "Levels"); - TranslateBaseMenu(__instance, "CustomLevel"); - } - - public static void TranslateBaseMenu(BaseMenu __instance, string levelsName) - { - Transform levels = __instance.transform.Find(levelsName); - if (levels != null) - { - List children = levels.GetComponentsInChildren(true).ToList(); - foreach (Transform child in children) - { - if (child.name == "Nextpage" || child.name == "LastPage" || child.name == "BackToIndex") - { - StringStore.TranslateTextTransform(child); - } - } - - StringStore.TranslateTextTransform(__instance.transform.Find("Goback")); - StringStore.TranslateTextTransform(__instance.transform.Find("Switich")); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/Board_Patch.cs b/BepInEx/Patches/GameObjects/Board_Patch.cs deleted file mode 100644 index 149d36c..0000000 --- a/BepInEx/Patches/GameObjects/Board_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(Board))] - public static class Board_Patch - { - [HarmonyPatch(nameof(Board.Update))] - [HarmonyPostfix] - private static void Update(Board __instance) - { - foreach (SpriteRenderer spriteRenderer in __instance.GetComponentsInChildren()) - { - if (spriteRenderer.sprite != null) - { - if (TextureStore.spriteDict.ContainsKey(spriteRenderer.sprite.name) && spriteRenderer.drawMode != SpriteDrawMode.Sliced) - { - spriteRenderer.drawMode = SpriteDrawMode.Sliced; - } - } - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs deleted file mode 100644 index 83a2ad1..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssBuffButton_Patch.cs +++ /dev/null @@ -1,53 +0,0 @@ -#if FIX -using System.Text.RegularExpressions; -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(AbyssBuffButton))] - public static class AbyssBuffButton_Patch - { - [HarmonyPatch(nameof(AbyssBuffButton.SetType))] - [HarmonyPostfix] - private static void SetType(AbyssBuffButton __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Regex regex = new Regex("([^\\s]+)\n价格:(\\d+)"); - - if (regex.IsMatch(__instance.description.text)) - { - Match match = regex.Match(__instance.description.text); - int groupCount = match.Groups.Count; - - List dynamicParts = []; - - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = StringStore.translationString.ContainsKey(groupValue) ? StringStore.translationString[groupValue] : groupValue; - dynamicParts.Add(translatedValue); - MelonLogger.Msg(translatedValue); - } - - __instance.description.text = string.Format(StringStore.translationStringRegex["([^\\s]+)\n价格:(\\d+)"], [.. dynamicParts]); - __instance.description.font = fontAsset; - } - } - - [HarmonyPatch(nameof(AbyssBuffButton.SetSold))] - [HarmonyPostfix] - private static void SetSold(AbyssBuffButton __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.description.text = StringStore.TranslateText(__instance.description.text); - __instance.description.font = fontAsset; - } - } -} -#endif \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs deleted file mode 100644 index 264f419..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssCheckSellMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -//using HarmonyLib; -//using System; -//using PvZ_Fusion_Translator__BepInEx_.AssetStore; -//using UnityEngine; - -//namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -//{ -// [HarmonyPatch(typeof(AbyssCheckSellMenu))] -// public static class AbyssCheckSellMenu_Patch -// { -// [HarmonyPatch(nameof(AbyssCheckSellMenu.SellIcon))] -// [HarmonyPostfix] -// private static void SellIcon(AbyssCheckSellMenu __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } - -// [HarmonyPatch(nameof(AbyssCheckSellMenu.MoveInBag))] -// [HarmonyPostfix] -// private static void MoveInBag(AbyssCheckSellMenu __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } -// } -//} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs deleted file mode 100644 index 5e85488..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/AbyssLevelEnter_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(AbyssLevelEnter))] - public static class AbyssLevelEnter_Patch - { - [HarmonyPatch(nameof(AbyssLevelEnter.SetLevel))] - [HarmonyPostfix] - private static void SetLevel(AbyssLevelEnter __instance) - { - __instance.levelName = StringStore.TranslateText(__instance.levelName); - } - } -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs deleted file mode 100644 index b469518..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Linq; -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(Advanture_Btn))] - public static class Advanture_Btn_Patch - { - [HarmonyPatch(nameof(Advanture_Btn.Start))] - [HarmonyPostfix] - private static void Start(Advanture_Btn __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == txt.text).Key; - txt.text = (StringStore.translationString.ContainsKey(originalKey + "_MG")) ? StringStore.TranslateText(originalKey + "_MG") : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs deleted file mode 100644 index 1342f06..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Linq; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(CustomLevelEnter))] - public static class CustomLevelEnter_Patch - { - [HarmonyPatch(nameof(CustomLevelEnter.Start))] - [HarmonyPostfix] - private static void Start(CustomLevelEnter __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == txt.text).Key; - txt.text = (StringStore.translationString.ContainsKey(originalKey + "_IZ")) ? StringStore.TranslateText(originalKey + "_IZ") : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs deleted file mode 100644 index 7b813d0..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(ExploreMakeSceneButton))] - public class ExploreMakeSceneButton_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(ExploreMakeSceneButton.Start))] - public static void Start(ExploreMakeSceneButton __instance) - { - __instance.sceneText.text = (StringStore.translationString.ContainsKey(__instance.sceneText.text + "_FS")) ? StringStore.TranslateText(__instance.sceneText.text + "_FS") : StringStore.TranslateText(__instance.sceneText.text); - __instance.sceneText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs deleted file mode 100644 index 1429902..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(ExploreMakeZombieButton))] - public class ExploreMakeZombieButton_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(ExploreMakeZombieButton.Start))] - public static void Start(ExploreMakeZombieButton __instance) - { - __instance.sceneText.text = Utils.GetZombieNameFromAlmanac(__instance.theZombieType); - __instance.sceneText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs deleted file mode 100644 index 52a196a..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(InGameBtn))] - public static class InGameBtn_Patch - { - [HarmonyPatch(nameof(InGameBtn.Update))] - [HarmonyPostfix] - private static void Update(InGameBtn __instance) - { - Transform sceneText = __instance.transform.FindChild("SceneText"); - if(sceneText != null) - { - TextMeshProUGUI sceneTextTMP = sceneText.transform.GetComponent(); - if(sceneTextTMP != null) - { - sceneTextTMP = AssetStore.StringStore.TranslateText(sceneTextTMP); - } - Transform sceneTextShadow = sceneText.transform.FindChild("SceneText"); - if(sceneTextShadow != null) - { - TextMeshProUGUI sceneTextShadowTMP = sceneTextShadow.transform.GetComponent(); - if (sceneTextShadowTMP != null) - { - sceneTextShadowTMP = AssetStore.StringStore.TranslateText(sceneTextShadowTMP); - } - } - } - - foreach(TextMeshProUGUI text in __instance.transform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs deleted file mode 100644 index 15b67f5..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs +++ /dev/null @@ -1,32 +0,0 @@ -using HarmonyLib; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(MainMenu_Btn))] - public static class MainMenu_Btn_Patch - { - //[HarmonyPatch(nameof(MainMenu_Btn.OnMouseEnter))] - //[HarmonyPostfix] - //private static void OnMouseEnter(MainMenu_Btn __instance) - //{ - // string textToShow = null; - - // if (__instance.transform.parent.name == "recipe") - // { - // textToShow = "探索模式"; - // } - // else if (__instance.name == "mysterious") - // { - // textToShow = "神秘模式"; - // } - - // if (textToShow != null) - // { - // InGameText.Instance.ShowText(textToShow, 2.0f); - // } - //} - } -} - - diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs deleted file mode 100644 index 79ad47d..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(NormalBtn))] - public class NormalBtn_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))] - public static void OnMouseUpAsButton(NormalBtn __instance) - { - if (__instance.transform.childCount > 0) - { - Transform banTransform = __instance.transform.GetChild(0); - if (banTransform != null) - { - banTransform.GetComponent().text = StringStore.TranslateText(banTransform.GetComponent().text); - } - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs deleted file mode 100644 index 6c79998..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs +++ /dev/null @@ -1,345 +0,0 @@ -#if MULTI_LANGUAGE -using HarmonyLib; -using System.Collections.Generic; -using System; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.UIElements; -using Object = UnityEngine.Object; -using BepInEx.Configuration; -using BepInEx; -using UnityEngine.Experimental.Rendering.RenderGraphModule; -using BepInEx.Unity.IL2CPP.Utils; -using Unity.VisualScripting.FullSerializer; - -public class OptionButtonData -{ - public OptionBtn Button { get; set; } - public Vector3 Position { get; set; } - public Utils.LanguageEnum? Language { get; set; } // Null if it's the "Next" button - public Utils.ToggleEnum? Toggle { get; set; } // Null if it's the "Next" button - public bool IsNextButton { get; set; } - public bool shifted = false; -} - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - internal class OptLanguageBtn_Patch - { - public static Dictionary LanguageBtnDict = new(); - public static Dictionary ToggleBtnDict = new(); - private static bool buttonsCreated = false; - private static bool togglesCreated = false; - private static OptionBtn cachedTemplateButton; - private static OptionBtn cachedTemplateToggleButton; - - private const float startX = 4.3241f + 2.56f; - private const float startY = 2.7769f; - private const float ySpacing = 1.2505f; - - private const float toggleStartX = 4.3241f; - private const float toggleStartY = -2.2251f; - - private static List AvailableLanguages; - private static List AvailableToggles; - private const int LanguagesPerPage = 5; - private static int currentPage = 0; - private static OptionBtn[] buttonSlots = new OptionBtn[6]; // 5 language buttons + 1 next button - private static OptionBtn[] toggleSlots = new OptionBtn[2]; - - public static void CreateLanguageButtons(OptionBtn templateButton) - { - if (buttonsCreated) return; - buttonsCreated = true; - cachedTemplateButton = templateButton; - - AvailableLanguages = Enum.GetValues(typeof(Utils.LanguageEnum)) - .Cast() - .Where(lang => lang != Utils.LanguageEnum.LANG_END) - .ToList(); - - for (int i = 0; i < 6; i++) - { - var newButton = Object.Instantiate(templateButton, templateButton.transform.parent); - newButton.optionType = 80 + i; - - float yPos = startY - i * ySpacing; - Vector3 pos = new(startX, yPos); - newButton.transform.position = pos; - - buttonSlots[i] = newButton; - - LanguageBtnDict[newButton.GetInstanceID()] = new OptionButtonData - { - Button = newButton, - Position = pos - }; - } - - UpdatePage(); - } - - public static void CreateToggleButtons(OptionBtn templateButton) - { - if (togglesCreated) return; - togglesCreated = true; - cachedTemplateToggleButton = templateButton; - - AvailableToggles = Enum.GetValues(typeof(Utils.ToggleEnum)) - .Cast() - .Where(lang => lang != Utils.ToggleEnum.TOGGLE_END) - .ToList(); - - for (int i = 0; i < 2; i++) - { - var newButton = Object.Instantiate(templateButton, templateButton.transform.parent); - newButton.optionType = 100 + i; - - float yPos = toggleStartY - i * ySpacing; - Vector3 pos = new(toggleStartX, yPos); - newButton.transform.position = pos; - - toggleSlots[i] = newButton; - - ToggleBtnDict[newButton.GetInstanceID()] = new OptionButtonData - { - Button = newButton, - Position = pos - }; - } - - UpdatePage(); - } - - private static void UpdatePage() - { - int startIndex = currentPage * LanguagesPerPage; - int langCount = AvailableLanguages.Count; - int toggleCount = (togglesCreated) ? AvailableToggles.Count : 0; - - for (int i = 0; i < 5; i++) - { - var btn = buttonSlots[i]; - var data = LanguageBtnDict[btn.GetInstanceID()]; - - if (startIndex + i < langCount) - { - var lang = AvailableLanguages[startIndex + i]; - data.Language = lang; - data.IsNextButton = false; - btn.gameObject.SetActive(true); - UpdateButtonText(btn, lang.ToString()); - } - else - { - data.Language = null; - data.IsNextButton = false; - btn.gameObject.SetActive(false); - } - } - - if (togglesCreated) - { - for (int i = 0; i < 2; i++) - { - var btn = toggleSlots[i]; - var data = ToggleBtnDict[btn.GetInstanceID()]; - - if (i < toggleCount) - { - var toggle = AvailableToggles[i]; - data.Toggle = toggle; - data.IsNextButton = false; - btn.gameObject.SetActive(true); - UpdateButtonText(btn, toggle.ToString()); - } - else - { - data.Language = null; - data.IsNextButton = false; - btn.gameObject.SetActive(false); - } - } - } - - // "Next" button always visible at index 5 - var nextBtn = buttonSlots[5]; - var nextData = LanguageBtnDict[nextBtn.GetInstanceID()]; - nextData.Language = null; - nextData.IsNextButton = true; - nextBtn.gameObject.SetActive(true); - UpdateButtonText(nextBtn, "Next"); - } - - public static void UpdateButtonText(OptionBtn button, string languageName) - { - TMP_FontAsset defaultAsset = FontStore.LoadTMPFont("English"); - - for (int i = 0; i < 3; i++) - { - Transform textTransform = button.transform.GetChild(i); - if (textTransform != null) - { - if (i == 0) textTransform.gameObject.SetActive(false); - - TextMeshProUGUI text = textTransform.GetComponent(); - if (text != null) - { - if (i == 0) - { - text.text = ""; - text.color = Color.red; - } - else - { - text.text = languageName; - } - text.fontSize = 16; - text.font = defaultAsset; - text.autoSizeTextContainer = false; - } - } - } - } - - private static void FlashMessage(OptionBtn button, string message, float yShift = 0.0f) - { - var child = button.transform.GetChild(0); - if (child != null) - { - var text = child.GetComponent(); - if (text != null) - { - text.text = message; - OptionButtonData data; - bool isToggle = ToggleBtnDict.TryGetValue(button.GetInstanceID(), out data); - - if(isToggle) - { - text.transform.position = new Vector3(text.transform.position.x, text.transform.position.y + (ToggleBtnDict[button.GetInstanceID()].shifted ? 0.0f : yShift), text.transform.position.z); - ToggleBtnDict[button.GetInstanceID()].shifted = true; - } - else - { - text.transform.position = new Vector3(text.transform.position.x, text.transform.position.y + (LanguageBtnDict[button.GetInstanceID()].shifted ? 0.0f : yShift), text.transform.position.z); - LanguageBtnDict[button.GetInstanceID()].shifted = true; - } - } - child.gameObject.SetActive(true); - - System.Threading.Tasks.Task.Delay(1000).ContinueWith(_ => - { - if (button != null && child != null && child.gameObject.activeSelf) - { - child.gameObject.SetActive(false); - } - }); - } - } - - private static void ToggleCustomAssets(string type) - { - if (type != "Textures" && type != "Audio") return; - - if (type == "Textures") - { - ConfigEntry customTexturesEntry; - Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultTextures"), out customTexturesEntry); - customTexturesEntry.BoxedValue = !customTexturesEntry.Value; // Toggle the config value - TextureStore.Reload(); - Coroutine replaceTextureRoutine = Core.MonoInstance.StartCoroutine(TextureStore.ReplaceTexturesCoroutine()); - } - - if (type == "Audio") - { - ConfigEntry customAudioEntry; - Core.Instance.Config.TryGetEntry(new ConfigDefinition("PvZ_Fusion_Translator", "DefaultAudio"), out customAudioEntry); - customAudioEntry.BoxedValue = !customAudioEntry.Value; // Toggle the config value - } - Core.Instance.Config.Save(); - } - - [HarmonyPatch(typeof(OptionBtn))] - public static class OptLangBtn_Patch - { - [HarmonyPatch(nameof(OptionBtn.Awake))] - [HarmonyPostfix] - private static void Awake(OptionBtn __instance) - { - if (!buttonsCreated || cachedTemplateButton == null) - { - buttonsCreated = false; - togglesCreated = false; - CreateLanguageButtons(__instance); - CreateToggleButtons(__instance); - } - } - - [HarmonyPatch("OnMouseUpAsButton")] - [HarmonyPrefix] - private static void OnMouseUpAsButton(OptionBtn __instance) - { - if (LanguageBtnDict.TryGetValue(__instance.GetInstanceID(), out var btnData)) - { - if (btnData.IsNextButton) - { - currentPage = (currentPage + 1) % (int)Math.Ceiling((float)AvailableLanguages.Count / LanguagesPerPage); - UpdatePage(); - return; - } - - if (btnData.Language is Utils.LanguageEnum selectedLang) - { - string currentLang = Utils.Language.ToString(); - - if (currentLang == selectedLang.ToString()) - { - FlashMessage(btnData.Button, "Already Selected!"); - } - else - { - Utils.ChangeLanguage(selectedLang.ToString()); - Debug.Log($"Language changed to: {selectedLang}"); - FlashMessage(btnData.Button, "Language Changed!"); - } - } - } - - if (ToggleBtnDict.TryGetValue(__instance.GetInstanceID(), out var toggleData)) - { - string toggleType = toggleData.Toggle.ToString(); - ToggleCustomAssets(toggleType); - if (toggleType == "Textures") - { - FlashMessage(toggleData.Button, "Toggled custom textures!", 0.1f); - } - else if (toggleType == "Audio") - { - FlashMessage(toggleData.Button, "Toggled custom audio!", 0.1f); - } - } - } - - [HarmonyPatch(nameof(OptionBtn.Update))] - [HarmonyPostfix] - private static void Update(OptionBtn __instance) - { - if (LanguageBtnDict.TryGetValue(__instance.GetInstanceID(), out var btnData)) - { - btnData.Button.transform.position = btnData.Position; - } - - if (ToggleBtnDict.TryGetValue(__instance.GetInstanceID(), out var toggleData)) - { - toggleData.Button.transform.position = toggleData.Position; - } - } - } - } -} -#endif \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs deleted file mode 100644 index 87f3e66..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs +++ /dev/null @@ -1,69 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(OptionBtn))] - public static class OptionBtn_Patch - { - [HarmonyPatch(nameof(OptionBtn.Awake))] - [HarmonyPostfix] - private static void Awake(OptionBtn __instance) - { - Transform text_1Transform = __instance.transform.GetChild(0)?.transform; - if (text_1Transform != null) - { - TextMeshProUGUI text_1 = text_1Transform.GetComponent(); - text_1 = StringStore.TranslateText(text_1); - text_1.autoSizeTextContainer = false; - } - - Transform textTransform = __instance.transform.GetChild(1)?.transform; - if (textTransform != null) - { - TextMeshProUGUI text = textTransform.GetComponent(); - text = StringStore.TranslateText(text); - text.autoSizeTextContainer = false; - } - - Transform text2Transform = __instance.transform.GetChild(2)?.transform; - if (text2Transform != null) - { - TextMeshProUGUI text2 = text2Transform.GetComponent(); - text2 = StringStore.TranslateText(text2); - text2.autoSizeTextContainer = false; - } - } - - [HarmonyPatch("OnMouseUpAsButton")] - [HarmonyPostfix] - private static void OnMouseUpAsButtonPostfix(OptionBtn __instance) - { - Transform text_1Transform = __instance.transform.GetChild(0)?.transform; - if (text_1Transform != null) - { - TextMeshProUGUI text_1 = text_1Transform.GetComponent(); - text_1 = StringStore.TranslateText(text_1); - text_1.autoSizeTextContainer = false; - } - - Transform textTransform = __instance.transform.GetChild(1)?.transform; - if (textTransform != null) - { - TextMeshProUGUI text = textTransform.GetComponent(); - text = StringStore.TranslateText(text); - text.autoSizeTextContainer = false; - } - - Transform text2Transform = __instance.transform.GetChild(2)?.transform; - if (text2Transform != null) - { - TextMeshProUGUI text2 = text2Transform.GetComponent(); - text2 = StringStore.TranslateText(text2); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs deleted file mode 100644 index bb07b21..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs +++ /dev/null @@ -1,42 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(PVPPotBtn))] - public class PVPPotBtn_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(PVPPotBtn.OnMouseUpAsButton))] - public static void OnMouseUpAsButton(PVPPotBtn __instance) - { - Transform sceneText = __instance.transform.FindChild("text"); - if(sceneText != null) - { - TextMeshProUGUI sceneTextTMP = sceneText.transform.GetComponent(); - if(sceneTextTMP != null) - { - sceneTextTMP.text = StringStore.TranslateText(sceneTextTMP.text); - } - } - Transform sceneTextShadow = sceneText.transform.FindChild("text_1"); - if(sceneTextShadow != null) - { - TextMeshProUGUI sceneTextShadowTMP = sceneTextShadow.transform.GetComponent(); - if (sceneTextShadowTMP != null) - { - sceneTextShadowTMP.text = StringStore.TranslateText(sceneTextShadowTMP.text); - } - } - - if (__instance.name.Equals("ChangeBg_3") || __instance.name.Equals("ChangeBg_4")) - { - __instance.gameObject.SetActive(false); - __instance.gameObject.SetActive(true); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs deleted file mode 100644 index e110b2f..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs +++ /dev/null @@ -1,15 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(PauseMenu_Btn))] - public static class PauseMenu_Btn_Patch - { - [HarmonyPatch(nameof(PauseMenu_Btn.Start))] - [HarmonyPostfix] - private static void Start(PauseMenu_Btn __instance) => StringStore.TranslateTextTransform(__instance.transform); - } - -} diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs deleted file mode 100644 index b6b8df4..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -#if FIX -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(SaveMenuBtn))] - public static class SaveMenuBtn_Patch - { - [HarmonyPatch(nameof(SaveMenuBtn.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton(SaveMenuBtn __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.theName.text = StringStore.TranslateText(__instance.theName.text); - __instance.theName.font = fontAsset; - } - } -} -#endif \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs b/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs deleted file mode 100644 index 0de74e2..0000000 --- a/BepInEx/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs +++ /dev/null @@ -1,85 +0,0 @@ -using HarmonyLib; -using TMPro; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.UI; -using UnityEngine.UIElements; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIButton))] - public static class UIButton_Patch - { - [HarmonyPatch(typeof(UIButton), nameof(UIButton.Start))] - [HarmonyPostfix] - public static void Start(UIButton __instance) - { - if (__instance.transform.childCount >= 2) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI text in __instance.transform.GetComponentsInChildren()) - { - if (__instance.transform.name == "Goback") - { - text.text = "合上"; - } - text.text = StringStore.TranslateText(text.text); - text.font = font; - } - } - else - { - StringStore.TranslateTextTransform(__instance.transform); - if (__instance.transform.name == "Goback") - { - foreach (TextMeshProUGUI text in __instance.transform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("合上"); - } - } - } - } - - [HarmonyPatch(nameof(UIButton.OnMouseUpAsButton))] - [HarmonyPostfix] - public static void Postfix_OnMouseUpAsButton(UIButton __instance) - { - try - { - if (__instance.transform.childCount >= 2) - { - if (__instance.name == "EditMode") - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - TextMeshProUGUI text = __instance.transform.GetChild(0).GetComponent(); - TextMeshProUGUI[] extraTexts = __instance.transform.GetChild(1).GetComponentsInChildren(); - - text.text = StringStore.TranslateText(text.text, false); - text.font = fontAsset; - - foreach (TextMeshProUGUI extraText in extraTexts) - { - extraText.text = StringStore.TranslateText(extraText.text, false); - extraText.font = fontAsset; - } - } - else - { - TextMeshProUGUI text = __instance.transform.GetChild(0).GetComponent(); - TextMeshProUGUI textShadow = __instance.transform.GetChild(1).GetComponent(); - - text.text = StringStore.TranslateText(text.text, false); - textShadow.text = StringStore.TranslateText(textShadow.text, false); - - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - textShadow.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } - catch (Exception) { } - } - } -} diff --git a/BepInEx/Patches/GameObjects/Close_Patch.cs b/BepInEx/Patches/GameObjects/Close_Patch.cs deleted file mode 100644 index 2df6f37..0000000 --- a/BepInEx/Patches/GameObjects/Close_Patch.cs +++ /dev/null @@ -1,52 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(Close))] - public static class Close_Patch - { - [HarmonyPatch(nameof(Close.Start))] - [HarmonyPostfix] - private static void Close_Start(Close __instance) - { - - TextMeshPro closeText = __instance.transform.GetChild(0).GetComponent(); - closeText.text = "合上"; - closeText = StringStore.TranslateText(closeText); - closeText.autoSizeTextContainer = true; - - Transform AlmanacTransform = __instance.transform.parent.transform; - - Transform nameTransform = AlmanacTransform.Find("Name"); - if (nameTransform != null) - { - TextMeshPro nameTMP = nameTransform.transform.GetComponent(); - if (nameTMP) - { - nameTMP = StringStore.TranslateText(nameTMP); - nameTMP.autoSizeTextContainer = true; - } - - Transform nameShadowTransform = nameTransform.Find("NameShadow"); - if (nameShadowTransform) - { - TextMeshPro nameShadowTMP = nameShadowTransform.transform.GetComponent(); - if (nameShadowTMP) - { - nameShadowTMP = StringStore.TranslateText(nameShadowTMP); - nameShadowTMP.autoSizeTextContainer = true; - } - } - } - - StringStore.TranslateTextTransform(AlmanacTransform.Find("Back"), true); - StringStore.TranslateTextTransform(AlmanacTransform.Find("NextPage")); - StringStore.TranslateTextTransform(AlmanacTransform.Find("LastPage")); - - } - } -} diff --git a/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs b/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs deleted file mode 100644 index 88b3411..0000000 --- a/BepInEx/Patches/GameObjects/CrisisZombieWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(CrisisZombieWindow))] - public static class CrisisZombieWindow_Patch - { - [HarmonyPatch(nameof(CrisisZombieWindow.Start))] - [HarmonyPostfix] - private static void Start(CrisisZombieWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(CrisisZombieWindow.SetZombieType))] - [HarmonyPostfix] - private static void SetZombieType(CrisisZombieWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs b/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs deleted file mode 100644 index a89481b..0000000 --- a/BepInEx/Patches/GameObjects/CustomSettings_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(CustomSettings))] - public static class CustomSettings_Patch - { - [HarmonyPatch(nameof(CustomSettings.Awake))] - [HarmonyPostfix] - private static void Awake(CustomSettings __instance) - { - __instance.textMesh = StringStore.TranslateText(__instance.textMesh); - } - - [HarmonyPatch(nameof(CustomSettings.ChangeText))] - [HarmonyPostfix] - private static void ChangeText(CustomSettings __instance) - { - __instance.textMesh = StringStore.TranslateText(__instance.textMesh); - } - } -} diff --git a/BepInEx/Patches/GameObjects/CustomSun_Patch.cs b/BepInEx/Patches/GameObjects/CustomSun_Patch.cs deleted file mode 100644 index 757ba73..0000000 --- a/BepInEx/Patches/GameObjects/CustomSun_Patch.cs +++ /dev/null @@ -1,45 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(CustomSun))] - public static class CustomSun_Patch - { - [HarmonyPatch(nameof(CustomSun.Awake))] - [HarmonyPostfix] - private static void Awake(CustomSun __instance) - { - if (__instance.inputField.gameObject.activeSelf) - { - string oriTextSun = __instance.inputField.m_Text; - __instance.inputField.gameObject.SetActive(false); - __instance.inputField.m_Text = StringStore.TranslateText(oriTextSun); - __instance.inputField.m_OriginalText = StringStore.TranslateText(oriTextSun); - __instance.inputField.gameObject.SetActive(true); - } - - if (__instance.setFlags.gameObject.activeSelf) - { - string oriTextFlags = __instance.setFlags.m_Text; - __instance.setFlags.gameObject.SetActive(false); - __instance.setFlags.m_Text = StringStore.TranslateText(oriTextFlags); - __instance.setFlags.m_OriginalText = StringStore.TranslateText(oriTextFlags); - __instance.setFlags.gameObject.SetActive(true); - } - - Transform lookZombieTransform = __instance.lookZombie.transform.GetChild(0).transform; - if (lookZombieTransform != null) - { - TextMeshProUGUI lookZombieTMP = lookZombieTransform.GetComponent(); - if (lookZombieTMP != null) - { - lookZombieTMP = StringStore.TranslateText(lookZombieTMP); - } - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/EveBuffMenu_Patch.cs b/BepInEx/Patches/GameObjects/EveBuffMenu_Patch.cs deleted file mode 100644 index 68beceb..0000000 --- a/BepInEx/Patches/GameObjects/EveBuffMenu_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Text.RegularExpressions; -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(EveBuffMenu))] - public static class EveBuffMenu_Patch - { - [HarmonyPatch(nameof(EveBuffMenu.Start))] - [HarmonyPostfix] - private static void Start(EveBuffMenu __instance) - { - foreach (EveOptionWindow window in __instance.windows) - { - EveOptionWindow_Patch.TranslateEveOptionWindow(window); - } - - foreach (TextMeshProUGUI text in __instance.quitButton.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("合上"); - } - } - - [HarmonyPatch(nameof(EveBuffMenu.InitWindows))] - [HarmonyPostfix] - private static void InitWindows(EveBuffMenu __instance) - { - foreach (EveOptionWindow window in __instance.windows) - { - EveOptionWindow_Patch.TranslateEveOptionWindow(window); - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/EveOptionWindow_Patch.cs b/BepInEx/Patches/GameObjects/EveOptionWindow_Patch.cs deleted file mode 100644 index f751dcd..0000000 --- a/BepInEx/Patches/GameObjects/EveOptionWindow_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Text.RegularExpressions; -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(EveOptionWindow))] - public static class EveOptionWindow_Patch - { - [HarmonyPatch(nameof(EveOptionWindow.SetType))] - [HarmonyPostfix] - private static void SetType(EveOptionWindow __instance) - { - TranslateEveOptionWindow(__instance); - } - - [HarmonyPatch(nameof(EveOptionWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(EveOptionWindow __instance) - { - TranslateEveOptionWindow(__instance); - } - - [HarmonyPatch(nameof(EveOptionWindow.SelectedByRow))] - [HarmonyPostfix] - private static void SelectedByRow(EveOptionWindow __instance) - { - TranslateEveOptionWindow(__instance); - } - - public static void TranslateEveOptionWindow(EveOptionWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - - foreach (TextMeshProUGUI text in __instance.buttonText) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ExploreEnterWindow_Patch.cs b/BepInEx/Patches/GameObjects/ExploreEnterWindow_Patch.cs deleted file mode 100644 index f0d6b94..0000000 --- a/BepInEx/Patches/GameObjects/ExploreEnterWindow_Patch.cs +++ /dev/null @@ -1,66 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(ExploreEnterWindow))] - public static class ExploreEnterWindow_Patch - { - [HarmonyPatch(nameof(ExploreEnterWindow.Awake))] - [HarmonyPostfix] - private static void Awake(ExploreEnterWindow __instance) - { - PlantType thePlantType = (PlantType)__instance.selfType; - - __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); - if (__instance.nameText.text == "") - { - __instance.nameText.text = StringStore.TranslateText(__instance.nameText.text); - } - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ExploreEnterWindow.SetInfo))] - [HarmonyPostfix] - private static void SetInfo(ExploreEnterWindow __instance) - { - PlantType thePlantType = (PlantType)__instance.selfType; - - __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); - if (__instance.nameText.text == "") - { - __instance.nameText.text = StringStore.TranslateText(__instance.nameText.text); - } - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ExploreEnterWindow.SetIcon))] - [HarmonyPostfix] - private static void SetIcon(ExploreEnterWindow __instance) - { - PlantType thePlantType = (PlantType)__instance.selfType; - - __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); - if (__instance.nameText.text == "") - { - __instance.nameText.text = StringStore.TranslateText(__instance.nameText.text); - } - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ExploreEnterWindow.SetDisable))] - [HarmonyPostfix] - private static void SetDisable(ExploreEnterWindow __instance) - { - if (__instance.disabled) - { - __instance.nameText.text = StringStore.TranslateText("敬请期待"); - } - - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} diff --git a/BepInEx/Patches/GameObjects/ExploreMakeMenu_Patch.cs b/BepInEx/Patches/GameObjects/ExploreMakeMenu_Patch.cs deleted file mode 100644 index b2d941e..0000000 --- a/BepInEx/Patches/GameObjects/ExploreMakeMenu_Patch.cs +++ /dev/null @@ -1,79 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_; -using System.Text.RegularExpressions; -using UnityEngine; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.IO; -using System.Text.Json; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(ExploreMakeMenu))] - public static class ExploreMakeMenu_Patch - { - [HarmonyPatch(nameof(ExploreMakeMenu.Awake))] - [HarmonyPostfix] - private static void Awake(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(ExploreMakeMenu.InitMenu))] - [HarmonyPostfix] - private static void InitMenu(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if(txt.text.Contains("关卡制作中:")) - { - string plantName = Utils.GetPlantNameFromAlmanac(txt.text.Split(":")[1]); - txt.text = String.Format(StringStore.translationStringRegex["关卡制作中:([^\\s]+)"], plantName); - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - } - } - - [HarmonyPatch(nameof(ExploreMakeMenu.ViewScene))] - [HarmonyPostfix] - private static void ViewScene(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(ExploreMakeMenu.InitZombieButtons))] - [HarmonyPostfix] - private static void InitZombieButtons(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ExploreMenu_Patch.cs b/BepInEx/Patches/GameObjects/ExploreMenu_Patch.cs deleted file mode 100644 index 795137f..0000000 --- a/BepInEx/Patches/GameObjects/ExploreMenu_Patch.cs +++ /dev/null @@ -1,48 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(ExploreMenu))] - public static class ExploreMenu_Patch - { - [HarmonyPatch(nameof(ExploreMenu.Awake))] - [HarmonyPostfix] - private static void Awake(ExploreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - } - - Transform randomLevelTextTransform = __instance.transform.FindChild("RandomLevel"); - //foreach (TextMeshProUGUI txt in randomLevelTextTransform.GetComponentsInChildren()) - //{ - // if (txt.name.Contains("Text (TMP)")) - // { - // txt.autoSizeTextContainer = true; - // if (txt.name == "Text (TMP)") - // { - // txt.transform.localPosition = new Vector3(94.4225f, -45.1565f, 0f); - // } - // } - //} - } - - [HarmonyPatch(nameof(ExploreMenu.UpdateWindows))] - [HarmonyPostfix] - private static void UpdateWindows(ExploreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs b/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs deleted file mode 100644 index 6f36532..0000000 --- a/BepInEx/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(FruitNinjaSelectWindow))] - public static class FruitNinjaSelectWindow_Patch - { - [HarmonyPatch(nameof(FruitNinjaSelectWindow.SetType))] - [HarmonyPostfix] - private static void SetType(FruitNinjaSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(FruitNinjaSelectWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(FruitNinjaSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/BepInEx/Patches/GameObjects/GardenBagMenu_Patch.cs b/BepInEx/Patches/GameObjects/GardenBagMenu_Patch.cs deleted file mode 100644 index 5c555a1..0000000 --- a/BepInEx/Patches/GameObjects/GardenBagMenu_Patch.cs +++ /dev/null @@ -1,51 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(GardenBagMenu))] - public static class GardenBagMenu_Patch - { - [HarmonyPatch(nameof(GardenBagMenu.SetTreasureCards))] - [HarmonyPostfix] - private static void SetTreasureCards(GardenBagMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if(txt.transform.parent.name.Contains("Close")) - { - txt.text = StringStore.TranslateText("合上"); - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(GardenBagMenu.SetTreasureCard))] - [HarmonyPostfix] - private static void SetTreasureCard(GardenBagMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if (txt.transform.parent.name.Contains("Close")) - { - txt.text = StringStore.TranslateText("合上"); - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/GardenCard_Patch.cs b/BepInEx/Patches/GameObjects/GardenCard_Patch.cs deleted file mode 100644 index ed7de7d..0000000 --- a/BepInEx/Patches/GameObjects/GardenCard_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(GardenCard))] - public static class GardenCard_Patch - { - [HarmonyPatch(nameof(GardenCard.Start))] - [HarmonyPostfix] - private static void Start(GardenCard __instance) - { - __instance.text.text = StringStore.TranslateText(__instance.text.text).Replace("26", "16"); - } - - [HarmonyPatch(nameof(GardenCard.ChangeCardSprite))] - [HarmonyPostfix] - private static void ChangeCardSprite(GardenCard __instance) - { - __instance.text.text = StringStore.TranslateText(__instance.text.text).Replace("26", "16"); - } - } -} diff --git a/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs b/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs deleted file mode 100644 index 5d8ea61..0000000 --- a/BepInEx/Patches/GameObjects/GardenPlant_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using System; -using System.Text.RegularExpressions; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(GardenPlant))] - public static class GardenPlant_Patch - { - [HarmonyPatch(nameof(GardenPlant.Start))] - [HarmonyPostfix] - private static void Start(GardenPlant __instance) - { - __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); - } - - [HarmonyPatch(nameof(GardenPlant.UpdateInfo))] - [HarmonyPostfix] - private static void UpdateInfo(GardenPlant __instance) - { - - __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MainMenu_Patch.cs b/BepInEx/Patches/GameObjects/MainMenu_Patch.cs deleted file mode 100644 index 8d00da2..0000000 --- a/BepInEx/Patches/GameObjects/MainMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(MainMenu))] - public class MainMenu_Patch - { - private static bool _warningShown = false; - - [HarmonyPostfix] - [HarmonyPatch(nameof(MainMenu.AnimOver))] - private static void AnimOver(MainMenu __instance) - { - if (_warningShown || NoticeMenu.Instance == null) - return; - - WarningStore.WarningReload(Utils.Language, NoticeMenu.Instance); - _warningShown = true; - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs deleted file mode 100644 index 0c0e3b6..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/AbyssGoods_Patch.cs +++ /dev/null @@ -1,21 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(AbyssGoods))] - public static class AbyssGoods_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(AbyssGoods.Start))] - private static void Start(AbyssGoods __instance) - { - __instance.costText.text = StringStore.TranslateText(__instance.costText.text, false); - __instance.costText_shadow.text = StringStore.TranslateText(__instance.costText_shadow.text, false); - __instance.hasText.text = StringStore.TranslateText(__instance.hasText.text, false); - __instance.hasText_shadow.text = StringStore.TranslateText(__instance.hasText_shadow.text, false); - } - } -} diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Brain_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Brain_Patch.cs deleted file mode 100644 index ed896cf..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/Brain_Patch.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Text.RegularExpressions; -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Brain))] - public static class Brain_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(Brain.Awake))] - private static void Awake(Brain __instance) - { - // reposition original points - Transform pointsTransform = __instance.points.transform; - GameObject pointsObject = __instance.points.gameObject; - pointsTransform.position = new Vector3(-6.5f, pointsTransform.position.y, pointsTransform.position.z); - - // instantiate and move new shadow - GameObject pointsShadowObject = UnityEngine.Object.Instantiate(pointsObject, parent: pointsTransform); - pointsShadowObject.SetActive(true); - Transform pointsShadowTransform = pointsShadowObject.transform; - pointsShadowTransform.position = new Vector3(-6.485f, pointsTransform.position.y - 0.015f, pointsTransform.position.z); - - // set points text - TextMeshPro pointsShadowText = pointsShadowObject.GetComponent(); - pointsShadowText.text = __instance.points.text; - pointsShadowText.sortingOrder -= 2; - pointsShadowText.color = Color.black; - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(Brain.Update))] - private static void Update(Brain __instance) - { - if (__instance.transform.Find("Points").GetChild(0) != null) - { - TextMeshPro shadowText = __instance.transform.Find("Points").GetChild(0).GetComponent(); - shadowText.text = __instance.points.text; - } - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(Brain.WinAction))] - private static void WinAction(Brain __instance) - { - if (__instance.transform.Find("Points").GetChild(0) != null) - { - TextMeshPro shadowText = __instance.transform.Find("Points").GetChild(0).GetComponent(); - shadowText.text = __instance.points.text; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs deleted file mode 100644 index 6659ddd..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/DY_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(DY))] - public static class DY_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(DY.Update))] - private static void Update(DY __instance) - { - __instance.TextMeshPro.text = StringStore.TranslateText(__instance.TextMeshPro.text); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs deleted file mode 100644 index acc26c1..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs +++ /dev/null @@ -1,30 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(JigsawClip))] - public static class JigsawClip_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(JigsawClip.Awake))] - private static void Postfix_Awake(JigsawClip __instance) - { - if (!__instance || !__instance.description) return; - - StringStore.TranslateTextUI(__instance.description); - } - [HarmonyPostfix] - [HarmonyPatch(nameof(JigsawClip.Update))] - private static void Postfix_Update(JigsawClip __instance) - { - if (!__instance || !__instance.description) return; - - if (__instance.description.text != StringStore.TranslateText(__instance.description.text)) - { - StringStore.TranslateTextUI(__instance.description); - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs deleted file mode 100644 index e4c913c..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ -[HarmonyPatch(typeof(LanternUmbrella))] - public class LanternUmbrella_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(LanternUmbrella.Update))] - private static void Update(LanternUmbrella __instance) - { - __instance.energyText = StringStore.TranslateText(__instance.energyText); - __instance.energyTextShadow = StringStore.TranslateText(__instance.energyTextShadow); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs deleted file mode 100644 index 3ff15e8..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(MagnetBox))] - public class MagnetBox_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(MagnetBox.Update))] - private static void Update(MagnetBox __instance) - { - StringStore.TranslateTextTransform(__instance.transform); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs deleted file mode 100644 index 4263677..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(MagnetInterface))] - public class MagnetInterface_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(MagnetInterface.Update))] - private static void Update(MagnetInterface __instance) - { - StringStore.TranslateTextTransform(__instance.transform); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs deleted file mode 100644 index 312d327..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/Money_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Money))] - public static class Money_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(Money.Update))] - private static void Update(Money __instance) - { - __instance.beanCount.text = StringStore.TranslateText(__instance.beanCount.text); - __instance.beanCount2.text = StringStore.TranslateText(__instance.beanCount2.text); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs deleted file mode 100644 index cd60f9f..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/Plant_Patch.cs +++ /dev/null @@ -1,48 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Plant))] - public static class Plant_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(Plant.Awake))] - private static void Awake(Plant __instance) - { - if (!(__instance.thePlantType == PlantType.SuperMachineNut || __instance.thePlantType == PlantType.MachineNut)) - return; - __instance.healthSlider.healthText.text = __instance.healthSlider.healthTextShadow.text = ChangeHPText(__instance.healthSlider.healthTextShadow.text); - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(Plant.UpdateText))] - private static void Update(Plant __instance) - { - if (!(__instance.thePlantType == PlantType.SuperMachineNut || __instance.thePlantType == PlantType.MachineNut)) - return; - if (__instance.thePlantHealth < __instance.thePlantMaxHealth) - return; - __instance.healthSlider.healthText.text = __instance.healthSlider.healthTextShadow.text = ChangeHPText(__instance.healthSlider.healthTextShadow.text); - } - - static string ChangeHPText(string originalText) - { - var regex = new Regex(@"(\d+)\d\d\d/(\d)000"); - if (regex.IsMatch(originalText)) - { - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - List dynamicParts = new List(); - - for (int i = 1; i < groupCount; i++) - dynamicParts.Add(match.Groups[i].Value); - return originalText = string.Format("{0}k/{1}k", [.. dynamicParts]); - } - return originalText; - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs deleted file mode 100644 index 90b423f..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(PlayerName))] - public static class PlayerName_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(PlayerName.Update))] - private static void Update(PlayerName __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs deleted file mode 100644 index c9ce753..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(SelectYourPlants))] - public static class SelectYourPlants_Patch - { - [HarmonyPatch(nameof(SelectYourPlants.Awake))] - [HarmonyPostfix] - private static void Awake(SelectYourPlants __instance) - { - __instance.TextMeshProUGUI = StringStore.TranslateText(__instance.TextMeshProUGUI); - __instance.TextMeshProUGUI.autoSizeTextContainer = true; - - __instance.TextMeshProUGUI2 = StringStore.TranslateText(__instance.TextMeshProUGUI2); - __instance.TextMeshProUGUI2.autoSizeTextContainer = true; - } - } -} diff --git a/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs deleted file mode 100644 index 3b34a5a..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs +++ /dev/null @@ -1,16 +0,0 @@ -using HarmonyLib; -using System; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(TrainingDummy), nameof(TrainingDummy.UpdateHealthText))] - public static class TrainingDummy_Patch - { - [HarmonyPostfix] - public static void UpdateHealthText(TrainingDummy __instance) - { - Zombie_Patch.TranslateHpUI_T(__instance.healthText, __instance); - Zombie_Patch.TranslateHpUI_T(__instance.healthTextShadow, __instance); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs deleted file mode 100644 index 3c4543d..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs +++ /dev/null @@ -1,16 +0,0 @@ -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(TreasureMoney))] - public static class TreasureMoney_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(TreasureMoney.Update))] - private static void Update(TreasureMoney __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - } - } -} diff --git a/BepInEx/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs deleted file mode 100644 index 8c8ccf0..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIProgress2))] - public static class UIProgress2_Patch - { - [HarmonyPatch(nameof(UIProgress2.Update))] - [HarmonyPostfix] - private static void Update(UIProgress2 __instance) - { - __instance.t.text = StringStore.TranslateText(__instance.t.text); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs deleted file mode 100644 index 5e8aac3..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(UltimateChomper), nameof(UltimateChomper.UpdateText))] - public static class UltimateChomper_Patch - { - [HarmonyPostfix] - public static void UpdateText(UltimateChomper __instance) - { - StringStore.TranslateText(__instance.killingText); - StringStore.TranslateText(__instance.killingTextShadow); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs b/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs deleted file mode 100644 index ff271df..0000000 --- a/BepInEx/Patches/GameObjects/MinorObjects/Zombie_Patch.cs +++ /dev/null @@ -1,176 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using System.Linq; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Zombie))] - public static class Zombie_Patch - { - private static Dictionary HPStrings = new Dictionary() - { - { "最后一击:(\\d+)\nDPS:([^\\s]+)\n总伤害:(\\d+)", "Last Damage: {0}\nDPS: {1}\nTotal: {2}" }, - { "^HP:(\\d+)/(\\d+)\n一类:(\\d+)/(\\d+)\n二类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 1 armor: {2}/{3}\nType 2 armor: {4}/{5}" }, - { "^HP:(\\d+)/(\\d+)\n一类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 1 armor: {2}/{3}" }, - { "^HP:(\\d+)/(\\d+)\n二类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nType 2 armor: {2}/{3}" }, - { "^HP:(\\d+)/(\\d+)$", "HP: {0}/{1}" } - }; - - public static void LoadHPStrings() - { - foreach (var hp in HPStrings) - if (StringStore.translationStringRegex.ContainsKey(hp.Key)) - HPStrings[hp.Key] = StringStore.translationStringRegex[hp.Key]; - } - - [HarmonyPatch(nameof(Zombie.Start))] - [HarmonyPostfix] - public static void Start(Zombie __instance) - { - TranslateHpUI(__instance.healthText, __instance); - TranslateHpUI(__instance.healthTextShadow, __instance); - - if (__instance.healthText.transform.rotation != Quaternion.Euler(0, 0, 0)) - __instance.healthText.transform.rotation = Quaternion.Euler(0f, 0f, 0f); - } - - [HarmonyPatch(nameof(Zombie.Update))] - [HarmonyPrefix] - public static void Update(Zombie __instance) - { - if (__instance.theZombieType == ZombieType.TrainingDummy || !Board.Instance.showZombieHealth) - return; - TranslateHpUI(__instance.healthText, __instance); - TranslateHpUI(__instance.healthTextShadow, __instance); - - if (__instance.healthText.transform.rotation != Quaternion.Euler(0f, 0f, 0f)) - __instance.healthText.transform.rotation = Quaternion.Euler(0f, 0f, 0f); - } - - public static void TranslateHpUI(TextMeshPro textTMP, Zombie __instance) - { - if (textTMP) - { - string origText = textTMP.text; - string translatedText = origText; - string pattern = "(\\d+)阶\\n([\\s\\S]+)"; - if (StringStore.TestRegex(translatedText, pattern)) - { - var match = Regex.Match(translatedText, pattern, RegexOptions.Singleline); - string tier = match.Groups[1].Value; - string healthText = TranslateHPText(match.Groups[2].Value, __instance); - string fStr = StringStore.translationStringRegex[pattern]; - translatedText = string.Format(fStr, new object[] { tier, healthText }); - } - else - { - translatedText = TranslateHPText(origText, __instance); - } - textTMP.text = translatedText == origText ? origText : translatedText; - textTMP.autoSizeTextContainer = false; - if (translatedText != origText) - textTMP.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - public static void TranslateHpUI_T(TextMeshPro textTMP, TrainingDummy __instance) - { - if (textTMP) - { - string origText = textTMP.text; - string translatedText = TranslateHPText_T(origText, __instance); - textTMP.text = translatedText == origText ? origText : translatedText; - textTMP.autoSizeTextContainer = false; - if (translatedText != origText) - textTMP.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - public static string TranslateHPText(string originalText, Zombie __instance) - { - if(originalText == null) - { - return originalText; - } - string finalText = __instance.healthText.text; - int fIndex = -1; - bool found = false; - - for (int i = 0; i < HPStrings.Count; i++) - { - var hp = HPStrings.ElementAt(i); - if(Regex.Match(originalText, hp.Key, RegexOptions.Singleline).Success) - { - fIndex = i; - found = true; - } - } - - if (fIndex > -1 && found) - { - string fStr = HPStrings.ElementAt(fIndex).Value; - - switch (fIndex) - { - case 1: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth, __instance.theFirstArmorHealth, __instance.theFirstArmorMaxHealth, __instance.theSecondArmorHealth, __instance.theSecondArmorMaxHealth); - break; - case 2: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth, __instance.theFirstArmorHealth, __instance.theFirstArmorMaxHealth); - break; - case 3: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth, __instance.theSecondArmorHealth, __instance.theSecondArmorMaxHealth); - break; - case 4: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth); - break; - default: - break; - } - } - - return finalText; - } - - public static string TranslateHPText_T(string originalText, TrainingDummy __instance) - { - string finalText = __instance.healthText.text; - int fIndex = -1; - bool found = false; - - for (int i = 0; i < HPStrings.Count; i++) - { - var hp = HPStrings.ElementAt(i); - Regex regex = new Regex(hp.Key); - if (regex.IsMatch(originalText)) - { - fIndex = i; - found = true; - } - } - - if (fIndex > -1 && found) - { - string fStr = HPStrings.ElementAt(fIndex).Value; - string DPS = originalText.Split("\n")[1].Replace("DPS:", ""); - DPS = StringStore.TranslateText(DPS); - - switch (fIndex) - { - case 0: - finalText = string.Format(fStr, __instance.lastDamage, DPS, __instance.totalDamage); - break; - default: - break; - } - } - - return finalText; - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs b/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs deleted file mode 100644 index 0579148..0000000 --- a/BepInEx/Patches/GameObjects/NoticePauseMenu_Patch.cs +++ /dev/null @@ -1,62 +0,0 @@ -using HarmonyLib; -using UnityEngine.UI; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.IO; -using System; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(NoticeMenu))] - public class NoticePauseMenu_Patch - { - [HarmonyPrefix] - [HarmonyPatch(nameof(NoticeMenu.Awake))] - private static void Pre_Awake(NoticeMenu __instance) - { - GameObject contentObject = __instance.transform.FindChild("Scroll View/Viewport/Content").gameObject; - - TextMeshProUGUI contentText = contentObject.GetComponent(); - File.WriteAllText(Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "changelog.txt"), contentText.text); - - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - string changelogDir = Path.Combine(stringDir, "changelog.txt"); - - if (!File.Exists(changelogDir)) - { - File.WriteAllText(changelogDir, contentText.text); - } - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(NoticeMenu.Awake))] - private static void Post_Awake(NoticeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - string changelogDir = Path.Combine(stringDir, "changelog.txt"); - - string changelogText = File.ReadAllText(changelogDir); - - GameObject contentObject = __instance.transform.FindChild("Scroll View/Viewport/Content").gameObject; - - TextMeshProUGUI contentText = contentObject.GetComponent(); - contentText.text = changelogText; - contentText.margin = new Vector4(6, 2, 12, 0); - - contentText.enableWordWrapping = true; - contentText.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - contentText.ForceMeshUpdate(); - - //float textHeight = contentText.preferredHeight; - //RectTransform contentRect = contentObject.GetComponent(); - //contentRect.sizeDelta = new Vector2(contentRect.sizeDelta.x, textHeight); - - ContentSizeFitter sizeFitter = contentObject.AddComponent(); - sizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs b/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs deleted file mode 100644 index 4ffed8c..0000000 --- a/BepInEx/Patches/GameObjects/OtherMenu_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(OtherMenu))] - public static class OtherMenu_Patch - { - [HarmonyPatch(nameof(OtherMenu.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(OtherMenu __instance) - { - __instance.text1 = StringStore.TranslateText(__instance.text1); - __instance.text2 = StringStore.TranslateText(__instance.text2); - } - } -} diff --git a/BepInEx/Patches/GameObjects/PlantDamageMenu_Patch.cs b/BepInEx/Patches/GameObjects/PlantDamageMenu_Patch.cs deleted file mode 100644 index d30635a..0000000 --- a/BepInEx/Patches/GameObjects/PlantDamageMenu_Patch.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text.RegularExpressions; -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlantDamageMenu))] - public static class PlantDamageMenu_Patch - { - [HarmonyPatch(nameof(PlantDamageMenu.Awake))] - [HarmonyPostfix] - private static void Awake(PlantDamageMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - [HarmonyPatch(nameof(PlantDamageMenu.InitCards))] - [HarmonyPostfix] - private static void InitCards(PlantDamageMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/PlantInfoWindow_Patch.cs b/BepInEx/Patches/GameObjects/PlantInfoWindow_Patch.cs deleted file mode 100644 index ed6e8dc..0000000 --- a/BepInEx/Patches/GameObjects/PlantInfoWindow_Patch.cs +++ /dev/null @@ -1,54 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.UIElements; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; -using System; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlantInfoWindow))] - public static class PlantInfoWindow_Patch - { - [HarmonyPatch(nameof(PlantInfoWindow.InitText))] - [HarmonyPostfix] - private static void InitText(PlantInfoWindow __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - BigGardenPlant thePlant = __instance.plant; - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if (txt.name.Contains("Introduce") && thePlant != null) - { - PlantType thePlantType = thePlant.thePlantType; - txt.text = StringStore.TranslateText(txt.text); - - string text = txt.text; - string[] lines = text.Split("\n"); - - lines[0] = Utils.GetPlantNameFromAlmanac(thePlantType); - string updatedText = String.Join("\n", lines); - - txt.text = updatedText; - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - - txt.font = fontAsset; - } - - Transform parentWindowTransform = __instance.transform.parent; - Transform returnPlantTransform = parentWindowTransform.FindChild("Close"); - - foreach(TextMeshProUGUI txt in returnPlantTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/PlayerShootingMenu_Patch.cs b/BepInEx/Patches/GameObjects/PlayerShootingMenu_Patch.cs deleted file mode 100644 index b893898..0000000 --- a/BepInEx/Patches/GameObjects/PlayerShootingMenu_Patch.cs +++ /dev/null @@ -1,40 +0,0 @@ -using HarmonyLib; -using TMPro; -using BepInEx.Unity.IL2CPP; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlayerShootingMenu))] - public static class PlayerShootingMenu_Patch - { - [HarmonyPatch(nameof(PlayerShootingMenu.Update))] - [HarmonyPostfix] - private static void Update(PlayerShootingMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(PlayerShootingMenu.Refresh))] - [HarmonyPostfix] - private static void Refresh(PlayerShootingMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Transform refreshTransform = __instance.transform.FindChild("Button"); - foreach (TextMeshProUGUI text in refreshTransform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - text.autoSizeTextContainer = false; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/PlayerShootingWindow_Patch.cs b/BepInEx/Patches/GameObjects/PlayerShootingWindow_Patch.cs deleted file mode 100644 index 2c228af..0000000 --- a/BepInEx/Patches/GameObjects/PlayerShootingWindow_Patch.cs +++ /dev/null @@ -1,36 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlayerShootingWindow))] - public static class PlayerShootingWindow_Patch - { - [HarmonyPatch(nameof(PlayerShootingWindow.SetType))] - [HarmonyPostfix] - private static void SetType(PlayerShootingWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(PlayerShootingWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(PlayerShootingWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs b/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs deleted file mode 100644 index 47797d5..0000000 --- a/BepInEx/Patches/GameObjects/RogueCardWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(RogueCardWindow))] - public static class RogueCardWindow_Patch - { - [HarmonyPatch(nameof(RogueCardWindow.InitCard))] - [HarmonyPostfix] - private static void InitCard(RogueCardWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(RogueCardWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(RogueCardWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs b/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs deleted file mode 100644 index ce379ad..0000000 --- a/BepInEx/Patches/GameObjects/RogueStartMenu_Patch.cs +++ /dev/null @@ -1,42 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.TextCore.Text; -using UnityEngine.UI; -using static System.Net.Mime.MediaTypeNames; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - - [HarmonyPatch(typeof(RogueStartMenu))] - public static class RogueStartMenu_Patch - { - [HarmonyPatch(nameof(RogueStartMenu.SetLeader))] - [HarmonyPostfix] - private static void SetLeader(RogueStartMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(RogueStartMenu.EnterGame))] - [HarmonyPostfix] - private static void EnterGame(RogueStartMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/SeedLibrary_Patch.cs b/BepInEx/Patches/GameObjects/SeedLibrary_Patch.cs deleted file mode 100644 index f2ba774..0000000 --- a/BepInEx/Patches/GameObjects/SeedLibrary_Patch.cs +++ /dev/null @@ -1,36 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(SeedLibrary))] - public static class SeedLibrary_Patch - { - [HarmonyPatch(nameof(SeedLibrary.ChangeSafeMode))] - [HarmonyPostfix] - private static void ChangeSafeMode(SeedLibrary __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - - Transform safetyBoxButtonTransform = __instance.transform.Find("SafeBox").Find("StartSafeMode"); - - if (__instance.safeMode == false && safetyBoxButtonTransform != null) - { - foreach (TextMeshProUGUI txt in safetyBoxButtonTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - } - } - } - } -} - - diff --git a/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs b/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs deleted file mode 100644 index 4169bda..0000000 --- a/BepInEx/Patches/GameObjects/ShootingMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(ShootingMenu))] - public static class ShootingMenu_Patch - { - [HarmonyPatch(nameof(ShootingMenu.Update))] - [HarmonyPostfix] - private static void Update(ShootingMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs b/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs deleted file mode 100644 index f42f5a5..0000000 --- a/BepInEx/Patches/GameObjects/ShootingSelectWindow_Patch.cs +++ /dev/null @@ -1,73 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(ShootingSelectWindow))] - public static class ShootingSelectWindow_Patch - { - [HarmonyPatch(nameof(ShootingSelectWindow.InitPlantType))] - [HarmonyPostfix] - private static void InitCard(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.SetUpgradePlantTypes))] - [HarmonyPostfix] - private static void SetUpgradePlantTypes(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.GetMaxIndexInRoutes))] - [HarmonyPostfix] - private static void GetMaxIndexInRoutes(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.Start))] - [HarmonyPostfix] - private static void Start(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/BepInEx/Patches/GameObjects/SpriteRenderer_patch.cs b/BepInEx/Patches/GameObjects/SpriteRenderer_patch.cs deleted file mode 100644 index 07279bd..0000000 --- a/BepInEx/Patches/GameObjects/SpriteRenderer_patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using TMPro; -using BepInEx.Unity.IL2CPP; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(SpriteRenderer))] - public static class SpriteRenderer_Patch - { - [HarmonyPatch(nameof(SpriteRenderer.InvokeSpriteChanged))] - [HarmonyPostfix] - private static void InvokeSpriteChanged(SpriteRenderer __instance) - { - if (__instance.sprite != null) - { - if (TextureStore.spriteDict.ContainsKey(__instance.sprite.name) && __instance.drawMode != SpriteDrawMode.Sliced) - { - __instance.drawMode = SpriteDrawMode.Sliced; - } - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TowerOption_Patch.cs b/BepInEx/Patches/GameObjects/TowerOption_Patch.cs deleted file mode 100644 index a8784d1..0000000 --- a/BepInEx/Patches/GameObjects/TowerOption_Patch.cs +++ /dev/null @@ -1,21 +0,0 @@ -//using HarmonyLib; -//using System; -//using TMPro; -//using PvZ_Fusion_Translator__BepInEx_.AssetStore; -//using UnityEngine; - -//namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(TowerOption))] -// public static class TowerOption_Patch -// { -// [HarmonyPatch(nameof(TowerOption.Start))] -// [HarmonyPostfix] -// private static void Postfix_Start(TowerOption __instance) -// { -// //TextMeshProUGUI[] allTexts = __instance.GetComponentsInChildren(true); -// __instance.introduce.text = StringStore.TranslateText(__instance.introduce.text); -// __instance.introduce.font = FontStore.LoadTMPFont(Utils.Language.ToString()); -// } -// } -//} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TowerUpgradeMenu_Patch.cs b/BepInEx/Patches/GameObjects/TowerUpgradeMenu_Patch.cs deleted file mode 100644 index fee9af4..0000000 --- a/BepInEx/Patches/GameObjects/TowerUpgradeMenu_Patch.cs +++ /dev/null @@ -1,39 +0,0 @@ -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TowerUpgradeMenu))] - public static class TowerUpgradeMenu_Patch - { - [HarmonyPatch(nameof(TowerUpgradeMenu.Awake))] - [HarmonyPostfix] - private static void Awake(TowerUpgradeMenu __instance) - { - __instance.des.text = StringStore.TranslateText(__instance.des.text); - __instance.des2.text = StringStore.TranslateText(__instance.des2.text); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - [HarmonyPatch(nameof(TowerUpgradeMenu.SetText))] - [HarmonyPostfix] - private static void SetText(TowerUpgradeMenu __instance) - { - __instance.des.text = StringStore.TranslateText(__instance.des.text); - __instance.des2.text = StringStore.TranslateText(__instance.des2.text); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TravelBuffMenu_Patch.cs b/BepInEx/Patches/GameObjects/TravelBuffMenu_Patch.cs deleted file mode 100644 index 2532e0c..0000000 --- a/BepInEx/Patches/GameObjects/TravelBuffMenu_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using static PvZ_Fusion_Translator__BepInEx_.Patches.Managers.TravelMgr_Patch; -using UnityEngine; -using System.Collections.Generic; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelBuffMenu))] - public static class TravelBuffMenu_Patch - { - [HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions))] - [HarmonyPostfix] - private static void RefeshOptions(TravelBuffMenu __instance) - { - foreach (TravelBuffOptionButton button in __instance.options) - { - button.introduce.text = translatedTravelBuffs[buffLinks[button.buffType]][button.buffIndex]; - List buffSet = translatedTravelBuffs[buffLinks[button.buffType]]; - string buffText = (button.buffIndex < buffSet.Count && button.show != null) ? buffSet[button.buffIndex] : StringStore.TranslateText(button.introduce.text); - button.introduce.text = buffText; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs b/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs deleted file mode 100644 index 9c67c46..0000000 --- a/BepInEx/Patches/GameObjects/TravelBuffOptionButton_Patch.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using static PvZ_Fusion_Translator__BepInEx_.Patches.Managers.TravelMgr_Patch; -using UnityEngine; -using System.Collections.Generic; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelBuffOptionButton))] - public static class TravelBuffOptionButton_Patch - { - [HarmonyPatch(nameof(TravelBuffOptionButton.SetBuff))] - [HarmonyPostfix] - private static void SetBuff(TravelBuffOptionButton __instance) - { - List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - string buffText = (__instance.buffIndex < buffSet.Count && __instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); - __instance.introduce.text = buffText; - } - - [HarmonyPatch(nameof(TravelBuffOptionButton.Awake))] - [HarmonyPostfix] - private static void Awake(TravelBuffOptionButton __instance) - { - List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - string buffText = (__instance.buffIndex < buffSet.Count && __instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); - __instance.introduce.text = buffText; - } - - [HarmonyPatch(nameof(TravelBuffOptionButton.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(TravelBuffOptionButton __instance) - { - List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - string buffText = (__instance.buffIndex < buffSet.Count && __instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); - __instance.introduce.text = buffText; - } - } -} diff --git a/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs b/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs deleted file mode 100644 index 29ed00b..0000000 --- a/BepInEx/Patches/GameObjects/TravelBuff_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelBuff))] - public static class TravelBuff_Patch - { - [HarmonyPatch(nameof(TravelBuff.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton() - { - if (TravelBuffMgr.Instance == null) return; - TravelBuffMgr.Instance.text = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text); - TravelBuffMgr.Instance.text2 = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text2); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs b/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs deleted file mode 100644 index d5e9697..0000000 --- a/BepInEx/Patches/GameObjects/TravelLookBuff_Patch.cs +++ /dev/null @@ -1,63 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using static PvZ_Fusion_Translator__BepInEx_.Patches.Managers.TravelMgr_Patch; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelLookBuff))] - public static class TravelLookBuff_Patch - { - [HarmonyPatch(nameof(TravelLookBuff.Clear))] - [HarmonyPostfix] - public static void Post_Clear(TravelLookBuff __instance) - { - __instance.introduce.text = StringStore.TranslateText("无"); - __instance.set = false; - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelLookBuff.OnMouseUpAsButton))] - [HarmonyPostfix] - public static void Post_OnMouseUpAsButton(TravelLookBuff __instance) - { - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelLookBuff.SetBuff))] - [HarmonyPostfix] - public static void Post_SetBuff(TravelLookBuff __instance) - { - List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - string buffText = (__instance.buffIndex < buffSet.Count) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); - __instance.introduce.text = buffText; -#if DEBUG - if (__instance.introduce.text != null) - { - Log.LogInfo($"BuffType: {__instance.buffType}, BuffIndex: {__instance.buffIndex}, BuffIntroduce: {__instance.introduce.text}"); - if (__instance.introduce.text != buffText) - { - FileLoader.DumpUntranslatedStrings(__instance.introduce.text); - //Log.LogInfo($"Mapped BuffIntroduce: {buffText}"); - } - } - -#endif - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs b/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs deleted file mode 100644 index 6eeb4a2..0000000 --- a/BepInEx/Patches/GameObjects/TravelLookMenu_Patch.cs +++ /dev/null @@ -1,46 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelLookMenu))] - public static class TravelLookMenu_Patch - { - public static string savedAssetString = ""; - - [HarmonyPatch(nameof(TravelLookMenu.Start))] - [HarmonyPostfix] - private static void Postfix_Start(TravelLookMenu __instance) - { - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - Transform quitButtonTransform = __instance.transform.Find("Quit"); - foreach (TextMeshProUGUI txt in quitButtonTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); - savedAssetString = __instance.treasureText.text; - } - - [HarmonyPatch(nameof(TravelLookMenu.Update))] - [HarmonyPostfix] - private static void Update(TravelLookMenu __instance) - { - if (savedAssetString != __instance.treasureText.text) - { - __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); - savedAssetString = __instance.treasureText.text; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs b/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs deleted file mode 100644 index 5b0ee24..0000000 --- a/BepInEx/Patches/GameObjects/TravelRefresh_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TravelRefresh))] - public static class TravelRefresh_Patch - { - [HarmonyPatch(nameof(TravelRefresh.Start))] - [HarmonyPostfix] - private static void Start(TravelRefresh __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); - } - - [HarmonyPatch(nameof(TravelRefresh.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton(TravelRefresh __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); - } - } -} diff --git a/BepInEx/Patches/GameObjects/TravelStore_Patch.cs b/BepInEx/Patches/GameObjects/TravelStore_Patch.cs deleted file mode 100644 index 5635ef8..0000000 --- a/BepInEx/Patches/GameObjects/TravelStore_Patch.cs +++ /dev/null @@ -1,70 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using static PvZ_Fusion_Translator__BepInEx_.Patches.Managers.TravelMgr_Patch; -using UnityEngine; -using System.Linq; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - public static class TravelStore_Patch - { - [HarmonyPatch(nameof(TravelStore.Update))] - [HarmonyPostfix] - private static void Update(TravelStore __instance) - { - foreach (TextMeshProUGUI text in __instance.introduces) - { - if (__instance.currentSelect != null) - { - var buffList = translatedTravelBuffs[buffLinks[(BuffType)__instance.currentSelect.theBuffType]]; - if (__instance.currentSelect.theBuffNumber < buffList.Count && __instance.currentSelect.theBuffNumber > -1) - { - text.text = buffList[__instance.currentSelect.theBuffNumber]; - } - else - { - text.text = StringStore.TranslateText(text.text); - } - } - } - foreach (var textMesh in __instance.points) - { - textMesh.text = StringStore.TranslateText(textMesh.text); - } - } - - [HarmonyPatch(nameof(TravelStore.RefreshBuff))] - [HarmonyPostfix] - private static void RefreshBuff(TravelStore __instance) - { - foreach (TravelBuff buff in __instance.travelBuffs) - { - TextMeshProUGUI cost = buff.transform.GetChild(1).GetComponent(); - cost.text = StringStore.TranslateText(cost.text); - cost.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - foreach (TextMeshProUGUI text in __instance.introduces) - { - if (__instance.currentSelect != null) - { - var buffList = translatedTravelBuffs[buffLinks[(BuffType)__instance.currentSelect.theBuffType]]; - if (__instance.currentSelect.theBuffNumber < buffList.Count && __instance.currentSelect.theBuffNumber > -1) - { - text.text = buffList[__instance.currentSelect.theBuffNumber]; - } - else - { - text.text = StringStore.TranslateText(text.text); - } - } - } - foreach (var textMesh in __instance.points) - { - textMesh.text = StringStore.TranslateText(textMesh.text); - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/TreasureConfirmMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureConfirmMenu_Patch.cs deleted file mode 100644 index 5c7df14..0000000 --- a/BepInEx/Patches/GameObjects/TreasureConfirmMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureConfirmMenu))] - public static class TreasureConfirmMenu_Patch - { - [HarmonyPatch(nameof(TreasureConfirmMenu.SetText))] - [HarmonyPostfix] - private static void SetText(TreasureConfirmMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/TreasureEquipmentMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureEquipmentMenu_Patch.cs deleted file mode 100644 index 729ab03..0000000 --- a/BepInEx/Patches/GameObjects/TreasureEquipmentMenu_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureEquipmentMenu))] - public static class TreasureEquipmentMenu_Patch - { - [HarmonyPatch(nameof(TreasureEquipmentMenu.Awake))] - [HarmonyPostfix] - private static void Awake(TreasureEquipmentMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureEquipmentMenu.UpdateCards))] - [HarmonyPostfix] - private static void UpdateCards(TreasureEquipmentMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/TreasureEvacuateMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureEvacuateMenu_Patch.cs deleted file mode 100644 index a399829..0000000 --- a/BepInEx/Patches/GameObjects/TreasureEvacuateMenu_Patch.cs +++ /dev/null @@ -1,30 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureEvacuateMenu))] - public static class TreasureEvacuateMenu_Patch - { - [HarmonyPatch(nameof(TreasureEvacuateMenu.Start))] - [HarmonyPostfix] - private static void Start(TreasureEvacuateMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - if (txt.name.Contains("text (1)")) - { - txt.name = txt.name + "_EVACUATE"; - } - } - } - } -} - - diff --git a/BepInEx/Patches/GameObjects/TreasureMainMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureMainMenu_Patch.cs deleted file mode 100644 index 649af54..0000000 --- a/BepInEx/Patches/GameObjects/TreasureMainMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureMainMenu))] - public static class TreasureMainMenu_Patch - { - [HarmonyPatch(nameof(TreasureMainMenu.Update))] - [HarmonyPostfix] - private static void Update(TreasureMainMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/TreasureStoreMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureStoreMenu_Patch.cs deleted file mode 100644 index 7d11fe7..0000000 --- a/BepInEx/Patches/GameObjects/TreasureStoreMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureStoreMenu))] - public static class TreasureStoreMenu_Patch - { - [HarmonyPatch(nameof(TreasureStoreMenu.InitCards))] - [HarmonyPostfix] - private static void InitCards(TreasureStoreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/TreasureUpgradeMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureUpgradeMenu_Patch.cs deleted file mode 100644 index b3990ab..0000000 --- a/BepInEx/Patches/GameObjects/TreasureUpgradeMenu_Patch.cs +++ /dev/null @@ -1,61 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureUpgradeMenu))] - public static class TreasureUpgradeMenu_Patch - { - [HarmonyPatch(nameof(TreasureUpgradeMenu.Start))] - [HarmonyPostfix] - private static void Start(TreasureUpgradeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureUpgradeMenu.UpgradeWareHouse))] - [HarmonyPostfix] - private static void UpgradeWareHouse(TreasureUpgradeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureUpgradeMenu.InitWareHouseUpgrade))] - [HarmonyPostfix] - private static void InitWareHouseUpgrade(TreasureUpgradeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - - foreach (Text txt in __instance.GetComponentsInChildren()) - { - GameObject newTxtObj = Utils.ConvertToTextMeshProUGUI(txt.gameObject, txt.transform.parent, "text"); - TextMeshProUGUI newTxt = newTxtObj.GetComponent(); - newTxt.text = StringStore.TranslateText("植物商店"); - newTxt.autoSizeTextContainer = true; - newTxt.color = new Color(0, 0, 0.3922f, 1); - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/TreasureWarehouseMenu_Patch.cs b/BepInEx/Patches/GameObjects/TreasureWarehouseMenu_Patch.cs deleted file mode 100644 index 235daba..0000000 --- a/BepInEx/Patches/GameObjects/TreasureWarehouseMenu_Patch.cs +++ /dev/null @@ -1,63 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(TreasureWarehouseMenu))] - public static class TreasureWarehouseMenu_Patch - { - [HarmonyPatch(nameof(TreasureWarehouseMenu.InitCards))] - [HarmonyPostfix] - private static void InitCards(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureWarehouseMenu.QuickSell))] - [HarmonyPostfix] - private static void QuickSell(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureWarehouseMenu.FastSell))] - [HarmonyPostfix] - private static void FastSell(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureWarehouseMenu.EnterStore))] - [HarmonyPostfix] - private static void EnterStore(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs b/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs deleted file mode 100644 index 49159a5..0000000 --- a/BepInEx/Patches/GameObjects/UIDifficulty_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIDifficulty))] - public static class UIDifficulty_Patch - { - [HarmonyPatch(nameof(UIDifficulty.Update))] - [HarmonyPostfix] - private static void Update(UIDifficulty __instance) - { - __instance.t.text = StringStore.TranslateText(__instance.t.text); - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs b/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs deleted file mode 100644 index d547f91..0000000 --- a/BepInEx/Patches/GameObjects/UIZombieNum_Patch.cs +++ /dev/null @@ -1,29 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIZombieNum))] - public static class UIZombieNum_Patch - { - [HarmonyPatch(nameof(UIZombieNum.Update))] - [HarmonyPostfix] - private static void Update(UIZombieNum __instance) - { - - #if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - string zombieText = StringStore.TranslateText(__instance.t.text); - __instance.t.text = zombieText; - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - string zombieText = StringStore.patchesStore["Zombies"]["Spanish"]; - __instance.t.text = string.Format(zombieText + " {0}", Board.Instance.enermyCount); - #endif - - __instance.t.font = fontAsset; - } - } -} diff --git a/BepInEx/Patches/Managers/AbyssBuffData_Patch.cs b/BepInEx/Patches/Managers/AbyssBuffData_Patch.cs deleted file mode 100644 index e839ade..0000000 --- a/BepInEx/Patches/Managers/AbyssBuffData_Patch.cs +++ /dev/null @@ -1,125 +0,0 @@ -//using HarmonyLib; -//using BepInEx; -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using System.IO; -//using System.Text; -//using System.Text.Json; -//using System.Threading.Tasks; -//using Unity.VisualScripting; -//using UnityEngine; - -//namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -//{ -// [HarmonyPatch(typeof(AbyssBuffData))] -// public static class AbyssBuffData_Patch -// { -// [HarmonyPatch(nameof(AbyssBuffData.LoadData))] -// [HarmonyPostfix] -// public static void Pre_LoadData(AbyssBuffData __instance) -// { -// string originalAbyssBuffStr = Resources.Load("AbyssBuffData").text; -// Dictionary> originalAbyssBuffData = JsonSerializer.Deserialize>>(originalAbyssBuffStr); -// List infos = originalAbyssBuffData["infos"]; -// Il2CppSystem.Collections.Generic.Dictionary> result = new(); - -// string abyssBuffDataDir = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), "abyss_buffs.json"); -// if (!File.Exists(abyssBuffDataDir)) -// { -// File.WriteAllText(abyssBuffDataDir, originalAbyssBuffStr); -// } - -// Dictionary abyssBuffData = JsonSerializer.Deserialize>(File.ReadAllText(abyssBuffDataDir)); - -// for (int i = 0; i < infos.Count; i++) -// { -// AbyssBuffInfo originalTuple = infos[i]; -// Il2CppSystem.ValueTuple translatedTuple = new(); - -// translatedTuple.Item1 = abyssBuffData.ContainsKey(originalTuple.name) ? abyssBuffData[originalTuple.name] : originalTuple.name; -// translatedTuple.Item2 = abyssBuffData.ContainsKey(originalTuple.introduce) ? abyssBuffData[originalTuple.introduce] : originalTuple.introduce; -// translatedTuple.Item3 = originalTuple.value; - -// foreach (var x in AbyssBuffData.buffDatas) -// { -// if (x.Value.Item1 == originalTuple.name) -// { -// AbyssBuffData.buffDatas[x.Key] = translatedTuple; -// break; -// } -// } -// } -// } -// } - -// public enum AbyssBuffClone -// { -// 生存_聚塑, -// 生存_启命, -// 生存_坚定, -// 生存_弥合, -// 生存_警戒, -// 生存_霸体, -// 生存_共存, -// 生存_护盾, -// 生存_治疗, -// 生存_主宰, -// 寒冰_聚塑, -// 寒冰_刺骨, -// 寒冰_凛风, -// 寒冰_冻结, -// 寒冰_保护, -// 寒冰_折磨, -// 寒冰_扩散, -// 寒冰_凝神, -// 寒冰_破冰, -// 寒冰_永冻, -// 魅惑_聚塑, -// 魅惑_感应, -// 魅惑_催眠, -// 魅惑_无畏, -// 魅惑_脆弱, -// 魅惑_黑曜, -// 魅惑_转世, -// 魅惑_支援, -// 魅惑_沉重, -// 魅惑_共鸣, -// 烈焰_聚塑, -// 烈焰_爆破, -// 烈焰_怒火, -// 烈焰_红唇, -// 烈焰_融化, -// 烈焰_燃烧, -// 烈焰_浴火, -// 烈焰_鬼火, -// 烈焰_诅咒, -// 烈焰_太阳, -// 通用_断水, -// 通用_千斤, -// 通用_急迫, -// 通用_折扣, -// 通用_密植, -// 通用_超级, -// 通用_究极, -// 通用_极速, -// 通用_强力, -// 通用_专注, -// 通用_迸发, -// 通用_投资, -// 通用_机遇, -// 通用_命运, -// 通用_时停, -// 通用_升级, -// 蒜毒_聚塑, -// 蒜毒_腐蚀, -// 蒜毒_侵蚀, -// 蒜毒_血清, -// 蒜毒_混乱, -// 蒜毒_虚弱, -// 蒜毒_反胃, -// 蒜毒_虫噬, -// 蒜毒_百毒, -// 蒜毒_爆裂 -// } -//} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs b/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs deleted file mode 100644 index 3459635..0000000 --- a/BepInEx/Patches/Managers/AbyssDevelopMenu_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(AbyssDevelopMenu))] - public static class AbyssDevelopMenu_Patch - { - [HarmonyPatch(nameof(AbyssDevelopMenu.UpdateInfo))] - [HarmonyPostfix] - private static void UpdateInfo(AbyssDevelopMenu __instance) - { - __instance.currentMoney.text = StringStore.TranslateText(__instance.currentMoney.text); - __instance.upgradeTextInfo.text = StringStore.TranslateText(__instance.upgradeTextInfo.text); - } - } -} diff --git a/BepInEx/Patches/Managers/AbyssInfo_Patch.cs b/BepInEx/Patches/Managers/AbyssInfo_Patch.cs deleted file mode 100644 index ce2e837..0000000 --- a/BepInEx/Patches/Managers/AbyssInfo_Patch.cs +++ /dev/null @@ -1,12 +0,0 @@ -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using System.Text; -//using System.Threading.Tasks; - -//namespace PvZ_Fusion_Translator.Patches.Managers -//{ -// public class AbyssInfo_Patch -// { -// } -//} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs b/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs deleted file mode 100644 index 6d02d4b..0000000 --- a/BepInEx/Patches/Managers/AbyssMenu2_Patch.cs +++ /dev/null @@ -1,101 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(AbyssMenu2))] - public static class AbyssMenu2_Patch - { - private static void UpdateAbyss2Text(AbyssMenu2 __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); - __instance.buffCountText.font = fontAsset; - - __instance.money.text = StringStore.TranslateText(__instance.money.text); - __instance.money.font = fontAsset; - - __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); - __instance.refreshText.font = fontAsset; - - __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); - __instance.statistics.font = fontAsset; - - Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; - if (buffTextTransform != null) StringStore.TranslateTextTransform(buffTextTransform); - - Transform moneyTransform = __instance.transform.FindChild("Money").transform; - if (moneyTransform != null) StringStore.TranslateTextTransform(moneyTransform); - - Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; - if (buffCountTextTransform != null) StringStore.TranslateTextTransform(buffCountTextTransform); - - Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; - if (refreshTextTransform != null) StringStore.TranslateTextTransform(refreshTextTransform); - - // Translate option buttons - Transform optionsTransform = __instance.transform.FindChild("Options").transform; - foreach (TextMeshProUGUI textMesh in optionsTransform.GetComponentsInChildren()) - { - textMesh.text = StringStore.TranslateText(textMesh.text); - } - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - [HarmonyPatch(nameof(AbyssMenu2.Start))] - [HarmonyPostfix] - private static void Start(AbyssMenu2 __instance) - { - UpdateAbyss2Text(__instance); - Utils.ConvertButtonText(__instance.transform, "Help"); - - // custom bag text - __instance.transform.FindChild("Bag").FindChild("text").GetComponent().text += "_深渊"; - Utils.ConvertButtonText(__instance.transform, "Bag"); - } - - [HarmonyPatch(nameof(AbyssMenu2.Awake))] - [HarmonyPostfix] - private static void Awake(AbyssMenu2 __instance) - { - UpdateAbyss2Text(__instance); - } - - [HarmonyPatch(nameof(AbyssMenu2.UpdateIcons))] - [HarmonyPostfix] - private static void UpdateIcons(AbyssMenu2 __instance) - { - UpdateAbyss2Text(__instance); - } - - [HarmonyPatch(nameof(AbyssMenu2.UpdateBuff))] - [HarmonyPostfix] - private static void UpdateBuff(AbyssMenu2 __instance) - { - UpdateAbyss2Text(__instance); - } - - [HarmonyPatch(nameof(AbyssMenu2.BuyBuff))] - [HarmonyPostfix] - private static void BuyBuff(AbyssMenu2 __instance) - { - UpdateAbyss2Text(__instance); - } - - [HarmonyPatch(nameof(AbyssMenu2.ShowBag))] - [HarmonyPostfix] - private static void ShowBag(AbyssMenu2 __instance) - { - UpdateAbyss2Text(__instance); - } - } -} diff --git a/BepInEx/Patches/Managers/AbyssMenu_Patch.cs b/BepInEx/Patches/Managers/AbyssMenu_Patch.cs deleted file mode 100644 index 0c60bcb..0000000 --- a/BepInEx/Patches/Managers/AbyssMenu_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(AbyssMenu))] - public static class AbyssMenu_Patch - { - [HarmonyPatch(nameof(AbyssMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AbyssMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.levelInfo) - { - txt.text = StringStore.TranslateText(txt.text, false); - txt.font = fontAsset; - } - - - } - } -} diff --git a/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs b/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs deleted file mode 100644 index 002d522..0000000 --- a/BepInEx/Patches/Managers/AlmanacMgrZombie_Patch.cs +++ /dev/null @@ -1,145 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using System.IO; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(AlmanacMgrZombie))] - public static partial class AlmanacMgrZombie_Patch - { - [HarmonyPatch(nameof(AlmanacMgrZombie.InitNameAndInfoFromJson))] - [HarmonyPostfix] - private static void InitNameAndInfoFromJson(AlmanacMgrZombie __instance) - { -#if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); -#else - string almanacDir = almanacDir = GetAssetDir(AssetType.Almanac); - string currentLanguage = "English"; -#endif - string path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedZombiesTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogError($"ZombieStringsTranslate.json file not found at path: {path}"); - return; - } - -#if OBFUSCATE - if (CheckSumStore.IsModified(path)) - { - Log.LogError("File {0} was modified!", path); - return; - } -#endif - - string json; - json = File.ReadAllText(path); - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage)) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = true; - } - -#if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); -#else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); -#endif - - TextMeshPro component = __instance.info.GetComponent(); - TextMeshPro component2 = __instance.zombieName.GetComponent(); - TextMeshPro component3 = __instance.zombieName.transform.GetChild(0).GetComponent(); - - ZombieAlmanacData zombieData = JsonUtility.FromJson(json); - - foreach (ZombieInfo zombieInfo in zombieData.zombies) - { - if (zombieInfo.theZombieType == __instance.theZombieType) - { - component.text = zombieInfo.info + "\n\n" + zombieInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - component2.text = zombieInfo.name; - component2.autoSizeTextContainer = true; - component3.text = Utils.RemoveColorTags(zombieInfo.name); - component3.autoSizeTextContainer = true; - - if (hasAlmanacFont) - component.font = almanacFontAsset; - else - component.font = fontAsset; - component2.font = fontAsset; - component3.font = fontAsset; - } - } - - if (File.Exists(moddedPath)) - { - string moddedJson; - moddedJson = File.ReadAllText(moddedPath); - - ZombieAlmanacData moddedZombieData = JsonUtility.FromJson(moddedJson); - - foreach (ZombieInfo zombieInfo in moddedZombieData.zombies) - { - if (zombieInfo.theZombieType == __instance.theZombieType) - { - component.text = zombieInfo.info + "\n\n" + zombieInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - component2.text = zombieInfo.name; - component2.autoSizeTextContainer = true; - component3.text = Utils.RemoveColorTags(zombieInfo.name); - component3.autoSizeTextContainer = true; - - if (hasAlmanacFont) - component.font = almanacFontAsset; - else - component.font = fontAsset; - component2.font = fontAsset; - component3.font = fontAsset; - } - } - } - - return; - } - - [HarmonyPatch(nameof(AlmanacMgrZombie.OnMouseDown))] - [HarmonyPrefix] - private static bool OnMouseDown(AlmanacMgrZombie __instance) - { - TextMeshPro component = __instance.info.GetComponent(); - if (component != null) - { - component.pageToDisplay = component.pageToDisplay > component.m_pageNumber ? 1 : component.pageToDisplay + 1; - return false; - } - return true; - } - } - - [Serializable] - public class ZombieAlmanacData - { - public List zombies; - } - - [Serializable] - public class ZombieInfo - { - public string name; - public string info; - public string introduce; - public ZombieType theZombieType; - } -} diff --git a/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs b/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs deleted file mode 100644 index 9e23635..0000000 --- a/BepInEx/Patches/Managers/AlmanacPlantBank_Patch.cs +++ /dev/null @@ -1,200 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.IO; -using UnityEngine; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(AlmanacPlantBank))] - public static partial class AlmanacPlantBank_Patch - { - [HarmonyPatch(nameof(AlmanacPlantBank.InitNameAndInfoFromJson))] - [HarmonyPostfix] - private static void InitNameAndInfoFromJson(AlmanacPlantBank __instance) - { -#if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); -#else - string almanacDir = GetAssetDir(AssetType.Almanac); - string currentLanguage = "English"; -#endif - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - return; - } - -#if OBFUSCATE - if (CheckSumStore.IsModified(path)) - { - Log.LogError("File {0} was modified!", path); - return; - } -#endif - - string json; - json = File.ReadAllText(path); - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage)) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = true; - } - -#if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); -#else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); -#endif - - TextMeshPro component = __instance.introduce.GetComponent(); - TextMeshPro component2 = __instance.plantName.GetComponent(); - TextMeshPro component3 = __instance.plantName.transform.GetChild(0).GetComponent(); - TextMeshPro component4 = __instance.cost.GetComponent(); - - AlmanacPlantBank.PlantData plantData = JsonUtility.FromJson(json); - - foreach (AlmanacPlantBank.PlantInfo plantInfo in plantData.plants) - { - if (plantInfo.seedType == __instance.theSeedType && !string.IsNullOrEmpty(plantInfo.name)) - { - component.autoSizeTextContainer = false; - component.text = plantInfo.info + "\n\n" + plantInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - - // fix dimensions for cost text - component.rectTransform.offsetMax = new Vector2(component.rectTransform.offsetMax.x, 27.3839f); - component.rectTransform.offsetMin = new Vector2(component.rectTransform.offsetMin.x, -29.3079f); - component.rectTransform.sizeDelta = new Vector2(component.rectTransform.sizeDelta.x, 50.917f); - component.transform.localPosition = new Vector3(component.transform.localPosition.x, component.transform.localPosition.y + 0.15f, component.transform.localPosition.z); - - - component2.text = plantInfo.name; - component2.autoSizeTextContainer = true; - - component3.text = Utils.RemoveColorTags(plantInfo.name ?? string.Empty); - component3.autoSizeTextContainer = true; - - component4.text = plantInfo.cost; - - if (hasAlmanacFont) - { - component.font = almanacFontAsset; - component4.font = almanacFontAsset; - } - else - { - component.font = fontAsset; - component4.font = fontAsset; - } - component2.font = fontAsset; - component3.font = fontAsset; - } - } - - if (File.Exists(moddedPath)) - { - string moddedJson; - moddedJson = File.ReadAllText(moddedPath); - - AlmanacPlantBank.PlantData moddedPlantData = JsonUtility.FromJson(moddedJson); - - foreach (AlmanacPlantBank.PlantInfo plantInfo in moddedPlantData.plants) - { - if (plantInfo.seedType == __instance.theSeedType && !string.IsNullOrEmpty(plantInfo.name)) - { - component.autoSizeTextContainer = false; - component.text = plantInfo.info + "\n\n" + plantInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - - // fix dimensions for cost text - component.rectTransform.offsetMax = new Vector2(component.rectTransform.offsetMax.x, 27.3839f); - component.rectTransform.offsetMin = new Vector2(component.rectTransform.offsetMin.x, -29.3079f); - component.rectTransform.sizeDelta = new Vector2(component.rectTransform.sizeDelta.x, 50.917f); - component.transform.localPosition = new Vector3(component.transform.localPosition.x, component.transform.localPosition.y + 0.15f, component.transform.localPosition.z); - - - component2.text = plantInfo.name; - component2.autoSizeTextContainer = true; - - component3.text = Utils.RemoveColorTags(plantInfo.name ?? string.Empty); - component3.autoSizeTextContainer = true; - - component4.text = plantInfo.cost; - - if (hasAlmanacFont) - { - component.font = almanacFontAsset; - component4.font = almanacFontAsset; - } - else - { - component.font = fontAsset; - component4.font = fontAsset; - } - component2.font = fontAsset; - component3.font = fontAsset; - } - } - } - - return; - } - - [HarmonyPatch(nameof(AlmanacPlantBank.OnMouseDown))] - [HarmonyPrefix] - private static bool OnMouseDown(AlmanacPlantBank __instance) - { - TextMeshPro component = __instance.introduce.GetComponent(); - if (component != null) - { - component.pageToDisplay = component.pageToDisplay > component.m_pageNumber ? 1 : component.pageToDisplay + 1; - return false; - } - return true; - } - - [HarmonyPatch(nameof(AlmanacPlantBank.PVPInit))] - [HarmonyPostfix] - private static void PVPInit(AlmanacPlantBank __instance) - { - TextMeshPro component = __instance.introduce.GetComponent(); - if (component != null) - { - component.autoSizeTextContainer = false; - } - - Transform banTransform = __instance.transform.FindChild("Ban").GetChild(0); - if (banTransform != null) - { - banTransform.GetComponent().text = StringStore.TranslateText(banTransform.GetComponent().text); - } - } - - [HarmonyPatch(nameof(AlmanacPlantBank.Start))] - [HarmonyPostfix] - public static void Post_Start(AlmanacPlantBank __instance) - { - GameObject skinTextObj = __instance.skinButton.transform.GetChild(0).gameObject; - GameObject skinShadowTextObj = UnityEngine.Object.Instantiate(skinTextObj, parent: __instance.skinButton.transform); - TextMeshPro skinShadowText = skinShadowTextObj.GetComponent(); - skinShadowText.text = StringStore.TranslateText("换肤_S"); - skinShadowText.sortingOrder -= 2; - skinShadowTextObj.transform.Translate(new Vector3(0.015f, -0.015f, 0)); - skinTextObj.transform.Translate(new Vector3(-0.022f, 0)); - skinShadowTextObj.transform.Translate(new Vector3(-0.022f, 0)); - __instance.skinButton.transform.localScale /= 1.75f; - __instance.skinButton.transform.Translate(new Vector3(-0.075f, -0.15f, 0)); - __instance.skinButton.transform.GetChild(1).Translate(new Vector3(0.35f, 0)); - __instance.skinButton.transform.GetChild(2).Translate(new Vector3(-0.35f, 0)); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/CanvasUpUI_Patch.cs b/BepInEx/Patches/Managers/CanvasUpUI_Patch.cs deleted file mode 100644 index c73b142..0000000 --- a/BepInEx/Patches/Managers/CanvasUpUI_Patch.cs +++ /dev/null @@ -1,34 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_; -using System; -using System.Linq; -using System.Collections.Generic; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(CanvasUpUI))] - public static class CanvasUpUI_Patch - { - [HarmonyPatch(nameof(CanvasUpUI.Start))] - [HarmonyPostfix] - public static void Start(CanvasUpUI __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => (x.Value == text.text || x.Value.Replace("\n", "") == text.text)).Key; - text.text = (StringStore.translationString.ContainsKey(originalKey + "_MG")) ? StringStore.TranslateText(originalKey + "_MG") : StringStore.TranslateText(text.text); - if(text.gameObject.name.Contains("LevelName")) - { - text.text = text.text.Replace("\n", " "); - } - text.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/ChessManager_Patch.cs b/BepInEx/Patches/Managers/ChessManager_Patch.cs deleted file mode 100644 index 1c2f52f..0000000 --- a/BepInEx/Patches/Managers/ChessManager_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.TextCore.Text; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(ChessManager))] - public static class ChessManager_Patch - { - [HarmonyPatch(nameof(ChessManager.Start))] - [HarmonyPostfix] - private static void Postfix_Start(ChessManager __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ChessManager.Update))] - [HarmonyPostfix] - private static void Postfix_Update(ChessManager __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ChessManager.UpdateText))] - [HarmonyPostfix] - private static void Postfix_UpdateText(ChessManager __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} diff --git a/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs b/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs deleted file mode 100644 index 81f4a72..0000000 --- a/BepInEx/Patches/Managers/CustomLevelShower_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if FIX -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(CustomLevelShower))] - public static class CustomLevelShower_Patch - { - [HarmonyPatch(nameof(CustomLevelShower.Show))] - [HarmonyPostfix] - private static void Show(CustomLevelShower __instance) - { - foreach (Transform transform in __instance.pages) - { - StringStore.TranslateTextTransform(transform); - } - } - } -} -#endif \ No newline at end of file diff --git a/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs b/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs deleted file mode 100644 index 84585b5..0000000 --- a/BepInEx/Patches/Managers/DifficultyMgr_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(DifficultyMgr))] - public static class DifficultyMgr_Patch - { - [HarmonyPatch(nameof(DifficultyMgr.Update))] - [HarmonyPostfix] - private static void DifficultyMgr_Update(DifficultyMgr __instance) - { - __instance.t = StringStore.TranslateText(__instance.t); - __instance.t.autoSizeTextContainer = false; - } - } -} diff --git a/BepInEx/Patches/Managers/DrawCardManager_Patch.cs b/BepInEx/Patches/Managers/DrawCardManager_Patch.cs deleted file mode 100644 index c85ca88..0000000 --- a/BepInEx/Patches/Managers/DrawCardManager_Patch.cs +++ /dev/null @@ -1,61 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using Il2CppSystem.Collections.Generic; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; -using UnityEngine.TextCore.Text; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects -{ - [HarmonyPatch(typeof(DrawCardManager))] - public static class DrawCardManager_Patch - { - [HarmonyPatch(nameof(DrawCardManager.UpdateText))] - [HarmonyPostfix] - private static void Postfix_UpdateText(DrawCardManager __instance) - { - Il2CppSystem.Collections.Generic.List texts = __instance.texts; - __instance.upName = StringStore.TranslateText(__instance.upName); - if (texts != null && texts.Count > 0) - { - foreach (TextMeshProUGUI textComponent in texts) - { - if (textComponent != null) - { - string translatedText = StringStore.TranslateText(textComponent.text); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - textComponent.text = translatedText; - textComponent.font = fontAsset; - } - } - } - } - - - - [HarmonyPatch(nameof(DrawCardManager.Update))] - [HarmonyPostfix] - private static void Postfix_Update(DrawCardManager __instance) - { - Il2CppSystem.Collections.Generic.List texts = __instance.texts; - __instance.upName = StringStore.TranslateText(__instance.upName); - - if (texts != null && texts.Count > 0) - { - foreach (TextMeshProUGUI textComponent in texts) - { - if (textComponent != null) - { - string translatedText = StringStore.TranslateText(textComponent.text); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - textComponent.text = translatedText; - textComponent.font = fontAsset; - } - } - } - - } - } -} - diff --git a/BepInEx/Patches/Managers/EndlessMgr_Patch.cs b/BepInEx/Patches/Managers/EndlessMgr_Patch.cs deleted file mode 100644 index b137eff..0000000 --- a/BepInEx/Patches/Managers/EndlessMgr_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(EndlessMgr))] - public static class EndlessMgr_Patch - { - [HarmonyPatch(nameof(EndlessMgr.Awake))] - [HarmonyPostfix] - private static void Awake(EndlessMgr __instance) - { - Transform textTransform = __instance.transform.GetChild(2); - if (textTransform != null && textTransform.gameObject.activeSelf) - { - TextMeshProUGUI textTMP = textTransform.GetComponent(); - if (textTMP != null) - { - textTMP = StringStore.TranslateText(textTMP); - } - } - } - } -} diff --git a/BepInEx/Patches/Managers/GameAPP_Patch.cs b/BepInEx/Patches/Managers/GameAPP_Patch.cs deleted file mode 100644 index 3fdccef..0000000 --- a/BepInEx/Patches/Managers/GameAPP_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using TMPro; -using UnityEngine.EventSystems; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(GameAPP))] - public class GameAPP_Patch - { - [HarmonyPatch(nameof(GameAPP.Update))] - [HarmonyPrefix] - private static bool Update(GameAPP __instance) - { - Core.Instance.OnUpdate(); - - if (EventSystem.current?.currentSelectedGameObject != null) - { - if (EventSystem.current.currentSelectedGameObject.TryGetComponent(out TMP_InputField field)) - { - __instance.MusicUpdate(); - return false; - } - } - return true; - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/Garden_Patch.cs b/BepInEx/Patches/Managers/Garden_Patch.cs deleted file mode 100644 index 6548f63..0000000 --- a/BepInEx/Patches/Managers/Garden_Patch.cs +++ /dev/null @@ -1,21 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(Garden))] - public static class Garden_Patch - { - [HarmonyPatch(nameof(Garden.Awake))] - [HarmonyPostfix] - private static void Awake(Garden __instance) - { - foreach (TextMeshPro text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/BepInEx/Patches/Managers/IZBottomMenu_Patch.cs b/BepInEx/Patches/Managers/IZBottomMenu_Patch.cs deleted file mode 100644 index c114a24..0000000 --- a/BepInEx/Patches/Managers/IZBottomMenu_Patch.cs +++ /dev/null @@ -1,54 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(IZBottomMenu))] - public static class IZBottomMenu_Patch - { - [HarmonyPatch(nameof(IZBottomMenu.ChangeString))] - [HarmonyPostfix] - public static void ChangeStringz(IZBottomMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.levelName) - { - string fStr = StringStore.translationStringRegex["([^\\s]+),推荐难度:(\\d+)"]; - string[] parts = text.text.Split(",推荐难度:"); - - if (new Regex("([^\\s]+),推荐难度:(\\d+)").IsMatch(text.text)) - { - string customName = (StringStore.translationString.ContainsKey(parts[0] + "_IZ")) ? parts[0] + "_IZ" : parts[0]; - text.text = string.Format(fStr, StringStore.TranslateText(customName), parts[1]); - } - - text.text = StringStore.TranslateText(text.text); - text.text = text.text.Replace("\n", " "); - } - } - - [HarmonyPatch(nameof(IZBottomMenu.SetLevelName))] - [HarmonyPostfix] - public static void SetLevelName(IZBottomMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.levelName) - { - string fStr = StringStore.translationStringRegex["([^\\s]+),推荐难度:(\\d+)"]; - string[] parts = text.text.Split(",推荐难度:"); - - if (new Regex("([^\\s]+),推荐难度:(\\d+)").IsMatch(text.text)) - { - text.text = string.Format(fStr, StringStore.TranslateText(parts[0]), parts[1]); - } - - text.text = StringStore.TranslateText(text.text); - text.text = text.text.Replace("\n", " "); - } - } - } -} - - diff --git a/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs b/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs deleted file mode 100644 index 8d698ec..0000000 --- a/BepInEx/Patches/Managers/InGameUIMgr_Patch.cs +++ /dev/null @@ -1,34 +0,0 @@ -using HarmonyLib; -using System; - -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(InGameUI))] - public static class InGameUIMgr_Patch - { - [HarmonyPatch(nameof(InGameUI.Start))] - [HarmonyPostfix] - private static void Start(InGameUI __instance) - { - TextMeshProUGUI[] array = new TextMeshProUGUI[] - { - __instance.transform.GetChild(4).GetComponent(), - __instance.transform.GetChild(4).GetChild(0).GetComponent(), - __instance.transform.GetChild(5).GetComponent(), - __instance.transform.GetChild(5).GetChild(0).GetComponent(), - __instance.transform.GetChild(6).GetComponent(), - __instance.transform.GetChild(6).GetChild(0).GetComponent() - }; - TextMeshProUGUI[] array2 = array; - for (int i = 0; i < array2.Length; i++) - { - - array2[i] = StringStore.TranslateText(array2[i]); - array2[i].text = array2[i].text.Replace("\n", " "); - } - } - } -} diff --git a/BepInEx/Patches/Managers/InGameUI_Patch.cs b/BepInEx/Patches/Managers/InGameUI_Patch.cs deleted file mode 100644 index 6b2c63a..0000000 --- a/BepInEx/Patches/Managers/InGameUI_Patch.cs +++ /dev/null @@ -1,78 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(InGameUI))] - public static class InGameUI_Patch - { - [HarmonyPatch(nameof(InGameUI.Start))] - [HarmonyPostfix] - private static void Start(InGameUI __instance) - { - TextMeshProUGUI[] array = new TextMeshProUGUI[] - { - __instance.transform.GetChild(4).GetComponent(), - __instance.transform.GetChild(4).GetChild(0).GetComponent(), - __instance.transform.GetChild(5).GetComponent(), - __instance.transform.GetChild(5).GetChild(0).GetComponent(), - __instance.transform.GetChild(6).GetComponent(), - __instance.transform.GetChild(6).GetChild(0).GetComponent()}; - TextMeshProUGUI[] array2 = array; - for (int i = 0; i < array2.Length; i++) - { - string originalText = array2[i].text; - array2[i].text = array2[i].text.Replace("\n", " "); - Regex checkFusionChallenge = new Regex("^超级([^\\s:]+)(:?挑战1?)"); - - if (array2[i].text.Contains("配方:") && !checkFusionChallenge.IsMatch(array2[i].text)) - { - string[] lines = array2[i].text.Split(":"); - lines[1] = Utils.GetPlantNameFromAlmanac(lines[1]); - if (lines[1] == "") - { - Log.LogError("Couldn't find plant! (Fusion Showcase)"); - lines[1] = StringStore.TranslateText(lines[1]); - } - array2[i].text = StringStore.TranslateText("配方:") + lines[1]; - array2[i].autoSizeTextContainer = true; - } - else - { - array2[i].text = (StringStore.translationString.ContainsKey(array2[i].text + "_MG")) ? StringStore.TranslateText(array2[i].text + "_MG") : StringStore.TranslateText(array2[i].text); - array2[i].text = array2[i].text.Replace("\n", " "); - } - } - } - - [HarmonyPatch(nameof(InGameUI.Update))] - [HarmonyPostfix] - private static void Update(InGameUI __instance) - { - foreach(TextMeshProUGUI txt in __instance.ShovelBank.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } - - [HarmonyPatch(typeof(InGameUI_IZ))] - public static class InGameUI_IZ_Patch - { - [HarmonyPatch(nameof(InGameUI_IZ.Update))] - [HarmonyPostfix] - private static void Update(InGameUI_IZ __instance) - { - foreach (TextMeshProUGUI txt in __instance.shovel.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs b/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs deleted file mode 100644 index b35fa41..0000000 --- a/BepInEx/Patches/Managers/OppositeBuffManager_Patch.cs +++ /dev/null @@ -1,48 +0,0 @@ -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using System.Collections.Generic; -using System.Text.RegularExpressions; -using TMPro; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(OppositeBuffManager))] - public static class OppositeBuffManager_Patch - { - public static Dictionary buffLinks = TravelMgr_Patch.buffLinks; - public static Dictionary> translatedTravelBuffs = TravelMgr_Patch.translatedTravelBuffs; - public static string badPattern = @"^但(.*)"; - public static string badFormat = StringStore.translationStringRegex.ContainsKey(badPattern) ? StringStore.translationStringRegex[badPattern] : "But, {0}"; - public static TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - [HarmonyPatch(nameof(OppositeBuffManager.Awake))] - [HarmonyPostfix] - private static void Awake(OppositeBuffManager __instance) - { - TranslateOppositeText(__instance.textA_bad, BuffType.Debuff, __instance.buffA.theDebuffID, true); - TranslateOppositeText(__instance.textA_good, __instance.buffA.theOptionType, __instance.buffA.theOptionID); - TranslateOppositeText(__instance.textB_bad, BuffType.Debuff, __instance.buffB.theDebuffID, true); - TranslateOppositeText(__instance.textB_good, __instance.buffB.theOptionType, __instance.buffB.theOptionID); - } - - public static void TranslateOppositeText(Il2CppSystem.Collections.Generic.List textList, BuffType buffType, int buffIndex, bool isBad = false) - { - string buff = translatedTravelBuffs[buffLinks[buffType]][buffIndex]; - - foreach (var text in textList) - { - if (isBad) - { - text.text = string.Format(badFormat, buff); - } - else - { - text.text = buff; - } - - text.font = fontAsset; - } - } - } -} diff --git a/BepInEx/Patches/Managers/SaveMenu_Patch.cs b/BepInEx/Patches/Managers/SaveMenu_Patch.cs deleted file mode 100644 index aa5d1f0..0000000 --- a/BepInEx/Patches/Managers/SaveMenu_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(SaveMenu))] - public static class SaveMenu_Patch - { - [HarmonyPatch(nameof(SaveMenu.Start))] - [HarmonyPostfix] - private static void Start(SaveMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.title.text = StringStore.TranslateText(__instance.title.text); - __instance.title.font = fontAsset; - __instance.title_shadow.text = StringStore.TranslateText(__instance.title_shadow.text); - __instance.title_shadow.font = fontAsset; - - foreach(SaveMenuBtn level in __instance.levels) - { - level.theName.text = StringStore.TranslateText(level.theName.text); - } - } - } -} diff --git a/BepInEx/Patches/Managers/TowerManager_Patch.cs b/BepInEx/Patches/Managers/TowerManager_Patch.cs deleted file mode 100644 index 71d3656..0000000 --- a/BepInEx/Patches/Managers/TowerManager_Patch.cs +++ /dev/null @@ -1,33 +0,0 @@ -using HarmonyLib; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using TMPro; -using BepInEx.Unity.IL2CPP; -using System.Collections.Generic; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(TowerManager))] - public static class TowerManager_Patch - { - public static List updatedText = []; - - public static void UpdateText() - { - foreach (Transform transform in updatedText) - { - if (transform != null) - { - transform.GetComponent().text = StringStore.TranslateText(transform.GetComponent().text); - } - } - } - - [HarmonyPatch(nameof(TowerManager.Update))] - [HarmonyPostfix] - public static void Update(TowerManager __instance) - { - - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs b/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs deleted file mode 100644 index c72829f..0000000 --- a/BepInEx/Patches/Managers/TravelBuffMgr_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using System; -using System.Text.Encodings.Web; -using System.Text.Json; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(TravelBuffMgr))] - public static class TravelBuffMgr_Patch - { - [HarmonyPatch(nameof(TravelBuffMgr.Awake))] - [HarmonyPostfix] - private static void Awake(TravelBuffMgr __instance) - { - __instance.text = AssetStore.StringStore.TranslateText(__instance.text); - __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); - } - - [HarmonyPatch(nameof(TravelBuffMgr.ShowText), new Type[] { typeof(int), typeof(int) })] - [HarmonyPostfix] - private static void ShowText(TravelBuffMgr __instance) - { - __instance.text = AssetStore.StringStore.TranslateText(__instance.text); - __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); - } - } -} diff --git a/BepInEx/Patches/Managers/TravelMgr_Patch.cs b/BepInEx/Patches/Managers/TravelMgr_Patch.cs deleted file mode 100644 index 51d56e8..0000000 --- a/BepInEx/Patches/Managers/TravelMgr_Patch.cs +++ /dev/null @@ -1,103 +0,0 @@ -using TMPro; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.IO; -using System.Threading.Tasks; -using HarmonyLib; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(TravelMgr))] - public static class TravelMgr_Patch - { - public static Dictionary buffLinks = new Dictionary() - { - { BuffType.AdvancedBuff, "advancedUpgrades" }, - { BuffType.UltimateBuff, "ultimateUpgrades" }, - { BuffType.UnlockPlant, "strongUltimates" }, - { BuffType.Debuff, "debuffs" }, - }; - - public static Dictionary> dumpedTravelBuffs = new Dictionary>() - { - { "advancedUpgrades", [] }, - { "ultimateUpgrades", [] }, - { "strongUltimates", [] }, - { "debuffs", [] } - }; - - public static Dictionary> translatedTravelBuffs = new Dictionary>(); - - public static void DumpTravelBuffs(Il2CppSystem.Collections.Generic.Dictionary source, Dictionary> dest, string index) - { - foreach (var i in source) - { - if (!Utils.CheckForUntranslatedText(i.Value)) - { - break; - } - dest[index].Add(i.Value); - } - } - - public static string MatchTravelBuff(string originalText) - { - string res = ""; - - foreach(var i in dumpedTravelBuffs) - { - if(i.Value.Contains(originalText)) - { - res = translatedTravelBuffs[i.Key][i.Value.IndexOf(originalText)]; - break; - } - } - - return res; - } - - [HarmonyPatch(nameof(TravelMgr.Awake))] - [HarmonyPrefix] - private static void Pre_Awake(TravelMgr __instance) - { - // Dump buffs - - dumpedTravelBuffs = new Dictionary>() // reset dump - { - { "advancedUpgrades", [] }, - { "ultimateUpgrades", [] }, - { "strongUltimates", [] }, - { "debuffs", [] } - }; - - DumpTravelBuffs(TravelMgr.advancedBuffs, dumpedTravelBuffs, "advancedUpgrades"); - DumpTravelBuffs(TravelMgr.ultimateBuffs, dumpedTravelBuffs, "ultimateUpgrades"); - DumpTravelBuffs(TravelMgr.unlocks, dumpedTravelBuffs, "strongUltimates"); - DumpTravelBuffs(TravelMgr.debuffs, dumpedTravelBuffs, "debuffs"); - - string dumpDir = FileLoader.GetAssetDir(FileLoader.AssetType.Dumps); - var options = new JsonSerializerOptions - { - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - WriteIndented = true - }; - File.WriteAllText(Path.Combine(dumpDir, "travel_buffs.json"), JsonSerializer.Serialize(dumpedTravelBuffs, options)); - - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - string travelBuffDir = Path.Combine(stringDir, "travel_buffs.json"); - - if(!File.Exists(travelBuffDir)) - { - File.WriteAllText(travelBuffDir, JsonSerializer.Serialize(dumpedTravelBuffs, options)); - } - - string travelBuffs = File.ReadAllText(Path.Combine(stringDir, "travel_buffs.json")); - - translatedTravelBuffs = JsonSerializer.Deserialize>>(travelBuffs); - } - } -} \ No newline at end of file diff --git a/BepInEx/Patches/Managers/TreasureManager_Patch.cs b/BepInEx/Patches/Managers/TreasureManager_Patch.cs deleted file mode 100644 index 6375434..0000000 --- a/BepInEx/Patches/Managers/TreasureManager_Patch.cs +++ /dev/null @@ -1,31 +0,0 @@ -using HarmonyLib; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(TreasureManager))] - public static class TreasureManager_Patch - { - [HarmonyPatch(nameof(TreasureManager.Update))] - [HarmonyPostfix] - private static void Update(TreasureManager __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.evaText) - { - txt.autoSizeTextContainer = false; - - if (txt.text != "Evacuate") - { - txt.text = StringStore.TranslateText(txt.text); - txt.name = txt.text + "_EVACUATE"; - txt.font = fontAsset; - } - } - } - } -} - - diff --git a/BepInEx/Patches/Managers/UIMgr_Patch.cs b/BepInEx/Patches/Managers/UIMgr_Patch.cs deleted file mode 100644 index 12f5d50..0000000 --- a/BepInEx/Patches/Managers/UIMgr_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.Managers -{ - [HarmonyPatch(typeof(UIMgr))] - public class UIMgr_Patch - { - //[HarmonyPatch(nameof(UIMgr.EnterMainMenu))] - //[HarmonyPostfix] - //private static void EnterMainMenu(UIMgr __instance) - //{ - // // Log.LogInfo("Entered Main Menu"); - // #if MULTI_LANGUAGE - // WarningStore.WarningReload(Utils.Language); - // #else - // WarningStore.WarningReload(); - // #endif - //} - } -} \ No newline at end of file diff --git a/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs b/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs deleted file mode 100644 index 2c3de3d..0000000 --- a/BepInEx/Patches/OtherManagers/AchievementClip_Patch.cs +++ /dev/null @@ -1,73 +0,0 @@ -using HarmonyLib; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using TMPro; -using Newtonsoft.Json; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; -using static PvZ_Fusion_Translator__BepInEx_.Patches.Managers.AlmanacPlantBank_Patch; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.OtherManagers -{ - [HarmonyPatch(typeof(AchievementClip))] - public static class AchievementClip_Patch - { - [HarmonyPatch(nameof(AchievementClip.Start))] - [HarmonyPostfix] - private static void Start(AchievementClip __instance) - { - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - string achievementDir = GetAssetDir(AssetType.Almanac, Utils.Language); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - string achievementDir = GetAssetDir(AssetType.Almanac); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - string path = Path.Combine(achievementDir, "AchievementsTextTranslate.json"); - - #if OBFUSCATE - if (CheckSumStore.IsModified(path)) - { - Log.LogError("File {0} was modified!", path); - return; - } - #endif - - if (!File.Exists(path)) return; - - string json; - json = File.ReadAllText(path); - Dictionary achievementsTexts = new Dictionary(); - achievementsTexts = JsonConvert.DeserializeObject>(json); - - TextMeshProUGUI text1 = __instance.introduce.transform.GetChild(1).GetComponent(); - TextMeshProUGUI text2 = __instance.introduce.transform.GetChild(2).GetComponent(); - TextMeshProUGUI name1 = __instance.image.transform.GetChild(0).GetComponent(); - - - text1.text = achievementsTexts[__instance._index].Name; - text1.font = fontAsset; - text2.text = achievementsTexts[__instance._index].Name; - text2.font = fontAsset; - name1.text = achievementsTexts[__instance._index].Text; - name1.font = fontAsset; - } - } - - public class AchievementObject - { - public Achievement achievement { get; set; } - public string Name { get; set; } - public string Text { get; set; } - - public AchievementObject(Achievement achievement = Achievement.Welcome, string name = "", string text = "") - { - this.achievement = achievement; - Name = name; - Text = text; - } - } -} diff --git a/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs b/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs deleted file mode 100644 index d313017..0000000 --- a/BepInEx/Patches/OtherManagers/GardenUI_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using System; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.OtherManagers -{ - [HarmonyPatch(typeof(GardenUI))] - public static class GardenUI_Patch - { - [HarmonyPatch(nameof(GardenUI.Update))] - [HarmonyPostfix] - public static void Update(GardenUI __instance) - { - __instance.currentPageText = StringStore.TranslateText(__instance.currentPageText, false); - __instance.currentPageText2 = StringStore.TranslateText(__instance.currentPageText2, false); - - // Transform PageText = __instance.transform.Find("PageText"); - // StringStore.TranslateTextTransform(PageText.transform); - } - } -} diff --git a/BepInEx/Patches/OtherManagers/MenuText_Patch.cs b/BepInEx/Patches/OtherManagers/MenuText_Patch.cs deleted file mode 100644 index 8aaf4f2..0000000 --- a/BepInEx/Patches/OtherManagers/MenuText_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if FIX -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.OtherManagers -{ - [HarmonyPatch(typeof(MenuText))] - public static class MenuText_Patch - { - [HarmonyPatch(nameof(MenuText.UpdateText), new Type[] { typeof(string) })] - [HarmonyPostfix] - private static void UpdateTextPatch(MenuText __instance) - { - TextMeshProUGUI text_1 = __instance.transform.GetChild(0).Find("text1").GetComponent(); - text_1.text = StringStore.TranslateText(text_1.text); - TextMeshProUGUI text = __instance.transform.GetChild(0).Find("text").GetComponent(); - text.text = StringStore.TranslateText(text_1.text); - } - } -} -#endif \ No newline at end of file diff --git a/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs b/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs deleted file mode 100644 index cf94e6c..0000000 --- a/BepInEx/Patches/OtherManagers/ThanksMenu_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -using HarmonyLib; -using System; -using TMPro; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; - -namespace PvZ_Fusion_Translator__BepInEx_.Patches.OtherManagers -{ - [HarmonyPatch(typeof(ThanksMenu))] - public class ThanksMenu_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(ThanksMenu.Update))] - private static void Update(ThanksMenu __instance) - { - TextMeshProUGUI textTransform = __instance.transform.GetChild(0).GetComponent(); - if (textTransform != null) - { - textTransform.text = StringStore.TranslateText(textTransform.text); - textTransform.autoSizeTextContainer = true; - } - } - } -} \ No newline at end of file diff --git a/BepInEx/PvZ Fusion Translator [BepInEx].csproj b/BepInEx/PvZ Fusion Translator [BepInEx].csproj deleted file mode 100644 index d1a8ddf..0000000 --- a/BepInEx/PvZ Fusion Translator [BepInEx].csproj +++ /dev/null @@ -1,614 +0,0 @@ - - - - net6.0 - PvZ_Fusion_Translator__BepInEx_ - BepInEx Port of PvZ Fusion Translator - 1.0.0 - true - latest - - https://api.nuget.org/v3/index.json; - https://nuget.bepinex.dev/v3/index.json; - https://nuget.samboy.dev/v3/index.json - - PvZ_Fusion_Translator__BepInEx_ - C:\Users\Admin\Downloads\PvZ FUSION VH FANMADE - C:\Users\rainb\Desktop\PC_PVZ-Fusion_3.1.1 - Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate;DebugMulti - AnyCPU;x64 - - - - - - - - - - - True - false - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;TESTING;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;TESTING;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;TESTING;DEBUG - - - - $(DefineConstants);CHEAT;DEBUG - - - - $(DefineConstants);CHEAT;DEBUG - - - - $(DefineConstants);CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE - - - - $(DefineConstants);OTHER;OBFUSCATE - - - - $(DefineConstants);OTHER;OBFUSCATE - - - - $(DefineConstants);OTHER;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE;RELEASE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(GamePath)\BepInEx\core\0Harmony.dll - - - $(GamePath)\BepInEx\core\AsmResolver.dll - - - $(GamePath)\BepInEx\core\AsmResolver.DotNet.dll - - - $(GamePath)\BepInEx\core\AsmResolver.PE.dll - - - $(GamePath)\BepInEx\core\AsmResolver.PE.File.dll - - - $(GamePath)\BepInEx\interop\Assembly-CSharp.dll - - - $(GamePath)\BepInEx\core\AssetRipper.CIL.dll - - - $(GamePath)\BepInEx\core\AssetRipper.Primitives.dll - - - $(GamePath)\BepInEx\core\BepInEx.Core.dll - - - $(GamePath)\BepInEx\core\BepInEx.Preloader.Core.dll - - - $(GamePath)\BepInEx\core\BepInEx.Unity.Common.dll - - - $(GamePath)\BepInEx\core\BepInEx.Unity.IL2CPP.dll - - - $(GamePath)\BepInEx\core\Cpp2IL.Core.dll - - - $(GamePath)\BepInEx\core\Disarm.dll - - - $(GamePath)\BepInEx\core\Gee.External.Capstone.dll - - - $(GamePath)\BepInEx\core\Iced.dll - - - $(GamePath)\BepInEx\core\Il2CppInterop.Common.dll - - - $(GamePath)\BepInEx\core\Il2CppInterop.Generator.dll - - - $(GamePath)\BepInEx\core\Il2CppInterop.HarmonySupport.dll - - - $(GamePath)\BepInEx\core\Il2CppInterop.Runtime.dll - - - $(GamePath)\BepInEx\interop\Il2CppMono.Security.dll - - - $(GamePath)\BepInEx\interop\Il2Cppmscorlib.dll - - - $(GamePath)\BepInEx\interop\Il2CppSystem.dll - - - $(GamePath)\BepInEx\interop\Il2CppSystem.Configuration.dll - - - $(GamePath)\BepInEx\interop\Il2CppSystem.Core.dll - - - $(GamePath)\BepInEx\interop\Il2CppSystem.Xml.dll - - - $(GamePath)\BepInEx\core\LibCpp2IL.dll - - - $(GamePath)\BepInEx\core\Mono.Cecil.dll - - - $(GamePath)\BepInEx\core\Mono.Cecil.Mdb.dll - - - $(GamePath)\BepInEx\core\Mono.Cecil.Pdb.dll - - - $(GamePath)\BepInEx\core\Mono.Cecil.Rocks.dll - - - $(GamePath)\BepInEx\core\MonoMod.RuntimeDetour.dll - - - $(GamePath)\BepInEx\core\MonoMod.Utils.dll - - - $(GamePath)\BepInEx\core\SemanticVersioning.dll - - - $(GamePath)\BepInEx\core\StableNameDotNet.dll - - - $(GamePath)\BepInEx\interop\Unity.2D.Animation.Runtime.dll - - - $(GamePath)\BepInEx\interop\Unity.Burst.dll - - - $(GamePath)\BepInEx\interop\Unity.Burst.Unsafe.dll - - - $(GamePath)\BepInEx\interop\Unity.Collections.dll - - - $(GamePath)\BepInEx\interop\Unity.Collections.LowLevel.ILSupport.dll - - - $(GamePath)\BepInEx\interop\Unity.InternalAPIEngineBridge.001.dll - - - $(GamePath)\BepInEx\interop\Unity.Mathematics.dll - - - $(GamePath)\BepInEx\interop\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - $(GamePath)\BepInEx\interop\Unity.RenderPipelines.Core.Runtime.dll - - - $(GamePath)\BepInEx\interop\Unity.RenderPipelines.Universal.Runtime.dll - - - $(GamePath)\BepInEx\interop\Unity.TextMeshPro.dll - - - $(GamePath)\BepInEx\interop\Unity.VisualScripting.Core.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.AccessibilityModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.AIModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.AndroidJNIModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.AnimationModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.AssetBundleModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.AudioModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ClothModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ClusterInputModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ClusterRendererModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ContentLoadModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.CoreModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.CrashReportingModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.DirectorModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.DSPGraphModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.GameCenterModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.GIModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.GridModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.HotReloadModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ImageConversionModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.IMGUIModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.InputLegacyModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.InputModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.JSONSerializeModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.LocalizationModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ParticleSystemModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.PerformanceReportingModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.Physics2DModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.PhysicsModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ProfilerModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.PropertiesModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.ScreenCaptureModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.SharedInternalsModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.SpriteMaskModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.SpriteShapeModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.StreamingModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.SubstanceModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.SubsystemsModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TerrainModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TerrainPhysicsModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TextCoreFontEngineModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TextCoreTextEngineModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TextRenderingModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TilemapModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.TLSModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UI.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UIElementsModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UIModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UmbraModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityAnalyticsCommonModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityAnalyticsModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityConnectModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityCurlModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityTestProtocolModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityWebRequestAudioModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityWebRequestModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityWebRequestTextureModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.UnityWebRequestWWWModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.VehiclesModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.VFXModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.VideoModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.VirtualTexturingModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.VRModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.WindModule.dll - - - $(GamePath)\BepInEx\interop\UnityEngine.XRModule.dll - - - $(GamePath)\BepInEx\core\WasmDisassembler.dll - - - $(GamePath)\BepInEx\interop\__Generated.dll - - - $(GamePath)\BepInEx\interop\Assembly-CSharp.dll - - - $(GamePath)\BepInEx\plugins\AudioImportLib.BepInEx.dll - - - $(GamePath)\BepInEx\core\Newtonsoft.Json.dll - - - - - - - - - diff --git a/BepInEx/Utils.cs b/BepInEx/Utils.cs deleted file mode 100644 index a09ed3a..0000000 --- a/BepInEx/Utils.cs +++ /dev/null @@ -1,430 +0,0 @@ -using BepInEx; -using BepInEx.Configuration; -using PvZ_Fusion_Translator__BepInEx_.AssetStore; -using PvZ_Fusion_Translator__BepInEx_.Patches.Managers; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text.RegularExpressions; -using TMPro; -using Unity.Burst.Intrinsics; -using Unity.VisualScripting.FullSerializer; -using UnityEngine; -using UnityEngine.Experimental.Rendering; -using UnityEngine.UI; -using static AlmanacPlantBank; -using static PvZ_Fusion_Translator__BepInEx_.FileLoader; - -namespace PvZ_Fusion_Translator__BepInEx_ -{ - public class Utils - { - public static Dictionary> plantIndices = new Dictionary>(); - - public static void RegisterPlantIndices() - { - plantIndices = new Dictionary>(); - string originalJson; - string translatedJson; - - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string dumpDir = GetAssetDir(AssetType.Dumps); - string originalPath = Path.Combine(dumpDir, "LawnStrings.json"); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - - if ((!File.Exists(path)) || (!File.Exists(originalPath))) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - } - else - { - originalJson = File.ReadAllText(originalPath); - translatedJson = File.ReadAllText(path); - AlmanacPlantBank.PlantData originalPlantData = JsonUtility.FromJson(originalJson); - AlmanacPlantBank.PlantData translatedPlantData = JsonUtility.FromJson(translatedJson); - - for (int i = 0; i < originalPlantData.plants.Count; i++) - { - var originalPlantInfo = originalPlantData.plants[i]; - AlmanacPlantBank.PlantInfo translatedPlantInfo = null; - - foreach (var info in translatedPlantData.plants) - { - if (info.seedType == originalPlantInfo.seedType) - { - translatedPlantInfo = info; - } - } - - if (translatedPlantInfo != null) - { - var temp = new KeyValuePair(translatedPlantInfo.seedType, translatedPlantInfo.name); - plantIndices.Add(originalPlantInfo.seedType, temp); - } - } - } - } - - public static Dictionary> recipeLinks = new Dictionary>(); - - public static void RegisterRecipeLinks() - { - recipeLinks.Clear(); - - Il2CppSystem.Array mixData = MixData.data.Cast(); - int rows = mixData.GetLength(0); - int columns = mixData.GetLength(1); - - foreach (PlantType plantType in Enum.GetValues(typeof(PlantType))) - { - int seedType = (int)plantType; - - recipeLinks.Add(seedType, new()); - - if (seedType > 0) - { - foreach (PlantType checkType in Enum.GetValues(typeof(PlantType))) - { - if (checkType > 0) - { - int[] checks = [mixData.GetValue(seedType, (int)checkType).Unbox(), mixData.GetValue((int)checkType, seedType).Unbox()]; - - if (checks[0] != 0) - { - recipeLinks[seedType].Add(checks[0]); - } - - if (checks[1] != 0) - { - recipeLinks[seedType].Add(checks[1]); - } - } - } - } - if (recipeLinks[seedType].Count > 0) - { - Log.LogDebug($"Found {recipeLinks[seedType].Count} fusions for {seedType}!"); - } - } - } - - internal static bool TryReplaceTexture2D(Texture2D ogTexture) - { - if (ogTexture != null) - { - if (TextureStore.textureDict.TryGetValue(ogTexture.name, out string texturePath)) - { - try - { - ImageConversion.LoadImage(ogTexture, File.ReadAllBytes(texturePath)); - - Core.Log.LogDebug("OK! Replaced Texture " + ogTexture.name); - - ogTexture.name = "replaced_" + ogTexture.name; - return true; - } - catch (Exception ex) - { - Log.LogError("Failed to replace texture: " + ogTexture.name + " at path: " + texturePath); - Log.LogError(ex.ToString()); - } - } - } - return false; - } - - internal static Texture2D LoadImage(string path) - { - if (!File.Exists(path)) - { - throw new FileNotFoundException($"The image file at path '{path}' does not exist."); - } - - byte[] array = File.ReadAllBytes(path); - Texture2D texture2D = new(2, 2, GraphicsFormat.R8G8B8A8_UNorm, TextureCreationFlags.None, 1, IntPtr.Zero, null); - ImageConversion.LoadImage(texture2D, array); - return texture2D; - } - - public static Color HexToColor(string hex) - { - - hex = hex.Replace("#", ""); - - float r = int.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber) / 255f; - float g = int.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber) / 255f; - float b = int.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber) / 255f; - - return new Color(r, g, b); - } - - public static void OpenSaveDirectory() - { - string saveDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData", "LocalLow", "LanPiaoPiao", "PlantsVsZombiesRH"); - Process.Start("explorer.exe", saveDirectory); - } - - public static void OpenTrello() - { - string website = "https://trello.com/b/DcdT1kUp"; - Process.Start(new ProcessStartInfo(website) { UseShellExecute = true }); - } - - public static string RemoveColorTags(string text) - { - if (string.IsNullOrEmpty(text)) - return text ?? string.Empty; - - // Remove opening color tags like - string withoutOpenTags = Regex.Replace(text, @"]+>", string.Empty, RegexOptions.IgnoreCase); - // Remove closing color tags like - string withoutCloseTags = Regex.Replace(withoutOpenTags, @"", string.Empty, RegexOptions.IgnoreCase); - return withoutCloseTags; - } - - public static string RemoveSizeTags(string text) - { - if (string.IsNullOrEmpty(text)) - return text ?? string.Empty; - - string withoutOpenTags = Regex.Replace(text, @"]+>", string.Empty, RegexOptions.IgnoreCase); - string withoutCloseTags = Regex.Replace(withoutOpenTags, @"", string.Empty, RegexOptions.IgnoreCase); - return withoutCloseTags; - } - - public static GameObject ConvertToTextMeshProUGUI(GameObject originalText, Transform parent, string name) - { - GameObject newObj = new GameObject(name); - newObj.transform.position = originalText.transform.position; - newObj.AddComponent(); - newObj.AddComponent(); - newObj.AddComponent(); - newObj.transform.SetParent(parent); - newObj.transform.localScale = Vector3.one; - - UnityEngine.Object.Destroy(originalText); - return newObj; - } - - public static void ConvertButtonText(Transform original, string name) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Transform transform = original.FindChild(name); - Transform textTransform = transform.FindChild("text"); - string text = textTransform.GetComponent().text; - Color color = textTransform.GetComponent().color; - - TextMeshProUGUI newGoBackText = Utils.ConvertToTextMeshProUGUI(textTransform.gameObject, transform, "text2").GetComponent(); - newGoBackText.autoSizeTextContainer = true; - newGoBackText.text = StringStore.TranslateText(text, false); - newGoBackText.font = fontAsset; - newGoBackText.color = color; - } - - public static string GetPlantNameFromAlmanac(PlantType thePlantType) - { - string json; - string thePlantName = ""; - - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - Log.LogError("Plant name could not be found!"); - thePlantName = ""; - } - else - { - json = File.ReadAllText(path); - AlmanacPlantBank.PlantData plantData = JsonUtility.FromJson(json); - - foreach (AlmanacPlantBank.PlantInfo plantInfo in plantData.plants) - { - if (plantInfo.seedType == (int)thePlantType) - { - thePlantName = plantInfo.name; - } - } - } - - return thePlantName; - } - - public static string GetPlantNameFromAlmanac(string theOriginalPlantName) - { - string originalJson; - string translatedJson; - string thePlantName = ""; - - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string dumpDir = GetAssetDir(AssetType.Dumps); - string originalPath = Path.Combine(dumpDir, "LawnStrings.json"); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - - if ((!File.Exists(path)) || (!File.Exists(originalPath))) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - Log.LogError("Plant name could not be found!"); - thePlantName = ""; - } - else - { - bool foundPlantName = false; - - originalJson = File.ReadAllText(originalPath); - translatedJson = File.ReadAllText(path); - AlmanacPlantBank.PlantData originalPlantData = JsonUtility.FromJson(originalJson); - AlmanacPlantBank.PlantData translatedPlantData = JsonUtility.FromJson(translatedJson); - - for (int i = 0; i < originalPlantData.plants.Count; i++) - { - AlmanacPlantBank.PlantInfo originalPlantInfo = originalPlantData.plants[i]; - KeyValuePair translatedPlantInfo = plantIndices[originalPlantInfo.seedType]; - - if (originalPlantInfo.name == theOriginalPlantName) - { - thePlantName = translatedPlantInfo.Value; - foundPlantName = true; - } - } - - if (!foundPlantName) - { - Log.LogInfo("Couldn't find plant name!"); - thePlantName = ""; - } - } - - return thePlantName; - } - - public static string GetZombieNameFromAlmanac(ZombieType theZombieType) - { - string json; - string theZombieName = ""; - - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogError($"ZombieStringsTranslate.json file not found at path: {path}"); - Log.LogError("Zombie name could not be found!"); - theZombieName = ""; - } - else - { - json = File.ReadAllText(path); - ZombieAlmanacData zombieData = JsonUtility.FromJson(json); - - foreach (ZombieInfo zombieInfo in zombieData.zombies) - { - if ((int)zombieInfo.theZombieType == (int)theZombieType) - { - theZombieName = zombieInfo.name; - } - } - } - - return theZombieName; - } - - - - public static bool CheckForUntranslatedText(string text) - { - Regex regex = new("\\p{IsCJKUnifiedIdeographs}+"); - try - { - Match match = regex.Match(text); - return match.Success; - } - catch(Exception e) - { - Log.LogError(e); - } - return false; - } - - -#if MULTI_LANGUAGE - internal static void ChangeLanguage(string language) - { - OldLanguage = Language; - - if (Enum.TryParse(language, out Utils.LanguageEnum lang)) - { - Utils.Language = lang; - } - else - { - // Handle invalid language string - Log.LogError($"Invalid language string: {language}"); - } - - WarningStore.isWarningMessageLoaded = false; - FontStore.Reload(); - StringStore.Reload(); - TextureStore.Reload(); - FileLoader.SaveLanguage(); - RegisterPlantIndices(); - PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.MinorObjects.Zombie_Patch.LoadHPStrings(); - } - #endif - - #if MULTI_LANGUAGE - public static Utils.LanguageEnum OldLanguage; - #endif - - public static Utils.LanguageEnum Language; - - public static string mainCategory = "PvZ_Fusion_Translator"; - - public static bool customTextures => Core.Instance != null && !Core.Instance.configDefaultTextures.Value; - public static bool customAudio => Core.Instance != null && !Core.Instance.configDefaultAudio.Value; - - public enum LanguageEnum - { - // first column - English, - French, - Italian, - German, - Spanish, - Portuguese, - - // second column - Javanese, //Filipino, - Vietnamese, - Indonesian, - Russian, //NOTE: legacy language - Japanese, - Korean, - - // third column - Ukrainian, - // Slovak, - //Polish, - Turkish, - //Arabic, - Romanian, - - LANG_END - } - - public enum ToggleEnum - { - Textures, - Audio, - TOGGLE_END - } - } - -} \ No newline at end of file diff --git a/MelonLoader/AssetStore/AudioStore.cs b/MelonLoader/AssetStore/AudioStore.cs deleted file mode 100644 index d37899e..0000000 --- a/MelonLoader/AssetStore/AudioStore.cs +++ /dev/null @@ -1,179 +0,0 @@ -using HarmonyLib; -using MelonLoader; -using MelonLoader.Utils; -using System.Reflection; -using UnityEngine; - -namespace PvZ_Fusion_Translator.AssetStore -{ - internal class AudioStore - { - public static Dictionary AudioClips = []; - public static Dictionary AudioClipNames = []; - - public static bool LogSounds; - - private static bool overrideEnabled; - private static readonly string customAudioPath = Path.Combine(MelonEnvironment.ModsDirectory, "PvZ_Fusion_Translator", "[Custom Audios]"); - private static readonly string[] allowedExts = [".wav", ".mp3", ".ogg"]; - - #if AUDIO_TESTING - public Canvas Canvas { get; set; } - public RectTransform songRectTransform { get; private set; } - #endif - - public static void Init() - { - LoadAudios(); - } - public static void LoadAudios() - { - if (!Directory.Exists(customAudioPath)) - Directory.CreateDirectory(customAudioPath); - - var category = MelonPreferences.CreateCategory("Audio Replace", ""); - category.CreateEntry("LogSounds", false); - LogSounds = category.GetEntry("LogSounds").Value; - MelonPreferences.Save(); - - string[] audioFiles = Directory.GetFiles(customAudioPath, "*", SearchOption.AllDirectories); - var ovrClip = audioFiles.SingleOrDefault(f => Path.GetFileNameWithoutExtension(f) == "REPLACE_ALL"); - if (ovrClip == null) - { - foreach (string file in audioFiles) - { - if (!allowedExts.Contains(Path.GetExtension(file))) - continue; - - AudioClip clip = AudioImportLib.API.LoadAudioClip(file); - AudioClips.Add(clip.name, clip); - Log.LogInfo("Added Override: " + clip.name); - } - } - else - { - AudioClip clip = AudioImportLib.API.LoadAudioClip(ovrClip); - AudioClips.Add(clip.name, clip); - overrideEnabled = true; - Log.LogInfo("Added Override: " + clip.name); - } - - Type audioSourceType = typeof(AudioSource); - string sourceMethodName = "Play"; - MethodInfo prefixMethod = typeof(AudioStore).GetMethod("AudioPlayPatch", BindingFlags.Static | BindingFlags.Public); - if (prefixMethod == null) - { - Log.LogError($"Couldn't find method named \"AudioPlayPatch\" in type <{typeof(Core)}>."); - return; - } - _ = Core.Instance.HarmonyInstance.Patch(AccessTools.Method(audioSourceType, sourceMethodName), new HarmonyMethod(prefixMethod)); - Core.Instance.HarmonyInstance.Patch(AccessTools.Method(audioSourceType, sourceMethodName, [typeof(ulong)]), new HarmonyMethod(prefixMethod)); - } - - #if AUDIO_TESTING - public static void InitializeCanvas() - { - - Transform canvasTransform; - - if (canvas != null) return; // Prevent duplicate canvas creation - - canvas = new GameObject("AudioSourceCanvas").AddComponent(); - canvas.renderMode = RenderMode.ScreenSpaceOverlay; - - CanvasScaler scaler = canvas.gameObject.AddComponent(); - scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; - scaler.referenceResolution = new Vector2(1920, 1080); - - canvas.gameObject.AddComponent(); - - // Add a RectTransform for positioning text - GameObject songTextObject = new GameObject("SongText"); - songTextObject.transform.SetParent(canvas.transform); - - songRectTransform = songTextObject.AddComponent(); - songRectTransform.anchorMin = new Vector2(1, 1); // Top-right corner - songRectTransform.anchorMax = new Vector2(1, 1); - songRectTransform.pivot = new Vector2(1, 1); - songRectTransform.anchoredPosition = new Vector2(-20, -20); // Adjust margin - - // Add a TextMeshPro component for the text - var textComponent = songTextObject.AddComponent(); - textComponent.alignment = TextAlignmentOptions.Right; - textComponent.fontSize = 24; - textComponent.color = Color.white; - textComponent.text = "Current Song: None"; // Placeholder - } - - - public static void AudioSources() - { - if (!Directory.Exists(customAudioPath)) - Directory.CreateDirectory(customAudioPath); - string path = Path.Combine(customAudioPath, "audio_source.json"); - if (!File.Exists(path)) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - return; - } - string json; - json = File.ReadAllText(path); - - AudioClipNames = JsonSerializer.Deserialize>(json); - } - - public static (string, string) GetAudioSource(string clipName) - { - if (AudioClipNames.TryGetValue(clipName, out var audioSource)) - { - return audioSource; - } - else - { - return ("Music", "Source Unknown"); - } - } - - - public static void UpdateAudioSourceText(string clipName, string sourceName) - { - if (songRectTransform == null) InitializeCanvas(); - - var textComponent = songRectTransform.GetComponent(); - if (textComponent != null) - { - textComponent.text = $"Current Song: {clipName}\nSource: {sourceName}"; - } - } - #endif - - - public static void AudioPlayPatch(AudioSource __instance) - { - if(Utils.customAudio) - { - if (__instance.clip == null) - return; - - if (Il2CppRhythmGame.RhythmGameManager.Instance != null && __instance.clip.name == "loon") - return; - - if (LogSounds) - MelonLogger.Msg($"Playing \"{__instance.clip.name}\" from object \"{__instance.gameObject.name}\""); - - string audioClipName = overrideEnabled ? "REPLACE_ALL" : __instance.clip.name; - if (AudioClips.TryGetValue(audioClipName, out AudioClip replaceClip)) - { - __instance.pitch = 1; - __instance.clip = replaceClip; - } - - #if AUDIO_TESTING - // Update the displayed audio source - var (name, source) = GetAudioSource(__instance.clip.name); - UpdateAudioSourceText(name, source); - #endif - } - } - } -} diff --git a/MelonLoader/AssetStore/CheckSumStore.cs b/MelonLoader/AssetStore/CheckSumStore.cs deleted file mode 100644 index fc9ce51..0000000 --- a/MelonLoader/AssetStore/CheckSumStore.cs +++ /dev/null @@ -1,858 +0,0 @@ -#if OBFUSCATE -using System.Security.Cryptography; -using System.Text.Encodings.Web; -using System.Text.Json; -using static Newtonsoft.Json.JsonConvert; -using static PvZ_Fusion_Translator.FileLoader; -namespace PvZ_Fusion_Translator.AssetStore -{ - internal class CheckSumStore - { - private static Dictionary modifiedCheckSums = new Dictionary(); - - private static Dictionary checkSums = new Dictionary() - { - #if !RELEASE || RELEASE - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_CloseButton" , "G/++rbb7GMZv51CxHKdVINtAji/x9zyyhlcbCCWyP2s=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_CloseButtonHighlight" , "nNygYVELdiLcY0xbk0I1uX92NRazxns+I1u7p0M/e4w=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundDay" , "pExENxFbAGfBzLByFps1SX9AN1H6cL0QQK0jOFn3qu8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundNight" , "n3LXi5yONzLVTc0eNStQtLdlcEsihCi5iImxbB7rMdY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundNightPool" , "fe6efxJzsAn3i75Wg7WrCyAFVQhMKXnzh+uThkCJXV4=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundPool" , "yKlIHtnBPI8tiUnlRCHYcCnqwarpiuzfOj4H3yGn40o=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_GroundRoof" , "cYTj11LkhWuJxO8j4h+s6+AG4JtgfZ2jfL4P/rWzGfc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_Imitater" , "9BD3A5dWXxgklYK4TTQ/G7d8A8OtZHgZrnq3hIrSlDY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_IndexBack" , "KqSOHoWk3g/Vd1vtwL1X5X33ft8TkxHnupydPB/f8lI=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_IndexButton" , "GWE8iGEa9rVJW3TGG0j2la9VwlxrJ/LfnLu0OMKxMZg=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_IndexButtonHighlight" , "kbz2ezXWjIGUC7Q0k3cagXMuRLpnU7l4xGiX7WdSMJE=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_PlantCard" , "lLnAYniK6sDgRW62t1Q/GGh9zIWkBOia+oFzntBBjx8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieBack" , "r3fcC00ZRR8vQUTsPRj339mQZi4/pFcL4rewSbRtM7E=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieCard" , "Fp2qKy2IpiEkA1hZrgXgrxyOA6hteIEQ8sqPrOkaaI4=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieWindow" , "mRlpQuXwIiUhKwkZXcK8sDZ6aQKnl43Y5Pbw5NMsKmk=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Almanac_ZombieWindow2" , "GPvh5nRvUqJMjRHwhqC4SUUB3BUKfCgTk6AWO8eGq/M=" }, - { "Dumps\\Default Textures [Do Not Remove]\\CursorClick" , "r7q8kCmXo9FHCC00VPswxjsGba2OMpE4UzBByode7KI=" }, - { "Dumps\\Default Textures [Do Not Remove]\\CursorDefault" , "xUv6VFWl/tzVsUa5heAlzlOyFjdzXsX9kT7EobZTIFQ=" }, - { "Dumps\\Default Textures [Do Not Remove]\\garden_new" , "jkDprxF6ApST91S4TzAGyzj2MC9umC8XCaasbstkBt8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\MainMenu" , "e2lbkFcEN6hqwDk3A0SHZJu7PwEcol1u/QZtvpq71gc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\MainMenutravel" , "fvORSzOzZ6sNDHL3qC/eA7tExSe/TsLIBswcuuFgFZ4=" }, - { "Dumps\\Default Textures [Do Not Remove]\\plant" , "ophzSlF5tmOXKn/2lHZUYiE4pMibPTqBvfQMnuBSzb8=" }, - { "Dumps\\Default Textures [Do Not Remove]\\Present" , "YHoZLVSxMkA8c2u2RCP1tJbFFZZxeulpuGTGp7AtpWA=" }, - { "Dumps\\Default Textures [Do Not Remove]\\PresentOpen" , "TL+KhicnGWIIOcEyMdTErS1SyBO5citeF37g3CxRiuo=" }, - { "Dumps\\Default Textures [Do Not Remove]\\PresentOpenZ" , "Ij60phw5j3rhjwMyGiVUOuvp0lelEJqtYQHEECc6l14=" }, - { "Dumps\\Default Textures [Do Not Remove]\\PresentZ" , "fZF3EH0YB37P7j1LBJN9jIwniyCy1Oe2Tw2BsSGc4iA=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedBank" , "BjG7XCi4XIPZO+NHAgksjgSUoO3JPJrL7BGFEWNaQ0A=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Background" , "RB2fot78wqAGxeIIBuG8ZEnytADs/yxhdh3Jre74nMo=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button" , "/KtMBXY5AmPsmt98HVMAuoDrocKr7s/+g7/6wfMJIxY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button2" , "JYwHTIvcmX8NS1wxlb7u1nMPG4BRA2mgm6R2IM/9NXk=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button2_Glow" , "NRov8DgO5+9rqTXQASV8izLAp302/o5ufZgVrvb7aig=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button_Disabled" , "nvfQ1CN+p9h1rUqVhOOLAlCmsdehs2qgVz6kmWERGkU=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedChooser_Button_Glow" , "Wg8LhHovWpNtScBLZbhcjgqQcr4C2pehb3QS2bpmO1Y=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedfog" , "SN9MPqY76N6ucf+vzs22J+2Bs23+1Tl56f7GrT3Z9Yc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedlinkage" , "kqQiioaMU/fAv9+eTzdzV7KizreB80Qio2e9cyWtaOY=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedp" , "i7wDlTSmSBueQ2sCWU7usRbfGoncupi6+plQrjv9A8w=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacketSilhouette" , "AVSM7MUReK4oLDUajmkWjQqT577of/ZhaAepDOQk54o=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Larger" , "C7ZuQNW+xi8YNyYtz09aAXOYP/t56u01WwgYo7FT0Tc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Night" , "YVCLQ3WeIUjevo0Wtf2xAOnDGAAzjl44bRHS1T5ProE=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Other" , "kiidD0VdJ/U0xYxtM7f9uvUYsK2VHFIZU3750doVtHc=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SeedPacket_Pool" , "8MQOevWJrWgIsnWhYi2xt61yxoJARcINzSYzRG7yrnM=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seedroof" , "zluDS1sgaJ4iHXt4PfJ3tqi+LVduGKB9+WLdWZZH0ik=" }, - { "Dumps\\Default Textures [Do Not Remove]\\seeds" , "JNHpZfk3qR+yWd4fhWsdNF+JxtfTOjTAKxLs61X0+co=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_almanac_shadow" , "SdZZ5VOq567+489ffjHcTbgWj3KjI01YKZgdUGj9yis=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Flower3" , "kIzmQGfYT3nCObTtM+C6F7WgE8oCj4M+Qq2II0n2IXw=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf1" , "OwGYCIlBbK5j1dZxBjHlPkvswRy+QHgYVXvmOYoMt6E=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf2" , "0ea/nJV5ziIA2Aher2Exfgz6lDuGDjqHf6Ra/bsmMrg=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf3" , "nzELmsj1XUXJmOhMLixHLBzW5TGhZCkwoAOaRpRJlYw=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf4" , "pXEZUhFqr2KC1pCQLB6MwwJhBM5ZI2teGOvYPgr011U=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaf5" , "SeX0iGZoN8ZbhKZSkonw9I7MS3lBVHVqzko1hX80LUg=" }, - { "Dumps\\Default Textures [Do Not Remove]\\SelectorScreen_Leaves" , "Fny+WEQ2N1yzFhdAPhR/zoK0P2HY4GDckluVL6u6Kz0=" }, - { "Dumps\\Default Textures [Do Not Remove]\\ShovelBank" , "Pas2yhjcl+HVwsIm68o9PRjAR72y5lTQm85e2vuYgBE=" }, - - // English - { "Localization\\English\\Textures\\Game\\FinalWave" , "0O9Esd6GUDRmYE9NtcuIvmRzZU6RKUeR4U6Xiy5qi6o=" }, - { "Localization\\English\\Textures\\Game\\FlagMeterLevelProgress" , "CzuBH4sm7Nid4zloZF3i0bpNcA9ILPhrmOxVYI4IggA=" }, - { "Localization\\English\\Textures\\Game\\HugeWave" , "n9O7b5CuD9Yu+ccecqsmm4ofp10MAw6eoZmIxnX8WwM=" }, - { "Localization\\English\\Textures\\Game\\StartPlant" , "IIz47Bh/4MjFKaZaHx5PAxz97YukBkSqHv8nnN7tMLM=" }, - { "Localization\\English\\Textures\\Game\\StartReady" , "lhaXbwp0oHTrX1JFyJE8hnabkzj4bgNyWdFDMn32cbo=" }, - { "Localization\\English\\Textures\\Game\\StartSet" , "WPtmG9W8kFZQthgaycm6P17wmnqWW55CnU2JjsOGJkU=" }, - { "Localization\\English\\Textures\\Logo\\标题合集" , "IfcPnZSGmfNl1jdd4RiGaD2o3XHs/K0R7HKKLzcFftE=" }, - { "Localization\\English\\Textures\\Menu\\NewAdv" , "6UYMHlQ5SdT+gX7cJLy0iwyCXdxblrjdNe2l/OCeDcc=" }, - { "Localization\\English\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Adventure_button" , "7PPDxa4AOg4Q/ioviwKYKx2ftu82+zlvJdbeqWlGaBQ=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "+Drt7kOZRfinB9t8BsklSl8Np6NxDPJ21XvYuVoiwbY=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Almanac" , "Th6/Pun/NEn6797dnzdq8XnCqY9/oIORszG6K3xSFbo=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "hp6y9BUvolJ0bQdU1FY1Oyt57fizZFx8Q3zXYR4t/BI=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenges_button" , "LDMp8hCkHDSIrN9F92K93txxjFZ69qKyfG429oRyGfc=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "rSB360yGYMYQyNUJYb2xMCgGmSFAl7plLTr1BDMA8W8=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenge_button" , "0DWLUXJ5RYKci+loCThNfHEpk7tKV08vifffcK8owNg=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "AXW4pkVR9twu7/SJYvqScPeNswIoefGCBJXDf7SsXFA=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Help1" , "bwLeNCc4/VtLyocaVQhB++/7t2l4ngYQg+3r95RSMDs=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Help2" , "B7p5vi9AyiidPL4nvBTVdL+WhUbsKzHEIHyWWAut1KU=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Options1" , "TJEiHNySrGFxBP85FeP3hl4TcLCVjX1VXYt0navnK04=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Options2" , "SehcWmqt2cxQhPlcJqUKGeRyl0VgxGymyrVKLyGH9LA=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Quit1" , "zbJL06XIJDi1PjiR52BZCmNSYaRCWLb13owTgv9hVw0=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Quit2" , "diLLwcdEED5M+H4Y35Rnyu+W+R6FU7qVDs7DteLWFtw=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "9JoXGZoVFEVUJR+s/mEye3rkTIYwGLZCiajp12bAP/g=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "b2xzl7F7FEkFZpxGKwEwasmF5BkxaZJArAhcnPQ+Ng4=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_WoodSign1" , "RhYg1ymYR4mEqL0do6dIqRxts+BG9GlB4d5dc+gMjsU=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_WoodSign2" , "aV7MGtWrsnh5O2ikBof66Y4n+w9xhbQbkOObNP2GysY=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "bov/KzSszIVUaDK3x1AFJZU5kbiBArl+tBybTxi7cS4=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_ZenGarden" , "8x4Y+E/DvSPrr1sY1k3trPVtqLrRuUUVWktfLIx5qTI=" }, - { "Localization\\English\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "ldiEJGQVyYvquwZuPy/aYNf+Am24dG6iILuw/1k3dNQ=" }, - { "Localization\\English\\Textures\\Menu\\SZW" , "2FoSx111GS6QF3dQoUlqhsbVbDSB0MrnUFKilgsIyzo=" }, - { "Localization\\English\\Textures\\Menu\\thanks" , "bffGVtPUS70M8mNXyKDE9aU+XqGMLITegGGOaPMVL84=" }, - { "Localization\\English\\Textures\\Menu\\travel" , "vy+5i0dx1+DIECxAsVv/co8gIwM9zk8djIKCHbG9ykI=" }, - { "Localization\\English\\Textures\\Menu\\钥匙经典" , "PAPsrNZRY9UetFgFnEwZKdN1TgNbCrU7ZtaPZVzBxvg=" }, - { "Localization\\English\\Textures\\Particles\\Doom" , "FqBUBeIvzyyXL+cqO4Fi6CKI5gZW5QXfHYPTOYoeteM=" }, - { "Localization\\English\\Textures\\Particles\\ExplosionPowie" , "cuikfX+3LOtSw3EPB6DnjANO5bKkoYCMdWSm+StmW70=" }, - { "Localization\\English\\Textures\\Particles\\ExplosionSpudow" , "4pJ/gZsuKRsAbUL1YWsaaJC9NxrzhqUiQe6glK07ydU=" }, - { "Localization\\English\\Textures\\Particles\\guang" , "kh0dcDxOXgh8+Eq1TmKdJug5PdR+nzZrK5iS5Nkw7Gw=" }, - { "Localization\\English\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - { "Localization\\English\\Textures\\Particles\\SunExplosionPowie" , "3bSjOYpanuLnsl58oYUzOAXt94nony6Drq8qdpfRSGQ=" }, - - { "Localization\\English\\Strings\\translation_regexs" , "rjxlsJwClOAJERCe9XmYJB1q+TX6h0p5zDHqCyu/9wE=" }, - { "Localization\\English\\Strings\\translation_strings" , "zsQF+z4URSZY7yuqTfuOIdc/sfcq6g1Hi6ZeedfBFS4=" }, - - { "Localization\\English\\Almanac\\LawnStringsTranslate" , "7BFCUmTVKh5MdefAGxiqgbVtWHcyq9Jg/e8jCWcGI2A=" }, - { "Localization\\English\\Almanac\\ZombieStringsTranslate" , "4KU0HKBDqw5VPbvDqzByDS4nGSG0UAHZ6ek7iv0FOUA=" }, - { "Localization\\English\\Almanac\\AchievementsTextTranslate" , "Y0rNgt02JEkiv/jacilOR0NgACVjqyWpQNQrF9t9PIs=" }, - - // French - { "Localization\\French\\Strings\\translation_regexs" , "Pv4R3N7SkRz8Ksp9DkHR+xMn3Tv7+t57FAwEYDveH4U=" }, - { "Localization\\French\\Strings\\translation_strings" , "atzVMZyXEHG93wcM7Uqz0tTHsWK+dxc1csQxLhHF5wA=" }, - - { "Localization\\French\\Textures\\Game\\FinalWave" , "VTTPmIlVoXW7tU/sQyTlZZq2dy3qOlVs7cmPQYd2PMU=" }, - { "Localization\\French\\Textures\\Game\\FlagMeterLevelProgress" , "DVG5/OyuPfwy7dNOE8NCKmqZK0tKpwsr7As0df3c+0Y=" }, - { "Localization\\French\\Textures\\Game\\StartPlant" , "RkTaTLEoVW4TnXBg+UL3YlG+sdqg+WhP934sTpLlzzk=" }, - { "Localization\\French\\Textures\\Game\\StartReady" , "8/MDcBU6dbIHN1vESmyp27QWxIbifrZZn4IDxKldW3c=" }, - { "Localization\\French\\Textures\\Game\\StartSet" , "8+doc0lYZ2a3W3qpbMSeRturIOWpmyhHw9COvM4Ctkk=" }, - { "Localization\\French\\Textures\\Menu\\NewAdv" , "4noYYWThghcWgV9BCO4WJjEGqHg+SblIoCoCKgTXdAo=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Adventure_button" , "ZRxJ77hv8I2NmSiK6LTDgnOG9obBh+ueMa3R/NDCd5I=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "MoCVUnQ+U8HdUtA4haA7Cx3CmlC/hvVuvYc9bakMtW0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Almanac" , "8txwE7D0UbRCH0hzukyZBACcCn1f9yiXLvhzBIkfKCg=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "WoiG0xkTP5oLEYBWOwnf+kkvbY3jD/xTVYgjBQ6/RLQ=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenges_button" , "3NEwHpNoT1jEl+4gDpOYQ/9osW9rvdfdmiJ0ALIV8Uw=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "RD2hIoFhO7AU6nmtrp5iJwjptYy6ociYKGUJxNsYHd0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenge_button" , "eQO5Wj2FOU2kLRMmI6Hhp3lir/hmYhOGrct5dL6utI0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "3cetfrmDbZHx1uumNbBApG5p8I2T8spnrqVhPqSxkI8=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Help1" , "2yINgPeQqUy6b/mzw/2mFfTxWUlzQrJoYC4Yz/VoGy0=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Help2" , "aaUDGQU1+0ltVD4OF2Luc/6pXK7LZ4B5jL9BtSNRnjo=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Options1" , "Lpt1mXltCSkn+9BeMOT+CzTxcQ7cwUtFem+I1tWHdqE=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Options2" , "MNNGXO8AboJJf9tMKXLpIB6j1foAj6bcHopNhHcpRVo=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Quit1" , "6NILc8MqiGcQ3ttSKGfDOEOgvUnIUNO/DWBIeNi4/pM=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Quit2" , "rwTFCgy3kNLCcBM5J6EjguUP4NuvfkDNJjks94eaP/g=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "UYwa4CPhRF8CiWro6Y22GfFQOlk8xCQ6Mldkgk4Jn0c=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "MzBfCyymyT0E4mGUdhps7O6IHJdHtwNtGoi3kRAS8Ok=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_WoodSign1" , "T2Ci2ItAeYw0hMbOP87XJefKbaye8Fhv5tN4H3V7TFg=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_WoodSign2" , "KnPecN+vhvShgMagZGtPKPzMLcc+N3Kqsrlt51YiKRU=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "v2L4jFj8hcIeJzle9LA0OLcCKwXXYdPVBucdslPTlF8=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_ZenGarden" , "ngbC53eTpHs9VaU1qViFJeJVCNhoZcvojiFpeqrXjMc=" }, - { "Localization\\French\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "F/nkF7zPU6FyWpOaxMim7/NbS6mH23er3ihfF2tVUSk=" }, - { "Localization\\French\\Textures\\Menu\\SZW" , "Z0uAEbNYk36lyCsPXGXnmjO0L3C1E68aA54stVpbYYs=" }, - { "Localization\\French\\Textures\\Menu\\thanks" , "bzYfnWlAyBzLCflijFAld5m0LBmzDS5vyCbUJs+cn0U=" }, - { "Localization\\French\\Textures\\Menu\\travel" , "Ca4e7HNOAXOUzKQAw+1+H1JRI14D1yLEn5cdXHmFcMo=" }, - { "Localization\\French\\Textures\\Menu\\钥匙经典" , "E+VDMHWhhtf9MwVo8SB9b2eDTE1v3u5Wd5DxoM935fo=" }, - { "Localization\\French\\Textures\\Particles\\Doom" , "q/QV2mCopjFnbwQUUTvoPtcyGV/UAwuxjB9v+GDm3OE=" }, - { "Localization\\French\\Textures\\Particles\\ExplosionPowie" , "mqTy7LXjfh1v7kEtwHzIckWjm/4P97dCs4CbyvzOESU=" }, - { "Localization\\French\\Textures\\Particles\\ExplosionSpudow" , "zFpkHlUNR9jWL/H8FQWy8habmtvu2wtMi/PpClRax2c=" }, - { "Localization\\French\\Textures\\Particles\\Sproing" , "FSStD7Lw1uNrSHqZkZCKrY+hcA6O1DOMKe/6R+jqNdk=" }, - - { "Localization\\French\\Almanac\\LawnStringsTranslate" , "sjZ1qRYGKM3sKMimzIlfmd3e2T5gIV38wy3bU75pLjU=" }, - { "Localization\\French\\Almanac\\ZombieStringsTranslate" , "k6XiNRnACedQuAMhh2CHx9jwMfPEJTbG/UZpubs7EM8=" }, - { "Localization\\French\\Almanac\\AchievementsTextTranslate" , "cFzYB+rYT5//+JpvEHa8Or97RYJZdAI0zK3Pr0Fw9hU=" }, - - // Italian - { "Localization\\Italian\\Strings\\translation_regexs" , "Fr7kZcK4cwoN6WsCARX06Od+PkzCv/FTetj7ME0cIok=" }, - { "Localization\\Italian\\Strings\\translation_strings" , "gXM9MZ66TBCflwXl3hMvH46U70kU2w3i4o0EQAd6Xp8=" }, - - { "Localization\\Italian\\Textures\\Game\\FinalWave" , "J7mSpIXvwo0JbrS8RLLWr8jS5KwRcMoDT6aSIVykhiU=" }, - { "Localization\\Italian\\Textures\\Game\\FlagMeterLevelProgress" , "pwnHiUlgXSYUhEXhBWe1XUeeWfYTb0oTY9/UlerGPuU=" }, - { "Localization\\Italian\\Textures\\Game\\StartPlant" , "6OqWQtc8U0Qm8qyhkdhgOmLhR3yGVnLOFhZ6ZrDIjy4=" }, - { "Localization\\Italian\\Textures\\Game\\StartReady" , "3QPcKBCGX8TLM8xCqCDJqY0uCsRg0vUxGzmTkvfXujM=" }, - { "Localization\\Italian\\Textures\\Game\\StartSet" , "VS5T89S8Do4xqRwxSBt9kjV9o/minfu3M//piKAJVkQ=" }, - { "Localization\\Italian\\Textures\\Menu\\NewAdv" , "UEsXovFnKuglsJ9S59cnJjDnhfDyTAXtLtVEnw9oOD8=" }, - { "Localization\\Italian\\Textures\\Menu\\options_menuback" , "WjWI+u05cf2sNThCp2EaWE58r2HwXRIP1gfwvwNo84k=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Adventure_button" , "s4XJiAhMaWGMpyzt/fGQG/dESF2XeQQ9x+1FQWyLkiU=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "NrVoP4kXJ8zaw9/cdm2oRPo08C3oCa24xCO23d11UBo=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Almanac" , "cOdUtbMj5hqPyHoYfORNboSUikAGyoNtKO7DicYANRI=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "ComYfg7rKwHPcmZENPfQP5T9TFQ0ARRmVye2nGAc+3A=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenges_button" , "DMY8d7mlP2ZmBHZz6BjYM1SEFlkFWp9VuIbB7+bMVwk=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "/OvCfFYFwlvf+DefR1/XYIAQ7djymbF4EK1kiLJzXHU=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenge_button" , "0XDQd6EaJkRSnYezFxhMFFAse/i2ZlRVmW+Fn9kSWnY=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "UfKNb+QqlwzBdu1eORqEeDB9lVVKmGMpqRSExUAUAak=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Help1" , "RoyqJT79KbODd3PfK28pDvvnhcps9XVDxNNT1GjXu38=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Help2" , "UQdoBeSlI04NXh+VYjUyN9l3gT5p/CDRAU1jUsFqerU=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Options1" , "3ebMHMsiekRjU3Rnc5t+yIkeHNpyZi8/Oulst4WWacg=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Options2" , "PFlm0Sdy/1Kajr32uINpR6i7YXQ54a8dq0+OI0R8zec=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Quit1" , "bPWwEE74Tdb583NcXB8e5W/meXVvmwuWkuajv+/R5Ro=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Quit2" , "vBdX54EEKdZkJgiFcCQPtzRPoj0NSKTq7UA7rWDSTBg=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "ZPkJ309XC1P5w3x4IPhItEeLd5WVlU0mIaBoHX3b5Bg=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "8VuUajuH7+8MJqROk/3XFQOEx541qi89ykuQCNaJ+L0=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_ZenGarden" , "1tP+grtgWPu5HtvUa2ox+9assN+Wgj63wBkJoskr6K8=" }, - { "Localization\\Italian\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "sZuiY1fbj5mg0TXaMok/qJFwoYf3+OxkN+Bk3pbTjs8=" }, - { "Localization\\Italian\\Textures\\Menu\\SZW" , "6cXREWl13sjqgdz3Zf5kT1N7bCoIc7LyrHg3WNMVTyE=" }, - { "Localization\\Italian\\Textures\\Menu\\thanks" , "I2nKJztoIdeVy/CyGYN/r/DB+Gvv3geaFxOdtMdf3ao=" }, - { "Localization\\Italian\\Textures\\Particles\\Doom" , "8E+/HlnnJa52eoBgLYjMyjBCsb5bhc/rTnsJKs2hucA=" }, - { "Localization\\Italian\\Textures\\Particles\\ExplosionPowie" , "u2bgHV+XPb4gSz8CagwJdbKWszej9uoIcbM1Z5GRto8=" }, - { "Localization\\Italian\\Textures\\Particles\\ExplosionSpudow" , "CciMCMupOdEov98dK59e2wF2izCwW8jpBkwQE/EV/JY=" }, - { "Localization\\Italian\\Textures\\Particles\\Sproing" , "nYlKAmcK0rADsk4KS7FaQ3FZBfl+IGQuXb7O1GCML6Y=" }, - - { "Localization\\Italian\\Almanac\\LawnStringsTranslate" , "npd2sE+VJ46XdwqP4cx+Jg7/mgxFiUUgpxEKxDrBUKk=" }, - { "Localization\\Italian\\Almanac\\ZombieStringsTranslate" , "GEhXXOMNHS12b+dR5Q6cxYrORjjyywpkPEKB3QzCn+I=" }, - { "Localization\\Italian\\Almanac\\AchievementsTextTranslate" , "Z4YUscuIUlrlLiaYWHTEvNjztVt291fLjJjkfc/lYBE=" }, - - // German - { "Localization\\German\\Strings\\translation_regexs" , "v3wwSqcUG/g71BrZXhYkpxDYebHeO52n1I8QjjlOuUw=" }, - { "Localization\\German\\Strings\\translation_strings" , "LGDwWtGeEnEvv31TnvXdkVUEs5od34WPNQ0od7WKy60=" }, - - { "Localization\\German\\Textures\\Game\\FinalWave" , "+MHS0Xz4nzGw+0knMtj5vJYSxaaT0KH/g8DWXUOv788=" }, - { "Localization\\German\\Textures\\Game\\FlagMeterLevelProgress" , "M0XScRnevh24JLXF48cG2GecSHlbP4vGUerW0xk63OA=" }, - { "Localization\\German\\Textures\\Game\\StartPlant" , "ab42rVDpP/bDtBjg9LvrfVmEf3E2Bry1pwOnMo8vF+A=" }, - { "Localization\\German\\Textures\\Game\\StartReady" , "7vV3VLAlAKbjXTBzaxlN+ulcOimET/gMvohDzyjFXoI=" }, - { "Localization\\German\\Textures\\Game\\StartSet" , "nNyPtyTiTsCPalXr/MgQob6EEb8kgyPZjMWmbXu3YFw=" }, - { "Localization\\German\\Textures\\Menu\\NewAdv" , "Lx7kxZzwBLios8g7raYwDDPcz2X48SshJaWuklBYUDc=" }, - { "Localization\\German\\Textures\\Menu\\options_menuback" , "WjWI+u05cf2sNThCp2EaWE58r2HwXRIP1gfwvwNo84k=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Adventure_button" , "8NsCGe3aSbZ00AJFlELTtD1hOJlu+RojAAvvD77ICpw=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "LcyIKu9BsVtJapQUrpkdefPiA+JTYkak3fg87Tx45JU=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Almanac" , "JrkVQQByD5XSa77HI5+MVGkrc+3nTDyKEP+Kuij6gPo=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "zUlJJqGxLiwafOpBogGO+zX621Q3EnetL+u5vROt6JQ=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenges_button" , "SWZKSjn8ytu5outezry04hHXcTmQD+f6KlWn4nlIZCA=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "9S0JmpQLSGprElTl2MzQoSuT+Eemhj7vaQ20lwi8Ynw=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenge_button" , "VRVyZIq8PBKunX8767vh70F/SA85Cifao+kvi7HMIHE=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "WIH6pTlcbWqOMk+H2OYsBft0jVBwYT7hhWiiWaZzT8s=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Help1" , "t9KLP/pCP5dWxWp7nAPjon/4224sE+yY2sX+MhqRJ1Q=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Help2" , "KZ7sZ8Q9Jus9Su3Tu3FLWmWJssq/RPnuOO/eQ7HgaXI=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Options1" , "nqTlln74GhHYs6GKAqcsoS7AzDnOD1jOjvfBBzMOEyo=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Options2" , "xtg2c+bnhPszl8u8BTma6O/xMxiZ/asBAA5jRCbWtek=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Quit1" , "xyxc8phjdNVui7E7RHFSSlu8OGIXw8HW2QpBCrKokmQ=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Quit2" , "PBuRnBbzOk257Jm2i3ISLoz3oeDzy6LNurXaf9LKV2E=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "92BwDgaXMJZXqrcCxdIm8XcZai1NuGH0amcno5E2uU0=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "YzxTyUcR2OvQ1ctFTKq3kd47A0tgiXp/kPQC/hgdom4=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_WoodSign1" , "T0wrDENK1CD3OgeosDNa4ab28lsSi9JmM7v8wbxB4bs=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_WoodSign2" , "9SZQ6SvrqFn5kPXbF1JD7F5uMfvGyV0xkar2qCvb2UM=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "jJD+LiAoEzsnPJeUFt2Gpf+e2P8JjKpnfLDDPh6Zcho=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_ZenGarden" , "5Z6wqSVe04hmNHCPdPrDlJrXqgblhY6OG843O19GVmw=" }, - { "Localization\\German\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "z6YuoHbmClwoKeBjsLa0wypSdcB3QrEh2wzzYnDk6Ek=" }, - { "Localization\\German\\Textures\\Menu\\SZW" , "op9D5nHLxn/WZ/TVVaeji8hj9qRQl1DeuHZF/rj/ZMA=" }, - { "Localization\\German\\Textures\\Menu\\thanks" , "myLBgPcIux3cNkPd833r01ZqJsCqBTty31xJE68ZD28=" }, - { "Localization\\German\\Textures\\Menu\\travel" , "ASg2t1qO64hqGJMqDTQ8da8KotTKpkGtzKIaKuO1MqU=" }, - { "Localization\\German\\Textures\\Menu\\钥匙经典" , "KuqwMj6aedb2J7e8rVQpMa5Ie97lAFbGuwGFZq3POJo=" }, - { "Localization\\German\\Textures\\Particles\\Doom" , "rY5dss0ZrDcUHYVTddyesRpU+r0HoF5eiBM4iDMhHhY=" }, - { "Localization\\German\\Textures\\Particles\\ExplosionPowie" , "Gu4iuRPXhL3KAlUjBjbBOpjPthKXlViQ+8lw2sreTNY=" }, - { "Localization\\German\\Textures\\Particles\\ExplosionSpudow" , "z0h6r4O2FdV1r4CbGVd4nmEpGHZeo8dM2wV9suiZq8o=" }, - { "Localization\\German\\Almanac\\AchievementsTextTranslate" , "12tsG4qJrdtX0dxUOa532CyrC+cF403BfFg3fsjRO+I=" }, - { "Localization\\German\\Almanac\\LawnStringsTranslate" , "Vqqn/gcnY7SIPEVbIxSBi6DXSVBwMyVCQvhOs4KCoJQ=" }, - { "Localization\\German\\Almanac\\ZombieStringsTranslate" , "RlBdepGFFohgICk5idOkRFo9t8FxUuiMw4hoo6eYs0Y=" }, - - // Spanish - { "Localization\\Spanish\\Strings\\translation_regexs" , "4QFp251QrntXDcXjGrGYje8gvuKNHAxVp4FfLm0uHI4=" }, - { "Localization\\Spanish\\Strings\\translation_strings" , "BT+eTs1l2eWCDb+5CGgJJmjyAGqTulKOh2VuDIkwxTE=" }, - - { "Localization\\Spanish\\Textures\\Game\\FinalWave" , "fcYpg8VM7fWplgQdj87NOj5jtGgCPzvW4c2fJOUiJIs=" }, - { "Localization\\Spanish\\Textures\\Game\\FlagMeterLevelProgress" , "4MdtfTqEleDpziEenobp9O5cP3L/nZk18gdT9xW2O9c=" }, - { "Localization\\Spanish\\Textures\\Game\\HugeWave" , "n9O7b5CuD9Yu+ccecqsmm4ofp10MAw6eoZmIxnX8WwM=" }, - { "Localization\\Spanish\\Textures\\Game\\StartPlant" , "s7phwlweOMyWGCtCtFoLSMSC/VQSxFPVoB9T+RZQyhk=" }, - { "Localization\\Spanish\\Textures\\Game\\StartReady" , "DRI5gg//9pDb5dOaR0PhlBzuhP2lryhT6aeklSCUTxY=" }, - { "Localization\\Spanish\\Textures\\Game\\StartSet" , "eiX7QvBlF+EcJrXsOxqOkzu0VF/6hb04uNRRHRA/RMA=" }, - { "Localization\\Spanish\\Textures\\Logo\\标题合集" , "zt6CxJgEU+kegWGRKzQKwJynE91Nbpk9hgSby2zHW/o=" }, - { "Localization\\Spanish\\Textures\\Menu\\MainMenu" , "ZTaVNrPrxtSad5bo89RQVNXxaprYLZuGsl6dvuAoJR4=" }, - { "Localization\\Spanish\\Textures\\Menu\\MainMenutravel" , "w7iF3kfdiOg8EdbPKZlfxfObZXSAdqAMzfDMtM+4Dd8=" }, - { "Localization\\Spanish\\Textures\\Menu\\NewAdv" , "itgAdOEzcDj7sUA11u4xX3BwY7vssEdui606FpUUrEk=" }, - { "Localization\\Spanish\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Adventure_button" , "yE5gPHXKy3xnVBFtSTC0zjhfl0tCrc6sHPK8AiiO/s0=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "gwHOCHLV9NAvvChiQt5X95UOLaStVZogt4DWAokvACg=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Almanac" , "xfqV6GfWdsrPhlVIduoQ6x5QWnci7DRO0E8qC6lItDA=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "a7NCRdhsKTG4/8CLniWG2j/3MbUh68YmT1QJWAVNCDI=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenges_button" , "LDMp8hCkHDSIrN9F92K93txxjFZ69qKyfG429oRyGfc=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "rSB360yGYMYQyNUJYb2xMCgGmSFAl7plLTr1BDMA8W8=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenge_button" , "OT8c2V3GBYxsCMO2nHs7+DbKkdHupmjujVexo/jm1us=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "utQuQr3NQGeGxfmtc3CC7s86/jTGH3SipAkDrAXVbxY=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Help1" , "+W/tytQsNLMSqPE3QnC43MgqBsU0H9XNrjk4RHundLA=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Help2" , "WNPFp01iipCzzArymTAcu4VLz5E+Hcm/bnjMZZ0eQ60=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_LevelNumbers" , "ES369OPOoW1RsrCvYQbKaUt0GF3zXXgUd3ZPnjDWXhc=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Options1" , "zOkXmvvFsyjLO/nq0Dgl88rTSrJWwBPMp6QiAobyqMw=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Options2" , "MycGypHA2qhq7cgAk97vlPX1gfxmeXoMxQ0FaKwQpkA=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Quit1" , "jtBCpgu/bShFN1ykigQtCjLb+U9aABHugP/8ezHmYxU=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Quit2" , "bbTsQCx08UTWFdM/0csjqYB8rSvCJJm3hZMWSDFmeI4=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Store" , "6gVEuBsk1/udDoEATm2tgmWMCkdme0+oxngcJAKrmP4=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "grdusCpWrRqZfBuNB1Dj7bKFzyQk3xFReAqoAEKYFhY=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "s6uGdZuYk0R0xmSa8KsCsZAziQC3F6AWyZaL+vqPi2Y=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "5iaDwlH8qBI3YyWWjyJ/azvzoOMuThRgYykZeAu55/I=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_WoodSign1" , "EzxodXEKdnZDB+CRtpfAMzlGaoqBoXhO79UprQAErmw=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_WoodSign2" , "vibMNgMtv+f43drQs5FWDYv/WaUn6VC3RVZv0qioywc=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "esQplw+1F5GBRJA2KPKbZWTQvPEpQp+d2oyym7Bz2OQ=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_ZenGarden" , "6TrN8Qb2J40RES+YBsBdk9b9A1yy81/+0ZCGSfOqmQM=" }, - { "Localization\\Spanish\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "zr7f1egwQiGj+qJiAM11sWpvRVgGkj1E3q2Tpa6t82Y=" }, - { "Localization\\Spanish\\Textures\\Menu\\SZW" , "zXZkY8n4Xa4BRXd2P7CrPeV/oyoImKa3aHZN0AQxrDA=" }, - { "Localization\\Spanish\\Textures\\Menu\\thanks" , "a38UKni0HkBOxxZOz8YLEuRomcdqRxH+cUxIiZv+57s=" }, - { "Localization\\Spanish\\Textures\\Menu\\travel" , "gyGKFv33M2THt9HsNOGXrzayuTk2O6eW7SpR+gq+6Ac=" }, - { "Localization\\Spanish\\Textures\\Menu\\钥匙经典" , "2x/0/QLjwKGhOFxClKDi+wmB+d0n3/B9Y48pW8Kr/uc=" }, - { "Localization\\Spanish\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - - { "Localization\\Spanish\\Almanac\\LawnStringsTranslate" , "EyMLq+zINvouAEcKNy8fPEu0YIJ98NSLqpMs1NX/U1Y=" }, - { "Localization\\Spanish\\Almanac\\ZombieStringsTranslate" , "tVcpi3GfFH/0aqsaeCuzszFYi6s1IxzO6Zw7wnB0flU=" }, - { "Localization\\Spanish\\Almanac\\AchievementsTextTranslate" , "9PRacAZIbZjZZfc6/qoAggpiW2yZfKjWY7C4im+a2xg=" }, - - // Portuguese - { "Localization\\Portuguese\\Strings\\translation_regexs" , "rzeZrvBSmqIGxLs/jHRAJycnkaoKthMidVOItF2PrbY=" }, - { "Localization\\Portuguese\\Strings\\translation_strings" , "j+vbHq7c9x5Rarc0yFX5eSQmHHtdXsgRqpCxJ9SGKi4=" }, - - { "Localization\\Portuguese\\Textures\\Game\\FinalWave" , "MK0QFrw4Fco5s9xq+8quKs1Li+SinkQuh2OxfZA4gqo=" }, - { "Localization\\Portuguese\\Textures\\Game\\FlagMeterLevelProgress" , "YnkJry/FceiULgkq9RJleesNqgLp/SeKiE5MJA7Kplk=" }, - { "Localization\\Portuguese\\Textures\\Game\\HugeWave" , "jRqYPyzJm7kTbLeaSosHlGLWoUjF1mWqtVNdwtAcvuY=" }, - { "Localization\\Portuguese\\Textures\\Game\\StartPlant" , "7IkydSAOydpjYX1+LSb+Fpt0M0KRmVcwdvjGgXJYMKg=" }, - { "Localization\\Portuguese\\Textures\\Game\\StartReady" , "xoyag2YhVyujDnM/xAq9Xtym8HGKl/h1GCda1mfM3PM=" }, - { "Localization\\Portuguese\\Textures\\Game\\StartSet" , "92OXIRhqJJhmdtb0W/WMNVi1t5hdEzpiwzfX/7p4vRI=" }, - { "Localization\\Portuguese\\Textures\\Logo\\标题合集" , "Ac0MlmlulBOa2w5peHxP7KhJFPAGObirxua3kWLlstY=" }, - { "Localization\\Portuguese\\Textures\\Menu\\MainMenu" , "LNnYLNOJryrvG5XIO+ObgE3Nohxjo9n07UjaGjfVHSQ=" }, - { "Localization\\Portuguese\\Textures\\Menu\\MainMenutravel" , "ZwjI2ybianrOFPEfrLP/38t6y4QB7D6B8hAfr7fvSQ8=" }, - { "Localization\\Portuguese\\Textures\\Menu\\NewAdv" , "gxMOlYYsojAuEQkjdLIM46dkx4ssCH+ncPdK3QBlAFk=" }, - { "Localization\\Portuguese\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "6yGbPdJMpbrmHUm9VSCVKHQxJ1sy0YgM42EhxRr1FLQ=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "rdyOJvSoNOHM6uNuL6ehbayGUaOUE/CWs8ZzbzOCafs=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Almanac" , "+5i+4oc5FJDlzzC86ewxR6aaGt2pB6snfvsCpJGL3gw=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "NBmzBkLDe+lMK/wxbV3p2L2hhByBUBP8onsYXO8Pxnk=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "mAy8FXDBpR1tsmwAkNvYB+kg8KKZLxmOtVP3d3DWiJ0=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "jbM14CqEIK+GnRKoKUna7P78p4c74g8NNPEbp01f0VY=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "TXWmZyG1TjBnem8kcFVv93RfUnYHf8CqV1n5BQyTGLo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "qUrCJfUYlEO32SCoPx89AzteV5hba2xzEjqCcNI2cJo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Flower3" , "KQThbd2XxKVgA/b9DE8RKwYoNRGTCvOOlGfIlmdnNFI=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Help1" , "gJxez2SDkvOvUtS7q3E6xlnQWWWeG28KaXJSG5pqqeg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Help2" , "FHAsPhSc3efXrwoZuiN3APOgXJQNf45znFcaoyZ7ZBE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_LevelNumbers" , "ES369OPOoW1RsrCvYQbKaUt0GF3zXXgUd3ZPnjDWXhc=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Options1" , "FQKd+uBul2bwIcr6nmNq1N3X25C8MRgjyGBy26OuR3g=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Options2" , "xZN/+5sa+0b2eDmS7WV2rw/IV6zglPmF9qan62eJHAg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Quit1" , "dLesJNU0+2/ep6cJnQBA2iUEgIOtve2ozeK9lBher/8=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Quit2" , "hvq+IpGRu+1Kvjz7g8797qjUIkMx8q3qcMyvJDnhMP4=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Store" , "WuaJyUo+GX7vDJ+R+MA6XRKF39j7lNZYOMCy+8wNzYE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "bDeLuhI74R/OTEAAqiIkJJfVyywn4s80lTrgGFNTzLA=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Survival_button" , "mAy8FXDBpR1tsmwAkNvYB+kg8KKZLxmOtVP3d3DWiJ0=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Survival_highlight" , "jbM14CqEIK+GnRKoKUna7P78p4c74g8NNPEbp01f0VY=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "1mherm3clK7CvLh9GpVqMII32w+w54mKZE7Z9fkkZZo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "3PVn0DR/33yNI2bjQnDDSSiFRUI+q+1j5lfk/R6JgxI=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "EqYk1lM+BEqgaAqOJXF2HRPkYTgc9j2iMyjcd7/w/Vg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "0iGZDDOUZGqqbMV0CNnjMPVNbNXmvyrJlDIkJ0SV2jE=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "r2YuP2O+mEVhGmapNpFRX8NTx1uY43oaU7kgZyzUhok=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "Ga88gKhsCeLtSoTYheuB6aPx5s34u9SqicGbLI/G6Ng=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "0xCUMxGOkVjkgU+fzmlzzSzC+acBGxKhmMjXT+idOk0=" }, - { "Localization\\Portuguese\\Textures\\Menu\\SZW" , "UVGfrlWecM6jEtNJPqjZ+zI66w3euAdOMNl1EPfKpxo=" }, - { "Localization\\Portuguese\\Textures\\Menu\\thanks" , "eHFnd+JUF/r6YRbpTtjmbs6Pywp92asO6TD/rLmO6Eg=" }, - { "Localization\\Portuguese\\Textures\\Menu\\travel" , "qmw+h5LBEWpIGaSe3HZF0XYUScF2VnGQxKWoD4cR2Pw=" }, - { "Localization\\Portuguese\\Textures\\Menu\\钥匙经典" , "g1DKaF3XxYSuiROmemzDz5C2cUcAQ7jPzuoV+nbC/Tw=" }, - { "Localization\\Portuguese\\Textures\\Particles\\Doom" , "FqBUBeIvzyyXL+cqO4Fi6CKI5gZW5QXfHYPTOYoeteM=" }, - { "Localization\\Portuguese\\Textures\\Particles\\ExplosionPowie" , "PHe2TsElYp9UvabT8sxF38JZc+4Hiz78HJyqH/Tzt3M=" }, - { "Localization\\Portuguese\\Textures\\Particles\\ExplosionSpudow" , "Hc/nhkiBIHrZzgdX8+zPYBVoGgNj8177Eqn/S/CvhUs=" }, - { "Localization\\Portuguese\\Textures\\Particles\\guang" , "zpzEG5fPPVYI3tf4DXE0hu3j5BlwIPSAKgcbpr/0wlw=" }, - { "Localization\\Portuguese\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - { "Localization\\Portuguese\\Textures\\Particles\\SunExplosionPowie" , "Cx5JShdk8H2FKNujBTOylSR0708YuufHqWUZiV+sG6c=" }, - - { "Localization\\Portuguese\\Almanac\\LawnStringsTranslate" , "WilEedYB6brtG2gExyru8VCIPjYiH8KOvCZ3dXkSaUc=" }, - { "Localization\\Portuguese\\Almanac\\ZombieStringsTranslate" , "ihC0adgxNlZjMrbLFMrYbprM2fY5Po4GfxaGvLJiDaU=" }, - { "Localization\\Portuguese\\Almanac\\AchievementsTextTranslate" , "2gd4zJcz6giTsKjIyjIca3DkWOipeedtbQpX26AJnkE=" }, - - // Javanese - { "Localization\\Javanese\\Strings\\translation_regexs" , "ci3jGT0t5FHqstahiDanSlnoXjHtfNLKD1JV2ZmbARQ=" }, - { "Localization\\Javanese\\Strings\\translation_strings" , "r84OFD0SmodV4abyygiyDmwPcfDZTPPvZ5XA+sYHAIA=" }, - { "Localization\\Javanese\\Textures\\Game\\FinalWave" , "ZuqUOUgNV8tNZ0vzyn0ME2VOYbD1TuksAP900r94QP8=" }, - { "Localization\\Javanese\\Textures\\Game\\FlagMeterLevelProgress" , "bZUyDcbcLtz+uG7pnXncJEgBQn6dkE0HUuO0py5Qqtg=" }, - { "Localization\\Javanese\\Textures\\Game\\HugeWave" , "yNfz9nK3LRYy307H6xe9fbIkBM1WryMNkpUpX/AjaY8=" }, - { "Localization\\Javanese\\Textures\\Game\\StartPlant" , "vx2ZKMq6MPzgi/wQkTCHS3q2MKGfDSV/nR0Y6wcV1RM=" }, - { "Localization\\Javanese\\Textures\\Game\\StartReady" , "U/G1MHSRD5N3XYuLz4aj5DAnj2OSIL7lTLSakoTd8o8=" }, - { "Localization\\Javanese\\Textures\\Game\\StartSet" , "uX5YiWkb7Fh5TmEJAyj5llaUEPIv8HoIgtLhQ4cenMo=" }, - { "Localization\\Javanese\\Textures\\Logo\\标题合集" , "uAh1wGHTmqL+eelty5vhYB6aeXxyt0j4PMXgyDsWg6c=" }, - { "Localization\\Javanese\\Textures\\Menu\\MainMenu" , "OZ1gfSCjvhys6N8eeM0OZKX/z/FDLtX6HW3MA/UqgLs=" }, - { "Localization\\Javanese\\Textures\\Menu\\MainMenutravel" , "V7dmKMS/Ta7LUobEgFudX3hVXCs8GBulEYJUIkvn+do=" }, - { "Localization\\Javanese\\Textures\\Menu\\NewAdv" , "y9AUQwwNxsOnkPM5LY5DT80cQ/X6WmNsGmzzo1VZdyY=" }, - { "Localization\\Javanese\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "5nPBRgfdFD0RWQ8j26FXzQBN630hSr+VRyKXr/9ALAM=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "39n+opclWXQEDzKDrsg2r0B5ZtCx7eMcryp13eJvZ1A=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Almanac" , "MAucz/pmIdNnun4hLfp0PDrjESlsAZ/iL49NCYl6feQ=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "Fea3OWEPntAYCFCP1DK0lrqQByQTQJ7TNWhS1wRfk3I=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "xdoeNs/98lT4BKon8Bcwk7m1S+fGbLeHgZISD9qVt1A=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "91z8WbCI7XptpUtaN7mJ1BWz+0JNRMYNbDcoxzb7YhA=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "6W1spOrj4FB/SgOb8851XRMAnXoudOjNyl6z4Egw/rs=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "2MhlockgUB7+YVxv096GrbPItf5IVWtuAiv/o65Dx3E=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Help1" , "TrxevH4mjIf4iCFdUXk/Skwq7Asg1dxteTGzqOjQk6o=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Help2" , "s8i2Ca+iB8CGihGdlzqFxZ8PYO7tdm4ODH3GiSqIyMA=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Options1" , "JmwncgGiBynAVjnGkPd0EKXh+MYkUhbpy7H90MYnfTE=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Options2" , "FBzi7WpQje1t1uadDIjcDCwVe994I+ICfmdx96NqrM4=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Quit1" , "N4yS6t5+p52vU93MbHeLgFik9uureOGgJFL8G4FwKho=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Quit2" , "NPtds1JqdvoLtHiAYxzyeM4RyvcrcYLu1HMSnO3252g=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_StartAdventure_Button1" , "fIaIRMLy8g56ifWSPZmKH6CCQLia550aovyHGJIRUBQ=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_StartAdventure_Highlight" , "n0+5ijqYlRWC/3l2JSqtZPnMDbFp7TLSeZefohaEqg8=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Store" , "6JxQIrwb++ekCR47/hQKyahxmMt0ntFDa8A6qETcs3M=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "8SnyShbhGdphCX4dqfWjuoQIZvlnpDsT7a9mrS6RLEs=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Survival_button" , "/mMMNvV2V0X7oSVyKWhLryEO7Bo+eCgDiHozjd4I3/I=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Survival_highlight" , "pNX/YY+qV9RmVt2dcXLTZ+magOEhQNxtxYCUQ4a+S4A=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "IlFeFIlDFW5QAMWwRrgwt9kvStq7pJXNYnWfa3o3zmo=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "aHyZVtF7SxvC8i5Cvj6eARj4+YrB64TZ5njk9whfdgk=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "aJ7MmKsDxiIuExTTP+b26x548jJC9PR2l5An3/Xdlv4=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "5G3x/AWLBZY10RKKdlll4yD9YFzTNqke1GJuTQk0nCo=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "S6vvweA+KTaP0m90S3lu8oitt0/kfc/XasW740bkeGs=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "kgnex+VH/1wjfCM0gLUPRQ16Nb/jeBOBwz7Uz+tBrKU=" }, - { "Localization\\Javanese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "cHufQXgZze8hFwdw5M1gzd/kgtMrFQGIaforUAQeVUk=" }, - { "Localization\\Javanese\\Textures\\Menu\\SZW" , "kJM+ICVWg9rIbVDkhX63KdViIjnVYH4IGC8rqvmnAQI=" }, - { "Localization\\Javanese\\Textures\\Menu\\thanks" , "UPSssI3shIEOMFKQKhRALT2SHpmBTMgHmxpBbRJmPIM=" }, - { "Localization\\Javanese\\Textures\\Menu\\travel" , "s0AOJiMph12ZnPEYyXZ66EbfBHl8xlwhHh70nlW3kkU=" }, - { "Localization\\Javanese\\Textures\\Menu\\钥匙经典" , "5VCHANL1SD1xv+QsPdIDIGeq1Ksw2Q0O9Z5fH1ilCBE=" }, - { "Localization\\Javanese\\Textures\\Particles\\Doom" , "OE2mWsoMv7SEqRWQJWzJ+A/5gQXeRtogIph28cHJyLI=" }, - { "Localization\\Javanese\\Textures\\Particles\\ExplosionPowie" , "P2jrh7tf2d/9EWHoMScwpkpm9ZSvd+ZACEJqSzen7lw=" }, - { "Localization\\Javanese\\Textures\\Particles\\ExplosionSpudow" , "PXVMwcdcn2pL3mN7O3JEMFvI78XGb/POvZ3Sh26bbOw=" }, - { "Localization\\Javanese\\Textures\\Particles\\guang" , "fWG+wb2CZqaSsaLhiscKXHpqWiyG7Z2qXtHhBzumlSU=" }, - { "Localization\\Javanese\\Textures\\Particles\\Sproing" , "+CRy8k+5wzAdG5wVPM3sTYny3hCmPURD42qnTOIv898=" }, - { "Localization\\Javanese\\Textures\\Particles\\SunExplosionPowie" , "ifNQQNn0abUE11stJvwS5wZQm2Y9kPhQx7bXtF0EnCs=" }, - - { "Localization\\Javanese\\Almanac\\LawnStringsTranslate" , "5JgLhxOJA5v4dmZIlUuj5IhDJAijMQov7xNm4mhcKTw=" }, - { "Localization\\Javanese\\Almanac\\ZombieStringsTranslate" , "XpsMKQ0tZON0zeC0NAjZZqC/4SgSBFieYpDBMit2WFo=" }, - { "Localization\\Javanese\\Almanac\\AchievementsTextTranslate" , "g+5/ND/fdGs4fX7mX88GFp1vdI5lAicu4UcOhjLWoO8=" }, - - // Vietnamese - { "Localization\\Vietnamese\\Strings\\translation_regexs" , "jkmDo2/shz/L1entNc/VMTHSwITTe1lDSWkXwu21HY0=" }, - { "Localization\\Vietnamese\\Strings\\translation_strings" , "DEcePF0ruVJLmtTWVL6cgpg6R14ha8loB7E1sEf6r1M=" }, - - { "Localization\\Vietnamese\\Textures\\Game\\FinalWave" , "Ut9Z9amTQgL3Pdcza22zTjKANBKZ9iGQGwuiV9yia90=" }, - { "Localization\\Vietnamese\\Textures\\Game\\FlagMeterLevelProgress" , "4pMjKlDTK/eLQtYWZy1yjgAsDizgOQLZZcA6lYdDbqA=" }, - { "Localization\\Vietnamese\\Textures\\Game\\StartPlant" , "Vu7L6nDEl62NmhpQF+79hPc/Os3iJogr1N3DGUPv/Nw=" }, - { "Localization\\Vietnamese\\Textures\\Game\\StartReady" , "z3YlFfGkneA4LSSqqtlpnwNLJq3h7gwtl1ZvcxdgUxE=" }, - { "Localization\\Vietnamese\\Textures\\Game\\StartSet" , "snzA81WMzGmssVb862bG95eMRmDGn8t3tBEtj0M/OL4=" }, - { "Localization\\Vietnamese\\Textures\\Logo\\标题合集" , "xqL8p6JTWYSMJmWxxOsA6ToA9bdeA1PrFSWsfarm2uw=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\NewAdv" , "HgyAiO6/YX6jfqzcfW08m/EeXqFRsaGQlIv09U3kHyM=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "vkeO+XAUZURjHfog5dqM2EWmx4Q/Hkgm2lxKWWuEn84=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "bmw+kDo75C0h/xHg7U01xvGQqzjHBjgOvYjuZDLdOU8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Almanac" , "1gsF1/5A/Wwg7X7NmYVvJi3vaavEqbAMDy96vLCElf0=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "Euqlx4l5PGWP/VDni40lyo6XONI7UH+jjT9NGbIdaSI=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "anKXed+ijHNf2PnlyRHOdnPNHujFsjwehPuS096dDS8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "Fva/m+l9o97nj/niIO3eXfVP+I9hCK+Mhm0nrB/ZgBw=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "wSZkmGAeFCCEj0US6ZJaJACCwRuj6Tj5JNirlbkmCcc=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "NFH6cDojgh8QeUFF9EMBi+yBVCj2Pi20Up1qQH3EycU=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Help1" , "Y3CrU9B+tdD80MgmCUoWmpvmByahXIvI5tzUjPZZlQ4=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Help2" , "lYbzNUtHudgFvpoEaIQZ420RBmFJmxjrwNmVrq1V1KA=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Options1" , "PmdPi4VkTI/Dlal5s82jQ3xay2F9xA5n5pfcz0ad4bk=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Options2" , "31itkFsIYHeaNMjwiHXiOkeC4pA4onVejVbvMR9dhS4=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Quit1" , "AuhF4Z+C9UE6huKECVBDMRSs1sUEOCsX2yJRPFJ19do=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Quit2" , "JsbRYVZk+KV1870Nt8rlWb6Le2YLKXU8Gc8NXMCfg3o=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "GXlUgJI9mP+YYqwBU/e+0LeFh9VsCgRLepK3yYLd5JA=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "U5t2Fhn17ahAzH7h+nkgpEpEVf7qBBoGfHd3d9tYnVY=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "2xGQ6lS/KxIwjmv3iu5cWBPGucSLBqcT7bdp8KCDC80=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "nMB8AT0nDCBG0aHPxmTKIvVNMvhVm8wli2zU22edZR8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "QhWvlqpFpjF0GYW3LTRaF7hjogvFH0CjtIGZNS1Q0rc=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "2PjsUHvJWhcAdG/Wq6xydshRL0ufXkj61IQ1QBnAcjo=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "xQ3G4RgOY+/pR4ZjmPkY92Ei/qURxbSmXF3dEGpkuYU=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\SZW" , "0Rfvp6ZzoeqC0CN53g7VD1VjqTNY6pRbZyfJhPk16s8=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\thanks" , "9+56vhTLNddtzyzVQfaKvf7pUwBwQQYYleVVh8j2P2Q=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\travel" , "Vz1TbErS6YBlJK3xGVltUi+M2wLINDwv675IfMYK774=" }, - { "Localization\\Vietnamese\\Textures\\Menu\\钥匙经典" , "3vVVP4TSpnN+GhcKIorkVC6NiSXU90gQUhUFkp5JV9k=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\Doom" , "wGdj1YC7DgQ9gO+0qOUM3GvWkZvmSmFcdZPRuC0xWg4=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\ExplosionPowie" , "NLVTBUV+qnJSN8iDyN0/X5mCLuMf/gNf0eqQSNgyR/4=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\ExplosionSpudow" , "87XKk/0oU6tGGyCe1/2KzBHucjYc6fpEl6C5MQGz1bI=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\guang" , "4hMjrrMrOOkLgHlLzuIieJGzwy/SzmY/JI6KDKxA9EU=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\Sproing" , "Kt9TlS9eDVObwbNh9iy00bB5WjXufKPZv7i+mxUG9mw=" }, - { "Localization\\Vietnamese\\Textures\\Particles\\SunExplosionPowie" , "DGdHTnCA+6ovq0sE5TwBEayKAuF5cb+MEOv8xX5hmFU=" }, - - { "Localization\\Vietnamese\\Almanac\\LawnStringsTranslate" , "CM3FWxA/MKhudP9bRjsTNY0ozLJ1K0nOVs/awEvOrnA=" }, - { "Localization\\Vietnamese\\Almanac\\ZombieStringsTranslate" , "yFHjQbsTxaw621AXaHzJLDulElVB1YlKI+nUxvjJuus=" }, - { "Localization\\Vietnamese\\Almanac\\AchievementsTextTranslate" , "Pyeukawk/N5uiUBKDs/erVzIzA+uqZZhtP2amyCKKdY=" }, - - // Indonesian - { "Localization\\Indonesian\\Strings\\translation_regexs" , "4hmtjqn06LLDtClO8mlg13blxXj1hPwWdaSjygj7/2I=" }, - { "Localization\\Indonesian\\Strings\\translation_strings" , "qc4bxqtaJeZBI6nxL4jnf+VpQu/xpJKs/89IYfDcNC8=" }, - { "Localization\\Indonesian\\Textures\\Game\\FinalWave" , "EKjMvK+krWb8AEnvhL02z4ETUR4GEbtEspU8xTL0XJY=" }, - { "Localization\\Indonesian\\Textures\\Game\\FlagMeterLevelProgress" , "bZUyDcbcLtz+uG7pnXncJEgBQn6dkE0HUuO0py5Qqtg=" }, - { "Localization\\Indonesian\\Textures\\Game\\HugeWave" , "kHSyCA4DjKiacui1Z2Vij0VSKr3UqI7FeiZp6MiYeRI=" }, - { "Localization\\Indonesian\\Textures\\Game\\StartPlant" , "lraovY3Nx09xinbn9lF3g5OQPBmBzwkCS9EX3PeKrKA=" }, - { "Localization\\Indonesian\\Textures\\Game\\StartReady" , "WwJG+GIHjqZ/3PWlt7MmATmn8gegir5JdWLHSDOyONk=" }, - { "Localization\\Indonesian\\Textures\\Game\\StartSet" , "wnAy+G4MWwVp11UL9OovumPhS+bFoIw188yt7djqd5o=" }, - { "Localization\\Indonesian\\Textures\\Logo\\标题合集" , "i+dOUq/gv+NF4PbSsElYnsoi8WnrHFgTMCA+lEXwH9E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\FlagMeterLevelProgress" , "CzuBH4sm7Nid4zloZF3i0bpNcA9ILPhrmOxVYI4IggA=" }, - { "Localization\\Indonesian\\Textures\\Menu\\MainMenu" , "OZ1gfSCjvhys6N8eeM0OZKX/z/FDLtX6HW3MA/UqgLs=" }, - { "Localization\\Indonesian\\Textures\\Menu\\MainMenutravel" , "V7dmKMS/Ta7LUobEgFudX3hVXCs8GBulEYJUIkvn+do=" }, - { "Localization\\Indonesian\\Textures\\Menu\\NewAdv" , "y9AUQwwNxsOnkPM5LY5DT80cQ/X6WmNsGmzzo1VZdyY=" }, - { "Localization\\Indonesian\\Textures\\Menu\\options_menuback" , "OGZ6SNFo8RbpPqWaO88qCzPm7r8Mv1WzUee9BlZDwFE=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Adventure_button" , "IZnCr7uu/muNeugOXMVymHMd5wJ+nfANiohpPnXKleo=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "qiAu0iMOKYUs9XDLgZ7LgVd+KiR0Xn0t0jtVNmjl2Yw=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Almanac" , "MAucz/pmIdNnun4hLfp0PDrjESlsAZ/iL49NCYl6feQ=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "Fea3OWEPntAYCFCP1DK0lrqQByQTQJ7TNWhS1wRfk3I=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenges_button" , "BTltkx67dDWnRIL/TaXUKcUYiQFT01zF0IicWldAV+E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "GCd2qh/rfLbLserDnSzPekRvxIS6W9q+FeNWfkEqTcg=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenge_button" , "6W1spOrj4FB/SgOb8851XRMAnXoudOjNyl6z4Egw/rs=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "2MhlockgUB7+YVxv096GrbPItf5IVWtuAiv/o65Dx3E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Help1" , "F3na7RpFGvO8bF5lvQbvJanJQmUqPEO5+vkKo4Cx220=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Help2" , "imagpCvSovqC6SkeR3BAJqH1u9ssin0C6jwIhx0wGpc=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Options1" , "DMwpZW09/p4CFkgsAqMPExEXzQYOb1TAWKURN4LOYc4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Options2" , "s6wcmSMPErvL/4QuRE7ZYWtCg6Nl6A3FeVL1pK8cOrQ=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Quit1" , "fNNNbsaNEYP3bl3KwlypWIDZNCpm4wVDYUDsjzBw1zU=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Quit2" , "Qm2506IHHfwXKMkqS3gS39hjjZnV3AP2IHJlOrhYpCI=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Store" , "6gVEuBsk1/udDoEATm2tgmWMCkdme0+oxngcJAKrmP4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "grdusCpWrRqZfBuNB1Dj7bKFzyQk3xFReAqoAEKYFhY=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Survival_button" , "0DWLUXJ5RYKci+loCThNfHEpk7tKV08vifffcK8owNg=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Survival_highlight" , "AXW4pkVR9twu7/SJYvqScPeNswIoefGCBJXDf7SsXFA=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "Q24q+w0RftOK+HcQTDvjG5xDpIEYMdecJyGTNGoh9+U=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "S2IYcVmWghuxAVeaV67EnZ1ZjxyLuEmqLRhknUAQ9dQ=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_WoodSign1" , "aJ7MmKsDxiIuExTTP+b26x548jJC9PR2l5An3/Xdlv4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_WoodSign2" , "h5NWhUBnM+ro6J6xs7UDPEmT6055qZP49ppF4wIxePw=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "tu3PiZyJK6CcwaV78aQpqXcE5aLaHA9rPpgzMAbcEAk=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_ZenGarden" , "MAMBtit0msOsty3zZ1yczih8NsF+4nA7fw7BkYMjCk0=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "B17BIhLDvt00Opiag4nqg9a6SvClVr3LlCjzMLI00iY=" }, - { "Localization\\Indonesian\\Textures\\Menu\\SZW" , "OWT6LXWuE7Tr3nH6wYMuUfh1+K9y4TRqtb570pm7veU=" }, - { "Localization\\Indonesian\\Textures\\Menu\\thanks" , "APJpvesl3m2b09ru53RG0MJWcbpia+teT/SnPrnO55E=" }, - { "Localization\\Indonesian\\Textures\\Menu\\travel" , "YP1AGn+G7iYrZ5NQy08TbVxMjFfH7HzdyAMJtwEQ5L4=" }, - { "Localization\\Indonesian\\Textures\\Menu\\钥匙经典" , "5VCHANL1SD1xv+QsPdIDIGeq1Ksw2Q0O9Z5fH1ilCBE=" }, - { "Localization\\Indonesian\\Textures\\Particles\\Doom" , "8vtJfi6ngoltUJQbyCLvp0RnoRZbbVN+piV6lwR8KgU=" }, - { "Localization\\Indonesian\\Textures\\Particles\\ExplosionPowie" , "mmL5xtnIBT3ffswqXHMiz0rXmbj85rCmiWGNnzQq1oM=" }, - { "Localization\\Indonesian\\Textures\\Particles\\ExplosionSpudow" , "PXVMwcdcn2pL3mN7O3JEMFvI78XGb/POvZ3Sh26bbOw=" }, - { "Localization\\Indonesian\\Textures\\Particles\\guang" , "fWG+wb2CZqaSsaLhiscKXHpqWiyG7Z2qXtHhBzumlSU=" }, - { "Localization\\Indonesian\\Textures\\Particles\\Sproing" , "+CRy8k+5wzAdG5wVPM3sTYny3hCmPURD42qnTOIv898=" }, - { "Localization\\Indonesian\\Textures\\Particles\\SunExplosionPowie" , "ifNQQNn0abUE11stJvwS5wZQm2Y9kPhQx7bXtF0EnCs=" }, - - { "Localization\\Indonesian\\Almanac\\LawnStringsTranslate" , "E/P7S2V3xWCnG/DZfW8shpV1ieJUvPf07U/TyJ9LPok=" }, - { "Localization\\Indonesian\\Almanac\\ZombieStringsTranslate" , "twHrylFgPp+RBQ6l10+QHIxgs/mI7p8lRC9etNsAKSU=" }, - { "Localization\\Indonesian\\Almanac\\AchievementsTextTranslate" , "eRZlZgKN2EtZV9BWYOPHPZHBuhLiHzYC3f/wDcwFnR4=" }, - - // Russian - { "Localization\\Russian\\Strings\\translation_regexs" , "6ASIdaFZLLTSdckI4evzynZY3CtCfTuG/BS0ENft/9I=" }, - { "Localization\\Russian\\Strings\\translation_strings" , "mRs9Kx+QyCO5PUScMWyr1P1f3cIMscK0pWjVP4iinL8=" }, - - { "Localization\\Russian\\Textures\\Game\\FinalWave" , "IOhfHr8EBtJYfpWWtELBUtmJNoxv1TdBFrhEfFPshVc=" }, - { "Localization\\Russian\\Textures\\Game\\FlagMeterLevelProgress" , "bGKyk8MpfsaYt95/NQ8kboA0Uxt6ay5PoL0l0RHZ/+M=" }, - { "Localization\\Russian\\Textures\\Game\\HugeWave" , "w1dq1brhzL0eGwj9GJS0vQZDgYVbWjDxRBx60xToKBc=" }, - { "Localization\\Russian\\Textures\\Game\\StartPlant" , "PIOtRaWW0ZdFMNBgyA3Ca4H4rMSLMvfXFvaY/ZZ/oEo=" }, - { "Localization\\Russian\\Textures\\Game\\StartReady" , "zUT1GiCxMDAPlxCyuYPmmztGxDCVdtjiB7C2+Qffpkg=" }, - { "Localization\\Russian\\Textures\\Game\\StartSet" , "ut3aHNTGhzVBNlvHTFIuyj+6SED8Pu9rOpIWKI0V8MQ=" }, - { "Localization\\Russian\\Textures\\Logo\\标题合集" , "qocM9muRdJBmjrs9yTHTknMLWX27aPY7AdMMdLIzd7c=" }, - { "Localization\\Russian\\Textures\\Menu\\NewAdv" , "PIDRlOMsgrLxpp51rWt//B2cBdmNKKEYTvuMUN0wFvI=" }, - { "Localization\\Russian\\Textures\\Menu\\options_menuback" , "HZfWszRsYXntilq2RRoQg6cYPNF7Api0ppAHYJ46wy4=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Adventure_button" , "UGbQ44kL1zXnsJcAr4vrZZu0hDSTEbtdKM2shtebg4w=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "drv1AX+e4D/mA+1IqymPQ5RllTfRatuI+a2/2YJD+GE=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Almanac" , "BdotPdigckPxfrORVW5EJucskfLdK06icpH+Q8mS9fs=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "XoTbNX+410xOdf6MX3BZiVlzD3MsWaqpF8KXZyxduXo=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenges_button" , "pcno2qw/DBMHX3VzGUHErYSAiQyGWseDJGjwHWZI//w=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "Bi5w/0q4C9CpWCjZGLLTHQek530srsp0/Kom4W29IG8=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenge_button" , "kfAEG09yl5h6dV0vHmPl6o72+Wu3kzvBXtyw62E1puk=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "VvP4urY9+U0EPEa19fByOzOX4yKuNzD7eLTuxlEBW2M=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Help1" , "jFKhKseKeZ+y1b1lLYBqfsM5GRGv6JVUa+Jo8sb9p0I=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Help2" , "c1xqKGKKyJhznB5vZpT8FkiSD/luKAEOVH7ZSr/rpp8=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Options1" , "BirUdLzY2B3sedbxZ1eqTwSo/l2UW+obPk+oZhhiSUw=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Options2" , "SLSw+97otiN10CyE6nX6QqHmiOjQR8aYuBUveZ8Lx9c=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Quit1" , "B5L16JYjqNJSD5pA9vhEq/C4gzFkz7VYnzcORjOytxA=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Quit2" , "+7s74lMPYaJu+U+572MRvmOolp33Q5xmu/TMOmRvlZc=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_StartAdventure_Button1" , "f+NFEqcMvJj20nysVA7mlGmFkJZAmmef+Gi8yUvwses=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_StartAdventure_Highlight" , "f+NFEqcMvJj20nysVA7mlGmFkJZAmmef+Gi8yUvwses=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Store" , "N+M6I8pUzeEaetRaE1Wjh2j4g7a1uwrBnqR+7zbsxxQ=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_StoreHighlight" , "QiFOWjJqdoRZMbXfTuKJwTdm5a3E6vm0rGkXwMaMCYs=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "ta02SAcbm7ErKiwz4vpZzrtuptJComb4X2DAwx8GiJw=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "28+kPzJUSqm5KKrUlA5GOAy5+q//1bknEniSze/Bb6M=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_WoodSign1" , "8CV21tQ/HxANofuuTatQO1Ul8zXQYwo1rfzU6iozCiU=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_WoodSign2" , "bG6o/CpJPm9XBfWq/m3f1cquTAOr5fbwRNtx7XEPcqg=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "v7BbNSzfQIVYLVrYSOIO2i1NbplOiQjYyQcR4rR8OJw=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_ZenGarden" , "WsYKxhTcuqTFT9jbeOne+W3/opToTbzZFnq7uGulJfQ=" }, - { "Localization\\Russian\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "aGRi1WWchHxPisQdbkX9xmsALia6I1jo8JpysSHb4BQ=" }, - { "Localization\\Russian\\Textures\\Menu\\SZW" , "eaqxoi1/FlIyUCfEpJnFgl1xoSwqP1XRHFIaobQzD1A=" }, - { "Localization\\Russian\\Textures\\Menu\\thanks" , "Juq3A9M9V/jScckNECv+JB2U7W+y6YivxELZV/nN3JE=" }, - { "Localization\\Russian\\Textures\\Menu\\travel" , "8lXVCidvQOeh8y9kG7xN51Ch9VyL8ThZah/OI1RxN6c=" }, - { "Localization\\Russian\\Textures\\Menu\\钥匙经典" , "wwcruWy65C8iXjA+SY1dvx/hrSQ/KvVkX4OOOZ6lS/s=" }, - { "Localization\\Russian\\Textures\\Particles\\Doom" , "OWddkj4pnY9xmSIuQIL0vb6F091j8UY2PEC4tZ6P3p8=" }, - { "Localization\\Russian\\Textures\\Particles\\ExplosionPowie" , "KbPmKOHVvOH9njUEBWb6SJPEdGOLbpAG0CpliNyUefA=" }, - { "Localization\\Russian\\Textures\\Particles\\ExplosionSpudow" , "k1C6TaoPE0ZRw79UAjDwlRaLjf4Q/b2N6JM9SN1I5fc=" }, - { "Localization\\Russian\\Textures\\Particles\\guang" , "+Xd4hpZk2VEhgHr9HATWRhjEbg4WlmXkh5DA+gXevIs=" }, - { "Localization\\Russian\\Textures\\Particles\\Sproing" , "i33iY8w5LR7Kdqf2vVQ7UmE9SrWZ+5AGepTy5QINyHE=" }, - { "Localization\\Russian\\Textures\\Particles\\SunExplosionPowie" , "BCXJtvwnDvIzc7cFnxN3wxR7t2o1rqa6hulW54PJLrc=" }, - - { "Localization\\Russian\\Almanac\\LawnStringsTranslate" , "NwYjBl+2v0brh38S4AJpHHWDK/1hCJ5VVqY+Cf5jYkU=" }, - { "Localization\\Russian\\Almanac\\ZombieStringsTranslate" , "ejVysCnTehbMFkjAXN7n7NqWespRHmv5cXYM0hMlK0U=" }, - { "Localization\\Russian\\Almanac\\AchievementsTextTranslate" , "ST45TjReYXrBOfT3r2YeDakJm1SN/jtH/5z0Qp6Ms4c=" }, - - // Japanese - { "Localization\\Japanese\\Strings\\translation_regexs" , "YXerYuvclj9na6pQOefuVfJVER28OAb2EkG/kMLqrGQ=" }, - { "Localization\\Japanese\\Strings\\translation_strings" , "hXi0RiHTbzptiAHqko0CRwDDWW9zoRSdQpOXpd4U3BI=" }, - - { "Localization\\Japanese\\Textures\\Game\\FinalWave" , "tyOrI4m+7b595JZufjhesTYXqiSWuNg4Dlm0fN/ZzVg=" }, - { "Localization\\Japanese\\Textures\\Game\\FlagMeterLevelProgress" , "J8Gnugo3MCdQCFNaw91nOWKiYEJltD7EpScPvgJjVdQ=" }, - { "Localization\\Japanese\\Textures\\Game\\StartPlant" , "8+rIjUEkUtyYRsu9ZHsM6B26fT87U6BYHtjhef+sZSc=" }, - { "Localization\\Japanese\\Textures\\Game\\StartReady" , "G0wx/YkdgSZju5xUluqrq554u7ywOGxRPjQwfEEHwSo=" }, - { "Localization\\Japanese\\Textures\\Game\\StartSet" , "4jSRsYZN+mA3pMZQtjtxxo7z8PYpjyM4Ja1coeOERmQ=" }, - { "Localization\\Japanese\\Textures\\Menu\\NewAdv" , "9CgysaFPLkL+h3CB5zLiUxj7Z7xSZCTQKFr/pAvjW4I=" }, - { "Localization\\Japanese\\Textures\\Menu\\options_menuback" , "KcUX62UuqoR0UKas1yijEQP56fWbagBIpSwFIr4df+k=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Adventure_button" , "nqJjYCKTGCWuIHwSSRDpsJkPK7quA/4UgfX+EZsadsI=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "/oarc88nswGdHzRI7+ol5XUH8pqEudTJ/l4mtWr6ugw=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Almanac" , "GsHU22IdE1GMx+6eDcJoQ/+LJDJwLG3sovrPion7/68=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "7aHSIocT5JbGVTh7addi0+WrON9G6LPv2xmuDy/tPRg=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenges_button" , "ljfdR00zwozWSwI85JwzGAGQgjXL1sCNpr/+juvcx0M=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "hkii/10+OmfcVLNOB3ATpI5iHpPhw7mgiVRAs+kDsHc=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenge_button" , "tf/14faCSFk7b9vFFn64FAAUpLGZVmfInI4K0Qmx9aM=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "1ZC0zr0P3WkXzKvZ17YwkLID/6YYdTx9PZQimMSos6o=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Help1" , "8OR4iqxkdQ3PsxbobY+JaN/w0lXNc2A+Kbec/VJ/QVY=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Help2" , "i60mg9eK5WzjUA0iZfQtvDWq7HImRV14xNqfLzFmELo=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Options1" , "YJZBgCXj/ZH4F8zPo+t4dAGmGMSiDAcybs2xuu1LTiw=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Options2" , "yIbcIgBPjVP3JKNiF6dBPdJ90Yd+fKC+99KUjTfHOqQ=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Quit1" , "hkDaVb8qUDLKPp1MIyGY6x4teZAVev56kjJ7KihPMss=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Quit2" , "Tx8u8J/YpKF0lEd436EJfOMzXVzSWlsWDHBh5s73MU0=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "hn9D4J0aBhdrM23YNrZJXd2qbQrePLru5gCYBR34xgo=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "+RQ4US+xJ23ieUzvO3sBzHJBEmCz5wZz7Gv6UmFjtdk=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_WoodSign1" , "78kL8cLZGoQdNcZjPbXFAkhN9A0zyCun8ieAOUvva3k=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_WoodSign2" , "Fkn7CvIOoeB8QrUUtj2HySgUg5ZR+zvry6jythPN2BY=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "S2xZmAOn82/7uJ0q5Ej4tc59cheMme02Eb/CBjQjULI=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_ZenGarden" , "AE/8V2mkM15VErDDjg0g497fF4S3GYdSDRi9pDq0S+Q=" }, - { "Localization\\Japanese\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "KiN9KORVPhugq/laYeo+78CNeNW3CEVpVmi2J2WTNT8=" }, - { "Localization\\Japanese\\Textures\\Menu\\SZW" , "4jkQn+T+/oceMqVHefAyo7G/8LQ/3jZuF41rnEaFVy8=" }, - { "Localization\\Japanese\\Textures\\Menu\\thanks" , "aoTr0qV9HPJLz4WImY9FpU6mbB6Jy2WfOeXULgDWdlc=" }, - { "Localization\\Japanese\\Textures\\Menu\\travel" , "MwowpcnQ4BXqoE6I8n2iP6ZzmVSMNaUpyBkPIkaI2hE=" }, - { "Localization\\Japanese\\Textures\\Menu\\钥匙经典" , "FeQQRbKmP9uOZ37BtcHNjWH46zSe1tCrexTrnWcKX50=" }, - { "Localization\\Japanese\\Textures\\Particles\\Doom" , "x/jlt63Ryze1+Dhjm9A1M65LkwrpuN0tTwn6wq7OtPg=" }, - { "Localization\\Japanese\\Textures\\Particles\\ExplosionPowie" , "uEPr3YXyamejZGcJ9QYxkQ6GOnqK3Ddv5HsgBJCIyl0=" }, - { "Localization\\Japanese\\Textures\\Particles\\ExplosionSpudow" , "4wZzRVJGrKmZDuJXuA8O/0mvLJS08DrhfWiRk6Arb/M=" }, - { "Localization\\Japanese\\Textures\\Particles\\Sproing" , "pKet1LadsHBdq8mOR3IOtOngBHyfxdFLp2hipu8I4ZU=" }, - - { "Localization\\Japanese\\Almanac\\LawnStringsTranslate" , "D4riwyc3qc5fWLhnspeXCgCip2cb5k1/t0PlEPJ7wdY=" }, - { "Localization\\Japanese\\Almanac\\ZombieStringsTranslate" , "AzhgHGtIesVnO8aGJnpnY/C8+5eua2Z3wN887spfz7U=" }, - { "Localization\\Japanese\\Almanac\\AchievementsTextTranslate" , "PAk0G69Abd/8mqXxsrg1dChYjb3/Hmgp2UD9fqVnqXw=" }, - - // Korean - { "Localization\\Korean\\Strings\\translation_regexs" , "zWV/cHF92F+GrFwlSkGXyep2jqBDG5LAiGwyDtcG2rU=" }, - { "Localization\\Korean\\Strings\\translation_strings" , "qXdtfjxdZcK4Oe6ptsZd3Vg4rIavfM06ZkmMfmR8G1M=" }, - - { "Localization\\Korean\\Textures\\Game\\FinalWave" , "7I9i/6CVcPOhoL2n3/NUNOedbaIyQqlsj5U+jVQauu4=" }, - { "Localization\\Korean\\Textures\\Game\\FlagMeterLevelProgress" , "yMpBQDYecmFimlzSnsO8vdyEPp0Q6O5lAg0DWFS1m6M=" }, - { "Localization\\Korean\\Textures\\Game\\StartPlant" , "yGZNl/ELOvk/XqMp5pIhwrSLkAa/T+2pWcYb/tVC8CY=" }, - { "Localization\\Korean\\Textures\\Game\\StartReady" , "aNTSN8/FwAmu63eHs7wzdoDCnw3h3KWQ4SCiPtBoTdQ=" }, - { "Localization\\Korean\\Textures\\Game\\StartSet" , "PcrGZLSUL2xrPGTMzZJBc/xC05UdlWoCeHP8vNm8BjQ=" }, - { "Localization\\Korean\\Textures\\Menu\\NewAdv" , "LidoBW/vXZhokFRjg8MRy7daY4wehQ9vd3dBLwTsFLU=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Adventure_button" , "XvILct+pOLn9Ke3VvtlZPo4Zpob6wgAaNwb5w1+i3z0=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Adventure_highlight" , "WTyEd+cIWl3fBF1guKAQuMvDdMDwFnsgyZXoklVRTdg=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Almanac" , "7DLBjkU41YWjh6up42n+2DU+UU4jzBcuCyIjoIQhK1E=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_AlmanacHighlight" , "1oUnvwRL6Jr+AwwXJKAB/jcmpWl+0UP69js6vIKZ9uY=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenges_button" , "qoPxgGKWuHKCg3pEmvkauWfmXFZWR0spWcoK6AvLysc=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenges_highlight" , "840p+IAAw8KPwkoNmvcWcOWwhpTzTtcLixzWr+MunS0=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenge_button" , "FwlC3AOwWWeiqereusDpkRatqnKKN3c/xq5iPAhVo5Q=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Challenge_highlight" , "RZPSyMMXOr7W5aOWcr5xSR9XiANkWWVk6/OUnxxpUpI=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Help1" , "Akybqv0glw81aMYpGoosQ3PR7Ukhq+cD+ZlEUkLC5Yw=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Help2" , "6RZFnrYjpZM932niXc1qmRtAJm97GlDHzh3Q9c1u5b0=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Options1" , "D7hYM4ZPRbA395EUkLhG4jf7lfJqSUalp7oZJQ9/BEs=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Options2" , "1Z3SHvyiFsK7Wy9I2tFONcVYjF50Ho4L2+CbePFqng8=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Quit1" , "eD9BNRKQU7qei+eAsCSIidMwvwEhuBLPcpZkb/Q/Ag8=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Quit2" , "scNdtWjkMrgtwBdXiS809HfOY+2+ycPqUAgH6RcFOfk=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_Vasebreaker_button" , "QPWZp3PBXeJK8y9Pu7euFoRNVsywdr5tCC6gOsKmlL8=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_vasebreaker_highlight" , "VGJtLoUZ4+EYlQUMHSOAUFYPwFr30w5/NLyl0G4Ba2Q=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_WoodSign1" , "CPf6iaNv3ftvdOMQwm/gJ8hXE/13KeS+GHzEBl6DrpM=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_WoodSign2" , "8Lr0ONZOInR+ZHz9ZQHHdr6e4jkARbxkDIm181Q/yWM=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_WoodSign2_press" , "8JALSm+TKjNzIAtOd6DXJjkjc0bqEBXhPqlTO6sKZ0c=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_ZenGarden" , "b8bJJeKpQJhesrxy3c3JconWq1RJkMwkOBOi1JcKkUA=" }, - { "Localization\\Korean\\Textures\\Menu\\SelectorScreen_ZenGardenHighlight" , "CwZAzOBJFFY9AG2tvPN58JggPNNEws9zEbcgMlsWEpc=" }, - { "Localization\\Korean\\Textures\\Menu\\SZW" , "ONrElpWA/7WkJq833t+slKToiieJtZhbz2dv2QSuQB0=" }, - { "Localization\\Korean\\Textures\\Menu\\thanks" , "HYnZf9x5uNG5tu5jga94X9+rILjt40bnKSR1qjkXF8M=" }, - { "Localization\\Korean\\Textures\\Menu\\travel" , "T/ngmCI6ilQ6k/pV2XZloY5OICc0bbKz0iwg/mcXpPw=" }, - { "Localization\\Korean\\Textures\\Menu\\钥匙经典" , "iO5Z+/6R8Pz1GoIh+TX5KWkCFJsOxfYYrMSV//9UJ34=" }, - { "Localization\\Korean\\Textures\\Particles\\Doom" , "FqBUBeIvzyyXL+cqO4Fi6CKI5gZW5QXfHYPTOYoeteM=" }, - { "Localization\\Korean\\Textures\\Particles\\ExplosionPowie" , "cuikfX+3LOtSw3EPB6DnjANO5bKkoYCMdWSm+StmW70=" }, - { "Localization\\Korean\\Textures\\Particles\\ExplosionSpudow" , "4pJ/gZsuKRsAbUL1YWsaaJC9NxrzhqUiQe6glK07ydU=" }, - { "Localization\\Korean\\Textures\\Particles\\guang" , "kh0dcDxOXgh8+Eq1TmKdJug5PdR+nzZrK5iS5Nkw7Gw=" }, - { "Localization\\Korean\\Textures\\Particles\\Sproing" , "WtzrUuUsjp/GmOfoHApij3VLMn+Tr5qUZ6GGqqhUyD0=" }, - { "Localization\\Korean\\Textures\\Particles\\SunExplosionPowie" , "3bSjOYpanuLnsl58oYUzOAXt94nony6Drq8qdpfRSGQ=" }, - - { "Localization\\Korean\\Almanac\\LawnStringsTranslate" , "KRMiSTM91FoCR9sTGJU6hvsh0+sBMyHfqXwTSSea27M=" }, - { "Localization\\Korean\\Almanac\\ZombieStringsTranslate" , "xHI2LAW0JSEZN010GZPhPB60N0Csfbev2Mk5RwWFYyQ=" }, - { "Localization\\Korean\\Almanac\\AchievementsTextTranslate" , "J4/ZjY7vFNvwsMBx5eIwP7syuLD/+D7OaTY+YbUnq6s=" }, - - // Custom Textures - { "[Custom Textures]\\Almanac_GroundDay" , "ruvrVDVaICj+5PzN5FIcLTma+GtTb2AuKkHA42jTVBw=" }, - { "[Custom Textures]\\Almanac_GroundNight" , "uwrsmHM/IFY1n+AkYYmgEhoWRoaefOjP6sQMCWLtJ2s=" }, - { "[Custom Textures]\\Almanac_GroundNightPool" , "MQrZAvJDWs7k0c8cQjeNp5WNfB1Yns54Wqib63Glhsg=" }, - { "[Custom Textures]\\Almanac_GroundPool" , "fgHaxsX/KUXzAuRTLE7itRtmjPJ8YPo01Sy6Y2O5XWU=" }, - { "[Custom Textures]\\Almanac_PlantCard" , "1Spu2IG3EoCLn0MhAwMxydN2E8xcffFVfnKGk0KowLY=" }, - { "[Custom Textures]\\Almanac_ZombieBack" , "PUxcz+EA7ehsPkyA3gsicvaANh+7vX56yKbrCNFd8cI=" }, - { "[Custom Textures]\\Almanac_ZombieCard" , "S3QeUIrxZ3BJiovEyHBz0AYIoVzT2mQ1JA5hN3Ke8B0=" }, - { "[Custom Textures]\\Almanac_ZombieWindow" , "0JHTUpc1HdZ8/s/4NVKnchFmyrUaXgTgv3kUwS18zKo=" }, - { "[Custom Textures]\\Almanac_ZombieWindow2" , "NA9+T0M/4BihrNsGQVQCyxX2IO8xuyIKCm1PT6aB/vc=" }, - { "[Custom Textures]\\CursorClick" , "cELLXJkEQM+ULhcuL3GXdJ6Lw9iJF0grx3NuSfI3iGE=" }, - { "[Custom Textures]\\CursorDefault" , "AfBSPF65+ZXswrGKH5NRB/b5oa4WR5vuIet3xQ9/hqc=" }, - { "[Custom Textures]\\plant" , "JqOyre0JXBHjvWqUafUaBEfym62ZVhte6sP68TDn4xQ=" }, - { "[Custom Textures]\\SeedChooser_Background" , "RBVMr9F/IJiTVV9G9iZyUQguN6c+fQGb1BUoyuAKbyY=" }, - { "[Custom Textures]\\seedfog" , "l4gO/839bvGY3zk1/JPHPrZiD5sqVq0dCnCflUr/ilQ=" }, - { "[Custom Textures]\\seedp" , "amr82tmtplngahLPlu4wdPlq5adTKqUMXZoZ9qJ6u1U=" }, - { "[Custom Textures]\\SeedPacketSilhouette" , "W6vow+euXzdwjAufkJuRtdaIEiEPmbeeOkOHiQBNmHA=" }, - { "[Custom Textures]\\SeedPacket_Larger" , "+TZxcpkpyz49vmlkTAYyohpQuneLwrw1eJdYpbN6wAs=" }, - { "[Custom Textures]\\SeedPacket_Night" , "0pv9hCIOuoj9wfH2FP18kNwLkYUz0wuxVs3zl3OiHC0=" }, - { "[Custom Textures]\\SeedPacket_Other" , "Y/xlegVxGFn6Dt1nsDAEFSnslM3lyQ6WyCSl7RfwA5k=" }, - { "[Custom Textures]\\SeedPacket_Pool" , "4m5EDn8xfUtrZ/qENCISIRbZVQEjgk9UN1//AelB1Tw=" }, - { "[Custom Textures]\\seedroof" , "z9o/8qUJkgtys4WmPRvCt/wJz056+0Fjvfvk6pHwbLo=" }, - - { "Localization\\Spanish\\Textures\\[Custom Textures]\\CursorClick" , "4sKy7/xqFJqS/HVR1jUgMNvcPQdv6argIePfdcRhoIk=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\CursorDefault" , "zuNjht1GXgF/fOKCnW7KnOOaccjHRDB9m6giJvkKz1Q=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\garden_new" , "siziOyP+M2D5mI5ugtsjNI1O+zKcRqlHBDGrnSU1EV4=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\Present" , "glh2PeOuG8W1jQBiX8Xh0/4owPMGxFFXdOIc2siZ8Uo=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\PresentOpen" , "9DQZ4GIEeqoATt6MA55HEvQrBueZ3FN9raMdqOIhOUI=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\PresentOpenZ" , "BORx+RuCJUu8FLzDqdZcBFKFzMDbKB0KDZIkk4SnEmM=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\PresentZ" , "3VQDMgCU5gz1uGzQzRSatXOHd50q9nHozgkicb9wEQU=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SeedBank" , "ffJswlQikAaPhUily+jKz59tjUUsysRTyPetub7pVw4=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SeedChooser_Background" , "Z3jzRdTSxhpLU9HqeYhcDz+CfP1SerwzYteBh2gEX8M=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\seeds" , "Yaqa1lY4mMxmksslr1WjcV3vYAwrcLT6AVVHEvHS6Mw=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf1" , "wAoIJKiNxAuEkhFW9QjUAXCbdQmq0Q5DtztG+1VWjig=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf2" , "hRe+ceHzLid2ltXXaJsfLg3YHkb0xSwvgFh62XqUnpg=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf3" , "sU5tHuXpjZGsDd0I5BMPmsHj0W4flayrCEhr36iudp8=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf4" , "UnezQl5tm4gUZ3DwYCzRM85siS2dZWuo0HHx09fc/LU=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaf5" , "a73hDOb3r3gZAgpklCB2EkFjUaUbKJBXKhGT3tYosP0=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\SelectorScreen_Leaves" , "ll3lRI+y441evcV9CJoFufhI5VQeC2eIew9AFSW8xEU=" }, - { "Localization\\Spanish\\Textures\\[Custom Textures]\\ShovelBank" , "DUCNzvvDjIp8Kr8Clyx4eWwApiHiD8RmP+W05Mre+fI=" }, - - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundDay" , "HqSlvHQOonZvcid0jFZAj7az/P8uwKXZMT4Ukwyc8j0=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundNight" , "qt947+pENaA91x4lYAYsNLcR6Xd6I1vNh/USyk45arw=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundNightPool" , "A92M4I2N2OfpN/y4R40ATVBrI2U+StgZQjIr0iVCEeU=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundPool" , "AmrvO/C5ggUeHr5+WOh16GWJ0jM1nXR+Vj/A87CRZ3U=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_GroundRoof" , "ftdvDcMiDrdIBIoOTcxU6b9qT+GmPEkH2+tG2HA8blk=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_PlantCard" , "1Spu2IG3EoCLn0MhAwMxydN2E8xcffFVfnKGk0KowLY=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieBack" , "PUxcz+EA7ehsPkyA3gsicvaANh+7vX56yKbrCNFd8cI=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieCard" , "S3QeUIrxZ3BJiovEyHBz0AYIoVzT2mQ1JA5hN3Ke8B0=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow" , "0JHTUpc1HdZ8/s/4NVKnchFmyrUaXgTgv3kUwS18zKo=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow2" , "NA9+T0M/4BihrNsGQVQCyxX2IO8xuyIKCm1PT6aB/vc=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\plant" , "Q5VaxJhSrv/z55FH7YmLBovhYV3zLux887J0IdOpwnc=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedChooser_Background" , "jnVWbr791bRlpO5CYQ5ZC2WPH4d7j8O4ODW41hA88nk=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\seedfog" , "fyjLtioDqCumbQuOl+4jgUYFqK+cATeOzoNl1qgRttI=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\seedp" , "8qE/ZB7wdjFq6bNr6jWeCsVhhUD+JWORmpXryejDmjI=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacketSilhouette" , "W6vow+euXzdwjAufkJuRtdaIEiEPmbeeOkOHiQBNmHA=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Larger" , "TtCGi5F02Qx/ix9OXY86bMNjHCdch1E7De9wMTp3JIs=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Night" , "3QSOoNwMue9tK30JgCea/K2pGDlDv+Ibhp0NKRoZHN0=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Other" , "7tjrV9SIzPaSEpMspdF7tKANXMu6ggeuj4XSy/UVACM=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\SeedPacket_Pool" , "U4zfEwx/0mUqIgUYvuQ10T+tWTqJ54V3RUJiA1+FJts=" }, - { "Localization\\Portuguese\\Textures\\[Custom Textures]\\seedroof" , "1W6A3m32iSQZ5WhJHK11tys1OQOvYLgdNGlUOe7wgnY=" }, - - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_IndexBack" , "S8wmWen4Za178Mkwwu8DJkKvvB2c2CRJbaRjIW/zvhw=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_PlantCard" , "O2UWyplpXK69pTFXYDSA5KiRyKAZ22LCDN71GIb5ZDg=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieBack" , "L91uR40W1iPLqBd+ouENStDe9RN+xUOZtbF048MiD1U=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieCard" , "3QvRtOtCpI6sqh26+Zbr9vTR9RB8oSXy4m7iS2snZUI=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow" , "+LHsQLlwsYWEVS11F+SustquGoxjbGiyrs58XwyeYMw=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\Almanac_ZombieWindow2" , "e51IJA1bz9dDEvmXtO6CeL6/M6KMXDvojCbTz2MtnLk=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\garden_new" , "WxH9rTrIHkmQeu0ALKfFuI6JvXo1uKQlwvgIc72+lhI=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\plant" , "ZkLNZASMXf7P0621AH2sFm3rbulCrs7otMLrrxiaqsA=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedBank" , "+5f20e56ArqQ3Mt2BXtpSM2vO7SV+mWOzIBalIEh4Ew=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Background" , "kjv++O/zFxvPVoObxFTLXsH2MIp3zae4UJ8zu8kVOhY=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Button" , "9d5FghH0XRShLwjivvcKtVqmlOQLZC/RqfT+Urv8PJo=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Button_Disabled" , "iTsQO62+/80kG4jELlTnB/AXA8wvQKnqCgvQS4pDVlY=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedChooser_Button_Glow" , "cFJCF740SGrFKt7c5OOAcRSVdW5ZZ6sBuE+T3JSwgOU=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedfog" , "JFjRJErflXFgxgxXXGHr6fjLaVIpoYSS0hlWa5Fi09c=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedlinkage" , "3IAYdQXkrWvDMBpg5Zw4ZRU39zuY9OAd3lVhwp07aMk=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedp" , "oaPa7rvvRy+pP3yUvA82hSNJ9/LQIZ+RVGPfCYvaLUg=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacketSilhouette" , "ca+mkPyRnAjVIZZRieUCHFV2t3qiJnX2YQnd/z3iTvs=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Larger" , "mFoaC4FBXiufdw/aG0SCLlxzpE1umDx3robELsUPhi8=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Night" , "KZEvxdx4nQnrYVPv8FY4DbVDAQBCjlllMnxXQHJ1gkE=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Other" , "EP7WPPrYdZvxAhRig/FBJWHEw67amJuOO9JO0Kqzh14=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\SeedPacket_Pool" , "8eLUx9OWZORq3ItJcbQltcsyc6oPAW9PThEHoul/LY0=" }, - { "Localization\\Javanese\\Textures\\[Custom Textures]\\seedroof" , "HhNxpjbMgvt2FZdZZ7kfl546x6+5B4B97DgSH80wkMg=" }, - - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_IndexBack" , "DagukR2bViPz88Iu2B5w4QDMs4ykui/BYdk+lyaTK2o=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_PlantCard" , "O2UWyplpXK69pTFXYDSA5KiRyKAZ22LCDN71GIb5ZDg=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieBack" , "L91uR40W1iPLqBd+ouENStDe9RN+xUOZtbF048MiD1U=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieCard" , "3QvRtOtCpI6sqh26+Zbr9vTR9RB8oSXy4m7iS2snZUI=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieWindow" , "+LHsQLlwsYWEVS11F+SustquGoxjbGiyrs58XwyeYMw=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\Almanac_ZombieWindow2" , "e51IJA1bz9dDEvmXtO6CeL6/M6KMXDvojCbTz2MtnLk=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\garden_new" , "WxH9rTrIHkmQeu0ALKfFuI6JvXo1uKQlwvgIc72+lhI=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\plant" , "ZkLNZASMXf7P0621AH2sFm3rbulCrs7otMLrrxiaqsA=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedBank" , "+5f20e56ArqQ3Mt2BXtpSM2vO7SV+mWOzIBalIEh4Ew=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Background" , "kjv++O/zFxvPVoObxFTLXsH2MIp3zae4UJ8zu8kVOhY=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Button" , "9d5FghH0XRShLwjivvcKtVqmlOQLZC/RqfT+Urv8PJo=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Button_Disabled" , "iTsQO62+/80kG4jELlTnB/AXA8wvQKnqCgvQS4pDVlY=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedChooser_Button_Glow" , "cFJCF740SGrFKt7c5OOAcRSVdW5ZZ6sBuE+T3JSwgOU=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedfog" , "JFjRJErflXFgxgxXXGHr6fjLaVIpoYSS0hlWa5Fi09c=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedlinkage" , "3IAYdQXkrWvDMBpg5Zw4ZRU39zuY9OAd3lVhwp07aMk=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedp" , "oaPa7rvvRy+pP3yUvA82hSNJ9/LQIZ+RVGPfCYvaLUg=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Larger" , "mFoaC4FBXiufdw/aG0SCLlxzpE1umDx3robELsUPhi8=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Night" , "KZEvxdx4nQnrYVPv8FY4DbVDAQBCjlllMnxXQHJ1gkE=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Other" , "EP7WPPrYdZvxAhRig/FBJWHEw67amJuOO9JO0Kqzh14=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\SeedPacket_Pool" , "8eLUx9OWZORq3ItJcbQltcsyc6oPAW9PThEHoul/LY0=" }, - { "Localization\\Indonesian\\Textures\\[Custom Textures]\\seedroof" , "HhNxpjbMgvt2FZdZZ7kfl546x6+5B4B97DgSH80wkMg=" }, - #endif - }; - - static string GetCheckSum(string filename) - { - using (var md5 = SHA256.Create()) - { - byte[] bytes = md5.ComputeHash(File.ReadAllBytes(filename)); - return Convert.ToBase64String(bytes); - } - } - - public static void SaveCheckSum() - { - string stringDir = GetAssetDir(AssetType.Dumps); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - string checkSumString = JsonSerializer.Serialize(checkSums, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - File.WriteAllText(Path.Combine(stringDir, "MD5.json"), checkSumString); - } - - public static void SaveModifiedChecksum() - { - string stringDir = GetAssetDir(AssetType.Dumps); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - string modifiedCheckSumString = JsonSerializer.Serialize(modifiedCheckSums, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - File.WriteAllText(Path.Combine(stringDir, "Modified_MD5.json"), modifiedCheckSumString); - } - - public static bool IsModified(string filepath) - { - string fileName = Path.GetFileNameWithoutExtension(filepath); - string directory = Path.GetDirectoryName(filepath); - string slicedFilePath = directory.Substring(directory.IndexOf("PvZ_Fusion_Translator\\") + "PvZ_Fusion_Translator\\".Length); - string slicedKey = Path.Combine(slicedFilePath, fileName); - - #if DEBUG - if (!checkSums.ContainsKey(slicedKey)) - { - checkSums.Add(slicedKey, GetCheckSum(filepath)); - SaveCheckSum(); - modifiedCheckSums.Add(slicedKey, GetCheckSum(filepath)); - SaveModifiedChecksum(); - } - else - { - if ((checkSums[slicedKey] != GetCheckSum(filepath))) - { - checkSums[slicedKey] = GetCheckSum(filepath); - modifiedCheckSums.Add(slicedKey, GetCheckSum(filepath)); - SaveModifiedChecksum(); - } - } - #elif RELEASE - if (!checkSums.ContainsKey(slicedKey) | (checkSums[slicedKey] != GetCheckSum(filepath))) - { - return true; - } - #endif - return false; - } - - public static void ConvertMD5Json() - { - string stringDir = GetAssetDir(AssetType.Dumps); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - string checksumDumpPath = Path.Combine(stringDir, "MD5.json"); - string checksumConvertPath = Path.Combine(stringDir, "MD5Convert.txt"); - string json = File.ReadAllText(checksumDumpPath); - Dictionary dictionary = DeserializeObject>(json); - - using StreamWriter writer = new StreamWriter(checksumConvertPath); - foreach (var kvp in dictionary) - { - string checksumKey = kvp.Key.Replace("\\", "\\\\"); - writer.WriteLine($"{{ \"{kvp.Key}\" , \"{kvp.Value}\" }},"); - } - - Log.LogDebug($"MD5.json converted to MD5Convert.json at {checksumConvertPath}"); - } - } -} -#endif \ No newline at end of file diff --git a/MelonLoader/AssetStore/DllStore.cs b/MelonLoader/AssetStore/DllStore.cs deleted file mode 100644 index 663f7ba..0000000 --- a/MelonLoader/AssetStore/DllStore.cs +++ /dev/null @@ -1,115 +0,0 @@ -/*using MelonLoader; -using MelonLoader.Utils; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PvZ_Fusion_Translator.AssetStore -{ - public static class DllStore - { - public static Dictionary dllData = new Dictionary() - { - { "Blooms_QOL.dll", null }, - { "PvZ_Fusion_Translator.dll", null } - }; - public static bool updateOnClose = false; - - public static void Init(string gameVersion) => TryGetNewDll(gameVersion); - - public static void TryGetNewDll(string gameVersion) - { - bool ableToUpdate = true; - string unableReason = ""; - string getGameVersionRequest = Utils.GetDataFromWeb("https://raw.githubusercontent.com/SillyStar-Github/PvZF-Translation-DLLs/refs/heads/main/CURRENT_GAME_VER").Result; - if(getGameVersionRequest != null) - { - Log.LogDebug($"Requst game version: {getGameVersionRequest} -> {Utils.CalculateGameVersion(getGameVersionRequest)}"); - Log.LogDebug($"This game version: {gameVersion} -> {Utils.CalculateGameVersion(gameVersion)}"); - if (Utils.CalculateGameVersion(getGameVersionRequest) != Utils.CalculateGameVersion(gameVersion)) - { - ableToUpdate = false; - unableReason = "Incorrect game version..."; - } - } - else - { - ableToUpdate = false; - unableReason = "Couldn't get latest game version info..."; - } - - if (ableToUpdate) - { - foreach(var key in dllData.Keys) - { - byte[] newDllRequest = Utils.GetByteDataFromWeb($"https://raw.githubusercontent.com/SillyStar-Github/PvZF-Translation-DLLs/refs/heads/main/{key}").Result; - if(newDllRequest != null) - { - dllData[key] = newDllRequest; - SaveNewDll(key); - } - else - { - Log.LogError($"Couldn't get latest {key} data!"); - } - } - } - else - { - Log.LogError($"Unable to update! {unableReason}"); - } - } - - public static void SaveNewDll(string name) - { - byte[] newDllData = dllData[name]; - if(newDllData != null) - { - string basePath = MelonEnvironment.ModsDirectory; - string toSavePath = Path.Combine(basePath, name + ".update"); - File.WriteAllBytes(toSavePath, newDllData); - } - } - - public static void UpdateNewDll() - { - foreach(var pair in dllData) - { - if(pair.Value != null) - { - updateOnClose = true; - } - } - - if(updateOnClose) - { - int processId = (Process.GetCurrentProcess().Id); - - var assembly = Core.Instance.MelonAssembly.Assembly; - string programName = "PvZ_Fusion_Translator.Resources.ModUpdateUtil.exe"; - - using var exeResourceStream = assembly.GetManifestResourceStream(programName); - string tempPath = Path.Combine(MelonEnvironment.ModsDirectory, "ModUpdateUtil.exe"); - using (var fileStream = File.Create(tempPath)) - { - exeResourceStream.CopyTo(fileStream); - } - - Process.Start(new ProcessStartInfo - { - FileName = tempPath, - Arguments = $"{processId.ToString()} {string.Join(",", dllData.Keys)} \"{MelonEnvironment.ModsDirectory}\"", - UseShellExecute = true - }); - } - else - { - Log.LogError("Cannot update on close! All .dll data is null!"); - } - } - } -} -*/ \ No newline at end of file diff --git a/MelonLoader/AssetStore/FontStore.cs b/MelonLoader/AssetStore/FontStore.cs deleted file mode 100644 index 48c5af1..0000000 --- a/MelonLoader/AssetStore/FontStore.cs +++ /dev/null @@ -1,150 +0,0 @@ -using Il2CppTMPro; -using MelonLoader; -using System.Reflection; -using UnityEngine; -using UnityEngine.TextCore.Text; - -namespace PvZ_Fusion_Translator.AssetStore -{ - public static class FontStore - { - internal static Dictionary fontAssetDict = []; - internal static Dictionary fontAssetDictSecondary = []; - - internal static void Init() - { - string fontsDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Fonts]"); - - AssetBundle assetBundle = Utils.GetAssetBundle(Path.Combine(fontsDir, "translation")); - - #if MULTI_LANGUAGE - foreach (string file in assetBundle.GetAllAssetNames()) - { - string fileName = Path.GetFileNameWithoutExtension(file); - - if (!fileName.EndsWith("_almanac") && !fileName.EndsWith("_fallback")) - { - TMP_FontAsset fontAsset = assetBundle.LoadAsset(file); - - fontAssetDict.Add(fileName, fontAsset); - - Log.LogInfo($"Font for language '{fileName}' loaded"); - } - } - - InitFallback(assetBundle); - #else - string defaultFontDir = Path.Combine("PvZ_Fusion_Translator", "[Custom Fonts]", "English.ttf"); - - TMP_FontAsset defaultFont = FontHandler.LoadTMPFont(defaultFontDir, true); - fontAssetDict.Add("English", defaultFont); - #endif - } - - internal static void InitFallback(AssetBundle assetBundle) - { - string fontsDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Fonts]"); - - foreach (string file in assetBundle.GetAllAssetNames()) - { - string fileName = Path.GetFileNameWithoutExtension(file); - - if (fileName.EndsWith("_almanac") || fileName.EndsWith("_fallback")) - { - TMP_FontAsset fallbackFont = assetBundle.LoadAsset(file); - - string fileNameLanguage = fileName.Replace("_fallback", "").Replace("_almanac", ""); - - Utils.TryAdd(fontAssetDictSecondary, fileName, fallbackFont); - - // Log.LogInfo($"Fallback font for language '{fileNameLanguage}' loaded"); - } - } - AddFallback(); - } - - public static void AddFallback() - { - foreach (var lang in fontAssetDict.Keys) - { - if (fontAssetDict[lang].fallbackFontAssetTable == null) - { - fontAssetDict[lang].fallbackFontAssetTable = new Il2CppSystem.Collections.Generic.List(); - } - - if (fontAssetDictSecondary.ContainsKey(lang)) - { - fontAssetDict[lang].fallbackFontAssetTable.Add(fontAssetDictSecondary[lang]); - Log.LogInfo("Fallback font for language '" + lang + "' added"); - continue; - } - if (fontAssetDictSecondary.ContainsKey(lang + "_almanac")) - { - fontAssetDict[lang].fallbackFontAssetTable.Add(fontAssetDictSecondary[lang + "_almanac"]); - Log.LogInfo("Fallback font for language '" + lang + "' added"); - continue; - } - if (fontAssetDictSecondary.ContainsKey(lang + "_fallback")) - { - fontAssetDict[lang].fallbackFontAssetTable.Add(fontAssetDictSecondary[lang + "_fallback"]); - Log.LogInfo("Fallback font for language '" + lang + "' added"); - continue; - } - } - } - - #if MULTI_LANGUAGE - public static TMP_FontAsset LoadTMPFont(string language) - { - if (fontAssetDict.TryGetValue(language.ToLower(), out TMP_FontAsset font)) - { - TMP_FontAsset fontAsset = font; - if (fontAsset.fallbackFontAssetTable != null) - { - // Log.LogInfo("Fallback font for language '" + language + "' loaded. The name of the FB Font is" + fontAsset.fallbackFontAssetTable[0].name); - } - return fontAsset; - } - return fontAssetDict.GetValueOrDefault("english"); - } - #else - public static TMP_FontAsset LoadTMPFont() - { - TMP_FontAsset defaultFont = fontAssetDict["English"]; - return defaultFont; - } - #endif - - public static TMP_FontAsset LoadTMPFontAlmanac(string language) - { - if (fontAssetDictSecondary.ContainsKey(language.ToLower())) - { - if (fontAssetDictSecondary.TryGetValue(language.ToLower(), out TMP_FontAsset almanacAsset)) - { - return almanacAsset; - } - } - if (fontAssetDictSecondary.ContainsKey(language.ToLower() + "_almanac")) - { - if (fontAssetDictSecondary.TryGetValue(language.ToLower() + "_almanac", out TMP_FontAsset almanacAsset)) - { - return almanacAsset; - } - } - - return fontAssetDict.GetValueOrDefault("english"); - } - - #if MULTI_LANGUAGE - public static void Reload() - { - // Get the current language - string currentLanguage = Utils.Language.ToString(); - - // Load the font for the current language - _ = LoadTMPFont(currentLanguage); - } - #endif - - } -} diff --git a/MelonLoader/AssetStore/StringStore.cs b/MelonLoader/AssetStore/StringStore.cs deleted file mode 100644 index f3df218..0000000 --- a/MelonLoader/AssetStore/StringStore.cs +++ /dev/null @@ -1,637 +0,0 @@ -using Il2CppTMPro; -using PvZ_Fusion_Translator.Patches.BaseTextObjects; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.AssetStore -{ - public static class StringStore - { - internal static Dictionary stringsDict = []; - - public static Dictionary translationStringRegex = new(); - - public static Dictionary translationString = new(); - - public static Dictionary customLevelStringRegex = new(); - - public static Dictionary customLevelString = new(); - - public static Dictionary izLevelTipDictionary = new(); - - public static Dictionary izTipCollectionString = new(); - - public static Dictionary fsLevelTipDictionary = new(); - - public static Dictionary fsTipCollectionString = new(); - - public static Dictionary> patchesStore = new() - { - { "Difficulty", new Dictionary - { - { "English" , "Difficulty:" }, - { "French" , "Difficulté:" }, - { "Italian" , "Difficoltà:" }, - { "German" , "Schwierigkeit:" }, - { "Spanish" , "Dificultad:" }, - { "Portuguese" , "Dificuldade:" }, - { "Filipino" , "Ang Hirap:" }, - { "Vietnamese" , "Độ Khó:" }, - { "Indonesian" , "Kesulitan:" }, - { "Russian" , "Сложность:" }, - { "Japanese" , "困難:" }, - { "Korean", "난이도:" }, - { "Javanese" , "Kesulitan:" }, - { "Polish", "Trudność:"}, - { "Hungarian", "Nehézség:"}, - { "Arabic", "صعوبة:"}, - // { "Ukrainian" , "Складність:" }, - // { "Slovak" , "Náročnosť:" }, - } - }, - { "Zombies", new Dictionary - { - { "English" , "Zombies:" }, - { "French" , "Les Zombies:" }, - { "Italian" , "Zombi:" }, - { "German" , "Zombies:" }, - { "Spanish" , "Zombis:" }, - { "Portuguese" , "Zumbis:" }, - { "Filipino" , "Mga Zombie:" }, - { "Vietnamese" , "Thây Ma:" }, - { "Indonesian" , "Zombi:" }, - { "Russian" , "Зомби:" }, - { "Japanese" , "ゾンビ:" }, - { "Korean", "좀비:" }, - { "Javanese" , "Mayit:" }, - { "Polish" , "Zombi:" }, - { "Hungarian" , "Zombik:" }, - { "Arabic" , "الزومبي:" }, - // { "Ukrainian" , "Зомбі:" }, - // { "Slovak" , "Zombíci:"} - } - } - - }; - - internal static void Init() - { - FileLoader.LoadStrings(); - } - - internal static void Reload() - { - translationString.Clear(); - translationStringRegex.Clear(); - customLevelString.Clear(); - customLevelStringRegex.Clear(); - izLevelTipDictionary.Clear(); - izTipCollectionString.Clear(); - fsLevelTipDictionary.Clear(); - fsTipCollectionString.Clear(); - InGameText_Patch.currentText = ""; - Utils.RegisterPlantIndices(); - FileLoader.LoadStrings(); - } - - public static TextMeshPro TranslateText(TextMeshPro originalTMP, bool isLog = false) - { - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - - string translatedText = TranslateText(originalTMP.text); - originalTMP.font = fontAsset; - originalTMP.text = translatedText; - - return originalTMP; - } - - public static TextMeshProUGUI TranslateText(TextMeshProUGUI originalTMP, bool isLog = false) - { - /*var frame = new StackTrace().GetFrame(1); - var method = frame.GetMethod(); - var className = method.DeclaringType.Name; - - Console.WriteLine($"tmp pro ugui: {className}.{method.Name}");*/ - - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - - string translatedText = TranslateText(originalTMP.text); - originalTMP.font = fontAsset; - originalTMP.text = translatedText; - - return originalTMP; - } - - public static string TranslateText(string originalText, bool isLog = false) - { - string text = DoTranslateText(originalText, false); - string checkText; - #if DEBUG - Regex regex = new("\\p{IsCJKUnifiedIdeographs}+"); - Match match = regex.Match(text); - - if(match.Success) - { - // Log.LogDebug("Untranslated String: " + match.Value); - FileLoader.DumpUntranslatedStrings(text); - } - #endif - checkText = text; - - return checkText; - } - - public static string TranslateText(string originalText, string pattern, bool isLog = false) - { - if (TestRegex(originalText, pattern)) - { - if(translationStringRegex.ContainsKey(pattern)) - { - // Extract dynamic parts from the original text - var regex = new Regex(pattern); - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - if (isLog) - Log.LogDebug("Text found in translationStringRegex {0}: {1}", match, groupCount); - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = DoTranslateString(groupValue); - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - return string.Format(translationStringRegex[pattern], [.. dynamicParts]); - } - else if(customLevelStringRegex.ContainsKey(pattern)) - { - // Extract dynamic parts from the original text - var regex = new Regex(pattern); - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - if (isLog) - Log.LogDebug("Text found in customLevelStringRegex {0}: {1}", match, groupCount); - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = customLevelString.ContainsKey(groupValue) - ? customLevelString[groupValue] - : groupValue; - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - return string.Format(customLevelStringRegex[pattern], [.. dynamicParts]); - } - else - { - return originalText; - } - } - else - { - if (isLog) - Log.LogDebug($"Text '{originalText}' not translated"); - FileLoader.DumpUntranslatedStrings(originalText); - return originalText; - } - } - - public static string DoTranslateString(string originalText, bool isLog = false) - { - if (string.IsNullOrEmpty(originalText)) - { - if (isLog) - Log.LogError("Text Null or Empty"); - - return string.Empty; - } - - if (translationString.ContainsKey(originalText)) - { - if (isLog) - Log.LogDebug($"Text '{originalText} found in translationString"); - return translationString[originalText]; - } - - if(izTipCollectionString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in izTipCollectionString"); - } - return izTipCollectionString[originalText]; - } - - if(fsTipCollectionString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in fsTipCollectionString"); - } - return fsTipCollectionString[originalText]; - } - - if(customLevelString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in customLevelString"); - } - return customLevelString[originalText]; - } - - if (Utils.plantIndiceString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in plantIndiceString"); - } - return Utils.plantIndiceString[originalText]; - } - - return originalText; - } - - public static string DoTranslateText(string originalText, bool isLog = false) - { - if (string.IsNullOrEmpty(originalText)) - { - if (isLog) - Log.LogError("Text Null or Empty"); - - return string.Empty; - } - - if (!Utils.CheckForUntranslatedText(originalText) && !(originalText).Contains("_")) return originalText; - - if (translationString.ContainsKey(originalText)) - { - if (isLog) - Log.LogDebug($"Text '{originalText} found in translationString"); - return translationString[originalText]; - } - - if(izTipCollectionString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in izTipCollectionString"); - } - return izTipCollectionString[originalText]; - } - - if(fsTipCollectionString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in fsTipCollectionString"); - } - return fsTipCollectionString[originalText]; - } - - if(customLevelString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in customLevelString"); - } - return customLevelString[originalText]; - } - - if (Utils.plantIndiceString.ContainsKey(originalText)) - { - if(isLog) - { - Log.LogDebug($"Text '{originalText}' found in plantIndiceString"); - } - return Utils.plantIndiceString[originalText]; - } - - // Regex-based dynamic translation - foreach (var entry in translationStringRegex) - { - if (TestRegex(originalText, entry.Key)) - { - // Extract dynamic parts from the original text - var regex = new Regex(entry.Key); - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - if (isLog) - Log.LogDebug("Text found in translationStringRegex {0}: {1}", match, groupCount); - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = DoTranslateString(groupValue); - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - return string.Format(entry.Value, [.. dynamicParts]); - } - } - - foreach (var entry in customLevelStringRegex) - { - if (TestRegex(originalText, entry.Key)) - { - // Extract dynamic parts from the original text - var regex = new Regex(entry.Key); - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - if (isLog) - Log.LogDebug("Text found in customLevelRegex {0}: {1}", match, groupCount); - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = customLevelString.ContainsKey(groupValue) - ? customLevelString[groupValue] - : groupValue; - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - return string.Format(entry.Value, [.. dynamicParts]); - } - } - - if (isLog) - Log.LogDebug($"Text '{originalText}' not translated"); - if(Utils.CheckForUntranslatedText(originalText)) - { - FileLoader.DumpUntranslatedStrings(originalText); - } - return originalText; - } - - public static string TranslateColorText(string originalText, bool isLog = false) - { - string text = TranslateColorSegments(originalText); - string checkText; -#if DEBUG - Regex regex = new("\\p{IsCJKUnifiedIdeographs}+"); - Match match = regex.Match(text); - - if (match.Success) - { - // Log.LogDebug("Untranslated String: " + match.Value); - FileLoader.DumpUntranslatedStrings(text); - } -#endif - checkText = text; - - return checkText; - } - - public static string TranslateColorSegments(string input) - { - string result = ""; - string pattern = @"]+>[\s\S]*?(?:<\/color>|$)|(?:<(?!color=)|[^<])+"; - string smallPattern = @"(]+>)(.*?)()"; - MatchCollection matches = Regex.Matches(input, pattern); - - for (int i = 0; i < matches.Count; i++) - { - Match match = matches[i]; - if (Regex.Match(match.Value, smallPattern, RegexOptions.Singleline).Success) - { - result += TranslateColorSegment(match.Value); - } - else - { - result += DoTranslateText(match.Value); - } - } - - return result; - } - - public static string TranslateColorSegment(string input) - { - string result = input; - string pattern = @"(]+>)(.*?)()"; - Match match = Regex.Match(input, pattern, RegexOptions.Singleline); - string translatedText = DoTranslateText(match.Groups[2].Value); - if(Utils.CheckForUntranslatedText(translatedText)) - { - FileLoader.DumpUntranslatedStrings(translatedText); - } - result = match.Groups[1].Value + translatedText + match.Groups[3].Value; - - return result; - } - public static bool TestRegex(string originalText, string pattern, bool singleLine = false) - { - RegexOptions options = (singleLine) ? RegexOptions.None : RegexOptions.Singleline; - return Regex.IsMatch(originalText, pattern, options); - } - - private static TextAlignmentOptions TextAnchorToTMPAlignment(TextAnchor anchor) - { - return anchor switch - { - TextAnchor.UpperLeft => TextAlignmentOptions.TopLeft, - TextAnchor.UpperCenter => TextAlignmentOptions.Top, - TextAnchor.UpperRight => TextAlignmentOptions.TopRight, - TextAnchor.MiddleLeft => TextAlignmentOptions.MidlineLeft, - TextAnchor.MiddleCenter => TextAlignmentOptions.Center, - TextAnchor.MiddleRight => TextAlignmentOptions.MidlineRight, - TextAnchor.LowerLeft => TextAlignmentOptions.BottomLeft, - TextAnchor.LowerCenter => TextAlignmentOptions.Bottom, - TextAnchor.LowerRight => TextAlignmentOptions.BottomRight, - _ => TextAlignmentOptions.Center - }; - } - - public static TextMeshProUGUI ConvertToTextMeshPro(UnityEngine.UI.Text oldText, TMP_FontAsset fontAsset, bool isLog = false) - { - if (oldText == null) - { - Log.LogError("UnityEngine.UI.Text component is null."); - return null; - } - - if (fontAsset == null) - { - Log.LogError("TMP_FontAsset is null. Conversion cannot proceed."); - return null; - } - - // Log.LogInfo($"Converting UnityEngine.UI.Text: {oldText.name}"); - - GameObject textObject = oldText.gameObject; - - // Preserve text content and settings - string originalText = oldText.text; - originalText = TranslateText(originalText, isLog); - TextAnchor alignment = oldText.alignment; - Color color = oldText.color; - - // Remove old Text component - UnityEngine.Object.DestroyImmediate(oldText); - - // Add TextMeshProUGUI component - TextMeshProUGUI newTMP = textObject.AddComponent(); - if (newTMP == null) - { - Log.LogError($"Failed to add TextMeshProUGUI to object: {textObject.name}"); - return null; - } - - // Configure TextMeshProUGUI - newTMP.text = originalText; - newTMP.color = color; - newTMP.alignment = TextAnchorToTMPAlignment(alignment); - newTMP.font = fontAsset; - - // Log.LogInfo($"Successfully converted {textObject.name} to TextMeshProUGUI."); - - return newTMP; - } - - public static void TranslateTextTransform(Transform baseTransform, bool isAutoTextContainer = false, bool isLog = false) - { - if (!baseTransform) return; - - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - - if (fontAsset == null) - { - #if MULTI_LANGUAGE - Log.LogError($"Font for language '{currentLanguage}' not found. Translation aborted."); - #else - Log.LogError("Font not found. Translation aborted."); - #endif - return; - } - - // Local function for processing transforms - void ProcessTextTransform(Transform textTransform) - { - if (!textTransform) return; - - // Handle TextMeshPro components - TextMeshPro textTMP = textTransform.GetComponent(); - if (textTMP) - { - textTMP.text = TranslateText(textTMP.text, isLog); - textTMP.autoSizeTextContainer = isAutoTextContainer; - textTMP.font = fontAsset; - } - - TextMeshProUGUI textTMPUGUI = textTransform.GetComponent(); - if (textTMPUGUI) - { - textTMPUGUI.text = TranslateText(textTMPUGUI.text, isLog); - textTMPUGUI.enableAutoSizing = isAutoTextContainer; - textTMPUGUI.font = fontAsset; - } - - // Handle UnityEngine.UI.Text components - UnityEngine.UI.Text textUI = textTransform.GetComponent(); - if (textUI) - { - ConvertToTextMeshPro(textUI, fontAsset, isLog); - } - } - - // Process specific text paths - ProcessTextTransform(baseTransform.Find("text")); - ProcessTextTransform(baseTransform.Find("text1")); - // ProcessTextTransform(baseTransform.Find("text2")); - - Transform shadowTransform = baseTransform.Find("text/shadow"); - if (shadowTransform) ProcessTextTransform(shadowTransform); - - shadowTransform = baseTransform.Find("text1/shadow"); - if (shadowTransform) ProcessTextTransform(shadowTransform); - - #if TESTING - Transform childTransform = baseTransform.GetChild(0); - if (childTransform) ProcessTextTransform(childTransform); - #endif - } - - public static void TranslateTextUI(TextMeshPro textTMP, bool? isAutoTextContainer = null, bool isLog = false) - { - string currentLanguage = Utils.Language.ToString(); - if (textTMP) - { - textTMP.text = TranslateText(textTMP.text, isLog); - if (isAutoTextContainer!=null) textTMP.autoSizeTextContainer = isAutoTextContainer.Value; - textTMP.font = FontStore.LoadTMPFont(currentLanguage); - } - } - public static void TranslateTextUI(TextMeshProUGUI textTMP, bool? isAutoTextContainer = null, bool isLog = false) - { - string currentLanguage = Utils.Language.ToString(); - if (textTMP) - { - string origText = textTMP.text; - - textTMP.text = TranslateText(origText, isLog) == "" ? origText : TranslateText(origText, isLog); - if (isAutoTextContainer != null) textTMP.autoSizeTextContainer = isAutoTextContainer.Value; - if (origText != textTMP.text) - textTMP.font = FontStore.LoadTMPFont(currentLanguage); - } - } - - public static void TranslateTextUI(TMP_InputField TextInput) - { - string currentLanguage = Utils.Language.ToString(); - if (TextInput) - { - string oriText = TextInput.m_Text; - TextInput.m_Text = TranslateText(oriText); - TextInput.m_OriginalText = TranslateText(oriText); - TextInput.fontAsset = FontStore.LoadTMPFont(currentLanguage); - } - } - - public static void LogAll() - { - Log.LogInfo("Logging all StringStore entries."); - Log.LogInfo("Regex Entries: {0}", translationStringRegex.Count); - Log.LogInfo("String Entries: {0}", translationString.Count); - } - } -} \ No newline at end of file diff --git a/MelonLoader/AssetStore/TextureStore.cs b/MelonLoader/AssetStore/TextureStore.cs deleted file mode 100644 index f5760d5..0000000 --- a/MelonLoader/AssetStore/TextureStore.cs +++ /dev/null @@ -1,67 +0,0 @@ -using MelonLoader; -using System.Collections; -using UnityEngine; - -namespace PvZ_Fusion_Translator.AssetStore -{ - public static class TextureStore - { - internal static Dictionary textureDict = []; - internal static Dictionary spriteDict = []; - - internal static void Init() => FileLoader.LoadTextures(); - - internal static void Reload() - { - textureDict.Clear(); - #if MULTI_LANGUAGE - RestoreTextures(); - #endif - FileLoader.LoadTextures(); - } - - public static IEnumerator ReplaceTexturesCoroutine() - { - while (true) - { - ReplaceTextures(); - yield return new WaitForSeconds(0.5f); // Adjust this interval as needed - } - } - - public static void ReplaceTextures() - { - Texture2D[] textures = Resources.FindObjectsOfTypeAll(); - foreach (Texture2D texture in textures) - { - if (texture.name.StartsWith("replaced_")) - continue; - - Utils.TryReplaceTexture2D(texture); - } - } - - #if MULTI_LANGUAGE - public static void RestoreTextures() - { - Texture2D[] textures = Resources.FindObjectsOfTypeAll(); - foreach (Texture2D texture in textures) - { - if (texture != null) - { - texture.name = texture.name.Replace("replaced_", ""); - } - } - } - #endif - - /*public static void LogAll() - { - Log.LogInfo("Logging all TextureStore entries."); - foreach (KeyValuePair entry in textureDict) - { - Log.LogInfo("TextureDict Entry: " + entry.Key + " | " + entry.Value); - } - }*/ - } -} diff --git a/MelonLoader/AssetStore/WarningStore.cs b/MelonLoader/AssetStore/WarningStore.cs deleted file mode 100644 index 7f753f1..0000000 --- a/MelonLoader/AssetStore/WarningStore.cs +++ /dev/null @@ -1,234 +0,0 @@ -//using System.Runtime.CompilerServices; -//using Il2Cpp; -//using Il2CppTMPro; -//using MelonLoader; -//using UnityEngine; -//using UnityEngine.TextCore.Text; -//using static MelonLoader.MelonLogger; - -//namespace PvZ_Fusion_Translator.AssetStore -//{ -// public static class WarningStore -// { -// #if MULTI_LANGUAGE -// private static Dictionary warningMessages = new() -// { -// { "English", ("The only valid source of this translation is from this community:\n" + -// "discord.gg/DPAC5ZVJ8T. If you got this anywhere else like \n" + -// "Plants Hybrid and superhybrid.online, they stole it.\n" + -// "Stray away from other sources as they may contain viruses.\n" + -// "Please visit our community for future updates.", -// "Okay! Got it.") }, -// { "French", ("La seule source valide pour cette traduction provient de cette\n" + -// "communauté :discord.gg/DPAC5ZVJ8T. Si vous l'avez obtenue \n" + -// "ailleurs, comme Plants Hybrid ou superhybrid.online, ils l'ont volée.\n" + -// "Évitez les autres sources, car elles peuvent contenir des virus.\n" + -// "Veuillez visiter notre communauté pour les mises à jour futures.", -// "D'accord !") }, -// { "Italian", ("L'unica fonte valida di questa traduzione è questa community:\n" + -// "discord.gg/DPAC5ZVJ8T. Se l'hai ottenuta altrove, come \n" + -// "Plants Hybrid e superhybrid.online, l'hanno rubata.\n" + -// "Evita altre fonti, potrebbero contenere virus.\n" + -// "Visita la nostra community per aggiornamenti futuri.", -// "Va bene! Ho capito.") }, -// { "German", ("Die einzige gültige Quelle für diese Übersetzung stammt aus\n" + -// "dieser Community: discord.gg/DPAC5ZVJ8T. Wenn Sie diese \n" + -// "irgendwo anders gefunden haben, z. B. bei Plants Hybrid oder \n" + -// "superhybrid.online, dann haben sie sie gestohlen.\n" + -// "Meiden Sie andere Quellen, da diese Viren enthalten könnten.\n" + -// "Bitte besuchen Sie unsere Community für zukünftige Updates.", -// "Okay, verstanden!") }, -// { "Spanish", ("La única fuente válida de esta traducción proviene de esta\n" + -// "comunidad: discord.gg/DPAC5ZVJ8T. Si la obtuvo en cualquier\n" + -// "otro lugar como Plants Hybrid o superhybrid.online, la robaron.\n" + -// "Manténgase alejado de otras fuentes, ya que podrían contener virus.\n" + -// "Por favor, visite nuestra comunidad para futuras actualizaciones.", -// "¡Entendido!") }, -// { "Portuguese", ("O lugar original e seguro dessa tradução vem daqui:\n" + -// "discord.gg/DPAC5ZVJ8T. Se você baixou ela de qualquer \n" + -// "lugar como Plants Hybrid ou superhybrid.online, eles\n" + -// "roubaram. Evite baixar deles, pode conter vírus.\n" + -// "Por favor, visite nossa comunidade para atualizações futuras.", -// "Okay, entendido.") }, -// { "Filipino", ("Ang tanging opisyal na source ng pagsasaling ito ay mula\n" + -// "lamang dito: discord.gg/DPAC5ZVJ8T. Kung nakuha nmo ito kahit \n" + -// "saan pa tulad ng Plants Hybrid at superhybrid.online, ito ay ninakaw. \n" + -// "Lumayo sa ibang source dahil posibleng may kasamang virus.\n" + -// "Paki-bisita ang aming komunidad para sa mga darating na update." , -// "Naiintindihan!") }, -// { "Vietnamese", ("Nguồn duy nhất hợp lệ của bản dịch này là từ cộng\n" + -// "đồng này: discord.gg/DPAC5ZVJ8T. Nếu bạn nhận \n" + -// "được nó ở bất cứ nơi nào khác như Plants Hybrid \n" + -// "hoặc superhybrid.online, họ đã ăn cắp nó.\n" + -// "Tránh xa các nguồn khác vì chúng có thể chứa \n" + -// "virus. Hãy ghé thăm cộng đồng của chúng tôi để \n" + -// "cập nhật trong tương lai.", -// "Đồng ý!") }, -// { "Indonesian", ("Satu-satunya sumber resmi dari terjemahan ini adalah \n" + -// "komunitas kami: discord.gg/DPAC5ZVJ8T. Jika Anda \n" + -// "mendapatkannya dari sumber lain seperti Plants Hybrid \n" + -// "dan superhybrid.online, mereka mencurinya. \n" + -// "Jauhi sumber lain karena mungkin ada virus.\n" + -// "Silakan kunjungi komunitas kami untuk pembaruan berikutnya.", -// "Oke! Mengerti.") }, -// { "Russian", ("Единственный проверенный источник этого перевода —\n" + -// "сообщество discord.gg/DPAC5ZVJ8T.\n" + -// "Или же его замена https://t.me/nekoshkindom\n" + -// "Если вы скачали этот мод где-либо ещё, возможно он содержит вирусы.\n" + -// "Программист перевода: LancerX0.\n" + -// "Переводчик: Nekosha.", "Хорошо!") }, -// { "Japanese", ("この翻訳の唯一の有効なソースは、このコミュニティからです:\n" + -// "discord.gg/DPAC5ZVJ8T.Plants Hybridやsuperhybrid.online、\n" + -// "YoutubeのBlue Flyが作っているもの、他のどこかでこれを入手した場合、\n" + -// "彼らはそれを盗んだことになります。ウイルスが含まれている可能性があるので、\n" + -// "他のソースからは離れてください。今後のアップデートについては、\n私たちのコミュニティをご覧ください。", -// "了解しました!") }, -// { "Korean", ("이 번역은 Bloom(discord.gg/DPAC5ZVJ8T)에서만\n" + -// "제공됩니다. Bloom 디스코드 이외의 다른서드 파티 사이트, \n" + -// "예를 들어 Plants Hybrid 및 superhybrid.online, 또는\n" + -// "유튜브 Blue Fly등에서 제공하는 파일은 무단으로 재배포된 것이며,\n" + -// "이런 사이트들에는 바이러스가 포함되어 있을 가능성이 높습니다. \n향후 업데이트를 위해 저희 디스코드를 방문해 주세요.", -// "확인") }, -// { "Javanese" , ("Sumber mung sing sah kanggo terjemahan iki saka komunitas iki:\n" + -// "discord.gg/DPAC5ZVJ8T. Yen sampeyan nemokake iki ing papan\n" + -// "liya kaya Plants Hybrid lan superhybrid.online, iku dicolong.\n" + -// "Aja nyedhaki sumber liya amarga bisa ngandhut virus. Mangga\n" + -// "ngunjungi komunitas kita kanggo nganyari ing mangsa ngarep.", -// "Oke! Ngertos.") }, -// { "Polish" , ("Jedynym wiarygodnym źródłem tego tłumaczenia jest ta społeczność:\n" + -// "discord.gg/DPAC5ZVJ8T. Jeśli znalazłeś to gdziekolwiek indziej, np. \n" + -// "Plants Hybrid i superhybrid.online, ukradli to.\n" + -// "Omijaj inne źródła, ponieważ mogą zawierać wirusy.\n" + -// "Odwiedź naszą społeczność, aby uzyskać przyszłe aktualizacje.", -// "Okay! Rozumiem.") }, -// { "Hungarian" , ("Ennek a fordításnak az egyetlen érvényes forrása ebből a közösségből származik:\n" + -// "discord.gg/DPAC5ZVJ8T. Ha ezt valahol máshol szerezted, például \n" + -// "Plants Hybrid és superhybrid.online oldalakon, akkor ők lopták.\n" + -// "Kerüld a többi forrást, mert vírusokat tartalmazhatnak.\n" + -// "Kérjük, látogass el közösségünkbe a jövőbeli frissítésekért.", -// "Oké! Értem.") }, -// { "Arabic" , ("The only valid source of this translation is from this community:\n" + -// "discord.gg/DPAC5ZVJ8T. If you got this anywhere else like \n" + -// "Plants Hybrid and superhybrid.online, they stole it.\n" + -// "Stray away from other sources as they may contain viruses.\n" + -// "Please visit our community for future updates.", -// "Okay! Got it.") }, -// // { "OTHER" , ("A única fonte válida dessa tradução é desta\ncomunidade: discord.gg/DPAC5ZVJ8T. Se você obteve \nisso em qualquer lugar como Plants Hybrid\ne superhybrid.online,ou Blue Fly do Youtube,\nelses roubaram. Fique longe de sites falsos. Por favor,\nvisite nossa comunidade para futuras atualizações.", "¡Okei! Entendido.") } -// // { "OTHER" , ("Ang translation na ito ay galing dito lamang:\ndiscord.gg/DPAC5ZVJ8T. Pag nakuha niyo ito sa iba pa\nkagaya ng Plants Hybrid o superhybrid.online, anumang\nginawagawa ng Blue Fly mula sa Youtube, o anumang\nSub2Unlock links, scam sila. MAG INGAT dahil\nkasi baka may virus 'jan. Join kayo sa discord namin!\nFilipino Translation by ColinPogi" , "Tayo magsi-laro!") } -// }; -// #else -// public static string warningMessage = "La única fuente válida de esta traducción proviene de esta\ncomunidad: discord.gg/DPAC5ZVJ8T. Si la obtuvo en cualquier\notro lugar como Plants Hybrid o superhybrid.online, la robaron.\nManténgase alejado de otras fuentes, ya que podrían contener virus.\nPor favor, visite nuestra comunidad para futuras actualizaciones."; -// public static string okayButton = "¡Entendido!"; -// #endif - -// #if MULTI_LANGUAGE -// public static (string, string) GetWarningMessage(Utils.LanguageEnum language) -// { -// if (warningMessages.TryGetValue(language.ToString(), out var message)) -// { - -// return message; -// } -// else -// { -// return warningMessages["English"]; // Default to English if language code is not found -// } -// } -//#endif - -// public static void WarningLoad(NoticeMenu noticeMenu) -// { -// if (noticeMenu == null || noticeMenu.transform == null) -// { -// MelonLogger.Warning("[WarningStore] NoticeMenu or transform is null - ABORTING"); -// return; -// } - -//#if MULTI_LANGUAGE -// try -// { -// var (warningMessage, okayButton) = GetWarningMessage(Utils.Language); -// TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - -// Transform warningTransform = noticeMenu.transform.Find("窗口"); -// if (warningTransform == null) -// { -// MelonLogger.Warning("[WarningStore] '窗口' transform not found - ABORTING"); -// return; -// } - -// Transform warningTextTransform = warningTransform.Find("文字"); -// Transform warningTextShadowTransform = warningTransform.Find("文字2"); - -// if (warningTextTransform == null || warningTextShadowTransform == null) -// { -// MelonLogger.Warning("[WarningStore] Could not find text components (文字/文字2)"); -// return; -// } - -// TextMeshProUGUI warningText = warningTextTransform.GetComponent(); -// TextMeshProUGUI shadowText = warningTextShadowTransform.GetComponent(); - -// if (warningText == null || shadowText == null) -// { -// MelonLogger.Warning("[WarningStore] TextMeshProUGUI components missing"); -// return; -// } - -// warningText.text = warningMessage; -// shadowText.text = warningMessage; - -// if (fontAsset != null) -// { -// warningText.font = fontAsset; -// shadowText.font = fontAsset; -// } -// else -// { -// MelonLogger.Warning("[WarningStore] Font asset is null"); -// } - -// MelonLogger.Msg("Warning message loaded successfully!"); -// } -// catch (Exception e) -// { -// MelonLogger.Error($"Critical error in WarningLoad: {e}"); -// } -//#endif -// } -//#if MULTI_LANGUAGE -// public static bool isWarningMessageLoaded = false; - -// public static void WarningReload(Utils.LanguageEnum language, NoticeMenu noticeMenu) -// { -// if (noticeMenu == null) -// { -// MelonLogger.Warning("[WarningStore] NoticeMenu is null in WarningReload"); -// return; -// } - -// if (Utils.OldLanguage.ToString() == language.ToString() && Utils.OldLanguage.ToString() != "English") -// { -// return; -// } - -// if (!isWarningMessageLoaded) -// { -// WarningLoad(noticeMenu); -// isWarningMessageLoaded = true; -// } -// } -//#else -// public static bool isWarningMessageLoaded = false; - -// public static void WarningReload() -// { -// if (!WarningStore.isWarningMessageLoaded) -// { -// WarningStore.WarningLoad(); -// WarningStore.isWarningMessageLoaded = true; -// } -// } -//#endif -// } -//} \ No newline at end of file diff --git a/MelonLoader/Core.cs b/MelonLoader/Core.cs deleted file mode 100644 index a93977c..0000000 --- a/MelonLoader/Core.cs +++ /dev/null @@ -1,132 +0,0 @@ -using MelonLoader; -using MelonLoader.Utils; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.Managers; -using PvZ_Fusion_Translator.Patches.Modes.Super_Editor; -using UnityEngine; -using static PvZ_Fusion_Translator.FileLoader; - -[assembly: MelonInfo(typeof(PvZ_Fusion_Translator.Core), "PvZ Fusion Translator", "231.0.0", "dynaslash / arifrios1st / lancerx0 / JustNull / Dakosha / Mamoru-kun / cassidy / Teyliu", null)] -[assembly: MelonGame("LanPiaoPiao", "PlantsVsZombiesRH")] - -namespace PvZ_Fusion_Translator -{ - public class Core : MelonMod - { - private static DateTime dtStart; - private static DateTime? dtStartToast; - private static string toast_txt; - public static bool isInitialized = false; - public static Core Instance { get; private set; } - - object replaceTextureRoutine = null; - - public override void OnEarlyInitializeMelon() => dtStart = DateTime.Now; - - public override void OnInitializeMelon() - { - base.OnInitializeMelon(); - Instance = this; - - Config(); - #if MULTI_LANGUAGE - FileLoader.LoadLanguage(); - #endif - TextureStore.Init(); - StringStore.Init(); - AudioStore.Init(); - FontStore.Init(); - - isInitialized = true; - } - - public override void OnLateInitializeMelon() - { - dtStart = DateTime.Now; - replaceTextureRoutine = MelonCoroutines.Start(TextureStore.ReplaceTexturesCoroutine()); - LoadTravelBuffs(); - Utils.RegisterPlantIndices(); - } - - public override void OnDeinitializeMelon() - { - MelonCoroutines.Stop(replaceTextureRoutine); - #if MULTI_LANGUAGE - FileLoader.SaveLanguage(); - #endif - //DllStore.UpdateNewDll(); - #if OBFUSCATE && !RELEASE - CheckSumStore.ConvertMD5Json(); - #endif - } - - public static void ShowToast(string message) - { - toast_txt = message; - dtStartToast = new DateTime?(DateTime.Now); - } - - public override void OnLateUpdate() - { - #if DEBUG - ModFeatures.OnLateUpdate(); - #endif - - if (Input.GetKeyDown(KeyCode.Insert)) - { - Utils.OpenSaveDirectory(); - } - - if (Input.GetKeyDown(KeyCode.PageUp)) - { - Utils.OpenOnlineAlmanac(); - } - - TowerManager_Patch.UpdateText(); - - if (CustomLevelMenu_Patch.requestTimer > 0) - { - CustomLevelMenu_Patch.requestTimer -= Time.deltaTime; - if(CustomLevelMenu_Patch.requestTimer < 0) - { - CustomLevelMenu_Patch.requestTimer = 0; - } - } - } - - public override void OnGUI() - { - #if DEBUG - if (dtStartToast != null) - { - GUI.Button(new Rect(10f, 10f, 200f, 20f), "\n" + toast_txt + "\n"); - TimeSpan? timeSpan = DateTime.Now - dtStartToast; - TimeSpan t = new(0, 0, 0, 2); - if (timeSpan > t) - { - dtStartToast = null; - } - } - #endif - } - - public String modsDirectory => Path.Combine(MelonEnvironment.ModsDirectory, "PvZ_Fusion_Translator"); - - public MelonPreferences_Entry configDefaultTextures; - public MelonPreferences_Entry configDefaultAudio; - public MelonPreferences_Entry configUseLocal; - public MelonPreferences_Entry configLanguage; - - private void Config() - { - var category = MelonPreferences.CreateCategory("PvZ_Fusion_Translator", "Fusion Translator Settings"); - - configDefaultTextures = category.CreateEntry("DefaultTextures", false); - configDefaultAudio = category.CreateEntry("DefaultAudio", false); - configUseLocal = category.CreateEntry("UseLocal", false); - configLanguage = category.CreateEntry("Language", "English"); - - MelonPreferences.Save(); - } - } -} \ No newline at end of file diff --git a/MelonLoader/FileLoader.cs b/MelonLoader/FileLoader.cs deleted file mode 100644 index f3d9e36..0000000 --- a/MelonLoader/FileLoader.cs +++ /dev/null @@ -1,1232 +0,0 @@ -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppInterop.Runtime.InteropTypes.Arrays; -using JetBrains.Annotations; -using MelonLoader; -using MelonLoader.TinyJSON; -using Newtonsoft.Json; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.GameObjects; -using PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; -using PvZ_Fusion_Translator.Patches.Modes.Odyssey; -using PvZ_Fusion_Translator.Patches.OtherManagers; -using System.CodeDom.Compiler; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using UnityEngine; - -namespace PvZ_Fusion_Translator -{ - internal static class FileLoader - { - internal enum AssetType - { - Textures, - Strings, - Dumps, - Almanac, - Sprites - } - - public static string GetAssetDir(AssetType assetType, Utils.LanguageEnum? language = null) - { - string languagePath = language.HasValue ? ("Localization" + Path.DirectorySeparatorChar + language.ToString()) : string.Empty; - return Path.Combine(Core.Instance.modsDirectory, languagePath, assetType.ToString()); - } - // private static string GetAssetDir(AssetType assetType) => Path.Combine(Core.Instance.modsDirectory, assetType.ToString()); - - internal static void LoadStrings() => LoadStrings(Utils.Language); - - internal static void LoadStrings(Utils.LanguageEnum language) - { - string stringDir = GetAssetDir(AssetType.Strings, Utils.Language); - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - - if(!Utils.useLocal) - { - // load translationStrings - string translationStringsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/translation_strings.json").Result; - - if(translationStringsContent != null) - { - LoadTranslationStrings(translationStringsContent); - } - else - { - string translationStringsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "translation_strings.json"); - if(File.Exists(translationStringsPath)) - { - LoadTranslationStrings(File.ReadAllText(translationStringsPath)); - } - } - - // load translationRegexs - string translationRegexsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/translation_regexs.json").Result; - - if(translationRegexsContent != null) - { - LoadTranslationRegexs(translationRegexsContent); - } - else - { - string translationRegexsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "translation_regexs.json"); - if(File.Exists(translationRegexsPath)) - { - LoadTranslationRegexs(File.ReadAllText(translationRegexsPath)); - } - } - - string customLevelStringsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/customlevel_strings.json").Result; - - if(customLevelStringsContent != null) - { - LoadCustomLevelStrings(customLevelStringsContent); - } - else - { - string customLevelStringsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "customlevel_strings.json"); - if(File.Exists(customLevelStringsPath)) - { - LoadCustomLevelStrings(File.ReadAllText(customLevelStringsPath)); - } - } - - // load translationRegexs - string customLevelRegexsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/customlevel_regexs.json").Result; - - if(customLevelRegexsContent != null) - { - LoadCustomLevelRegexs(customLevelRegexsContent); - } - else - { - string customLevelRegexsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "customlevel_regexs.json"); - if(File.Exists(customLevelRegexsPath)) - { - LoadCustomLevelRegexs(File.ReadAllText(customLevelRegexsPath)); - } - } - - // load changelog - - LoadChangelogText(); - - // load tips - string izTipsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/tips_iz.json").Result; - - if(izTipsContent != null) - { - LoadIZStrings(izTipsContent); - } - else - { - string izTipsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "tips_iz.json"); - if(File.Exists(izTipsPath)) - { - LoadIZStrings(File.ReadAllText(izTipsPath)); - } - } - - string fsTipsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/tips_fs.json").Result; - - if(fsTipsContent != null) - { - LoadFSStrings(fsTipsContent); - } - else - { - string fsTipsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "tips_fs.json"); - if(File.Exists(fsTipsPath)) - { - LoadFSStrings(File.ReadAllText(fsTipsPath)); - } - } - - // load almanacs - - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - - if(!Directory.Exists(almanacDir)) - { - Directory.CreateDirectory(almanacDir); - } - - string plantAlmanacContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Almanac/LawnStringsTranslate.json").Result; - - if(plantAlmanacContent != null) - { - AlmanacPlantMenu_Patch.LoadPlantAlmanacData(plantAlmanacContent); - } - else - { - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - if(File.Exists(path)) - { - AlmanacPlantMenu_Patch.LoadPlantAlmanacData(File.ReadAllText(path)); - } - } - - string zombieAlmanacContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Almanac/ZombieStringsTranslate.json").Result; - - if(zombieAlmanacContent != null) - { - AlmanacZombieMenu_Patch.almanacJson = zombieAlmanacContent; - } - else - { - string path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - if(File.Exists(path)) - { - AlmanacZombieMenu_Patch.almanacJson = File.ReadAllText(path); - } - } - - string detailStringsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Almanac/DetailStringsTranslate.json").Result; - if(detailStringsContent != null) - { - LoadDetailStrings(detailStringsContent); - } - else - { - string path = Path.Combine(almanacDir, "DetailStringsTranslate.json"); - if(File.Exists(path)) - { - LoadDetailStrings(File.ReadAllText(path)); - } - } - - // load travel_buffs - - LoadTravelBuffs(); - - // load abyss buffs - - //Patches.Modes.Abyss.AbyssBuffMenu_Patch.LoadAbyssBuffData(); - - SaveStrings(); - DumpJson(); - } - else - { - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - try - { - foreach (string filepath in Directory.EnumerateFiles(stringDir, "*.json", SearchOption.AllDirectories)) - { - - #if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } - #endif - - string fileName = Path.GetFileNameWithoutExtension(filepath); - StringStore.stringsDict[fileName] = filepath; - #if DEBUG - Log.LogInfo("Loading File : " + filepath); - #endif - string jsonString = File.ReadAllText(filepath); - if (fileName.EndsWith("translation_strings")) - { - LoadTranslationStrings(jsonString); - } - else if (fileName.EndsWith("translation_regexs")) - { - LoadTranslationRegexs(jsonString); - } - else if (fileName.EndsWith("customlevel_strings")) - { - LoadCustomLevelStrings(jsonString); - } - else if (fileName.EndsWith("customlevel_regexs")) - { - LoadCustomLevelRegexs(jsonString); - } - else if(fileName.EndsWith("tips_iz")) - { - LoadIZStrings(jsonString); - } - else if(fileName.EndsWith("tips_fs")) - { - LoadFSStrings(jsonString); - } - //else if(fileName.EndsWith("abyss_buffs")) - //{ - // Patches.Modes.Abyss.AbyssBuffMenu_Patch.LoadAbyssBuffData(); - //} - else if (fileName.EndsWith("travel_buffs")) - { - LoadTravelBuffs(); - } - } - - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - - if(!Directory.Exists(almanacDir)) - { - Directory.CreateDirectory(almanacDir); - } - - string plantAlmanacPath = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - - if(File.Exists(plantAlmanacPath)) - { - AlmanacPlantMenu_Patch.LoadPlantAlmanacData(File.ReadAllText(plantAlmanacPath)); - } - - string zombieAlmanacPath = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - if(File.Exists(zombieAlmanacPath)) - { - AlmanacZombieMenu_Patch.almanacJson = File.ReadAllText(zombieAlmanacPath); - } - - string detailStringsPath = Path.Combine(almanacDir, "DetailStringsTranslate.json"); - if(File.Exists(detailStringsPath)) - { - LoadDetailStrings(File.ReadAllText(detailStringsPath)); - } - - LoadChangelogText(); - - SaveStrings(); - DumpJson(); - } - catch (Exception e) - { - Log.LogError("Error loading string."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - - Log.LogInfo("Strings loaded successfully."); - } - - internal static void LoadTranslationStrings(string content) - { - Dictionary dictionary = System.Text.Json.JsonSerializer.Deserialize>(content); - foreach (var (key, value) in dictionary) - { - StringStore.translationString[key] = value; - } - } - - internal static void LoadTranslationRegexs(string content) - { - Dictionary dictionary = System.Text.Json.JsonSerializer.Deserialize>(content); - foreach (var (key, value) in dictionary) - { - StringStore.translationStringRegex[key] = value; - } - Zombie_Patch.LoadHPStrings(); - } - - internal static void LoadCustomLevelStrings(string content) - { - Dictionary dictionary = System.Text.Json.JsonSerializer.Deserialize>(content); - foreach (var (key, value) in dictionary) - { - StringStore.customLevelString[key] = value; - } - } - - internal static void LoadCustomLevelRegexs(string content) - { - Dictionary dictionary = System.Text.Json.JsonSerializer.Deserialize>(content); - foreach (var (key, value) in dictionary) - { - StringStore.customLevelStringRegex[key] = value; - } - } - - internal static void LoadIZStrings(string content) - { - var izDump = DumpIZStrings(); - var izLevelData = izDump.Item1; - var izLevelDataDump = izDump.Item2; - - var izTranslatedTips = System.Text.Json.JsonSerializer.Deserialize>(content); - - foreach (var level in izLevelData) - { - string data = level.text; - LevelData levelData = JsonUtility.FromJson(data); - if(levelData.tips != null) - { - if(izTranslatedTips.ContainsKey(level.name) && !StringStore.izTipCollectionString.ContainsKey(levelData.tips)) - { - StringStore.izLevelTipDictionary.Add(level.name, izTranslatedTips[level.name]); - StringStore.izTipCollectionString.Add(levelData.tips, izTranslatedTips[level.name]); - } - } - } - } - - internal static void LoadFSStrings(string content) - { - var fusionShowcaseDump = DumpFSStrings(); - var fusionShowcaseData = fusionShowcaseDump.Item1; - var fusionShowcaseDataDump = fusionShowcaseDump.Item2; - - var fsTranslatedTips = System.Text.Json.JsonSerializer.Deserialize>(content); - - foreach (var level in fusionShowcaseData) - { - string data = level.text; - LevelData levelData = JsonUtility.FromJson(data); - if (levelData.tips != null) - { - if (fsTranslatedTips.ContainsKey(level.name) && !StringStore.fsTipCollectionString.ContainsKey(levelData.tips)) - { - StringStore.fsLevelTipDictionary.Add(level.name, fsTranslatedTips[level.name]); - StringStore.fsTipCollectionString.Add(levelData.tips, fsTranslatedTips[level.name]); - } - } - } - } - - internal static void LoadDetailStrings(string content) - { - var detailStringsDump = DumpDetailStrings(); - var detailStringsData = detailStringsDump.Item1; - var detailStrings = detailStringsDump.Item2; - - var translatedDetailStrings = System.Text.Json.JsonSerializer.Deserialize>(content); - AlmanacSelectMenu_Patch.detailStrings = translatedDetailStrings; - - foreach (var detailString in detailStringsData.details) - { - if (translatedDetailStrings.ContainsKey(detailString.title)) - { - if(!AlmanacSelectMenu_Patch.detailTranslateStrings.ContainsKey(detailString.text)) - { - AlmanacSelectMenu_Patch.detailTranslateStrings.Add(detailString.text, translatedDetailStrings[detailString.title]); - } - else - { - AlmanacSelectMenu_Patch.detailTranslateStrings[detailString.text] = translatedDetailStrings[detailString.title]; - } - } - } - } - - internal static void LoadChangelogText() - { - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - string changelogDir = Path.Combine(stringDir, "changelog.txt"); - string changelogText = ""; - if (!File.Exists(changelogDir)) - { - File.WriteAllText(changelogDir, ""); - } - - changelogText = File.ReadAllText(changelogDir); - - if(!Utils.useLocal) - { - string changelogContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/changelog.txt").Result; - - if(changelogContent != null) - { - changelogText = changelogContent; - } - } - else - { - changelogText = File.ReadAllText(changelogDir); - } - - NoticePauseMenu_Patch.changelogText = changelogText; - } - - internal static void LoadTravelBuffs() - { - if (!Utils.useLocal) - { - string travelBuffsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/travel_buffs.json").Result; - - if (travelBuffsContent != null) - { - TravelMgr_Patch.GenerateTranslatedTravelBuffs(travelBuffsContent); - } - else - { - string travelBuffsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "travel_buffs.json"); - if (File.Exists(travelBuffsPath)) - { - TravelMgr_Patch.GenerateTranslatedTravelBuffs(File.ReadAllText(travelBuffsPath)); - } - } - } - else - { - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - - foreach (string filepath in Directory.EnumerateFiles(stringDir, "*.json", SearchOption.AllDirectories)) - { - string fileName = Path.GetFileNameWithoutExtension(filepath); - string jsonString = File.ReadAllText(filepath); - if (fileName.EndsWith("travel_buffs")) - { - TravelMgr_Patch.GenerateTranslatedTravelBuffs(jsonString); - } - } - } - } - - public static bool loadDefaultTextures = MelonPreferences.GetEntryValue("PvZ_Fusion_Translator", "DefaultTextures"); - internal static void LoadTextures() - { - // Default or Custom Texturse -> English Textures -> Localized Textures - try - { - if (Utils.customTextures) - { - LoadCustomTextures(); - } - } - catch (Exception e) - { - Log.LogError("Error loading texture setting."); - Log.LogError($"{e.GetType()} {e.Message}"); - } - - #if MULTI_LANGUAGE - LoadLocalizedTextures(Utils.Language); - LoadLocalizedSprites(Utils.Language); - #else - LoadLocalizedTextures(); - #endif - - Log.LogInfo("Textures loaded successfully."); - } - - internal static void LoadLocalizedTextures(Utils.LanguageEnum? language = null) - { - string textureDir = GetAssetDir(AssetType.Textures, language); - - if (!Directory.Exists(textureDir)) - { - Directory.CreateDirectory(textureDir); - } - try - { - Dictionary localTOC = new Dictionary(); - string localTOCDir = Path.Combine(textureDir, "Texture_TOC.json"); - if (!File.Exists(localTOCDir)) - { - File.WriteAllText(localTOCDir, "{}"); - } - - string localTOCContent = File.ReadAllText(localTOCDir); - localTOC = System.Text.Json.JsonSerializer.Deserialize>(localTOCContent); - - string basePath = Core.Instance.modsDirectory; - - if (!Utils.useLocal) - { - string textureTOCRequest = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Textures/Texture_TOC.json").Result; - if (textureTOCRequest != null) - { - Dictionary textureTOC = JsonConvert.DeserializeObject>(textureTOCRequest); - - List toDownload = new(); - - foreach(var pair in textureTOC) - { - if(!localTOC.ContainsKey(pair.Key)) - { - toDownload.Add(pair.Key); - continue; - } - - if(pair.Value != localTOC[pair.Key]) - { - toDownload.Add(pair.Key); - } - - if(!File.Exists(Path.Combine(basePath, pair.Key))) - { - toDownload.Add(pair.Key); - continue; - } - } - - string toWriteText = SerializeWithIndentation(textureTOC); - File.WriteAllText(localTOCDir, toWriteText); - - foreach(string path in toDownload) - { - string downloadPath = Path.Combine(basePath, path); - - string baseUrl = $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; - string url = baseUrl + path; - - byte[] imageData = Utils.GetByteDataFromWeb(url).Result; - if(imageData != null) - { - string fileName = Path.GetFileName(downloadPath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.textureDict[fileName] = imageData; - if(!Directory.Exists(Path.GetDirectoryName(downloadPath))) - { - Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); - } - File.WriteAllBytes(downloadPath, imageData); - } - } - } - } - - foreach (string filepath in Directory.EnumerateFiles(textureDir, "*.png", SearchOption.AllDirectories)) - { - if (filepath.Contains("[Custom Textures]", StringComparison.OrdinalIgnoreCase) && loadDefaultTextures) - { - continue; - } - - if (!localTOC.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) - && (SerializeWithIndentation(localTOC) != "{}")) continue; - - #if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } - #endif - - #if DEBUG - Log.LogDebug("Loading File : " + filepath); - #endif - - byte[] imageData = File.ReadAllBytes(filepath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - - internal static void LoadLocalizedSprites(Utils.LanguageEnum? language = null) - { - string textureDir = GetAssetDir(AssetType.Sprites, language); - - if (!Directory.Exists(textureDir)) - { - Directory.CreateDirectory(textureDir); - } - try - { - string trueTextureDir = GetAssetDir(AssetType.Textures, language); - Dictionary localTOC = new Dictionary(); - string localTOCDir = Path.Combine(trueTextureDir, "Texture_TOC.json"); - if (!File.Exists(localTOCDir)) - { - File.WriteAllText(localTOCDir, "{}"); - } - - string localTOCContent = File.ReadAllText(localTOCDir); - localTOC = System.Text.Json.JsonSerializer.Deserialize>(localTOCContent); - - string basePath = Core.Instance.modsDirectory; - - if(!Utils.useLocal) - { - string textureTOCRequest = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Textures/Texture_TOC.json").Result; - if (textureTOCRequest != null) - { - Dictionary textureTOC = JsonConvert.DeserializeObject>(textureTOCRequest); - - List toDownload = new(); - - foreach(var pair in textureTOC) - { - if(!localTOC.ContainsKey(pair.Key)) - { - toDownload.Add(pair.Key); - continue; - } - - if(pair.Value != localTOC[pair.Key]) - { - toDownload.Add(pair.Key); - } - - if(!File.Exists(Path.Combine(basePath, pair.Key))) - { - toDownload.Add(pair.Key); - continue; - } - } - - string toWriteText = SerializeWithIndentation(textureTOC); - File.WriteAllText(localTOCDir, toWriteText); - - foreach(string path in toDownload) - { - string downloadPath = Path.Combine(basePath, path); - - string baseUrl = $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; - string url = baseUrl + path; - - byte[] imageData = Utils.GetByteDataFromWeb(url).Result; - if(imageData != null) - { - string fileName = Path.GetFileName(downloadPath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.spriteDict[fileName] = imageData; - if(!Directory.Exists(Path.GetDirectoryName(downloadPath))) - { - Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); - } - File.WriteAllBytes(downloadPath, imageData); - } - } - } - } - - foreach (string filepath in Directory.EnumerateFiles(textureDir, "*.png", SearchOption.AllDirectories)) - { - if (filepath.Contains("[Custom Textures]", StringComparison.OrdinalIgnoreCase) && loadDefaultTextures) - { - continue; - } - - if (!localTOC.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) - && (SerializeWithIndentation(localTOC) != "{}")) continue; - - #if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } - #endif - - #if DEBUG - Log.LogDebug("Loading File (Sprite): " + filepath); - #endif - - byte[] imageData = File.ReadAllBytes(filepath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.spriteDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - - internal static void LoadDefaultTextures() - { - if(Utils.customTextures == false) - { - string textureDefaultDir = Path.Combine(Core.Instance.modsDirectory, AssetType.Dumps.ToString(), "Default Textures [Do Not Remove]"); - if (!Directory.Exists(textureDefaultDir)) - { - Directory.CreateDirectory(textureDefaultDir); - } - try - { - string trueTextureDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Textures]"); - Dictionary localTOC = new Dictionary(); - string localTOCDir = Path.Combine(trueTextureDir, "Default_TOC.json"); - if (!File.Exists(localTOCDir)) - { - File.WriteAllText(localTOCDir, "{}"); - } - - string localTOCContent = File.ReadAllText(localTOCDir); - localTOC = System.Text.Json.JsonSerializer.Deserialize>(localTOCContent); - - string basePath = Core.Instance.modsDirectory; - - if (!Utils.useLocal) - { - string textureTOCRequest = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/{Uri.EscapeDataString("[Custom Textures]")}/Default_TOC.json").Result; - if (textureTOCRequest != null) - { - Dictionary textureTOC = JsonConvert.DeserializeObject>(textureTOCRequest); - - List toDownload = new(); - - foreach (var pair in textureTOC) - { - if (!localTOC.ContainsKey(pair.Key)) - { - toDownload.Add(pair.Key); - continue; - } - - if (pair.Value != localTOC[pair.Key]) - { - toDownload.Add(pair.Key); - } - - if(!File.Exists(Path.Combine(basePath, pair.Key))) - { - toDownload.Add(pair.Key); - continue; - } - } - - string toWriteText = SerializeWithIndentation(textureTOC); - File.WriteAllText(localTOCDir, toWriteText); - - foreach (string path in toDownload) - { - string downloadPath = Path.Combine(basePath, path); - - string baseUrl = $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; - string url = baseUrl + path; - - byte[] imageData = Utils.GetByteDataFromWeb(url).Result; - if (imageData != null) - { - string fileName = Path.GetFileName(downloadPath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.textureDict[fileName] = imageData; - if(!Directory.Exists(Path.GetDirectoryName(downloadPath))) - { - Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); - } - File.WriteAllBytes(downloadPath, imageData); - } - } - } - } - - foreach (string filepath in Directory.EnumerateFiles(textureDefaultDir, "*.png", SearchOption.AllDirectories)) - { - if (!localTOC.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) - && (SerializeWithIndentation(localTOC) != "{}")) continue; - - #if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } - #endif - - byte[] imageData = File.ReadAllBytes(filepath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - } - - internal static void LoadCustomTextures() - { - string texturePackDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Textures]"); - - if (!Directory.Exists(texturePackDir)) - { - Directory.CreateDirectory(texturePackDir); - } - try - { - string trueTextureDir = Path.Combine(Core.Instance.modsDirectory, "[Custom Textures]"); - Dictionary localTOC = new Dictionary(); - string localTOCDir = Path.Combine(trueTextureDir, "Custom_TOC.json"); - if (!File.Exists(localTOCDir)) - { - File.WriteAllText(localTOCDir, "{}"); - } - - string localTOCContent = File.ReadAllText(localTOCDir); - localTOC = System.Text.Json.JsonSerializer.Deserialize>(localTOCContent); - - string basePath = Core.Instance.modsDirectory; - - if (!Utils.useLocal) - { - string textureTOCRequest = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/{Uri.EscapeDataString("[Custom Textures]")}/Custom_TOC.json").Result; - if (textureTOCRequest != null) - { - Dictionary textureTOC = JsonConvert.DeserializeObject>(textureTOCRequest); - - List toDownload = new(); - - foreach (var pair in textureTOC) - { - if (!localTOC.ContainsKey(pair.Key)) - { - toDownload.Add(pair.Key); - continue; - } - - if (pair.Value != localTOC[pair.Key]) - { - toDownload.Add(pair.Key); - continue; - } - - if(!File.Exists(Path.Combine(basePath, pair.Key))) - { - toDownload.Add(pair.Key); - continue; - } - } - - string toWriteText = SerializeWithIndentation(textureTOC); - File.WriteAllText(localTOCDir, toWriteText); - - foreach (string path in toDownload) - { - string downloadPath = Path.Combine(basePath, path); - - string baseUrl = $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; - string url = baseUrl + path; - - byte[] imageData = Utils.GetByteDataFromWeb(url).Result; - if (imageData != null) - { - string fileName = Path.GetFileName(downloadPath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.textureDict[fileName] = imageData; - if(!Directory.Exists(Path.GetDirectoryName(downloadPath))) - { - Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); - } - File.WriteAllBytes(downloadPath, imageData); - } - } - } - } - - foreach (string filepath in Directory.EnumerateFiles(texturePackDir, "*.png", SearchOption.AllDirectories)) - { - #if OBFUSCATE - if (CheckSumStore.IsModified(filepath)) - { - Log.LogError("File {0} was modified!" , filepath); - continue; - } - #endif - - if (!localTOC.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) - && (SerializeWithIndentation(localTOC) != "{}")) continue; - - byte[] imageData = File.ReadAllBytes(filepath); - Texture2D texture2D = Utils.LoadImage(imageData); - TextureStore.textureDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; - } - } - - catch (Exception e) - { - Log.LogError("Error loading Texture."); - Log.LogError(e.GetType() + " " + e.Message); - } - } - - internal static void SaveStrings() - { - #if MULTI_LANGUAGE - string stringDir = GetAssetDir(AssetType.Strings, Utils.Language); - #else - string stringDir = GetAssetDir(AssetType.Strings); - #endif - if (!Directory.Exists(stringDir)) - { - Directory.CreateDirectory(stringDir); - } - - // save regexs - - string translationStringRegex = SerializeWithIndentation(StringStore.translationStringRegex, 2); - - File.WriteAllText(Path.Combine(stringDir, "translation_regexs.json"), translationStringRegex); - - // save strings - - string translationString = SerializeWithIndentation(StringStore.translationString, 2); - - File.WriteAllText(Path.Combine(stringDir, "translation_strings.json"), translationString); - - // save iz tips - - string izTipCollectionString = SerializeWithIndentation(StringStore.izLevelTipDictionary, 1, ' '); - - File.WriteAllText(Path.Combine(stringDir, "tips_iz.json"), izTipCollectionString); - - // save fs tips - - string fsLevelTipDictionary = SerializeWithIndentation(StringStore.fsLevelTipDictionary); - - File.WriteAllText(Path.Combine(stringDir, "tips_fs.json"), fsLevelTipDictionary); - - // save changelog - - if(NoticePauseMenu_Patch.changelogText != "") - { - File.WriteAllText(Path.Combine(stringDir, "changelog.txt"), NoticePauseMenu_Patch.changelogText); - } - - // save abyss buffs - - //if(Patches.Modes.Abyss.AbyssBuffMenu_Patch.abyssBuffData != new Dictionary()) - //{ - // string abyssBuffData = SerializeWithIndentation(Patches.Modes.Abyss.AbyssBuffMenu_Patch.abyssBuffData, 2); - // File.WriteAllText(Path.Combine(stringDir, "abyss_buffs.json"), abyssBuffData); - //} - - // save almanacs - - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - - if(AlmanacPlantMenu_Patch.almanacJson != "") - { - string plantAlmanac = SerializeWithIndentation(AlmanacPlantMenu_Patch.almanacJson); - - File.WriteAllText(Path.Combine(almanacDir, "LawnStringsTranslate.json"), AlmanacPlantMenu_Patch.almanacJson); - } - - if(AlmanacZombieMenu_Patch.almanacJson != "") - { - string zombieAlmanac = SerializeWithIndentation(AlmanacZombieMenu_Patch.almanacJson); - - File.WriteAllText(Path.Combine(almanacDir, "ZombieStringsTranslate.json"), AlmanacZombieMenu_Patch.almanacJson); - } - - if(AlmanacSelectMenu_Patch.detailStrings != new Dictionary()) - { - string detailStrings = SerializeWithIndentation(AlmanacSelectMenu_Patch.detailStrings); - - File.WriteAllText(Path.Combine(almanacDir, "DetailStringsTranslate.json"), detailStrings); - } - } - - public static string SerializeWithIndentation(T value, int size = 4, char indentChar = ' ') - { - var stringBuilder = new StringBuilder(); - var stringWriter = new StringWriter(); - using (JsonTextWriter writer = new JsonTextWriter(stringWriter)) - { - writer.Formatting = Formatting.Indented; - writer.Indentation = size; - writer.IndentChar = indentChar; - - Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer(); - serializer.Serialize(writer, value, typeof(T)); - } - - return stringWriter.ToString(); - } - - public static void DumpJson() - { - string dumpDir = GetAssetDir(AssetType.Dumps); - - if (!Directory.Exists(dumpDir)) - { - Directory.CreateDirectory(dumpDir); - } - string LawnStrings = Resources.Load("LawnStrings").text; - string ZombieStrings = Resources.Load("ZombieStrings").text; - //string AbyssBuffData = Resources.Load("AbyssBuffData").text; - File.WriteAllText(Path.Combine(dumpDir, "LawnStrings.json"), LawnStrings); - File.WriteAllText(Path.Combine(dumpDir, "ZombieStrings.json"), ZombieStrings); - //File.WriteAllText(Path.Combine(dumpDir, "AbyssBuffData.json"), AbyssBuffData); - - // dump iz tips - var izDump = DumpIZStrings(); - var izLevelData = izDump.Item1; - var izLevelDataDump = izDump.Item2; - - File.WriteAllText(Path.Combine(dumpDir, "tips_iz.json"), System.Text.Json.JsonSerializer.Serialize(izLevelDataDump, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - - // dump fusion showcase tips - var fusionShowcaseDump = DumpFSStrings(); - var fusionShowcaseData = fusionShowcaseDump.Item1; - var fusionShowcaseDataDump = fusionShowcaseDump.Item2; - - File.WriteAllText(Path.Combine(dumpDir, "tips_fs.json"), System.Text.Json.JsonSerializer.Serialize(fusionShowcaseDataDump, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - - // dump almanac mechanics - var detailStringsDump = DumpDetailStrings(); - var detailStringsData = detailStringsDump.Item1; - var detailStrings = detailStringsDump.Item2; - - File.WriteAllText(Path.Combine(dumpDir, "DetailStrings.json"), System.Text.Json.JsonSerializer.Serialize(detailStrings, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - - /*Dictionary achievementsList = new Dictionary(); - foreach (Il2CppSystem.Collections.Generic.KeyValuePair> entry in AchievementClip.achievementsText) - { - achievementsList.Add(entry.Key, new AchievementObject(entry.Key, entry.Value.Item1, entry.Value.Item2)); - } - File.WriteAllText(Path.Combine(dumpDir, "AchievementsText.json"), System.Text.Json.JsonSerializer.Serialize(achievementsList, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }));*/ - } - - public static ValueTuple, Dictionary> DumpIZStrings() - { - var izLevelData = Resources.LoadAll("izleveldata"); - Dictionary izLevelDataDump = new Dictionary(); - foreach (var level in izLevelData) - { - string data = level.text; - LevelData levelData = JsonUtility.FromJson(data); - if(levelData.tips != null) - { - izLevelDataDump.Add(level.name, levelData.tips); - } - } - return new ValueTuple, Dictionary>(izLevelData, izLevelDataDump); - } - - public static ValueTuple, Dictionary> DumpFSStrings() - { - var fusionShowcaseData = Resources.LoadAll("leveldata/explore"); - Dictionary fusionShowcaseDataDump = new Dictionary(); - foreach (var level in fusionShowcaseData) - { - string data = level.text; - LevelData levelData = JsonUtility.FromJson(data); - if (levelData.tips != null) - { - fusionShowcaseDataDump.Add(level.name, levelData.tips); - } - } - return new ValueTuple, Dictionary>(fusionShowcaseData, fusionShowcaseDataDump); - } - - public static ValueTuple> DumpDetailStrings() - { - string detailStringsData = Resources.Load("detailstrings").text; - Il2CppAlmanacData.AlmanacData detailStrings = JsonUtility.FromJson(detailStringsData); - - Dictionary detailStringsDump = new Dictionary(); - foreach (var detailString in detailStrings.details) - { - if(detailStringsDump.ContainsKey(detailString.title)) - { - detailStringsDump[detailString.title] = detailString.text; - } - else - { - detailStringsDump.Add(detailString.title, detailString.text); - } - } - return new ValueTuple>(detailStrings, detailStringsDump); - } - - #if DEBUG - public static void DumpUntranslatedStrings(string text) - { - string dumpDir = GetAssetDir(AssetType.Dumps); - string jsonFile = Path.Combine(dumpDir, "UntranslatedStrings.json"); - - if (!Directory.Exists(dumpDir)) - { - Directory.CreateDirectory(dumpDir); - } - - if (!File.Exists(jsonFile)) - { - File.WriteAllText(jsonFile, "{}"); // Initialize empty JSON object - } - - string json = File.ReadAllText(jsonFile); - var untranslatedStrings = System.Text.Json.JsonSerializer.Deserialize>(json); - - if (!untranslatedStrings.ContainsKey(text)) - { - untranslatedStrings[text] = text; - var options = new JsonSerializerOptions - { - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - WriteIndented = true - }; - File.WriteAllText(jsonFile, System.Text.Json.JsonSerializer.Serialize(untranslatedStrings, options)); - } - } - #endif - - - #if MULTI_LANGUAGE - internal static void LoadLanguage() - { - try - { - // Load the language preference as a string and parse it into the enum - string languageName = MelonPreferences.GetEntryValue("PvZ_Fusion_Translator", "Language"); - if (Enum.TryParse(languageName, out Utils.LanguageEnum loadedLanguage)) - { - Utils.Language = loadedLanguage; - } - else - { - Log.LogWarning($"Invalid language '{languageName}' found in preferences. Falling back to English."); - Utils.Language = Utils.LanguageEnum.English; // Default fallback - } - Log.LogWarning($"Loaded language {languageName}"); - } - catch (Exception e) - { - Log.LogError("Error loading language setting."); - Log.LogError($"{e.GetType()} {e.Message}"); - } - Log.LogInfo($"Language has been loaded: {Utils.Language}"); - } - - internal static void SaveLanguage() - { - try - { - // Save the current language as a string - MelonPreferences.SetEntryValue("PvZ_Fusion_Translator", "Language", Utils.Language.ToString()); - - // Ensure changes are written to the config file - // MelonPreferences.Save(); - } - catch (Exception e) - { - Log.LogError("Error saving language setting."); - Log.LogError($"{e.GetType()} {e.Message}"); - } - // Log.LogInfo($"Language has been saved: {Utils.Language}"); - } - #endif - } -} \ No newline at end of file diff --git a/MelonLoader/FontHandler.cs b/MelonLoader/FontHandler.cs deleted file mode 100644 index a2cad5a..0000000 --- a/MelonLoader/FontHandler.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Il2CppTMPro; -using MelonLoader.Utils; -using UnityEngine; - -namespace PvZ_Fusion_Translator -{ - public static class FontHandler - { - public static Font LoadFont(this string pathFromModsFolder, bool throwException) - { - string fontFilePath = Path.Combine(MelonEnvironment.ModsDirectory, pathFromModsFolder); - if (!File.Exists(fontFilePath)) - { - if (throwException) - Log.LogWarning($"Font not found at path: '{fontFilePath}'."); - return null; - } - Font font = new(); - Font.Internal_CreateFontFromPath(font, fontFilePath); - return font; - } - - public static TMP_FontAsset ConvertToTMP(this Font font) - { - TMP_FontAsset fontAsset = TMP_FontAsset.CreateFontAsset(font); - if (fontAsset == null) - { - Log.LogWarning($"Failed to create TMP_FontAsset from font '{font.name}'."); - return null; - } - return fontAsset; - } - - public static TMP_FontAsset LoadTMPFont(this string pathFromModsFolder, bool throwException) - { - Font font = pathFromModsFolder.LoadFont(throwException); - if (!font) - return null; - TMP_FontAsset fontAsset = font.ConvertToTMP(); - return fontAsset; - } - } -} \ No newline at end of file diff --git a/MelonLoader/Log.cs b/MelonLoader/Log.cs deleted file mode 100644 index d7d93b6..0000000 --- a/MelonLoader/Log.cs +++ /dev/null @@ -1,25 +0,0 @@ -using MelonLoader; -using MelonLoader.Logging; -using System.Drawing; - -namespace PvZ_Fusion_Translator -{ - internal static class Log - { - public static void LogDebug(object txt) => Melon.Logger.Msg(ColorARGB.Gray, txt); - public static void LogDebug(string txt) => Melon.Logger.Msg(ColorARGB.Gray, txt); - public static void LogDebug(string txt, params object[] args) => Melon.Logger.Msg(ColorARGB.Gray, txt, args); - - public static void LogInfo(object txt) => Melon.Logger.Msg(ColorARGB.Blue, txt); - public static void LogInfo(string txt) => Melon.Logger.Msg(ColorARGB.Blue, txt); - public static void LogInfo(string txt, params object[] args) => Melon.Logger.Msg(ColorARGB.Blue, txt, args); - - public static void LogWarning(object txt) => Melon.Logger.Warning(txt); - public static void LogWarning(string txt) => Melon.Logger.Warning(txt); - public static void LogWarning(string txt, params object[] args) => Melon.Logger.Warning(txt, args); - - public static void LogError(object txt) => Melon.Logger.Error(txt); - public static void LogError(string txt) => Melon.Logger.Error(txt); - public static void LogError(string txt, params object[] args) => Melon.Logger.Error(txt, args); - } -} \ No newline at end of file diff --git a/MelonLoader/ModFeatures.cs b/MelonLoader/ModFeatures.cs deleted file mode 100644 index ca2703b..0000000 --- a/MelonLoader/ModFeatures.cs +++ /dev/null @@ -1,95 +0,0 @@ -//#if DEBUG -using Il2Cpp; -using Il2CppGameLevel; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.Modes.Super_Editor; -using UnityEngine; - -namespace PvZ_Fusion_Translator -{ - public static class ModFeatures - { - public enum ModType - { - ReloadStrings, - ReloadTextures, - ExportLevelStrings - } - - private class ModFeature - { - public string Name { get; private set; } - public ModType ModType { get; private set; } - public KeyCode KeyCode { get; private set; } - public bool IsActive { get; set; } - - public ModFeature(string Name, ModType ModType, KeyCode KeyCode, bool defaultValue = false) - { - this.Name = Name; - this.ModType = ModType; - this.KeyCode = KeyCode; - this.IsActive = defaultValue; - } - - public void ToggleFeature() - { - if (this.ModType == ModType.ReloadStrings) - { - StringStore.Reload(); - Core.ShowToast("Strings Reloaded!"); - return; - } - - if (this.ModType == ModType.ReloadTextures) - { - TextureStore.Reload(); - Core.ShowToast("Textures Reloaded!"); - return; - } - - if (this.ModType == ModType.ExportLevelStrings) - { - CustomMenu customMenu = UnityEngine.Object.FindObjectOfType(); - if (!customMenu) return; - if(customMenu.isActiveAndEnabled) - { - Patches.Modes.Super_Editor.GameLevel.LevelManager_Patch.ExportLevelStrings(customMenu.LevelData); - Core.ShowToast("Dumped level strings!"); - } - return; - } - } - } - - private static Dictionary featureLists = new() - { - {ModType.ReloadStrings,new ModFeature("Reload Strings",ModType.ReloadStrings,KeyCode.Home, true)}, - {ModType.ReloadTextures,new ModFeature("Reload Textures",ModType.ReloadTextures,KeyCode.End, true)}, - {ModType.ExportLevelStrings,new ModFeature("Export Level Strings",ModType.ExportLevelStrings,KeyCode.N, true)} - }; - - - public static void ToggleFeature(ModType ModType) - { - if (!featureLists.ContainsKey(ModType)) - return; - - featureLists[ModType].ToggleFeature(); - } - - public static void OnLateUpdate() - { - foreach (var (type, feature) in featureLists) - { - if (feature.KeyCode != KeyCode.None && Enum.IsDefined(typeof(KeyCode), feature.KeyCode)) - { - if (Input.GetKeyDown(feature.KeyCode)) - { - feature.ToggleFeature(); - } - } - } - } - } -} -//#endif \ No newline at end of file diff --git a/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs b/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs deleted file mode 100644 index 4fc812f..0000000 --- a/MelonLoader/Patches/BaseTextObjects/InGameText_Patch.cs +++ /dev/null @@ -1,400 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppCore; -using Il2CppAlmanacData; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.Modes.Odyssey; -using System.Text.RegularExpressions; -using System.Xml.Linq; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(InGameText))] - public static class InGameText_Patch - { - public static string currentText = ""; - - [HarmonyPatch(nameof(InGameText.ShowText))] - [HarmonyPostfix] - public static void ShowText(InGameText __instance) - { - TranslateInGameText(__instance); - } - - [HarmonyPatch(nameof(InGameText.DebugWarning))] - [HarmonyPostfix] - public static void DebugWarning(InGameText __instance) - { - TranslateInGameText(__instance); - } - - [HarmonyPatch(nameof(InGameText.Update))] - [HarmonyPostfix] - public static void Update(InGameText __instance) - { - TranslateInGameText(__instance); - } - - public static void TranslateInGameText(InGameText __instance) - { - TextMeshProUGUI txt = null; - - if (__instance.textMesh == null || __instance.textHead == null) - { - if (__instance.TryGetComponent(out TextMeshProUGUI selfTxt)) - { - txt = selfTxt; - } - } - else - { - txt = __instance.textMesh; - } - - if(txt != null) - { - if (!txt.gameObject.active) return; - - TranslateInGameTextMesh(txt); - } - } - - public static void TranslateInGameTextMesh(TextMeshProUGUI txt) - { - if (txt == null) return; - if (txt.text == currentText) return; - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - string originalText = txt.text; - string lockedPlantMatch = CheckLockedMessage(originalText); - string travelMatch = TravelMgr_Patch.MatchTravelBuff(originalText); - int godsGachaCheck = CheckGodsGachaPopup(originalText); - string godsGachaMatch = ""; - string superEditorPlantMatch = CheckSuperEditorPopup(originalText); - string customLevelRegexMatch = CheckCustomLevelRegex(originalText); - string qualityCheckMatch = CheckQualityUpgrade(originalText); - - switch(godsGachaCheck) - { - case 1: - case 2: - case 3: - godsGachaMatch = TranslateGodsGachaPopup(originalText, godsGachaCheck); - break; - default: - break; - } - - if(godsGachaMatch != "") - { - txt.text = godsGachaMatch; - if (txt.gameObject.name.Contains("main")) - { - originalText = txt.text; - Transform shadowText = txt.transform.parent.Find("Text_shadow"); - if (shadowText != null) - { - shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); - } - } - } - else if (travelMatch != "") - { - txt.text = TravelMgr_Patch.AddBuffName(travelMatch); - if (txt.gameObject.name.Contains("main")) - { - originalText = txt.text; - Transform shadowText = txt.transform.parent.Find("Text_shadow"); - if (shadowText != null) - { - shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); - } - } - } - else if(qualityCheckMatch != "") - { - txt.text = qualityCheckMatch; - } - else if(superEditorPlantMatch != "") - { - txt.text = superEditorPlantMatch; - } - else if(lockedPlantMatch != "") - { - txt.text = lockedPlantMatch; - } - else if(customLevelRegexMatch != "") - { - txt.text = customLevelRegexMatch; - } - else if((Regex.Match(txt.text, @"(]*>.*?)", RegexOptions.Singleline).Success) && - !StringStore.translationString.ContainsKey(txt.text) && - !StringStore.fsTipCollectionString.ContainsKey(txt.text) && - !StringStore.izTipCollectionString.ContainsKey(txt.text) && - !StringStore.customLevelString.ContainsKey(txt.text)) - { - txt.text = StringStore.TranslateColorText(txt.text, true); - if (txt.gameObject.name.Contains("main")) - { - originalText = txt.text; - Transform shadowText = txt.transform.parent.Find("Text_shadow"); - if (shadowText != null) - { - shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); - } - } - } - else - { - txt.text = StringStore.TranslateText(txt.text, true); - if (txt.gameObject.name.Contains("main")) - { - originalText = txt.text; - Transform shadowText = txt.transform.parent.Find("Text_shadow"); - if (shadowText != null) - { - shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); - } - } - } - txt.font = fontAsset; - - currentText = txt.text; - } - - public static string namePlantedPattern = "种植了:([^\\s]+)"; - public static string nameUpgradedPattern = "升级成功:([^\\s]+) -> ([^\\s]+)"; - public static string nameAlreadyPlantedPattern = "场上已经有一个([^\\s]+)了"; - public static string upgradePathRemovedPattern = "已移除路线:([^\\s]+)"; - - public static string lockedPlantPattern = "^([\\s\\S]+)\\+([\\S]+)$"; - public static string multiLockedPlantPattern = "^或 ([\\s\\S]+)\\+([\\S]+)$"; - - public static string qualityChangePattern = "诸神注视着你,并选中了一个他们喜欢的词条\n植物【([\\S]+)】的词条【强化:([\\S]+)】获得品质升级\n当前品质:([\\S]+)"; - - public static Dictionary fallbackFStrs = new Dictionary() - { - { namePlantedPattern, "{0} planted!"}, - { nameUpgradedPattern, "{0} successfully upgraded to {1}!"}, - { nameAlreadyPlantedPattern, "{0} already exists on the lawn!"}, - { upgradePathRemovedPattern, "Upgrade Path removed for {0}" }, - { @"([^\s]+)\((\d+)\)", "{0}({1})" }, - { lockedPlantPattern, "{0} + {1}" }, - { multiLockedPlantPattern, "or {0} + {1}" }, - { qualityChangePattern, "The gods are watching you, and they have granted you an upgrade!\nThe {1} upgrade for {0} has been upgraded.\nCurrent Quality: {2}" } - }; - - public static int CheckGodsGachaPopup(string originalText) - { - int res = 0; - - if (Regex.IsMatch(originalText, namePlantedPattern)) - { - res = 1; - } - else if(Regex.IsMatch(originalText, nameUpgradedPattern)) - { - res = 2; - } - else if(Regex.IsMatch(originalText, nameAlreadyPlantedPattern)) - { - res = 3; - } - - return res; - } - - public static string TranslateGodsGachaPopup(string originalText, int type) - { - string res = originalText; - - switch(type) - { - case 1: - res = StringStore.TranslateText(originalText, namePlantedPattern); - break; - case 2: - res = StringStore.TranslateText(originalText, nameUpgradedPattern); - break; - case 3: - res = StringStore.TranslateText(originalText, nameAlreadyPlantedPattern); - break; - default: - break; - } - - return res; - } - - public static string TranslatePlantNameParts(string originalText, string pattern) - { - string res = ""; - string fStr = ""; - Match match = Regex.Match(originalText, pattern); - if(match.Success) - { - GroupCollection groups = match.Groups; - fStr = StringStore.translationStringRegex.ContainsKey(pattern) ? StringStore.translationStringRegex[pattern] : fallbackFStrs[pattern]; - List dynamicParts = []; - for(int i = 1; i < groups.Count; i++) - { - string group = groups[i].Value; - string plantName = Utils.GetPlantNameFromAlmanac(group); - dynamicParts.Add(plantName); - } - res = string.Format(fStr, [.. dynamicParts]); - } - return res; - } - - public static string TranslatePlantNameParts(string originalText, string pattern, string fallback) - { - string res = ""; - string fStr = ""; - Match match = Regex.Match(originalText, pattern); - if(match.Success) - { - GroupCollection groups = match.Groups; - fStr = StringStore.translationStringRegex.ContainsKey(pattern) ? StringStore.translationStringRegex[pattern] : fallback; - List dynamicParts = []; - for(int i = 1; i < groups.Count; i++) - { - string group = groups[i].Value; - string plantName = Utils.GetPlantNameFromAlmanac(group); - if (plantName == "") plantName = StringStore.TranslateText(group); - dynamicParts.Add(plantName); - } - res = string.Format(fStr, [.. dynamicParts]); - } - return res; - } - - public static string CheckSuperEditorPopup(string originalText) - { - string res = ""; - - if(Regex.IsMatch(originalText, upgradePathRemovedPattern)) - { - res = StringStore.TranslateText(originalText, upgradePathRemovedPattern); - } - else if(Regex.IsMatch(originalText, "当前全部基础植物:(.*)")) - { - string pattern = "当前全部基础植物:(.*)"; - Match match = Regex.Match(originalText, pattern); - if(match.Success) - { - GroupCollection groups = match.Groups; - string plantNameGroup = groups[1].Value; - string[] plantNames = plantNameGroup.Split(" "); - string plantRes = ""; - string shortPattern = @"([^\s]+)\((\d+)\)"; - foreach (string plantName in plantNames) - { - Match shortMatch = Regex.Match(plantName, shortPattern); - if(shortMatch.Success) - { - string fStr = StringStore.translationStringRegex.ContainsKey(shortPattern) ? StringStore.translationStringRegex[shortPattern] : fallbackFStrs[shortPattern]; - string shortRes = string.Format(fStr, [Utils.GetPlantNameFromAlmanac(shortMatch.Groups[1].Value), shortMatch.Groups[2].Value]); - plantRes += shortRes + " "; - } - } - res = StringStore.TranslateText("当前全部基础植物:" + plantRes); - } - } - - return res; - } - - public static string CheckLockedMessage(string originalText) - { - string res = ""; - - Regex lockedPlantRegex = new Regex(lockedPlantPattern); - Regex multiLockedPlantRegex = new Regex(multiLockedPlantPattern); - - if(lockedPlantRegex.IsMatch(originalText)) - { - if(originalText.Contains("\n")) - { - string[] lines = originalText.Split("\n"); - if (lockedPlantRegex.IsMatch(lines[0])) - { - string firstLine = lines[0]; - Match match = lockedPlantRegex.Match(firstLine); - GroupCollection groups = match.Groups; - if (Utils.plantIndiceString.ContainsKey(groups[1].Value) && Utils.plantIndiceString.ContainsKey(groups[2].Value)) - { - firstLine = StringStore.TranslateText(firstLine, lockedPlantPattern); - List translatedLines = new List() { firstLine }; - for(int i = 1; i < lines.Length; i++) - { - string nextLine = lines[i]; - string translatedNextLine = StringStore.TranslateText(nextLine, multiLockedPlantPattern); - translatedLines.Add(translatedNextLine); - } - res = string.Join("\n", translatedLines); - } - else - { - return ""; - } - } - } - else - { - if (lockedPlantRegex.IsMatch(originalText)) - { - Match match = lockedPlantRegex.Match(originalText); - GroupCollection groups = match.Groups; - if (Utils.plantIndiceString.ContainsKey(groups[1].Value) && Utils.plantIndiceString.ContainsKey(groups[2].Value)) - { - res = StringStore.TranslateText(originalText, lockedPlantPattern); - } - else - { - return ""; - } - } - } - } - - return res; - } - - public static string CheckCustomLevelRegex(string originalText) - { - string res = ""; - - foreach(var pair in StringStore.customLevelStringRegex) - { - if(StringStore.TestRegex(originalText, pair.Key)) - { - res = StringStore.TranslateText(originalText, pair.Key); - } - } - foreach(var pair in StringStore.translationStringRegex) - { - if(StringStore.TestRegex(originalText, pair.Key)) - { - res = ""; - } - } - return res; - } - - public static string CheckQualityUpgrade(string originalText) - { - string res = ""; - - if(Regex.IsMatch(originalText, qualityChangePattern)) - { - res = StringStore.TranslateText(originalText, qualityChangePattern); - } - - return res; - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/BaseTextObjects/TMP_Dropdown_Patch.cs b/MelonLoader/Patches/BaseTextObjects/TMP_Dropdown_Patch.cs deleted file mode 100644 index 9b7a3a3..0000000 --- a/MelonLoader/Patches/BaseTextObjects/TMP_Dropdown_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.Patches.Managers; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TMP_Dropdown))] - public static class TMP_Dropdown_Patch - { - [HarmonyPatch(nameof(TMP_Dropdown.Awake))] - [HarmonyPatch(nameof(TMP_Dropdown.Start))] - [HarmonyPatch(nameof(TMP_Dropdown.Show))] - [HarmonyPatch(nameof(TMP_Dropdown.SetValue))] - [HarmonyPostfix] - public static void Awake(TMP_Dropdown __instance) - { - if(__instance.captionText) - { - TMP_Text txt = __instance.captionText; - txt.text = StringStore.translationString.ContainsKey(txt.text + "_code") ? StringStore.TranslateText(txt.text + "_code") : StringStore.TranslateText(txt.text); - } - - if(__instance.itemText) - { - TMP_Text txt = __instance.itemText; - txt.text = StringStore.translationString.ContainsKey(txt.text + "_code") ? StringStore.TranslateText(txt.text + "_code") : StringStore.TranslateText(txt.text); - } - - foreach(TMP_Dropdown.DropdownItem dropdownItem in __instance.m_Items) - { - TMP_Text txt = dropdownItem.text; - txt.text = StringStore.translationString.ContainsKey(txt.text + "_code") ? StringStore.TranslateText(txt.text + "_code") : StringStore.TranslateText(txt.text); - } - } - - [HarmonyPatch(nameof(TMP_Dropdown.CreateDropdownList))] - public static void CreateDropdownList(TMP_Dropdown __instance) - { - foreach(TMP_Text txt in __instance.GetComponentsInChildren(true)) - { - txt.text = StringStore.translationString.ContainsKey(txt.text + "_code") ? StringStore.TranslateText(txt.text + "_code") : StringStore.TranslateText(txt.text); - } - } - } -} diff --git a/MelonLoader/Patches/BaseTextObjects/TMP_InputField_Patch.cs b/MelonLoader/Patches/BaseTextObjects/TMP_InputField_Patch.cs deleted file mode 100644 index 0465668..0000000 --- a/MelonLoader/Patches/BaseTextObjects/TMP_InputField_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TMP_InputField))] - public static class TMP_InputField_Patch - { - [HarmonyPatch(nameof(TMP_InputField.OnEnable))] - [HarmonyPostfix] - public static void OnEnable(TMP_InputField __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - string text = StringStore.TranslateText(__instance.text); - __instance.m_Text = StringStore.TranslateText(text); - __instance.m_OriginalText = StringStore.TranslateText(text); - __instance.m_TextComponent.text = StringStore.TranslateText(text); - } - } - } -} diff --git a/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs b/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs deleted file mode 100644 index e7444ca..0000000 --- a/MelonLoader/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs +++ /dev/null @@ -1,110 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.Patches.Managers; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TextMeshProUGUI))] - public static class TextMeshProUGUI_Patch - { - [HarmonyPatch(nameof(TextMeshProUGUI.OnEnable))] - [HarmonyPostfix] - private static void OnEnable(TextMeshProUGUI __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - __instance.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - - if (!Utils.CheckForUntranslatedText(__instance.text) && !(__instance.text).Contains("_")) return; - - if(__instance.transform.parent != null) - { - if(__instance.transform.parent.name.Contains("DrawCardsText")) - { - return; - } - - if(__instance.transform.parent.parent != null) - { - if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) - { - return; - } - } - } - - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = false; - - if (__instance.name.StartsWith("LevelName")) - { - __instance.text = __instance.text.Replace("\n", " "); - - if ((__instance.name == "LevelName2" || __instance.name == "LevelName3") && !(__instance.gameObject.transform.parent.name.Contains("Difficulty") || __instance.gameObject.name.Contains("Difficulty"))) - { - TowerManager_Patch.updatedText.Add(__instance.transform); - } - } - if (__instance.transform.parent != null && __instance.transform.parent.name.StartsWith("Window")) - { - __instance.fontSizeMin = 10; - __instance.fontSize = 12; - } - - // __instance.ForceMeshUpdate(); - } - } - - /*[HarmonyPatch(nameof(TextMeshProUGUI.Awake))] - [HarmonyPostfix] - private static void Awake(TextMeshProUGUI __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - if (__instance.transform.parent.parent != null) - { - if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) - { - return; - } - } - - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = false; - - if (__instance.transform.parent != null && __instance.transform.parent.name.StartsWith("Window")) - { - __instance.fontSizeMin = 10; - __instance.fontSize = 12; - } - - if (__instance.text == "Полный Хаос" && __instance.transform.parent.parent.Find("Image").GetComponent().activeSprite.name == "Present") - { - __instance.text += "\nБесконечно"; - } - - // __instance.ForceMeshUpdate(); - } - }*/ - } - - /*[HarmonyPatch(typeof(TMP_SubMeshUI))] - public static class TMP_SubMeshUI_Patch - { - [HarmonyPatch(nameof(TMP_SubMeshUI.OnEnable))] - [HarmonyPostfix] - public static void OnEnable(TMP_SubMeshUI __instance) - { - if (!string.IsNullOrEmpty(__instance.textComponent.text)) - { - string text = StringStore.TranslateText(__instance.textComponent.text); - __instance.m_TextComponent.text = StringStore.TranslateText(text); - __instance.textComponent.text = StringStore.TranslateText(text); - } - } - }*/ -} diff --git a/MelonLoader/Patches/BaseTextObjects/TextMeshPro_Patch.cs b/MelonLoader/Patches/BaseTextObjects/TextMeshPro_Patch.cs deleted file mode 100644 index 2be83f5..0000000 --- a/MelonLoader/Patches/BaseTextObjects/TextMeshPro_Patch.cs +++ /dev/null @@ -1,33 +0,0 @@ -using HarmonyLib; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.BaseTextObjects -{ - [HarmonyPatch(typeof(TextMeshPro))] - public static class TextMeshPro_Patch - { - [HarmonyPatch(nameof(TextMeshPro.OnEnable))] - [HarmonyPostfix] - private static void OnEnable(TextMeshPro __instance) - { - if (!string.IsNullOrEmpty(__instance.text)) - { - if(__instance.transform.parent.name.Contains("DrawCardsText")) - { - return; - } - else if (__instance.transform.parent.name.StartsWith("AlmanacHelp") || __instance.transform.parent.name.StartsWith("CardBank")) - { - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = false; - return; - } else if (!(__instance.transform.name.Contains("AlmanacZombie") || __instance.transform.name.Contains("AlmanacPlant") || __instance.transform.name.Contains("Name") || __instance.transform.name.Contains("Tips") || __instance.transform.parent.name.Contains("Signboard") || __instance.transform.parent.name.Contains("text"))) - { - __instance = StringStore.TranslateText(__instance); - __instance.autoSizeTextContainer = true; - } - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/AlmanacBuffMenu_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacBuffMenu_Patch.cs deleted file mode 100644 index 968af10..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacBuffMenu_Patch.cs +++ /dev/null @@ -1,100 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Drawing; -using static Il2Cpp.AlmanacBuffMenu; -using static PvZ_Fusion_Translator.FileLoader; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; -using static PvZ_Fusion_Translator.Utils; -using Unity.VisualScripting; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacBuffMenu))] - public static class AlmanacBuffMenu_Patch - { - [HarmonyPatch(nameof(AlmanacBuffMenu.Awake))] - [HarmonyPostfix] - public static void Post_Awake(AlmanacBuffMenu __instance) - { - foreach(AlmanacCardUI cardUI in __instance.cards) - { - AlmanacBuffMenu.CardInfo cardInfo = __instance.cardInfos[cardUI]; - var buffData = FindBuffData(cardInfo.description); - - if (buffData.Item1 == null || buffData.Item3 == null) continue; - - cardUI.cost.text = (buffData.Item4) ? buffData.Item1 : $"{buffData.Item1} #{buffData.Item2}"; - } - - Post_OnCardClick(__instance); - } - - [HarmonyPatch(nameof(AlmanacBuffMenu.SetAllCards))] - [HarmonyPatch(nameof(AlmanacBuffMenu.Start))] - [HarmonyPatch(nameof(AlmanacBuffMenu.InitMenu))] - [HarmonyPostfix] - public static void Post_SetAllCards(AlmanacBuffMenu __instance) - { - foreach(AlmanacCardUI cardUI in __instance.cards) - { - AlmanacBuffMenu.CardInfo cardInfo = __instance.cardInfos[cardUI]; - var buffData = FindBuffData(cardInfo.description); - if (buffData.Item1 == null || buffData.Item3 == null) continue; - - cardUI.cost.text = (buffData.Item4) ? buffData.Item1 : $"{buffData.Item1} #{buffData.Item2}"; - } - - Post_OnToolClick(__instance); - - Post_OnCardClick(__instance); - } - - [HarmonyPatch(nameof(AlmanacBuffMenu.OnToolClick))] - [HarmonyPostfix] - public static void Post_OnToolClick(AlmanacBuffMenu __instance) - { - foreach(TextMeshProUGUI txt in __instance.toolButton.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - [HarmonyPatch(nameof(AlmanacBuffMenu.OnCardClick))] - [HarmonyPostfix] - public static void Post_OnCardClick(AlmanacBuffMenu __instance) - { - var buffData = FindBuffData(__instance.buffDescription.text); - - if (buffData.Item1 == null || buffData.Item3 == null) - { - return; - } - - __instance.buffTitle.text = (buffData.Item4) ? buffData.Item1 : $"{buffData.Item1} #{buffData.Item2}"; - __instance.buffTitle.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - string buffFStr = StringStore.translationStringRegex.ContainsKey("BUFF_NAME_FORMAT") ? StringStore.translationStringRegex["BUFF_NAME_FORMAT"] : "{0}: {1}"; - string fBuffDesc = string.Format(buffFStr, buffData.Item1, buffData.Item3); - __instance.buffDescription.text = (buffData.Item4) ? fBuffDesc + "\n\n" : buffData.Item3 + "\n\n"; - __instance.buffDescription.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - string colorHex = StringStore.translationString.ContainsKey("MOD_ALMANAC_COL") ? StringStore.TranslateText("MOD_ALMANAC_COL") : "#000000"; - System.Drawing.Color descriptionColor = ColorTranslator.FromHtml(colorHex); - __instance.buffDescription.color = new UnityEngine.Color(descriptionColor.R / 255.0f, descriptionColor.G / 255.0f, descriptionColor.B / 255.0f); - - __instance.buffDescription.fontSizeMax = 18; - __instance.buffDescription.margin = new Vector4(8, 4, 25, 0); - - __instance.buffDescription.enableWordWrapping = true; - __instance.buffDescription.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.buffDescription.ForceMeshUpdate(); - - Post_OnToolClick(__instance); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/AlmanacCardUI_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacCardUI_Patch.cs deleted file mode 100644 index 9cdf33e..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacCardUI_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacCardUI))] - public static class AlmanacCardUI_Patch - { - [HarmonyPatch(nameof(AlmanacCardUI.Awake))] - [HarmonyPostfix] - public static void Awake(AlmanacCardUI __instance) - { - if (!Utils.CheckForUntranslatedText(__instance.cost.text)) return; - __instance.cost.text = StringStore.TranslateText(__instance.cost.text); - } - - /*[HarmonyPatch(nameof(AlmanacCardUI.OnPointerDown))] - [HarmonyPostfix] - public static void OnPointerDown(AlmanacCardUI __instance) - { - foreach (AlmanacCardUI almanacCardUI in __instance.menu.GetComponentsInChildren()) - { - AlmanacCardUI_Patch.Awake(almanacCardUI); - } - }*/ - } -} diff --git a/MelonLoader/Patches/GameObjects/AlmanacPlantMenu_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacPlantMenu_Patch.cs deleted file mode 100644 index 39a454d..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacPlantMenu_Patch.cs +++ /dev/null @@ -1,137 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppTMPro; -using MelonLoader.TinyJSON; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.Json; -using System.Text.RegularExpressions; -using Unity.Collections; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.UI; -using UnityEngine.UIElements; -using static PvZ_Fusion_Translator.FileLoader; -using static PvZ_Fusion_Translator.Utils; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacPlantMenu))] - public static class AlmanacPlantMenu_Patch - { - public static string almanacJson = ""; - public static Dictionary plantInfoDict = new(); - - [HarmonyPatch(nameof(AlmanacPlantMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AlmanacPlantMenu __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren(true)) - { - bool isPlantName = text.gameObject.name.Contains("Name") && text.transform.parent.name != "Background"; - if (text.gameObject.name != "Description" && !isPlantName && !text.gameObject.name.Contains("Cost")) - { - text.text = StringStore.TranslateText(text.text); - text.font = font; - text.autoSizeTextContainer = true; - } - } - - foreach (AlmanacCardUI almanacCardUI in __instance.GetComponentsInChildren()) - { - AlmanacCardUI_Patch.Awake(almanacCardUI); - } - - // skin button resize - - AlmanacPlantWindow window = __instance.window; - GameObject skinButton = window.skinButton; - GameObject skinTextObj = skinButton.transform.Find("text_1").gameObject; - skinButton.transform.localScale /= 1.75f; - skinButton.transform.localPosition = new Vector3(0.0f, 111.345f, 0.0f); - skinButton.transform.GetChild(1).Translate(new Vector3(-0.35f, 0)); - skinButton.transform.GetChild(2).Translate(new Vector3(0.35f, 0)); - } - - [HarmonyPatch(nameof(AlmanacPlantMenu.SearchChanged))] - [HarmonyPrefix] - public static bool SearchChanged(AlmanacPlantMenu __instance, ref TMP_InputField inputField) - { - string search = inputField.text; - if (search != StringStore.TranslateText("搜索") && search != "") - { - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - - string json = AlmanacPlantMenu_Patch.almanacJson; - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - - AlmanacData plantData = JsonUtility.FromJson(json); - - Il2CppSystem.Collections.Generic.List searchedPlants = new(); - - foreach (PlantInfo plantInfo in plantData.plants) - { - if (plantInfo.name.ToLower().Contains(search.ToLower())) - { - searchedPlants.Add((PlantType)plantInfo.seedType); - } - else if ($"{plantInfo.seedType}".ToLower().StartsWith(search.ToLower())) - { - searchedPlants.Add((PlantType)plantInfo.seedType); - } - } - - __instance.ShowPlants(searchedPlants); - - return false; - } - - return true; - } - - [HarmonyPatch(nameof(AlmanacPlantMenu.ShowPlants), argumentTypes: [typeof(Il2CppSystem.Func)])] - [HarmonyPostfix] - public static void ShowPlants(AlmanacPlantMenu __instance, ref Func condition) - { - foreach (AlmanacCardUI cardUI in __instance.cards) - { - AlmanacCardUI_Patch.Awake(cardUI); - } - } - - [HarmonyPatch(nameof(AlmanacPlantMenu.ClassicMix))] - [HarmonyPostfix] - public static void ClassicMix(AlmanacPlantMenu __instance) - { - foreach (AlmanacCardUI cardUI in __instance.cards) - { - AlmanacCardUI_Patch.Awake(cardUI); - } - } - - public static void LoadPlantAlmanacData(string json) - { - if (json == null) return; - - almanacJson = json; - - var plantData = JsonUtility.FromJson(almanacJson); - - foreach (Il2CppAlmanacData.PlantInfo plantInfo in plantData.plants) - { - if(plantInfoDict.ContainsKey(plantInfo.seedType)) - { - plantInfoDict[plantInfo.seedType] = plantInfo; - } - else - { - plantInfoDict.Add(plantInfo.seedType, plantInfo); - } - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/AlmanacPlantWindow_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacPlantWindow_Patch.cs deleted file mode 100644 index b752d26..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacPlantWindow_Patch.cs +++ /dev/null @@ -1,69 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.UI; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacPlantWindow))] - public static class AlmanacPlantWindow_Patch - { - [HarmonyPatch(nameof(AlmanacPlantWindow.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(AlmanacPlantWindow __instance) - { - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); - - string json = AlmanacPlantMenu_Patch.almanacJson; - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary.ContainsKey((currentLanguage + "_almanac").ToLower()) || FontStore.fontAssetDictSecondary.ContainsKey((currentLanguage).ToLower())) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = true; - } - - TMP_FontAsset fontAsset = (hasAlmanacFont) ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) : FontStore.LoadTMPFont(Utils.Language.ToString()); - - AlmanacData plantData = JsonUtility.FromJson(json); - - if(AlmanacPlantMenu_Patch.plantInfoDict.ContainsKey((int)__instance.currentPlantType)) - { - PlantInfo plantInfo = AlmanacPlantMenu_Patch.plantInfoDict[(int)__instance.currentPlantType]; - - foreach (TextMeshProUGUI text in __instance.showedPlantName) - { - text.autoSizeTextContainer = false; - text.text = $"{Utils.RemoveSizeTags(plantInfo.name)} ({plantInfo.seedType})"; - text.font = fontAsset; - text.fontSizeMax = 21; - } - - char[] toTrim = Environment.NewLine.ToCharArray(); - __instance.showedPlantIntroduce.text = Utils.RemoveSizeTags(plantInfo.info) + "\n\n" + Utils.RemoveSizeTags(plantInfo.introduce) + "\n\n" + Utils.RemoveSizeTags(plantInfo.cost).TrimStart(toTrim) + "\n\n"; - __instance.showedPlantIntroduce.font = fontAsset; - __instance.showedPlantIntroduce.fontSizeMax = 21; - __instance.showedPlantIntroduce.margin = new Vector4(6, 2, 12, 0); - - __instance.showedPlantIntroduce.enableWordWrapping = true; - __instance.showedPlantIntroduce.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.showedPlantIntroduce.ForceMeshUpdate(); - - float textHeight = __instance.showedPlantIntroduce.preferredHeight; - __instance.plantTextContent.sizeDelta = new Vector2(__instance.plantTextContent.sizeDelta.x, textHeight); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/AlmanacSelectMenu_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacSelectMenu_Patch.cs deleted file mode 100644 index c335bb3..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacSelectMenu_Patch.cs +++ /dev/null @@ -1,56 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using Unity.Collections; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.UI; -using UnityEngine.UIElements; -using static PvZ_Fusion_Translator.FileLoader; -using static PvZ_Fusion_Translator.Utils; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacSelectMenu))] - public static class AlmanacSelectMenu_Patch - { - public static Dictionary detailStrings = new Dictionary(); - public static Dictionary detailTranslateStrings = new Dictionary(); - - [HarmonyPatch(nameof(AlmanacSelectMenu.Awake))] - [HarmonyPostfix] - public static void Awake(AlmanacSelectMenu __instance) - { - TranslateAlmanacSelectMenu(__instance); - - foreach(UIButton uiButton in __instance.GetComponentsInChildren()) - { - if(uiButton.gameObject.name.Contains("Selection(Clone)")) - { - uiButton.clickEvent.AddListener(new Action(() => { TranslateAlmanacSelectMenu(__instance); })); - } - } - } - - [HarmonyPatch(nameof(AlmanacSelectMenu.InitMenu))] - [HarmonyPostfix] - public static void InitMenu(AlmanacSelectMenu __instance) - { - TranslateAlmanacSelectMenu(__instance); - } - - public static void TranslateAlmanacSelectMenu(AlmanacSelectMenu __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = detailTranslateStrings.ContainsKey(txt.text) ? detailTranslateStrings[txt.text] : StringStore.TranslateText(txt.text); - txt.font = font; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/AlmanacZombieMenu_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacZombieMenu_Patch.cs deleted file mode 100644 index 17e6a27..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacZombieMenu_Patch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.UI; -using static PvZ_Fusion_Translator.FileLoader; -using static PvZ_Fusion_Translator.Utils; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacZombieMenu))] - public static class AlmanacZombieMenu_Patch - { - public static string almanacJson = ""; - - [HarmonyPatch(nameof(AlmanacZombieMenu.Start))] - [HarmonyPostfix] - private static void Start(AlmanacZombieMenu __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren(true)) - { - if (text.gameObject.name.Contains("Cost")) continue; - - bool isZombieName = text.gameObject.name.Contains("Name") && text.transform.parent.name != "Background"; - if (text.gameObject.name != "Description" && !isZombieName) - { - text.text = StringStore.TranslateText(text.text); - text.font = font; - text.autoSizeTextContainer = true; - } - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs b/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs deleted file mode 100644 index 49a4852..0000000 --- a/MelonLoader/Patches/GameObjects/AlmanacZombieWindow_Patch.cs +++ /dev/null @@ -1,77 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.UI; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(AlmanacZombieWindow))] - public static class AlmanacZombieWindow_Patch - { - [HarmonyPatch(nameof(AlmanacZombieWindow.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(AlmanacZombieWindow __instance) - { - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - - string json = AlmanacZombieMenu_Patch.almanacJson; - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary.ContainsKey((currentLanguage + "_almanac").ToLower()) || FontStore.fontAssetDictSecondary.ContainsKey((currentLanguage).ToLower())) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = true; - } - - TMP_FontAsset fontAsset = (hasAlmanacFont) ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) : FontStore.LoadTMPFont(Utils.Language.ToString()); - - Il2CppAlmanacData.AlmanacData zombieAlmanacData = JsonUtility.FromJson(json); - var zombieDataDic = ZombieDataManager.zombieDataDic; - - foreach (Il2CppAlmanacData.ZombieInfo zombieInfo in zombieAlmanacData.zombies) - { - if (zombieInfo.theZombieType == __instance.currentZombieType) - { - foreach (TextMeshProUGUI text in __instance.showedZombieName) - { - text.autoSizeTextContainer = false; - text.text = $"{Utils.RemoveSizeTags(zombieInfo.name)} ({(int)zombieInfo.theZombieType})"; - text.font = fontAsset; - text.fontSizeMax = 21; - } - - ZombieDataManager.ZombieData zombieData = zombieDataDic[__instance.currentZombieType]; - - string spawnInfo = ""; - string spawnInfoFormat = StringStore.translationStringRegex.ContainsKey("出怪等级: (\\d+)\n出怪权重: (\\d+)") ? StringStore.translationStringRegex["出怪等级: (\\d+)\n出怪权重: (\\d+)"] : null; - if(spawnInfoFormat != null) - { - spawnInfo = string.Format(spawnInfoFormat, [zombieData.summonLevel, zombieData.summonWeight]) + "\n\n"; - } - - __instance.showedZombieIntroduce.text = Utils.RemoveSizeTags(zombieInfo.info) + "\n\n" + spawnInfo + Utils.RemoveSizeTags(zombieInfo.introduce) + "\n\n"; - __instance.showedZombieIntroduce.font = fontAsset; - __instance.showedZombieIntroduce.fontSizeMax = 21; - __instance.showedZombieIntroduce.margin = new Vector4(3, 2, 12, 0); - - __instance.showedZombieIntroduce.enableWordWrapping = true; - __instance.showedZombieIntroduce.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - __instance.showedZombieIntroduce.ForceMeshUpdate(); - - float textHeight = __instance.showedZombieIntroduce.preferredHeight; - __instance.zombieTextContent.sizeDelta = new Vector2(__instance.zombieTextContent.sizeDelta.x, textHeight); - } - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/Almanac_Patch.cs b/MelonLoader/Patches/GameObjects/Almanac_Patch.cs deleted file mode 100644 index d1e2885..0000000 --- a/MelonLoader/Patches/GameObjects/Almanac_Patch.cs +++ /dev/null @@ -1,54 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; -using Unity.VisualScripting; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(Almanac))] - public static class Almanac_Patch - { - [HarmonyPatch(nameof(Almanac.Awake))] - [HarmonyPostfix] - private static void Awake(Almanac __instance) - { - TranslateAlmanacMenu(__instance); - } - - /*[HarmonyPatch(nameof(Almanac.OldAlmanac))] - [HarmonyPostfix] - private static void OldAlmanac(Almanac __instance) - { - TranslateAlmanacMenu(__instance); - }*/ - - [HarmonyPatch(nameof(Almanac.AnimSwitch))] - [HarmonyPostfix] - private static void AnimSwitch(Almanac __instance) - { - TranslateAlmanacMenu(__instance); - } - - public static void TranslateAlmanacMenu(Almanac __instance) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - if (text.gameObject.name.Contains("Cost")) continue; - - if(text.text == "关闭") - { - text.text = StringStore.TranslateText("合上"); - } - else - { - text.text = StringStore.TranslateText(text.text); - } - text.font = font; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs b/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs deleted file mode 100644 index 49c2fa3..0000000 --- a/MelonLoader/Patches/GameObjects/BaseMenu_Patch.cs +++ /dev/null @@ -1,67 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using static MelonLoader.MelonLogger; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(BaseMenu))] - public static class BaseMenu_Patch - { - [HarmonyPatch(nameof(BaseMenu.Awake))] - [HarmonyPrefix] - private static void Pre_Awake(BaseMenu __instance) - { - if(__instance.name.Contains("NoticePauseMenu")) - { - NoticePauseMenu_Patch.Pre_Awake(__instance); - } - } - - [HarmonyPatch(nameof(BaseMenu.Awake))] - [HarmonyPostfix] - private static void Post_Awake(BaseMenu __instance) - { - if(__instance.name.Contains("NoticePauseMenu")) - { - NoticePauseMenu_Patch.Post_Awake(__instance); - } - - if(__instance.name.StartsWith("MainMenu(Clone)")) - { - MainMenu_Patch.AnimOver(__instance); - } - - if(__instance.name.StartsWith("PlantDamageMenu")) - { - PlantDamageMenu_Patch.Awake(__instance); - } - - TranslateBaseMenuTransform(__instance, "Level"); - TranslateBaseMenuTransform(__instance, "Levels"); - TranslateBaseMenuTransform(__instance, "CustomLevel"); - - StringStore.TranslateTextTransform(__instance.transform.Find("Goback")); - StringStore.TranslateTextTransform(__instance.transform.Find("Switich")); - } - - public static void TranslateBaseMenuTransform(BaseMenu __instance, string levelsName) - { - Transform levels = __instance.transform.Find(levelsName); - if (levels != null) - { - List children = levels.GetComponentsInChildren(true).ToList(); - foreach (Transform child in children) - { - if (child.name == "Nextpage" || child.name == "LastPage" || child.name == "BackToIndex") - { - StringStore.TranslateTextTransform(child); - } - } - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/Board_Patch.cs b/MelonLoader/Patches/GameObjects/Board_Patch.cs deleted file mode 100644 index 328e768..0000000 --- a/MelonLoader/Patches/GameObjects/Board_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(Board))] - public static class Board_Patch - { - [HarmonyPatch(nameof(Board.Update))] - [HarmonyPostfix] - private static void Update(Board __instance) - { - foreach (SpriteRenderer spriteRenderer in __instance.GetComponentsInChildren()) - { - if (spriteRenderer.sprite != null) - { - if (TextureStore.spriteDict.ContainsKey(spriteRenderer.sprite.name) && spriteRenderer.drawMode != SpriteDrawMode.Sliced) - { - spriteRenderer.drawMode = SpriteDrawMode.Sliced; - } - } - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs deleted file mode 100644 index 1238676..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(Advanture_Btn))] - public static class Advanture_Btn_Patch - { - [HarmonyPatch(nameof(Advanture_Btn.Start))] - [HarmonyPostfix] - private static void Start(Advanture_Btn __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == txt.text).Key; - txt.text = (StringStore.translationString.ContainsKey(originalKey + "_MG")) ? StringStore.TranslateText(originalKey + "_MG") : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/BackToIndex_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/BackToIndex_Patch.cs deleted file mode 100644 index 621e118..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/BackToIndex_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - //[HarmonyPatch(typeof(BackToIndex))] - //public class BackToIndex_Patch - // { - // [HarmonyPostfix] - // [HarmonyPatch(nameof(BackToIndex.Awake))] - // public static void Awake(BackToIndex __instance) - // { - // StringStore.TranslateTextTransform(__instance.transform.GetChild(0)); - // } - //} -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs deleted file mode 100644 index ed70973..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(CustomLevelEnter))] - public static class CustomLevelEnter_Patch - { - [HarmonyPatch(nameof(CustomLevelEnter.Start))] - [HarmonyPostfix] - private static void Start(CustomLevelEnter __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == txt.text).Key; - txt.text = (StringStore.translationString.ContainsKey(originalKey + "_IZ")) ? StringStore.TranslateText(originalKey + "_IZ") : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs deleted file mode 100644 index 1e7e111..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(ExploreMakeSceneButton))] - public class ExploreMakeSceneButton_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(ExploreMakeSceneButton.Start))] - public static void Start(ExploreMakeSceneButton __instance) - { - __instance.sceneText.text = (StringStore.translationString.ContainsKey(__instance.sceneText.text + "_FS")) ? StringStore.TranslateText(__instance.sceneText.text + "_FS") : StringStore.TranslateText(__instance.sceneText.text); - __instance.sceneText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs deleted file mode 100644 index 49d638f..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(ExploreMakeZombieButton))] - public class ExploreMakeZombieButton_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(ExploreMakeZombieButton.Start))] - public static void Start(ExploreMakeZombieButton __instance) - { - __instance.sceneText.text = Utils.GetZombieNameFromAlmanac(__instance.theZombieType); - __instance.sceneText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/GodShootingLevelButton_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/GodShootingLevelButton_Patch.cs deleted file mode 100644 index 6964c15..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/GodShootingLevelButton_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(GodShootingLevelButton))] - public static class GodShootingLevelButton_Patch - { - [HarmonyPatch(nameof(GodShootingLevelButton.Awake))] - [HarmonyPostfix] - private static void Awake(GodShootingLevelButton __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == txt.text).Key; - txt.text = (StringStore.translationString.ContainsKey(originalKey + "_GS")) ? StringStore.TranslateText(originalKey + "_GS") : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs deleted file mode 100644 index 62b7911..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(InGameBtn))] - public static class InGameBtn_Patch - { - [HarmonyPatch(nameof(InGameBtn.Start))] - [HarmonyPostfix] - private static void Start(InGameBtn __instance) - { - Transform sceneText = __instance.transform.FindChild("SceneText"); - if(sceneText != null) - { - TextMeshProUGUI sceneTextTMP = sceneText.transform.GetComponent(); - if(sceneTextTMP != null) - { - sceneTextTMP = AssetStore.StringStore.TranslateText(sceneTextTMP); - } - Transform sceneTextShadow = sceneText.transform.FindChild("SceneText"); - if(sceneTextShadow != null) - { - TextMeshProUGUI sceneTextShadowTMP = sceneTextShadow.transform.GetComponent(); - if (sceneTextShadowTMP != null) - { - sceneTextShadowTMP = AssetStore.StringStore.TranslateText(sceneTextShadowTMP); - } - } - } - - foreach(TextMeshProUGUI text in __instance.transform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/LevelSaveEnter_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/LevelSaveEnter_Patch.cs deleted file mode 100644 index 86a42f0..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/LevelSaveEnter_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - public static class LevelSaveEnter_Patch - { - public static void TranslateEnter(LevelSaveEnter __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.text.text = StringStore.TranslateText(__instance.text.text); - __instance.text.font = fontAsset; - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs deleted file mode 100644 index 097df1f..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using UnityEngine; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(MainMenu_Btn))] - public static class MainMenu_Btn_Patch - { - //public static List speechBubbles = new List(); - - //[HarmonyPatch(nameof(MainMenu_Btn.OnMouseEnter))] - //[HarmonyPostfix] - //private static void OnMouseEnter(MainMenu_Btn __instance) - //{ - // string textToShow = null; - - // if(__instance.transform.parent.name == "recipe") - // { - // textToShow = "探索模式"; - // } - // else if (__instance.name == "mysterious") - // { - // textToShow = "神秘模式"; - // } - - // if(textToShow != null) - // { - // InGameText.Instance.ShowText(textToShow, 2.0f); - // } - // } - } - -} -*/ \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs deleted file mode 100644 index 8ccfcf0..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(NormalBtn))] - public class NormalBtn_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))] - public static void OnMouseUpAsButton(NormalBtn __instance) - { - if(__instance.transform.childCount > 0) - { - Transform banTransform = __instance.transform.GetChild(0); - if (banTransform != null) - { - banTransform.GetComponent().text = StringStore.TranslateText(banTransform.GetComponent().text); - } - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs deleted file mode 100644 index 45d94df..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs +++ /dev/null @@ -1,393 +0,0 @@ -#if MULTI_LANGUAGE -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.UIElements; -using static MelonLoader.MelonLogger; -using Object = UnityEngine.Object; - -public class OptionButtonData -{ - public OptionBtn Button { get; set; } - public Vector3 Position { get; set; } - public Utils.LanguageEnum? Language { get; set; } // Null if it's the "Next" button - public Utils.ToggleEnum? Toggle { get; set; } // Null if it's the "Next" button - public bool IsNextButton { get; set; } - public bool shifted = false; -} - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - internal class OptLanguageBtn_Patch - { - public static Dictionary LanguageBtnDict = new(); - public static Dictionary ToggleBtnDict = new(); - private static bool buttonsCreated = false; - private static bool togglesCreated = false; - private static OptionBtn cachedTemplateButton; - private static OptionBtn cachedTemplateToggleButton; - - private const float startX = 4.3241f + 2.56f; - private const float startY = 2.7769f; - private const float ySpacing = 1.2505f; - - private const float toggleStartX = 4.3241f; - private const float toggleStartY = -0.9746f; - - private static List AvailableLanguages; - private static List AvailableToggles; - private const int LanguagesPerPage = 5; - private static int currentPage = 0; - public static OptionBtn[] buttonSlots = new OptionBtn[6]; // 5 language buttons + 1 next button - public static OptionBtn[] toggleSlots = new OptionBtn[3]; - - public static void CreateLanguageButtons(OptionBtn templateButton) - { - if (buttonsCreated) return; - buttonsCreated = true; - cachedTemplateButton = templateButton; - - AvailableLanguages = Enum.GetValues(typeof(Utils.LanguageEnum)) - .Cast() - .Where(lang => lang != Utils.LanguageEnum.LANG_END) - .ToList(); - - for (int i = 0; i < 6; i++) - { - var newButton = Object.Instantiate(templateButton, templateButton.transform.parent); - newButton.tag = "LangOpt"; - foreach(Transform child in newButton.GetComponentsInChildren()) - { - child.tag = "LangOpt"; - } - newButton.optionType = 80 + i; - - float yPos = startY - i * ySpacing; - Vector3 pos = new(startX, yPos); - newButton.transform.position = pos; - - buttonSlots[i] = newButton; - - LanguageBtnDict[newButton.GetInstanceID()] = new OptionButtonData - { - Button = newButton, - Position = pos - }; - } - - UpdatePage(); - } - - public static void CreateToggleButtons(OptionBtn templateButton) - { - if (togglesCreated) return; - togglesCreated = true; - cachedTemplateToggleButton = templateButton; - - AvailableToggles = Enum.GetValues(typeof(Utils.ToggleEnum)) - .Cast() - .Where(lang => lang != Utils.ToggleEnum.TOGGLE_END) - .ToList(); - - for (int i = 0; i < 3; i++) - { - var newButton = Object.Instantiate(templateButton, templateButton.transform.parent); - newButton.tag = "LangOpt"; - foreach(Transform child in newButton.GetComponentsInChildren()) - { - child.tag = "LangOpt"; - } - newButton.optionType = 100 + i; - - float yPos = toggleStartY - i * ySpacing; - Vector3 pos = new(toggleStartX, yPos); - newButton.transform.position = pos; - - toggleSlots[i] = newButton; - - ToggleBtnDict[newButton.GetInstanceID()] = new OptionButtonData - { - Button = newButton, - Position = pos - }; - } - - UpdatePage(); - } - - private static void UpdatePage() - { - int startIndex = currentPage * LanguagesPerPage; - int langCount = AvailableLanguages.Count; - int toggleCount = (togglesCreated) ? AvailableToggles.Count : 0; - - for (int i = 0; i < 5; i++) - { - var btn = buttonSlots[i]; - var data = LanguageBtnDict[btn.GetInstanceID()]; - - if (startIndex + i < langCount) - { - var lang = AvailableLanguages[startIndex + i]; - data.Language = lang; - data.IsNextButton = false; - btn.gameObject.SetActive(true); - - string languageName = Utils.LanguageNames.ContainsKey(lang) ? Utils.LanguageNames[lang] : lang.ToString(); - UpdateButtonText(btn, languageName, FontStore.LoadTMPFont(lang.ToString())); - } - else - { - data.Language = null; - data.IsNextButton = false; - btn.gameObject.SetActive(false); - } - } - - if (togglesCreated) - { - for (int i = 0; i < 3; i++) - { - var btn = toggleSlots[i]; - var data = ToggleBtnDict[btn.GetInstanceID()]; - - if (i < toggleCount) - { - var toggle = AvailableToggles[i]; - data.Toggle = toggle; - data.IsNextButton = false; - btn.gameObject.SetActive(true); - string buttonText = Utils.ToggleNames.ContainsKey(toggle) ? Utils.ToggleNames[toggle] : toggle.ToString(); - UpdateButtonText(btn, StringStore.TranslateText(buttonText), FontStore.LoadTMPFont(Utils.Language.ToString())); - string sourceMsg = ""; - switch(i) - { - case 0: - sourceMsg = "" + (!(Utils.customTextures) ? "Texture Source:\nDefault" : "Texture Source:\nCustom"); - FlashMessage(btn, sourceMsg, 0.1f, false); - break; - case 1: - sourceMsg = "" + (!(Utils.customAudio) ? "Audio Source:\nDefault" : "Audio Source:\nCustom"); - FlashMessage(btn, sourceMsg, 0.1f, false); - break; - case 2: - sourceMsg = "" + (!(Utils.useLocal) ? "Translation Source:\nOnline" : "Translation Source:\nLocal"); - FlashMessage(btn, sourceMsg, 0.1f, false); - break; - default: - break; - } - } - else - { - data.Language = null; - data.IsNextButton = false; - btn.gameObject.SetActive(false); - } - } - } - - // "Next" button always visible at index 5 - var nextBtn = buttonSlots[5]; - var nextData = LanguageBtnDict[nextBtn.GetInstanceID()]; - nextData.Language = null; - nextData.IsNextButton = true; - nextBtn.gameObject.SetActive(true); - UpdateButtonText(nextBtn, "Next"); - } - - public static void UpdateButtonText(OptionBtn button, string languageName, TMP_FontAsset fontAsset = null) - { - TMP_FontAsset defaultAsset = FontStore.LoadTMPFont("English"); - - for (int i = 0; i < 3; i++) - { - Transform textTransform = button.transform.GetChild(i); - if (textTransform != null) - { - if (i == 0) textTransform.gameObject.SetActive(false); - - TextMeshProUGUI text = textTransform.GetComponent(); - if (text != null) - { - if (i == 0) - { - text.text = ""; - text.color = Color.red; - } - else - { - text.text = languageName; - } - text.fontSize = 16; - text.font = (fontAsset != null) ? fontAsset : defaultAsset; - text.autoSizeTextContainer = false; - } - } - } - } - - public static void FlashMessage(OptionBtn button, string message, float yShift = 0.0f, bool useTimer = true) - { - var child = button.transform.GetChild(0); - if (child != null) - { - var text = child.GetComponent(); - string originalMsg = ""; - if (text != null) - { - originalMsg = text.text; - text.text = message; - OptionButtonData data; - bool isToggle = ToggleBtnDict.TryGetValue(button.GetInstanceID(), out data); - - if(isToggle) - { - text.transform.position = new Vector3(text.transform.position.x, text.transform.position.y + (ToggleBtnDict[button.GetInstanceID()].shifted ? 0.0f : yShift), text.transform.position.z); - ToggleBtnDict[button.GetInstanceID()].shifted = true; - } - else - { - text.transform.position = new Vector3(text.transform.position.x, text.transform.position.y + (LanguageBtnDict[button.GetInstanceID()].shifted ? 0.0f : yShift), text.transform.position.z); - LanguageBtnDict[button.GetInstanceID()].shifted = true; - } - } - child.gameObject.SetActive(true); - - if(useTimer) - { - System.Threading.Tasks.Task.Delay(1000).ContinueWith(_ => - { - if (button != null && child != null && child.gameObject.activeSelf) - { - OptionButtonData buttonData = ToggleBtnDict[button.GetInstanceID()]; - if(buttonData.Toggle != null) - { - string sourceMsg = originalMsg; - switch(buttonData.Toggle) - { - case Utils.ToggleEnum.Textures: - sourceMsg = "" + (!(Utils.customTextures) ? "Texture Source:\nDefault" : "Texture Source:\nCustom"); - break; - case Utils.ToggleEnum.Audio: - sourceMsg = "" + (!(Utils.customAudio) ? "Audio Source:\nDefault" : "Audio Source:\nCustom"); - break; - default: - break; - } - text.text = sourceMsg; - } - - } - }); - } - } - } - - private static void ToggleCustomAssets(string type) - { - if (type != "Textures" && type != "Audio" && type != "SwapLocal") return; - - if(type == "Textures") - { - Utils.customTextures = !Utils.customTextures; - MelonPreferences.SetEntryValue("PvZ_Fusion_Translator", "DefaultTextures", !Utils.customTextures); - TextureStore.Reload(); - object replaceTextureRoutine = MelonCoroutines.Start(TextureStore.ReplaceTexturesCoroutine()); - } - - if (type == "Audio") - { - Utils.customAudio = (Utils.customAudio) ? false : true; - MelonPreferences.SetEntryValue("PvZ_Fusion_Translator", "DefaultAudio", !Utils.customAudio); - } - - if (type == "SwapLocal") - { - Utils.WarnLocalData(); - } - - MelonPreferences.Save(); - } - - [HarmonyPatch(typeof(OptionBtn))] - public static class OptLangBtn_Patch - { - public static void Awake(OptionBtn __instance) - { - if (!buttonsCreated || cachedTemplateButton == null) - { - buttonsCreated = false; - togglesCreated = false; - CreateLanguageButtons(__instance); - CreateToggleButtons(__instance); - } - } - - [HarmonyPatch("OnMouseUpAsButton")] - [HarmonyPrefix] - private static void OnMouseUpAsButton(OptionBtn __instance) - { - if (LanguageBtnDict.TryGetValue(__instance.GetInstanceID(), out var btnData)) - { - if (btnData.IsNextButton) - { - currentPage = (currentPage + 1) % (int)Math.Ceiling((float)AvailableLanguages.Count / LanguagesPerPage); - UpdatePage(); - return; - } - - if (btnData.Language is Utils.LanguageEnum selectedLang) - { - string currentLang = Utils.Language.ToString(); - - if (currentLang == selectedLang.ToString()) - { - FlashMessage(btnData.Button, "Already Selected!"); - } - else - { - Utils.ChangeLanguage(selectedLang.ToString()); - Debug.Log($"Language changed to: {selectedLang}"); - FlashMessage(btnData.Button, "Language Changed!"); - } - } - } - - if (ToggleBtnDict.TryGetValue(__instance.GetInstanceID(), out var toggleData)) - { - string toggleType = toggleData.Toggle.ToString(); - ToggleCustomAssets(toggleType); - if (toggleType == "Textures") - { - FlashMessage(toggleData.Button, "Toggled custom textures!\n(Restart Required)", 0.1f); - } - else if (toggleType == "Audio") - { - FlashMessage(toggleData.Button, "Toggled custom audio!", 0.1f); - } - } - } - - [HarmonyPatch(nameof(OptionBtn.Update))] - [HarmonyPostfix] - private static void Update(OptionBtn __instance) - { - if (LanguageBtnDict.TryGetValue(__instance.GetInstanceID(), out var btnData)) - { - btnData.Button.transform.position = btnData.Position; - } - - if (ToggleBtnDict.TryGetValue(__instance.GetInstanceID(), out var toggleData)) - { - toggleData.Button.transform.position = toggleData.Position; - } - } - } - } -} -#endif \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs deleted file mode 100644 index e4d1e07..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs +++ /dev/null @@ -1,69 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(OptionBtn))] - public static class OptionBtn_Patch - { - [HarmonyPatch(nameof(OptionBtn.Awake))] - [HarmonyPostfix] - private static void Awake(OptionBtn __instance) - { - Transform text_1Transform = __instance.transform.GetChild(0)?.transform; - if (text_1Transform != null) - { - TextMeshProUGUI text_1 = text_1Transform.GetComponent(); - text_1 = StringStore.TranslateText(text_1); - text_1.autoSizeTextContainer = false; - } - - Transform textTransform = __instance.transform.GetChild(1)?.transform; - if (textTransform != null) - { - TextMeshProUGUI text = textTransform.GetComponent(); - text = StringStore.TranslateText(text); - text.autoSizeTextContainer = false; - } - - Transform text2Transform = __instance.transform.GetChild(2)?.transform; - if (text2Transform != null) - { - TextMeshProUGUI text2 = text2Transform.GetComponent(); - text2 = StringStore.TranslateText(text2); - text2.autoSizeTextContainer = false; - } - } - - [HarmonyPatch("OnMouseUpAsButton")] - [HarmonyPostfix] - private static void OnMouseUpAsButtonPostfix(OptionBtn __instance) - { - Transform text_1Transform = __instance.transform.GetChild(0)?.transform; - if (text_1Transform != null) - { - TextMeshProUGUI text_1 = text_1Transform.GetComponent(); - text_1 = StringStore.TranslateText(text_1); - text_1.autoSizeTextContainer = false; - } - - Transform textTransform = __instance.transform.GetChild(1)?.transform; - if (textTransform != null) - { - TextMeshProUGUI text = textTransform.GetComponent(); - text = StringStore.TranslateText(text); - text.autoSizeTextContainer = false; - } - - Transform text2Transform = __instance.transform.GetChild(2)?.transform; - if (text2Transform != null) - { - TextMeshProUGUI text2 = text2Transform.GetComponent(); - text2 = StringStore.TranslateText(text2); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs deleted file mode 100644 index 2dfd98e..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs +++ /dev/null @@ -1,43 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppPVPScaryPot; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - /*[HarmonyPatch(typeof(PVPPotBtn))] - public class PVPPotBtn_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(PVPPotBtn.OnMouseUpAsButton))] - public static void OnMouseUpAsButton(PVPPotBtn __instance) - { - Transform sceneText = __instance.transform.FindChild("text"); - if(sceneText != null) - { - TextMeshProUGUI sceneTextTMP = sceneText.transform.GetComponent(); - if(sceneTextTMP != null) - { - sceneTextTMP.text = StringStore.TranslateText(sceneTextTMP.text); - } - } - Transform sceneTextShadow = sceneText.transform.FindChild("text_1"); - if(sceneTextShadow != null) - { - TextMeshProUGUI sceneTextShadowTMP = sceneTextShadow.transform.GetComponent(); - if (sceneTextShadowTMP != null) - { - sceneTextShadowTMP.text = StringStore.TranslateText(sceneTextShadowTMP.text); - } - } - - if (__instance.name.Equals("ChangeBg_3") || __instance.name.Equals("ChangeBg_4")) - { - __instance.gameObject.SetActive(false); - __instance.gameObject.SetActive(true); - } - } - }*/ -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs deleted file mode 100644 index 501706f..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs +++ /dev/null @@ -1,15 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(PauseMenu_Btn))] - public static class PauseMenu_Btn_Patch - { - [HarmonyPatch(nameof(PauseMenu_Btn.Start))] - [HarmonyPostfix] - private static void Start(PauseMenu_Btn __instance) => StringStore.TranslateTextTransform(__instance.transform); - } - -} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs deleted file mode 100644 index f9b16ac..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -#if FIX -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(SaveMenuBtn))] - public static class SaveMenuBtn_Patch - { - [HarmonyPatch(nameof(SaveMenuBtn.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton(SaveMenuBtn __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.theName.text = StringStore.TranslateText(__instance.theName.text); - __instance.theName.font = fontAsset; - } - } -} -#endif \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/UIBtn_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/UIBtn_Patch.cs deleted file mode 100644 index 4afc43c..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/UIBtn_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine; -//using UnityEngine.UI; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(UIBtn))] -// public static class UIBtn_Patch -// { -// [HarmonyPatch(nameof(UIBtn.Awake))] -// [HarmonyPostfix] -// private static void Postfix_Awake(UIBtn __instance) -// { -// if(__instance.TryGetComponent(out BackToIndex component)) -// { -// Utils.ConvertButtonText(__instance.transform.parent, component.name); -// } -// } -// } -//} diff --git a/MelonLoader/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs b/MelonLoader/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs deleted file mode 100644 index 515f9d8..0000000 --- a/MelonLoader/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs +++ /dev/null @@ -1,56 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.UI; -using UnityEngine.UIElements; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIButton))] - public static class UIButton_Patch - { - [HarmonyPatch(typeof(UIButton), nameof(UIButton.Start))] - [HarmonyPostfix] - public static void Start(UIButton __instance) - { - if(__instance.transform.childCount >= 2) - { - TMP_FontAsset font = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI text in __instance.transform.GetComponentsInChildren()) - { - if (__instance.transform.name == "Goback") - { - text.text = "合上"; - } - text.text = StringStore.TranslateText(text.text); - text.font = font; - } - } - else - { - StringStore.TranslateTextTransform(__instance.transform); - if(__instance.transform.name == "Goback") - { - foreach(TextMeshProUGUI text in __instance.transform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("合上"); - } - } - } - } - - [HarmonyPatch(nameof(UIButton.OnMouseUpAsButton))] - [HarmonyPostfix] - public static void Postfix_OnMouseUpAsButton(UIButton __instance) - { - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/Close_Patch.cs b/MelonLoader/Patches/GameObjects/Close_Patch.cs deleted file mode 100644 index fb6ff9a..0000000 --- a/MelonLoader/Patches/GameObjects/Close_Patch.cs +++ /dev/null @@ -1,53 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(Close))] - public static class Close_Patch - { - [HarmonyPatch(nameof(Close.Start))] - [HarmonyPostfix] - private static void Close_Start(Close __instance) - { - - TextMeshPro closeText = __instance.transform.GetChild(0).GetComponent(); - closeText.text = "合上"; - closeText = StringStore.TranslateText(closeText); - closeText.autoSizeTextContainer = true; - - Transform AlmanacTransform = __instance.transform.parent.transform; - - Transform nameTransform = AlmanacTransform.Find("Name"); - if (nameTransform != null) - { - TextMeshPro nameTMP = nameTransform.transform.GetComponent(); - if (nameTMP) - { - nameTMP = StringStore.TranslateText(nameTMP); - nameTMP.autoSizeTextContainer = true; - } - - Transform nameShadowTransform = nameTransform.Find("NameShadow"); - if (nameShadowTransform) - { - TextMeshPro nameShadowTMP = nameShadowTransform.transform.GetComponent(); - if (nameShadowTMP) - { - nameShadowTMP = StringStore.TranslateText(nameShadowTMP); - nameShadowTMP.autoSizeTextContainer = true; - } - } - } - - StringStore.TranslateTextTransform(AlmanacTransform.Find("Back"), true); - StringStore.TranslateTextTransform(AlmanacTransform.Find("NextPage")); - StringStore.TranslateTextTransform(AlmanacTransform.Find("LastPage")); - - } - } -} -*/ \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ConfirmMenu_Patch.cs b/MelonLoader/Patches/GameObjects/ConfirmMenu_Patch.cs deleted file mode 100644 index 6dc92b7..0000000 --- a/MelonLoader/Patches/GameObjects/ConfirmMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(ConfirmMenu))] - public static class ConfirmMenu_Patch - { - [HarmonyPatch(nameof(ConfirmMenu.SetTitle))] - [HarmonyPostfix] - private static void SetTitle(ConfirmMenu __instance) - { - foreach(TextMeshProUGUI title in __instance.title) - { - title.text = StringStore.TranslateText(title.text); - title.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/CrisisZombieWindow_Patch.cs b/MelonLoader/Patches/GameObjects/CrisisZombieWindow_Patch.cs deleted file mode 100644 index 9bef668..0000000 --- a/MelonLoader/Patches/GameObjects/CrisisZombieWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(CrisisZombieWindow))] - public static class CrisisZombieWindow_Patch - { - [HarmonyPatch(nameof(CrisisZombieWindow.Start))] - [HarmonyPostfix] - private static void Start(CrisisZombieWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(CrisisZombieWindow.SetZombieType))] - [HarmonyPostfix] - private static void SetZombieType(CrisisZombieWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/MelonLoader/Patches/GameObjects/CustomSettings_Patch.cs b/MelonLoader/Patches/GameObjects/CustomSettings_Patch.cs deleted file mode 100644 index 18ee55a..0000000 --- a/MelonLoader/Patches/GameObjects/CustomSettings_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using PvZ_Fusion_Translator.AssetStore; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(CustomSettings))] -// public static class CustomSettings_Patch -// { -// [HarmonyPatch(nameof(CustomSettings.Awake))] -// [HarmonyPostfix] -// private static void Awake(CustomSettings __instance) -// { -// __instance.textMesh = StringStore.TranslateText(__instance.textMesh); -// } - -// [HarmonyPatch(nameof(CustomSettings.ChangeText))] -// [HarmonyPostfix] -// private static void ChangeText(CustomSettings __instance) -// { -// __instance.textMesh = StringStore.TranslateText(__instance.textMesh); -// } -// } -//} diff --git a/MelonLoader/Patches/GameObjects/CustomSun_Patch.cs b/MelonLoader/Patches/GameObjects/CustomSun_Patch.cs deleted file mode 100644 index 5d71423..0000000 --- a/MelonLoader/Patches/GameObjects/CustomSun_Patch.cs +++ /dev/null @@ -1,46 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(CustomSun))] - public static class CustomSun_Patch - { - [HarmonyPatch(nameof(CustomSun.Awake))] - [HarmonyPostfix] - private static void Awake(CustomSun __instance) - { - if (__instance.inputField.gameObject.activeSelf) - { - string oriTextSun = __instance.inputField.m_Text; - __instance.inputField.gameObject.SetActive(false); - __instance.inputField.m_Text = StringStore.TranslateText(oriTextSun); - __instance.inputField.m_OriginalText = StringStore.TranslateText(oriTextSun); - __instance.inputField.gameObject.SetActive(true); - } - - if (__instance.setFlags.gameObject.activeSelf) - { - string oriTextFlags = __instance.setFlags.m_Text; - __instance.setFlags.gameObject.SetActive(false); - __instance.setFlags.m_Text = StringStore.TranslateText(oriTextFlags); - __instance.setFlags.m_OriginalText = StringStore.TranslateText(oriTextFlags); - __instance.setFlags.gameObject.SetActive(true); - } - - Transform lookZombieTransform = __instance.lookZombie.transform.GetChild(0).transform; - if (lookZombieTransform != null) - { - TextMeshProUGUI lookZombieTMP = lookZombieTransform.GetComponent(); - if (lookZombieTMP != null) - { - lookZombieTMP = StringStore.TranslateText(lookZombieTMP); - } - } - } - } -} -*/ \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/EveBuffMenu_Patch.cs b/MelonLoader/Patches/GameObjects/EveBuffMenu_Patch.cs deleted file mode 100644 index 51725ab..0000000 --- a/MelonLoader/Patches/GameObjects/EveBuffMenu_Patch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(EveBuffMenu))] - public static class EveBuffMenu_Patch - { - [HarmonyPatch(nameof(EveBuffMenu.Start))] - [HarmonyPostfix] - private static void Start(EveBuffMenu __instance) - { - foreach (EveOptionWindow window in __instance.windows) - { - EveOptionWindow_Patch.TranslateEveOptionWindow(window); - } - - foreach (TextMeshProUGUI text in __instance.quitButton.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("合上"); - } - } - - [HarmonyPatch(nameof(EveBuffMenu.InitWindows))] - [HarmonyPostfix] - private static void InitWindows(EveBuffMenu __instance) - { - foreach(EveOptionWindow window in __instance.windows) - { - EveOptionWindow_Patch.TranslateEveOptionWindow(window); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/EveOptionWindow_Patch.cs b/MelonLoader/Patches/GameObjects/EveOptionWindow_Patch.cs deleted file mode 100644 index 3d0a4c0..0000000 --- a/MelonLoader/Patches/GameObjects/EveOptionWindow_Patch.cs +++ /dev/null @@ -1,50 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(EveOptionWindow))] - public static class EveOptionWindow_Patch - { - [HarmonyPatch(nameof(EveOptionWindow.SetType))] - [HarmonyPostfix] - private static void SetType(EveOptionWindow __instance) - { - TranslateEveOptionWindow(__instance); - } - - [HarmonyPatch(nameof(EveOptionWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(EveOptionWindow __instance) - { - TranslateEveOptionWindow(__instance); - } - - [HarmonyPatch(nameof(EveOptionWindow.SelectedByRow))] - [HarmonyPostfix] - private static void SelectedByRow(EveOptionWindow __instance) - { - TranslateEveOptionWindow(__instance); - } - - public static void TranslateEveOptionWindow(EveOptionWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - - foreach (TextMeshProUGUI text in __instance.buttonText) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ExploreEnterWindow_Patch.cs b/MelonLoader/Patches/GameObjects/ExploreEnterWindow_Patch.cs deleted file mode 100644 index 648d2e2..0000000 --- a/MelonLoader/Patches/GameObjects/ExploreEnterWindow_Patch.cs +++ /dev/null @@ -1,73 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(ExploreEnterWindow))] - public static class ExploreEnterWindow_Patch - { - [HarmonyPatch(nameof(ExploreEnterWindow.Awake))] - [HarmonyPostfix] - private static void Awake(ExploreEnterWindow __instance) - { - PlantType thePlantType = (PlantType)__instance.selfType; - - __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); - - if(__instance.nameText.text == "") - { - StringStore.TranslateText(__instance.nameText.text); - } - - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ExploreEnterWindow.SetInfo))] - [HarmonyPostfix] - private static void SetInfo(ExploreEnterWindow __instance) - { - PlantType thePlantType = (PlantType)__instance.selfType; - - __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); - - if (__instance.nameText.text == "") - { - StringStore.TranslateText(__instance.nameText.text); - } - - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ExploreEnterWindow.SetIcon))] - [HarmonyPostfix] - private static void SetIcon(ExploreEnterWindow __instance) - { - PlantType thePlantType = (PlantType)__instance.selfType; - - __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); - - if (__instance.nameText.text == "") - { - StringStore.TranslateText(__instance.nameText.text); - } - - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ExploreEnterWindow.SetDisable))] - [HarmonyPostfix] - private static void SetDisable(ExploreEnterWindow __instance) - { - if (__instance.disabled) - { - __instance.nameText.text = StringStore.TranslateText("敬请期待"); - } - - __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ExploreMakeMenu_Patch.cs b/MelonLoader/Patches/GameObjects/ExploreMakeMenu_Patch.cs deleted file mode 100644 index 4116c29..0000000 --- a/MelonLoader/Patches/GameObjects/ExploreMakeMenu_Patch.cs +++ /dev/null @@ -1,72 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(ExploreMakeMenu))] - public static class ExploreMakeMenu_Patch - { - [HarmonyPatch(nameof(ExploreMakeMenu.Awake))] - [HarmonyPostfix] - private static void Awake(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(ExploreMakeMenu.InitMenu))] - [HarmonyPostfix] - private static void InitMenu(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if(txt.text.Contains("关卡制作中:")) - { - string plantName = Utils.GetPlantNameFromAlmanac(txt.text.Split(":")[1]); - txt.text = String.Format(StringStore.translationStringRegex["关卡制作中:([^\\s]+)"], plantName); - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - } - } - - [HarmonyPatch(nameof(ExploreMakeMenu.ViewScene))] - [HarmonyPostfix] - private static void ViewScene(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(ExploreMakeMenu.InitZombieButtons))] - [HarmonyPostfix] - private static void InitZombieButtons(ExploreMakeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ExploreMenu_Patch.cs b/MelonLoader/Patches/GameObjects/ExploreMenu_Patch.cs deleted file mode 100644 index 63a4f66..0000000 --- a/MelonLoader/Patches/GameObjects/ExploreMenu_Patch.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Numerics; -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(ExploreMenu))] - public static class ExploreMenu_Patch - { - [HarmonyPatch(nameof(ExploreMenu.Awake))] - [HarmonyPostfix] - private static void Awake(ExploreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - } - - Transform randomLevelTextTransform = __instance.transform.FindChild("RandomLevel"); - } - - [HarmonyPatch(nameof(ExploreMenu.UpdateWindows))] - [HarmonyPostfix] - private static void UpdateWindows(ExploreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs b/MelonLoader/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs deleted file mode 100644 index b04fd27..0000000 --- a/MelonLoader/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(FruitNinjaSelectWindow))] - public static class FruitNinjaSelectWindow_Patch - { - [HarmonyPatch(nameof(FruitNinjaSelectWindow.SetType))] - [HarmonyPostfix] - private static void SetType(FruitNinjaSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(FruitNinjaSelectWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(FruitNinjaSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/MelonLoader/Patches/GameObjects/GardenPlant_Patch.cs b/MelonLoader/Patches/GameObjects/GardenPlant_Patch.cs deleted file mode 100644 index 92ad5ec..0000000 --- a/MelonLoader/Patches/GameObjects/GardenPlant_Patch.cs +++ /dev/null @@ -1,29 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using Il2CppZenGarden; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(GardenPlant))] - public static class GardenPlant_Patch - { - [HarmonyPatch(nameof(GardenPlant.Start))] - [HarmonyPostfix] - private static void Start(GardenPlant __instance) - { - __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); - } - - [HarmonyPatch(nameof(GardenPlant.UpdateInfo))] - [HarmonyPostfix] - private static void UpdateInfo(GardenPlant __instance) - { - - __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/GardenStoreMenu_Patch.cs b/MelonLoader/Patches/GameObjects/GardenStoreMenu_Patch.cs deleted file mode 100644 index fcb586d..0000000 --- a/MelonLoader/Patches/GameObjects/GardenStoreMenu_Patch.cs +++ /dev/null @@ -1,40 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppAlmanacData; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Drawing; -using Il2CppZenGarden; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(GardenStoreMenu))] - public static class GardenStoreMenu_Patch - { - [HarmonyPatch(nameof(GardenStoreMenu.InitGoodsList))] - [HarmonyPatch(nameof(GardenStoreMenu.GetDatas))] - [HarmonyPatch(nameof(GardenStoreMenu.PurchaseGoods))] - [HarmonyPatch(nameof(GardenStoreMenu.Update))] - [HarmonyPatch(nameof(GardenStoreMenu.Start))] - [HarmonyPostfix] - public static void TranslateGardenStoreMenu(GardenStoreMenu __instance) - { - foreach(GardenShopSlot slot in __instance.GetComponentsInChildren()) - { - TranslateGardenShopSlot(slot); - } - } - - [HarmonyPatch(nameof(GardenShopSlot.Start))] - [HarmonyPostfix] - public static void TranslateGardenShopSlot(GardenShopSlot __instance) - { - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/GodShootingMenu_Patch.cs b/MelonLoader/Patches/GameObjects/GodShootingMenu_Patch.cs deleted file mode 100644 index 4932b4b..0000000 --- a/MelonLoader/Patches/GameObjects/GodShootingMenu_Patch.cs +++ /dev/null @@ -1,44 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using static MelonLoader.MelonLogger; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(GodShootingMenu))] - public static class GodShootingMenu_Patch - { - [HarmonyPatch(nameof(GodShootingMenu.Start))] - [HarmonyPostfix] - private static void Start(GodShootingMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.transform.Find("Background").GetComponentsInChildren()) - { - text.autoSizeTextContainer = true; - text.text = StringStore.TranslateText(text.text); - } - - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(GodShootingMenu.ShowRoutes))] - [HarmonyPostfix] - private static void ShowRoutes(GodShootingMenu __instance) - { - foreach(var route in __instance.routes) - { - if (route.Value == null) continue; - - foreach(TextMeshProUGUI text in route.Value.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/LevelResultMenu_Patch.cs b/MelonLoader/Patches/GameObjects/LevelResultMenu_Patch.cs deleted file mode 100644 index 3f52c2c..0000000 --- a/MelonLoader/Patches/GameObjects/LevelResultMenu_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2Cpp; -using UnityEngine; -using HarmonyLib; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(LevelResultMenu))] - public static class LevelResultMenu_Patch - { - [HarmonyPatch(nameof(LevelResultMenu.Start))] - [HarmonyPatch(nameof(LevelResultMenu.ShowResult))] - [HarmonyPostfix] - public static void Awake(LevelResultMenu __instance) - { - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/LoseMenu_Patch.cs b/MelonLoader/Patches/GameObjects/LoseMenu_Patch.cs deleted file mode 100644 index 2ba8b25..0000000 --- a/MelonLoader/Patches/GameObjects/LoseMenu_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(LoseMenu))] - public static class LoseMenu_Patch - { - public static void TranslateLoseMenu(BaseMenu __instance) - { - if(__instance.TryGetComponent(out LoseMenu loseMenu)) - { - loseMenu.title.text = StringStore.TranslateText(loseMenu.title.text); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/MainMenu_Patch.cs b/MelonLoader/Patches/GameObjects/MainMenu_Patch.cs deleted file mode 100644 index 770d936..0000000 --- a/MelonLoader/Patches/GameObjects/MainMenu_Patch.cs +++ /dev/null @@ -1,109 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.Events; -using UnityEngine.Rendering; -using UnityEngine.UIElements; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(MainMenu))] - public class MainMenu_Patch - { - public static void AnimOver(BaseMenu __instance) - { - Transform changelogObj = __instance.transform.Find("Grave/UpdateInfoButton"); - Transform langObj = UnityEngine.Object.Instantiate(changelogObj, changelogObj.position + new Vector3(0.0f, 0.855f), changelogObj.rotation, __instance.transform.Find("Grave")); - langObj.name = "LanguagesButton"; - __instance.collider2Ds.Add(langObj.GetComponent()); - UIButton langBtn = langObj.GetComponent(); - - foreach(TextMeshProUGUI text in langObj.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("Languages"); - } - - langBtn.clickEvent = new UnityEvent(); - langBtn.clickEvent.AddListener(new Action(() => OpenLanguageMenu(langBtn.gameObject))); - } - - public static void OpenLanguageMenu(GameObject langBtn) - { - UIMgr.EnterOptionMenu(); - GameObject newOptionsMenu = GameAPP.canvasUp.Find("OptionMenu(Clone)").gameObject; - newOptionsMenu.name = "LanguageMenu"; - - List toKeep = new List() { "Background", "F", "Goback"}; - foreach(Transform child in newOptionsMenu.GetComponentsInChildren()) - { - if(!toKeep.Contains(child.name) && !toKeep.Contains(child.parent.name) && child.name != "LanguageMenu") - { - child.gameObject.SetActive(false); - } - } - - OptionBtn templateButton = newOptionsMenu.transform.Find("Buttons/F").GetComponent(); - OptLanguageBtn_Patch.OptLangBtn_Patch.Awake(templateButton); - - UIButton goBackButton = newOptionsMenu.transform.Find("Goback").GetComponent(); - - newOptionsMenu.transform.Find("Buttons/F").gameObject.SetActive(false); - newOptionsMenu.transform.Find("Buttons").gameObject.SetActive(true); - - foreach (TextMeshProUGUI text in newOptionsMenu.transform.Find("Background").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("Language Settings"); - } - - /*GameObject optionMenuAnchor = UnityEngine.Object.Instantiate(assetBundle.LoadAsset("OptionMenu").TryCast(), GameAPP.canvasUp); - optionMenuAnchor.transform.SetParent(newOptionsMenu.transform, false); - Transform messageAnchor = optionMenuAnchor.transform.Find("MessageAnchor"); - Transform plantAnchor = optionMenuAnchor.transform.Find("PlantAnchor"); - - System.Random random = new System.Random(); - var plantTypes = Enum.GetValues(typeof(PlantType)); - PlantType randomPlantChoice = (PlantType)plantTypes.GetValue(random.Next(plantTypes.Length)); - - if(!GameAPP.resourcesManager.plantPrefabs.ContainsKey(randomPlantChoice) || GameAPP.resourcesManager.plantPrefabs[randomPlantChoice] == null) - { - randomPlantChoice = (PlantType)plantTypes.GetValue(random.Next(plantTypes.Length)); - } - - if (GameAPP.resourcesManager.plantPrefabs[randomPlantChoice] != null) - { - GameObject plant = CreatePlant.SetPlantInAlmamac(plantAnchor.position, (int)randomPlantChoice); - plant.transform.SetParent(newOptionsMenu.transform); - SortingGroup sortingGroup = plant.AddComponent(); - sortingGroup.sortingLayerName = "UI"; - sortingGroup.sortingOrder = 20001; - //plant.transform.position = new Vector3(-7.21f, -3.66f); - UnityEngine.Object.Destroy(plant.GetComponent()); - }*/ - - /*GameObject messageObj = new GameObject(); - messageObj.name = "MultilangMessage"; - messageObj.transform.SetParent(newOptionsMenu.transform); - TextMeshProUGUI messageText = messageObj.AddComponent(); - messageObj.transform.localScale = Vector3.one; - messageText.autoSizeTextContainer = false; - messageText.font = FontStore.LoadTMPFont(Utils.LanguageEnum.English.ToString()); - messageText.text = "Hello this is multilanguage choose language over there ------>";*/ - } - - [HarmonyPatch(nameof(MainMenu.EnterUpdateUrl))] - [HarmonyPrefix] - public static bool Pre_EnterUpdateUrl(MainMenu __instance) - { - System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo - { - FileName = @"https://github.com/Teyliu/PVZF-Translation", - UseShellExecute = true - }); - return false; - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/Brain_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/Brain_Patch.cs deleted file mode 100644 index 58a09e7..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/Brain_Patch.cs +++ /dev/null @@ -1,57 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Brain))] - public static class Brain_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(Brain.Awake))] - private static void Awake(Brain __instance) - { - // reposition original points - Transform pointsTransform = __instance.points.transform; - GameObject pointsObject = __instance.points.gameObject; - pointsTransform.position = new Vector3(-6.5f, pointsTransform.position.y, pointsTransform.position.z); - - // instantiate and move new shadow - GameObject pointsShadowObject = UnityEngine.Object.Instantiate(pointsObject, parent: pointsTransform); - pointsShadowObject.SetActive(true); - Transform pointsShadowTransform = pointsShadowObject.transform; - pointsShadowTransform.position = new Vector3(-6.485f, pointsTransform.position.y - 0.015f, pointsTransform.position.z); - - // set points text - TextMeshPro pointsShadowText = pointsShadowObject.GetComponent(); - pointsShadowText.text = __instance.points.text; - pointsShadowText.sortingOrder -= 2; - pointsShadowText.color = Color.black; - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(Brain.Update))] - private static void Update(Brain __instance) - { - if(__instance.transform.Find("Points").GetChild(0) != null) - { - TextMeshPro shadowText = __instance.transform.Find("Points").GetChild(0).GetComponent(); - shadowText.text = __instance.points.text; - } - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(Brain.WinAction))] - private static void WinAction(Brain __instance) - { - if (__instance.transform.Find("Points").GetChild(0) != null) - { - TextMeshPro shadowText = __instance.transform.Find("Points").GetChild(0).GetComponent(); - shadowText.text = __instance.points.text; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/DY_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/DY_Patch.cs deleted file mode 100644 index 10b48b2..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/DY_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(DY))] - public static class DY_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(DY.Update))] - private static void Update(DY __instance) - { - __instance.TextMeshPro.text = StringStore.TranslateText(__instance.TextMeshPro.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/GameLose_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/GameLose_Patch.cs deleted file mode 100644 index e55957f..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/GameLose_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using UnityEngine; -using Il2Cpp; -using Il2CppCore; -using PvZ_Fusion_Translator.Patches.BaseTextObjects; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(GameLose))] - public static class GameLose_Patch - { - [HarmonyPatch(nameof(GameLose.UpdateSecondChanceTimer))] - public static void UpdateSecondChanceTimer(GameLose __instance) - { - if (InGameText.Instance == null) return; - - if (InGameText.Instance.timer < 0) return; - - InGameText_Patch.TranslateInGameText(InGameText.Instance); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/HealthSlider_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/HealthSlider_Patch.cs deleted file mode 100644 index 370d592..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/HealthSlider_Patch.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2Cpp; -using HarmonyLib; -using UnityEngine; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using Unity.VisualScripting; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(HealthSlider))] - public static class HealthSlider_Patch - { - public static TMP_FontAsset fontAsset = null; - - [HarmonyPatch(nameof(HealthSlider.Start))] - [HarmonyPostfix] - public static void Post_Start(HealthSlider __instance) - { - if(!fontAsset) - { - fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - [HarmonyPatch(nameof(HealthSlider.UpdateText))] - [HarmonyPostfix] - public static void Post_UpdateText(HealthSlider __instance) - { - if(!fontAsset) fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - if (__instance.healthText.font != fontAsset) __instance.healthText.font = fontAsset; - - foreach(TextMeshProUGUI txt in __instance.healthTextContainer.GetComponentsInChildren(true)) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs deleted file mode 100644 index ff0bb5d..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs +++ /dev/null @@ -1,31 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(JigsawClip))] - public static class JigsawClip_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(JigsawClip.Awake))] - private static void Postfix_Awake(JigsawClip __instance) - { - if (!__instance || !__instance.description) return; - - StringStore.TranslateTextUI(__instance.description); - } - [HarmonyPostfix] - [HarmonyPatch(nameof(JigsawClip.Update))] - private static void Postfix_Update(JigsawClip __instance) - { - if (!__instance || !__instance.description) return; - - if (__instance.description.text != StringStore.TranslateText(__instance.description.text)) - { - StringStore.TranslateTextUI(__instance.description); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs deleted file mode 100644 index d4a1c82..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - /*[HarmonyPatch(typeof(LanternUmbrella))] - public class LanternUmbrella_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(LanternUmbrella.Update))] - private static void Update(LanternUmbrella __instance) - { - __instance.energyText = StringStore.TranslateText(__instance.energyText); - __instance.energyTextShadow = StringStore.TranslateText(__instance.energyTextShadow); - } - }*/ -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs deleted file mode 100644 index ea419b4..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(MagnetBox))] - public class MagnetBox_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(MagnetBox.Update))] - private static void Update(MagnetBox __instance) - { - StringStore.TranslateTextTransform(__instance.transform); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs deleted file mode 100644 index a46f208..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(MagnetInterface))] - public class MagnetInterface_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(MagnetInterface.Update))] - private static void Update(MagnetInterface __instance) - { - StringStore.TranslateTextTransform(__instance.transform); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/Money_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/Money_Patch.cs deleted file mode 100644 index 3caa1d1..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/Money_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Money))] - public static class Money_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(Money.Update))] - private static void Update(Money __instance) - { - if (!Utils.CheckForUntranslatedText(__instance.beanCount.text)) return; - __instance.beanCount.text = StringStore.TranslateText(__instance.beanCount.text); - __instance.beanCount2.text = StringStore.TranslateText(__instance.beanCount2.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/Plant_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/Plant_Patch.cs deleted file mode 100644 index b46f0db..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/Plant_Patch.cs +++ /dev/null @@ -1,47 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - /*[HarmonyPatch(typeof(Plant))] - public static class Plant_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(Plant.Awake))] - private static void Awake(Plant __instance) - { - if (!(__instance.thePlantType == PlantType.SuperMachineNut || __instance.thePlantType == PlantType.MachineNut)) - return; - __instance.healthSlider.healthText.text = __instance.healthSlider.healthTextShadow.text = ChangeHPText(__instance.healthSlider.healthTextShadow.text); - } - - [HarmonyPostfix] - [HarmonyPatch(nameof(Plant.UpdateText))] - private static void Update(Plant __instance) - { - if (!(__instance.thePlantType == PlantType.SuperMachineNut || __instance.thePlantType == PlantType.MachineNut)) - return; - if (__instance.thePlantHealth < __instance.thePlantMaxHealth) - return; - __instance.healthSlider.healthText.text = __instance.healthSlider.healthTextShadow.text = ChangeHPText(__instance.healthSlider.healthTextShadow.text); - } - - static string ChangeHPText(string originalText) - { - var regex = new Regex(@"(\d+)\d\d\d/(\d)000"); - if (regex.IsMatch(originalText)) - { - var match = regex.Match(originalText); - int groupCount = match.Groups.Count; - - List dynamicParts = new List(); - - for (int i = 1; i < groupCount; i++) - dynamicParts.Add(match.Groups[i].Value); - return originalText = string.Format("{0}k/{1}k", [.. dynamicParts]); - } - return originalText; - } - }*/ -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs deleted file mode 100644 index 6b55d0a..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(PlayerName))] - public static class PlayerName_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(PlayerName.Update))] - private static void Update(PlayerName __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - } - } -}*/ \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/PumpinerChestMenu_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/PumpinerChestMenu_Patch.cs deleted file mode 100644 index 4a54d10..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/PumpinerChestMenu_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2Cpp; -using UnityEngine; -using HarmonyLib; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(PumpinerChestMenu))] - public static class PumpinerChestMenu_Patch - { - [HarmonyPatch(nameof(PumpinerChestMenu.InitPlants))] - [HarmonyPostfix] - public static void Post_InitPlants(PumpinerChestMenu __instance) - { - Transform closeBtnTransform = __instance.transform.Find("SampleButton"); - TextMeshProUGUI txt = closeBtnTransform.GetComponentInChildren(); - txt.text = StringStore.TranslateText("合上"); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs deleted file mode 100644 index a5c1d73..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(SelectYourPlants))] - public static class SelectYourPlants_Patch - { - [HarmonyPatch(nameof(SelectYourPlants.Awake))] - [HarmonyPostfix] - private static void Awake(SelectYourPlants __instance) - { - __instance.TextMeshProUGUI = StringStore.TranslateText(__instance.TextMeshProUGUI); - __instance.TextMeshProUGUI.autoSizeTextContainer = true; - - __instance.TextMeshProUGUI2 = StringStore.TranslateText(__instance.TextMeshProUGUI2); - __instance.TextMeshProUGUI2.autoSizeTextContainer = true; - } - } -} -*/ \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/SpecialCard_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/SpecialCard_Patch.cs deleted file mode 100644 index 875809e..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/SpecialCard_Patch.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(SpecialCard))] - public static class SpecialCard_Patch - { - [HarmonyPatch(nameof(SpecialCard.Awake))] - [HarmonyPatch(nameof(SpecialCard.Start))] - [HarmonyPatch(nameof(SpecialCard.ClickedEvent))] - [HarmonyPostfix] - public static void Post_Awake(SpecialCard __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs deleted file mode 100644 index 8128ccc..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs +++ /dev/null @@ -1,16 +0,0 @@ -using HarmonyLib; -using Il2Cpp; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(TrainingDummy), nameof(TrainingDummy.UpdateHealthText))] - public static class TrainingDummy_Patch - { - [HarmonyPostfix] - public static void UpdateHealthText(TrainingDummy __instance) - { - Zombie_Patch.TranslateHpUI_T(__instance.healthText, __instance); - //Zombie_Patch.TranslateHpUI_T(__instance.healthTextShadow, __instance); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs deleted file mode 100644 index 60dc971..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(TreasureMoney))] - public static class TreasureMoney_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(TreasureMoney.Update))] - private static void Update(TreasureMoney __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs deleted file mode 100644 index 2ab8b59..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIProgress2))] - public static class UIProgress2_Patch - { - [HarmonyPatch(nameof(UIProgress2.Update))] - [HarmonyPostfix] - private static void Update(UIProgress2 __instance) - { - __instance.t.text = StringStore.TranslateText(__instance.t.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs deleted file mode 100644 index 9443605..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - /*[HarmonyPatch(typeof(UltimateChomper), nameof(UltimateChomper.UpdateText))] - public static class UltimateChomper_Patch - { - [HarmonyPostfix] - public static void UpdateText(UltimateChomper __instance) - { - StringStore.TranslateText(__instance.killingText); - StringStore.TranslateText(__instance.killingTextShadow); - } - }*/ -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs b/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs deleted file mode 100644 index 6dd850a..0000000 --- a/MelonLoader/Patches/GameObjects/MinorObjects/Zombie_Patch.cs +++ /dev/null @@ -1,178 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; -using Il2CppTMPro; -using System.Reflection.Metadata.Ecma335; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects -{ - [HarmonyPatch(typeof(Zombie))] - public static class Zombie_Patch - { - private static Dictionary HPStrings = new Dictionary() - { - { "最后一击:(\\d+)\nDPS:([^\\s]+)\n总伤害:(\\d+)", "Last Damage: {0}\nDPS: {1}\nTotal: {2}" }, - { "^HP:(\\d+)/(\\d+)\n一类:(\\d+)/(\\d+)\n二类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nT1 armor: {2}/{3}\nT2 armor: {4}/{5}" }, - { "^HP:(\\d+)/(\\d+)\n一类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nT1 armor: {2}/{3}" }, - { "^HP:(\\d+)/(\\d+)\n二类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nT2 armor: {2}/{3}" }, - { "^HP:(\\d+)/(\\d+)$", "HP: {0}/{1}" } - }; - - public static void LoadHPStrings() - { - foreach (var hp in HPStrings) - if (StringStore.translationStringRegex.ContainsKey(hp.Key)) - HPStrings[hp.Key] = StringStore.translationStringRegex[hp.Key]; - } - - [HarmonyPatch(nameof(Zombie.Start))] - [HarmonyPostfix] - public static void Start(Zombie __instance) - { - TranslateHpUI(__instance.healthText, __instance); - //TranslateHpUI(__instance.healthTextShadow, __instance); - - if (__instance.healthText.transform.rotation != Quaternion.Euler(0, 0, 0)) - __instance.healthText.transform.rotation = Quaternion.Euler(0f, 0f, 0f); - } - - [HarmonyPatch(nameof(Zombie.UpdateHealthText))] - [HarmonyPostfix] - public static void Update(Zombie __instance) - { - if (__instance.theZombieType == ZombieType.TrainingDummy || !Board.Instance.showZombieHealth) - return; - - if (__instance.healthText == null) return; - - TranslateHpUI(__instance.healthText, __instance); - //TranslateHpUI(__instance.healthTextShadow, __instance); - - if (__instance.healthText.transform.rotation != Quaternion.Euler(0f, 0f, 0f)) - __instance.healthText.transform.rotation = Quaternion.Euler(0f, 0f, 0f); - } - - public static void TranslateHpUI(TextMeshPro textTMP, Zombie __instance) - { - if (textTMP) - { - string origText = textTMP.text; - string translatedText = origText; - if (translatedText == null) return; - string pattern = "(\\d+)阶\n([\\s\\S]+)"; - if (StringStore.TestRegex(translatedText, pattern)) - { - var match = Regex.Match(translatedText, pattern, RegexOptions.Singleline); - string tier = match.Groups[1].Value; - string healthText = TranslateHPText(match.Groups[2].Value, __instance); - string fStr = StringStore.translationStringRegex[pattern]; - translatedText = string.Format(fStr, [tier, healthText]); - } - else - { - translatedText = TranslateHPText(origText, __instance); - } - textTMP.text = translatedText == origText ? origText : translatedText; - textTMP.autoSizeTextContainer = false; - if (translatedText != origText) - textTMP.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - public static void TranslateHpUI_T(TextMeshPro textTMP, TrainingDummy __instance) - { - if (textTMP) - { - string origText = textTMP.text; - string translatedText = TranslateHPText_T(origText, __instance); - textTMP.text = translatedText == origText ? origText : translatedText; - textTMP.autoSizeTextContainer = false; - if (translatedText != origText) - textTMP.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - public static string TranslateHPText(string originalText, Zombie __instance) - { - if(originalText == null) - { - return originalText; - } - - string finalText = __instance.healthText.text; - int fIndex = -1; - bool found = false; - - for(int i = 0; i < HPStrings.Count; i++) - { - var hp = HPStrings.ElementAt(i); - if(Regex.Match(originalText, hp.Key, RegexOptions.Singleline).Success) - { - fIndex = i; - found = true; - } - } - - if(fIndex > -1 && found) - { - string fStr = HPStrings.ElementAt(fIndex).Value; - - switch (fIndex) - { - case 1: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth, __instance.theFirstArmorHealth, __instance.theFirstArmorMaxHealth, __instance.theSecondArmorHealth, __instance.theSecondArmorMaxHealth); - break; - case 2: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth, __instance.theFirstArmorHealth, __instance.theFirstArmorMaxHealth); - break; - case 3: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth, __instance.theSecondArmorHealth, __instance.theSecondArmorMaxHealth); - break; - case 4: - finalText = string.Format(fStr, __instance.theHealth, __instance.theMaxHealth); - break; - default: - break; - } - } - - return finalText; - } - - public static string TranslateHPText_T(string originalText, TrainingDummy __instance) - { - string finalText = __instance.healthText.text; - int fIndex = -1; - bool found = false; - - for (int i = 0; i < HPStrings.Count; i++) - { - var hp = HPStrings.ElementAt(i); - Regex regex = new Regex(hp.Key); - if (regex.IsMatch(originalText)) - { - fIndex = i; - found = true; - } - } - - if (fIndex > -1 && found) - { - string fStr = HPStrings.ElementAt(fIndex).Value; - - switch (fIndex) - { - case 0: - finalText = string.Format(fStr, __instance.lastDamage, __instance.CurrentDPS, __instance.totalDamage); - break; - default: - break; - } - } - - return finalText; - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/NoticePauseMenu_Patch.cs b/MelonLoader/Patches/GameObjects/NoticePauseMenu_Patch.cs deleted file mode 100644 index e050e37..0000000 --- a/MelonLoader/Patches/GameObjects/NoticePauseMenu_Patch.cs +++ /dev/null @@ -1,56 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.UI; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - public class NoticePauseMenu_Patch - { - public static string changelogText = ""; - - public static void Pre_Awake(BaseMenu __instance) - { - GameObject contentObject = __instance.transform.FindChild("Scroll View/Viewport/Content").gameObject; - - TextMeshProUGUI contentText = contentObject.GetComponent(); - File.WriteAllText(Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "changelog.txt"), contentText.text); - - string stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); - string changelogDir = Path.Combine(stringDir, "changelog.txt"); - - if (!File.Exists(changelogDir)) - { - File.WriteAllText(changelogDir, contentText.text); - } - } - - public static void Post_Awake(BaseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - FileLoader.LoadChangelogText(); - - GameObject contentObject = __instance.transform.FindChild("Scroll View/Viewport/Content").gameObject; - - TextMeshProUGUI contentText = contentObject.GetComponent(); - contentText.text = changelogText; - contentText.margin = new Vector4(6, 2, 12, 0); - - contentText.enableWordWrapping = true; - contentText.overflowMode = TextOverflowModes.ScrollRect; - - Canvas.ForceUpdateCanvases(); - contentText.ForceMeshUpdate(); - - //float textHeight = contentText.preferredHeight; - //RectTransform contentRect = contentObject.GetComponent(); - //contentRect.sizeDelta = new Vector2(contentRect.sizeDelta.x, textHeight); - - ContentSizeFitter sizeFitter = contentObject.AddComponent(); - sizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/OtherMenu_Patch.cs b/MelonLoader/Patches/GameObjects/OtherMenu_Patch.cs deleted file mode 100644 index 8fed8a9..0000000 --- a/MelonLoader/Patches/GameObjects/OtherMenu_Patch.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(OtherMenu))] - public static class OtherMenu_Patch - { - [HarmonyPatch(nameof(OtherMenu.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(OtherMenu __instance) - { - __instance.text1 = StringStore.TranslateText(__instance.text1); - __instance.text2 = StringStore.TranslateText(__instance.text2); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/PVPRandomManager_Patch.cs b/MelonLoader/Patches/GameObjects/PVPRandomManager_Patch.cs deleted file mode 100644 index a3d21b0..0000000 --- a/MelonLoader/Patches/GameObjects/PVPRandomManager_Patch.cs +++ /dev/null @@ -1,33 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using static MelonLoader.MelonLogger; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PVPRandomManager))] - public static class PVPRandomManager_Patch - { - [HarmonyPatch(nameof(PVPRandomManager.Start))] - [HarmonyPostfix] - private static void Start(PVPRandomManager __instance) - { - foreach(TextMeshPro text in __instance.texts) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(PVPRandomManager.Update))] - [HarmonyPostfix] - private static void ZombieEnterHouse(PVPRandomManager __instance) - { - foreach(TextMeshPro text in __instance.texts) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs b/MelonLoader/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs deleted file mode 100644 index 50c7f38..0000000 --- a/MelonLoader/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlantCardPackageBuilder))] - public static class PlantCardPackageBuilder_Patch - { - [HarmonyPatch(nameof(PlantCardPackageBuilder.UpdateText))] - [HarmonyPostfix] - private static void UpdateText(PlantCardPackageBuilder __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.text.text = StringStore.TranslateText(__instance.text.text); - __instance.text.font = fontAsset; - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/PlantDamageMenu_Patch.cs b/MelonLoader/Patches/GameObjects/PlantDamageMenu_Patch.cs deleted file mode 100644 index f29c099..0000000 --- a/MelonLoader/Patches/GameObjects/PlantDamageMenu_Patch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlantDamageMenu))] - public static class PlantDamageMenu_Patch - { - public static void Awake(BaseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == text.text).Key; - text.text = StringStore.translationString.ContainsKey(originalKey + "_RM") ? StringStore.TranslateText(originalKey + "_RM") : StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - [HarmonyPatch(nameof(PlantDamageMenu.Awake))] - [HarmonyPatch(nameof(PlantDamageMenu.InitCards))] - [HarmonyPostfix] - public static void InitCards(PlantDamageMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == text.text).Key; - text.text = StringStore.translationString.ContainsKey(originalKey + "_RM") ? StringStore.TranslateText(originalKey + "_RM") : StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/PlantDataMenu_Patch.cs b/MelonLoader/Patches/GameObjects/PlantDataMenu_Patch.cs deleted file mode 100644 index 1643d0d..0000000 --- a/MelonLoader/Patches/GameObjects/PlantDataMenu_Patch.cs +++ /dev/null @@ -1,94 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlantDataMenu))] - public static class PlantDataMenu_Patch - { - [HarmonyPatch(nameof(PlantDataMenu.Start))] - [HarmonyPostfix] - public static void Post_Start(PlantDataMenu __instance) - { - TranslatePlantDataMenu(__instance); - } - - /*[HarmonyPatch(nameof(PlantDataMenu.Update))] - [HarmonyPostfix] - public static void Post_Update(PlantDataMenu __instance) - { - TranslatePlantDataMenu(__instance); - }*/ - - [HarmonyPatch(nameof(PlantDataMenu.InitDataFromPlant))] - [HarmonyPostfix] - public static void Post_InitDataFromPlant(PlantDataMenu __instance) - { - TranslatePlantDataMenu(__instance); - } - - public static void TranslatePlantDataMenu(PlantDataMenu __instance) - { - if (!__instance) return; - - PlantType thePlantType = __instance.plant.thePlantType; - string plantName = Utils.GetPlantNameFromAlmanac(thePlantType); - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI text in __instance.nameText) - { - text.text = plantName; - text.font = fontAsset; - } - - foreach(TextMeshProUGUI text in __instance.infoText) - { - string toTranslate = text.text; - string startColorTag = ""; - - string colorPattern = @"(]+>)(.*?)()"; - Match match = Regex.Match(toTranslate, colorPattern); - if(match.Success) - { - startColorTag = match.Groups[1].Value; - toTranslate = match.Groups[2].Value; - } - - string[] parts = toTranslate.Split("\n"); - List translatedParts = new List(); - - foreach(string part in parts) - { - translatedParts.Add(StringStore.TranslateText(part)); - } - - string joinedTranslation = String.Join("\n", translatedParts); - - if(startColorTag != "") - { - text.text = startColorTag + joinedTranslation + ""; - } - else - { - text.text = joinedTranslation; - } - - text.font = fontAsset; - } - - foreach(TextMeshProUGUI text in __instance.toggles.transform.Find("Viewport/Content/Toggles").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs b/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs deleted file mode 100644 index f749978..0000000 --- a/MelonLoader/Patches/GameObjects/PlantInfoWindow_Patch.cs +++ /dev/null @@ -1,56 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader.TinyJSON; -using PvZ_Fusion_Translator.AssetStore; -using Unity.Collections; -using UnityEngine; -using UnityEngine.UIElements; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlantInfoWindow))] - public static class PlantInfoWindow_Patch - { - [HarmonyPatch(nameof(PlantInfoWindow.InitText))] - [HarmonyPostfix] - private static void InitText(PlantInfoWindow __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - BigGardenPlant thePlant = __instance.plant; - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if (txt.name.Contains("Introduce") && thePlant != null) - { - PlantType thePlantType = thePlant.thePlantType; - txt.text = StringStore.TranslateText(txt.text); - - string text = txt.text; - string[] lines = text.Split("\n"); - - lines[0] = Utils.GetPlantNameFromAlmanac(thePlantType); - string updatedText = String.Join("\n", lines); - - txt.text = updatedText; - } - else - { - txt.text = StringStore.TranslateText(txt.text); - } - - txt.font = fontAsset; - } - - Transform parentWindowTransform = __instance.transform.parent; - Transform returnPlantTransform = parentWindowTransform.FindChild("Close"); - - foreach(TextMeshProUGUI txt in returnPlantTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/PlayerSaveMenu_Patch.cs b/MelonLoader/Patches/GameObjects/PlayerSaveMenu_Patch.cs deleted file mode 100644 index d550ff9..0000000 --- a/MelonLoader/Patches/GameObjects/PlayerSaveMenu_Patch.cs +++ /dev/null @@ -1,36 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlayerSaveMenu))] - public static class PlayerSaveMenu_Patch - { - [HarmonyPatch(nameof(PlayerSaveMenu.CreatePlayerData))] - [HarmonyPostfix] - public static void CreatePlayerData(PlayerSaveMenu __instance) - { - TranslateCreatePlayerSaveMenu(); - } - - [HarmonyPatch(nameof(PlayerSaveMenu.ResetName))] - [HarmonyPostfix] - public static void ResetName(PlayerSaveMenu __instance) - { - TranslateCreatePlayerSaveMenu(); - } - - public static void TranslateCreatePlayerSaveMenu() - { - Transform reNameMenuTransform = GameAPP.canvasUp.Find("ReNameMenu(Clone)"); - if(reNameMenuTransform.TryGetComponent(out ReNameMenu reNameMenu)) - { - reNameMenu.title.text = StringStore.TranslateText(reNameMenu.title.text); - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/PlayerShootingMenu_Patch.cs b/MelonLoader/Patches/GameObjects/PlayerShootingMenu_Patch.cs deleted file mode 100644 index 3e47e10..0000000 --- a/MelonLoader/Patches/GameObjects/PlayerShootingMenu_Patch.cs +++ /dev/null @@ -1,40 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlayerShootingMenu))] - public static class PlayerShootingMenu_Patch - { - [HarmonyPatch(nameof(PlayerShootingMenu.Update))] - [HarmonyPostfix] - private static void Update(PlayerShootingMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(PlayerShootingMenu.Refresh))] - [HarmonyPostfix] - private static void Refresh(PlayerShootingMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Transform refreshTransform = __instance.transform.FindChild("Button"); - foreach (TextMeshProUGUI text in refreshTransform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - text.autoSizeTextContainer = false; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/PlayerShootingWindow_Patch.cs b/MelonLoader/Patches/GameObjects/PlayerShootingWindow_Patch.cs deleted file mode 100644 index de7a336..0000000 --- a/MelonLoader/Patches/GameObjects/PlayerShootingWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(PlayerShootingWindow))] - public static class PlayerShootingWindow_Patch - { - [HarmonyPatch(nameof(PlayerShootingWindow.SetType))] - [HarmonyPostfix] - private static void SetType(PlayerShootingWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(PlayerShootingWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(PlayerShootingWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/MelonLoader/Patches/GameObjects/ReNameMenu_Patch.cs b/MelonLoader/Patches/GameObjects/ReNameMenu_Patch.cs deleted file mode 100644 index 5a1ce8e..0000000 --- a/MelonLoader/Patches/GameObjects/ReNameMenu_Patch.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using UnityEngine; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(ReNameMenu))] - public static class ReNameMenu_Patch - { - [HarmonyPatch(nameof(ReNameMenu.SetTitle))] - [HarmonyPostfix] - public static void SetTitle(ReNameMenu __instance) - { - __instance.title.text = StringStore.TranslateText(__instance.title.text); - } - - [HarmonyPatch(nameof(ReNameMenu.SetInputText))] - [HarmonyPostfix] - public static void SetInputText(ReNameMenu __instance) - { - __instance.input.text = StringStore.TranslateText(__instance.input.text); - } - } -} diff --git a/MelonLoader/Patches/GameObjects/RogueCardWindow_Patch.cs b/MelonLoader/Patches/GameObjects/RogueCardWindow_Patch.cs deleted file mode 100644 index 57db19c..0000000 --- a/MelonLoader/Patches/GameObjects/RogueCardWindow_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(RogueCardWindow))] - public static class RogueCardWindow_Patch - { - [HarmonyPatch(nameof(RogueCardWindow.InitCard))] - [HarmonyPostfix] - private static void InitCard(RogueCardWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(RogueCardWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(RogueCardWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - } -} diff --git a/MelonLoader/Patches/GameObjects/RogueStartMenu_Patch.cs b/MelonLoader/Patches/GameObjects/RogueStartMenu_Patch.cs deleted file mode 100644 index c231ce3..0000000 --- a/MelonLoader/Patches/GameObjects/RogueStartMenu_Patch.cs +++ /dev/null @@ -1,44 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.TextCore.Text; -using UnityEngine.UI; -using static MelonLoader.MelonLogger; -using static System.Net.Mime.MediaTypeNames; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - - [HarmonyPatch(typeof(RogueStartMenu))] - public static class RogueStartMenu_Patch - { - [HarmonyPatch(nameof(RogueStartMenu.SetLeader))] - [HarmonyPostfix] - private static void SetLeader(RogueStartMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(RogueStartMenu.EnterGame))] - [HarmonyPostfix] - private static void EnterGame(RogueStartMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} diff --git a/MelonLoader/Patches/GameObjects/SeedLibrary_Patch.cs b/MelonLoader/Patches/GameObjects/SeedLibrary_Patch.cs deleted file mode 100644 index f307a4f..0000000 --- a/MelonLoader/Patches/GameObjects/SeedLibrary_Patch.cs +++ /dev/null @@ -1,58 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(SeedLibrary))] - public static class SeedLibrary_Patch - { - [HarmonyPatch(nameof(SeedLibrary.ChangeSafeMode))] - [HarmonyPostfix] - private static void ChangeSafeMode(SeedLibrary __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - //foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - //{ - // txt.text = StringStore.TranslateText(txt.text); - // txt.font = fontAsset; - //} - - Transform safetyBoxButtonTransform = __instance.transform.FindChild("SafeBox").FindChild("StartSafeMode"); - - if (__instance.safeMode == false && safetyBoxButtonTransform != null) - { - foreach (TextMeshProUGUI txt in safetyBoxButtonTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - } - } - } - - [HarmonyPatch(nameof(SeedLibrary.Start))] - [HarmonyPatch(nameof(SeedLibrary.SetAllCards))] - [HarmonyPostfix] - private static void SetAllCards(SeedLibrary __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - //foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - //{ - // txt.text = StringStore.TranslateText(txt.text); - // txt.font = fontAsset; - //} - - foreach(TextMeshProUGUI txt in __instance.page.GetComponentsInChildren(true)) - { - txt.font = fontAsset; - if (!Utils.CheckForUntranslatedText(txt.text)) - { - txt.text = StringStore.TranslateText(txt.text); - } - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ShootingMenu_Patch.cs b/MelonLoader/Patches/GameObjects/ShootingMenu_Patch.cs deleted file mode 100644 index 7735106..0000000 --- a/MelonLoader/Patches/GameObjects/ShootingMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - /*[HarmonyPatch(typeof(ShootingMenu))] - public static class ShootingMenu_Patch - { - [HarmonyPatch(nameof(ShootingMenu.Update))] - [HarmonyPostfix] - private static void Update(ShootingMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - }*/ -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/ShootingSelectWindow_Patch.cs b/MelonLoader/Patches/GameObjects/ShootingSelectWindow_Patch.cs deleted file mode 100644 index 79580b5..0000000 --- a/MelonLoader/Patches/GameObjects/ShootingSelectWindow_Patch.cs +++ /dev/null @@ -1,73 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - /*[HarmonyPatch(typeof(ShootingSelectWindow))] - public static class ShootingSelectWindow_Patch - { - [HarmonyPatch(nameof(ShootingSelectWindow.InitPlantType))] - [HarmonyPostfix] - private static void InitCard(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.SetUpgradePlantTypes))] - [HarmonyPostfix] - private static void SetUpgradePlantTypes(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.GetMaxIndexInRoutes))] - [HarmonyPostfix] - private static void GetMaxIndexInRoutes(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - - [HarmonyPatch(nameof(ShootingSelectWindow.Start))] - [HarmonyPostfix] - private static void Start(ShootingSelectWindow __instance) - { - Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); - TextMeshProUGUI introduceText = introduceTransform.GetComponent(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - introduceText.text = StringStore.TranslateText(introduceText.text); - introduceText.font = fontAsset; - } - }*/ -} diff --git a/MelonLoader/Patches/GameObjects/SpriteRenderer_Patch.cs b/MelonLoader/Patches/GameObjects/SpriteRenderer_Patch.cs deleted file mode 100644 index 744fa5b..0000000 --- a/MelonLoader/Patches/GameObjects/SpriteRenderer_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(SpriteRenderer))] - public static class SpriteRenderer_Patch - { - [HarmonyPatch(nameof(SpriteRenderer.InvokeSpriteChanged))] - [HarmonyPostfix] - private static void InvokeSpriteChanged(SpriteRenderer __instance) - { - if (__instance.sprite != null) - { - if (TextureStore.spriteDict.ContainsKey(__instance.sprite.name) && __instance.drawMode != SpriteDrawMode.Sliced) - { - __instance.drawMode = SpriteDrawMode.Sliced; - } - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TowerOption_Patch.cs b/MelonLoader/Patches/GameObjects/TowerOption_Patch.cs deleted file mode 100644 index 1dcceda..0000000 --- a/MelonLoader/Patches/GameObjects/TowerOption_Patch.cs +++ /dev/null @@ -1,21 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(TowerOption))] -// public static class TowerOption_Patch -// { -// [HarmonyPatch(nameof(TowerOption.Start))] -// [HarmonyPostfix] -// private static void Postfix_Start(TowerOption __instance) -// { -// //TextMeshProUGUI[] allTexts = __instance.GetComponentsInChildren(true); -// __instance.introduce.text = StringStore.TranslateText(__instance.introduce.text); -// __instance.introduce.font = FontStore.LoadTMPFont(Utils.Language.ToString()); -// } -// } -//}} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/TowerUpgradeMenu_Patch.cs b/MelonLoader/Patches/GameObjects/TowerUpgradeMenu_Patch.cs deleted file mode 100644 index 4b863b3..0000000 --- a/MelonLoader/Patches/GameObjects/TowerUpgradeMenu_Patch.cs +++ /dev/null @@ -1,40 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(TowerUpgradeMenu))] - public static class TowerUpgradeMenu_Patch - { - [HarmonyPatch(nameof(TowerUpgradeMenu.Awake))] - [HarmonyPostfix] - private static void Awake(TowerUpgradeMenu __instance) - { - __instance.des.text = StringStore.TranslateText(__instance.des.text); - __instance.des2.text = StringStore.TranslateText(__instance.des2.text); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - - [HarmonyPatch(nameof(TowerUpgradeMenu.SetText))] - [HarmonyPostfix] - private static void SetText(TowerUpgradeMenu __instance) - { - __instance.des.text = StringStore.TranslateText(__instance.des.text); - __instance.des2.text = StringStore.TranslateText(__instance.des2.text); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/UIDifficulty_Patch.cs b/MelonLoader/Patches/GameObjects/UIDifficulty_Patch.cs deleted file mode 100644 index c7b6c5b..0000000 --- a/MelonLoader/Patches/GameObjects/UIDifficulty_Patch.cs +++ /dev/null @@ -1,21 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIDifficulty))] - public static class UIDifficulty_Patch - { - [HarmonyPatch(nameof(UIDifficulty.Update))] - [HarmonyPostfix] - private static void Update(UIDifficulty __instance) - { - if (!Utils.CheckForUntranslatedText(__instance.t.text)) return; - __instance.t.text = StringStore.TranslateText(__instance.t.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs b/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs deleted file mode 100644 index 9401da2..0000000 --- a/MelonLoader/Patches/GameObjects/UIZombieNum_Patch.cs +++ /dev/null @@ -1,29 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(UIZombieNum))] - public static class UIZombieNum_Patch - { - [HarmonyPatch(nameof(UIZombieNum.Update))] - [HarmonyPostfix] - private static void Update(UIZombieNum __instance) - { - - #if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - string zombieText = StringStore.TranslateText(__instance.t.text); - __instance.t.text = zombieText; - #else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - string zombieText = StringStore.patchesStore["Zombies"]["Spanish"]; - __instance.t.text = string.Format(zombieText + " {0}", Board.Instance.enermyCount); - #endif - - __instance.t.font = fontAsset; - } - } -} diff --git a/MelonLoader/Patches/GameObjects/WarningMenu_Patch.cs b/MelonLoader/Patches/GameObjects/WarningMenu_Patch.cs deleted file mode 100644 index f3103ff..0000000 --- a/MelonLoader/Patches/GameObjects/WarningMenu_Patch.cs +++ /dev/null @@ -1,96 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(WarningMenu))] - public static class WarningMenu_Patch - { - [HarmonyPatch(nameof(WarningMenu.Start))] - [HarmonyPostfix] - private static void Start(WarningMenu __instance) - { - TranslateInvestmentWarning(__instance); - } - - [HarmonyPatch(nameof(WarningMenu.EnableChallengeMode))] - [HarmonyPostfix] - private static void EnableChallengeMode(WarningMenu __instance) - { - TranslateInvestmentWarning(__instance); - } - - [HarmonyPatch(nameof(WarningMenu.Cancel))] - [HarmonyPostfix] - private static void Cancel(WarningMenu __instance) - { - TranslateInvestmentWarning(__instance); - } - - public static void TranslateInvestmentWarning(WarningMenu __instance) - { - Transform normalModeTransform = __instance.transform.Find("Normal"); - Transform challengeModeTransform = __instance.transform.Find("Challenge"); - - if (normalModeTransform != null) - { - TextMeshProUGUI text = normalModeTransform.Find("text").GetComponent(); - TextMeshProUGUI textShadow = normalModeTransform.Find("text (1)").GetComponent(); - - text.text = StringStore.translationString.ContainsKey("普通模式_IV") ? StringStore.TranslateText("普通模式_IV") : Utils.RemoveColorTags(StringStore.TranslateText(text.text)); - text.alignment = TextAlignmentOptions.Center; - text.autoSizeTextContainer = true; - textShadow.text = Utils.RemoveColorTags(text.text); - textShadow.alignment = TextAlignmentOptions.Center; - textShadow.autoSizeTextContainer = true; - } - - if (challengeModeTransform != null) - { - TextMeshProUGUI text = challengeModeTransform.Find("text").GetComponent(); - TextMeshProUGUI textShadow = challengeModeTransform.Find("text (1)").GetComponent(); - - text.text = StringStore.translationString.ContainsKey("诅咒模式_IV") ? StringStore.TranslateText("诅咒模式_IV") : Utils.RemoveColorTags(StringStore.TranslateText(text.text)); - text.alignment = TextAlignmentOptions.Center; - text.autoSizeTextContainer = true; - textShadow.text = Utils.RemoveColorTags(text.text); - textShadow.alignment = TextAlignmentOptions.Center; - textShadow.autoSizeTextContainer = true; - } - - if (__instance.tutor != null) - { - foreach (TextMeshProUGUI text in __instance.tutor.GetComponentsInChildren()) - { - if (text.gameObject.name == "text1") - { - text.text = StringStore.TranslateText(text.text); - if (text.transform.parent.Find("text").TryGetComponent(out TextMeshProUGUI textShadow)) - { - textShadow.text = Utils.RemoveColorTags(text.text); - } - } - } - } - - if (__instance.challenge != null) - { - foreach (TextMeshProUGUI text in __instance.challenge.GetComponentsInChildren()) - { - if (text.gameObject.name == "text1") - { - text.text = StringStore.TranslateText(text.text); - if (text.transform.parent.Find("text").TryGetComponent(out TextMeshProUGUI textShadow)) - { - textShadow.text = Utils.RemoveColorTags(text.text); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Managers/AbyssDevelopMenu_Patch.cs b/MelonLoader/Patches/Managers/AbyssDevelopMenu_Patch.cs deleted file mode 100644 index a0f32d7..0000000 --- a/MelonLoader/Patches/Managers/AbyssDevelopMenu_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(AbyssDevelopMenu))] - public static class AbyssDevelopMenu_Patch - { - [HarmonyPatch(nameof(AbyssDevelopMenu.UpdateInfo))] - [HarmonyPostfix] - private static void UpdateInfo(AbyssDevelopMenu __instance) - { - __instance.currentMoney.text = StringStore.TranslateText(__instance.currentMoney.text); - __instance.upgradeTextInfo.text = StringStore.TranslateText(__instance.upgradeTextInfo.text); - } - } -} diff --git a/MelonLoader/Patches/Managers/AbyssMenu2_Patch.cs b/MelonLoader/Patches/Managers/AbyssMenu2_Patch.cs deleted file mode 100644 index bbd5a58..0000000 --- a/MelonLoader/Patches/Managers/AbyssMenu2_Patch.cs +++ /dev/null @@ -1,74 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(AbyssMenu2))] - public static class AbyssMenu2_Patch - { - [HarmonyPatch(nameof(AbyssMenu2.Start))] - [HarmonyPostfix] - private static void Start(AbyssMenu2 __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); - __instance.buffCountText.font = fontAsset; - - __instance.money.text = StringStore.TranslateText(__instance.money.text); - __instance.money.font = fontAsset; - - __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); - __instance.refreshText.font = fontAsset; - - __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); - __instance.statistics.font = fontAsset; - - Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; - if (buffTextTransform != null) StringStore.TranslateTextTransform(buffTextTransform); - - Transform moneyTransform = __instance.transform.FindChild("Money").transform; - if (moneyTransform != null) StringStore.TranslateTextTransform(moneyTransform); - - Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; - if (buffCountTextTransform != null) StringStore.TranslateTextTransform(buffCountTextTransform); - - Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; - if (refreshTextTransform != null) StringStore.TranslateTextTransform(refreshTextTransform); - } - - [HarmonyPatch(nameof(AbyssMenu2.Awake))] - [HarmonyPostfix] - private static void Awake(AbyssMenu2 __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); - __instance.buffCountText.font = fontAsset; - - __instance.money.text = StringStore.TranslateText(__instance.money.text); - __instance.money.font = fontAsset; - - __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); - __instance.refreshText.font = fontAsset; - - __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); - __instance.statistics.font = fontAsset; - - Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; - if (buffTextTransform != null) StringStore.TranslateTextTransform(buffTextTransform); - - Transform moneyTransform = __instance.transform.FindChild("Money").transform; - if (moneyTransform != null) StringStore.TranslateTextTransform(moneyTransform); - - Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; - if (buffCountTextTransform != null) StringStore.TranslateTextTransform(buffCountTextTransform); - - Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; - if (refreshTextTransform != null) StringStore.TranslateTextTransform(refreshTextTransform); - } - } -} diff --git a/MelonLoader/Patches/Managers/AbyssMenu_Patch.cs b/MelonLoader/Patches/Managers/AbyssMenu_Patch.cs deleted file mode 100644 index aa48391..0000000 --- a/MelonLoader/Patches/Managers/AbyssMenu_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(AbyssMenu))] - public static class AbyssMenu_Patch - { - [HarmonyPatch(nameof(AbyssMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AbyssMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.levelInfo) - { - txt.text = StringStore.TranslateText(txt.text, false); - txt.font = fontAsset; - } - - - } - } -} diff --git a/MelonLoader/Patches/Managers/AlmanacMgrZombie_Patch.cs b/MelonLoader/Patches/Managers/AlmanacMgrZombie_Patch.cs deleted file mode 100644 index a47e22c..0000000 --- a/MelonLoader/Patches/Managers/AlmanacMgrZombie_Patch.cs +++ /dev/null @@ -1,128 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(AlmanacMgrZombie))] - public static partial class AlmanacMgrZombie_Patch - { - [HarmonyPatch(nameof(AlmanacMgrZombie.InitNameAndInfoFromJson))] - [HarmonyPostfix] - private static void InitNameAndInfoFromJson(AlmanacMgrZombie __instance) - { -#if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); -#else - string almanacDir = almanacDir = GetAssetDir(AssetType.Almanac); - string currentLanguage = "English"; -#endif - string path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedZombiesTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogError($"ZombieStringsTranslate.json file not found at path: {path}"); - return; - } - -#if OBFUSCATE - if (CheckSumStore.IsModified(path)) - { - Log.LogError("File {0} was modified!", path); - return; - } -#endif - - string json; - json = File.ReadAllText(path); - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage)) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = true; - } - -#if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); -#else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); -#endif - - TextMeshPro component = __instance.info.GetComponent(); - TextMeshPro component2 = __instance.zombieName.GetComponent(); - TextMeshPro component3 = __instance.zombieName.transform.GetChild(0).GetComponent(); - - ZombieAlmanacData zombieData = JsonUtility.FromJson(json); - - foreach (ZombieInfo zombieInfo in zombieData.zombies) - { - if (zombieInfo.theZombieType == __instance.theZombieType) - { - component.text = zombieInfo.info + "\n\n" + zombieInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - component2.text = zombieInfo.name; - component2.autoSizeTextContainer = true; - component3.text = Utils.RemoveColorTags(zombieInfo.name); - component3.autoSizeTextContainer = true; - - if (hasAlmanacFont) - component.font = almanacFontAsset; - else - component.font = fontAsset; - component2.font = fontAsset; - component3.font = fontAsset; - } - } - - if (File.Exists(moddedPath)) - { - string moddedJson; - moddedJson = File.ReadAllText(moddedPath); - - ZombieAlmanacData moddedZombieData = JsonUtility.FromJson(moddedJson); - - foreach (ZombieInfo zombieInfo in moddedZombieData.zombies) - { - if (zombieInfo.theZombieType == __instance.theZombieType) - { - component.text = zombieInfo.info + "\n\n" + zombieInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - component2.text = zombieInfo.name; - component2.autoSizeTextContainer = true; - component3.text = Utils.RemoveColorTags(zombieInfo.name); - component3.autoSizeTextContainer = true; - - if (hasAlmanacFont) - component.font = almanacFontAsset; - else - component.font = fontAsset; - component2.font = fontAsset; - component3.font = fontAsset; - } - } - } - - return; - } - - [HarmonyPatch(nameof(AlmanacMgrZombie.OnMouseDown))] - [HarmonyPrefix] - private static bool OnMouseDown(AlmanacMgrZombie __instance) - { - TextMeshPro component = __instance.info.GetComponent(); - if (component != null) - { - component.pageToDisplay = component.pageToDisplay > component.m_pageNumber ? 1 : component.pageToDisplay + 1; - return false; - } - return true; - } - } -}*/ \ No newline at end of file diff --git a/MelonLoader/Patches/Managers/AlmanacPlantBank_Patch.cs b/MelonLoader/Patches/Managers/AlmanacPlantBank_Patch.cs deleted file mode 100644 index 236fc5c..0000000 --- a/MelonLoader/Patches/Managers/AlmanacPlantBank_Patch.cs +++ /dev/null @@ -1,200 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(AlmanacPlantBank))] - public static partial class AlmanacPlantBank_Patch - { - [HarmonyPatch(nameof(AlmanacPlantBank.InitNameAndInfoFromJson))] - [HarmonyPostfix] - private static void InitNameAndInfoFromJson(Il2Cpp.AlmanacPlantBank __instance) - { -#if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); -#else - string almanacDir = GetAssetDir(AssetType.Almanac); - string currentLanguage = "English"; -#endif - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - string moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); - - if (!File.Exists(path)) - { - Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); - return; - } - -#if OBFUSCATE - if (CheckSumStore.IsModified(path)) - { - Log.LogError("File {0} was modified!", path); - return; - } -#endif - - string json; - json = File.ReadAllText(path); - - bool hasAlmanacFont = false; - TMP_FontAsset almanacFontAsset = null; - if (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage)) - { - almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); - hasAlmanacFont = true; - } - -#if MULTI_LANGUAGE - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); -#else - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); -#endif - - TextMeshPro component = __instance.introduce.GetComponent(); - TextMeshPro component2 = __instance.plantName.GetComponent(); - TextMeshPro component3 = __instance.plantName.transform.GetChild(0).GetComponent(); - TextMeshPro component4 = __instance.cost.GetComponent(); - - AlmanacPlantBank.PlantData plantData = JsonUtility.FromJson(json); - - foreach (AlmanacPlantBank.PlantInfo plantInfo in plantData.plants) - { - if (plantInfo.seedType == __instance.theSeedType && !string.IsNullOrEmpty(plantInfo.name)) - { - component.autoSizeTextContainer = false; - component.text = plantInfo.info + "\n\n" + plantInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - - // fix dimensions for cost text - component.rectTransform.offsetMax = new Vector2(component.rectTransform.offsetMax.x, 27.3839f); - component.rectTransform.offsetMin = new Vector2(component.rectTransform.offsetMin.x, -29.3079f); - component.rectTransform.sizeDelta = new Vector2(component.rectTransform.sizeDelta.x, 50.917f); - component.transform.localPosition = new Vector3(component.transform.localPosition.x, component.transform.localPosition.y + 0.15f, component.transform.localPosition.z); - - - component2.text = plantInfo.name; - component2.autoSizeTextContainer = true; - - component3.text = Utils.RemoveColorTags(plantInfo.name ?? string.Empty); - component3.autoSizeTextContainer = true; - - component4.text = plantInfo.cost; - - if (hasAlmanacFont) - { - component.font = almanacFontAsset; - component4.font = almanacFontAsset; - } - else - { - component.font = fontAsset; - component4.font = fontAsset; - } - component2.font = fontAsset; - component3.font = fontAsset; - } - } - - if (File.Exists(moddedPath)) - { - string moddedJson; - moddedJson = File.ReadAllText(moddedPath); - - AlmanacPlantBank.PlantData moddedPlantData = JsonUtility.FromJson(moddedJson); - - foreach (AlmanacPlantBank.PlantInfo plantInfo in moddedPlantData.plants) - { - if (plantInfo.seedType == __instance.theSeedType && !string.IsNullOrEmpty(plantInfo.name)) - { - component.autoSizeTextContainer = false; - component.text = plantInfo.info + "\n\n" + plantInfo.introduce; - component.overflowMode = TextOverflowModes.Page; - - // fix dimensions for cost text - component.rectTransform.offsetMax = new Vector2(component.rectTransform.offsetMax.x, 27.3839f); - component.rectTransform.offsetMin = new Vector2(component.rectTransform.offsetMin.x, -29.3079f); - component.rectTransform.sizeDelta = new Vector2(component.rectTransform.sizeDelta.x, 50.917f); - component.transform.localPosition = new Vector3(component.transform.localPosition.x, component.transform.localPosition.y + 0.15f, component.transform.localPosition.z); - - - component2.text = plantInfo.name; - component2.autoSizeTextContainer = true; - - component3.text = Utils.RemoveColorTags(plantInfo.name ?? string.Empty); - component3.autoSizeTextContainer = true; - - component4.text = plantInfo.cost; - - if (hasAlmanacFont) - { - component.font = almanacFontAsset; - component4.font = almanacFontAsset; - } - else - { - component.font = fontAsset; - component4.font = fontAsset; - } - component2.font = fontAsset; - component3.font = fontAsset; - } - } - } - - return; - } - - [HarmonyPatch(nameof(AlmanacPlantBank.OnMouseDown))] - [HarmonyPrefix] - private static bool OnMouseDown(AlmanacPlantBank __instance) - { - TextMeshPro component = __instance.introduce.GetComponent(); - if (component != null) - { - component.pageToDisplay = component.pageToDisplay > component.m_pageNumber ? 1 : component.pageToDisplay + 1; - return false; - } - return true; - } - - [HarmonyPatch(nameof(AlmanacPlantBank.PVPInit))] - [HarmonyPostfix] - private static void PVPInit(Il2Cpp.AlmanacPlantBank __instance) - { - TextMeshPro component = __instance.introduce.GetComponent(); - if (component != null) - { - component.autoSizeTextContainer = false; - } - - Transform banTransform = __instance.transform.FindChild("Ban").GetChild(0); - if (banTransform != null) - { - banTransform.GetComponent().text = StringStore.TranslateText(banTransform.GetComponent().text); - } - } - - [HarmonyPatch(nameof(AlmanacPlantBank.Start))] - [HarmonyPostfix] - public static void Post_Start(AlmanacPlantBank __instance) - { - GameObject skinTextObj = __instance.skinButton.transform.GetChild(0).gameObject; - GameObject skinShadowTextObj = UnityEngine.Object.Instantiate(skinTextObj, parent: __instance.skinButton.transform); - TextMeshPro skinShadowText = skinShadowTextObj.GetComponent(); - skinShadowText.text = StringStore.TranslateText("换肤_S"); - skinShadowText.sortingOrder -= 2; - skinShadowTextObj.transform.Translate(new Vector3(0.015f, -0.015f, 0)); - skinTextObj.transform.Translate(new Vector3(-0.022f, 0)); - skinShadowTextObj.transform.Translate(new Vector3(-0.022f, 0)); - __instance.skinButton.transform.localScale /= 1.75f; - __instance.skinButton.transform.Translate(new Vector3(-0.075f, -0.15f, 0)); - __instance.skinButton.transform.GetChild(1).Translate(new Vector3(0.35f, 0)); - __instance.skinButton.transform.GetChild(2).Translate(new Vector3(-0.35f, 0)); - } - } -}*/ \ No newline at end of file diff --git a/MelonLoader/Patches/Managers/CanvasUpUI_Patch.cs b/MelonLoader/Patches/Managers/CanvasUpUI_Patch.cs deleted file mode 100644 index 6efb242..0000000 --- a/MelonLoader/Patches/Managers/CanvasUpUI_Patch.cs +++ /dev/null @@ -1,31 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(CanvasUpUI))] - public static class CanvasUpUI_Patch - { - [HarmonyPatch(nameof(CanvasUpUI.Start))] - [HarmonyPostfix] - public static void Start(CanvasUpUI __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => (x.Value == text.text || x.Value.Replace("\n", "") == text.text)).Key; - text.text = (StringStore.translationString.ContainsKey(originalKey + "_MG")) ? StringStore.TranslateText(originalKey + "_MG") : StringStore.TranslateText(text.text); - if(text.gameObject.name.Contains("LevelName")) - { - text.text = text.text.Replace("\n", " "); - } - text.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Managers/ChessManager_Patch.cs b/MelonLoader/Patches/Managers/ChessManager_Patch.cs deleted file mode 100644 index 8ff4841..0000000 --- a/MelonLoader/Patches/Managers/ChessManager_Patch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.TextCore.Text; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(ChessManager))] - public static class ChessManager_Patch - { - [HarmonyPatch(nameof(ChessManager.Start))] - [HarmonyPostfix] - private static void Postfix_Start(ChessManager __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ChessManager.Update))] - [HarmonyPostfix] - private static void Postfix_Update(ChessManager __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(ChessManager.UpdateText))] - [HarmonyPostfix] - private static void Postfix_UpdateText(ChessManager __instance) - { - __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); - __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } -} diff --git a/MelonLoader/Patches/Managers/CustomLevelShower_Patch.cs b/MelonLoader/Patches/Managers/CustomLevelShower_Patch.cs deleted file mode 100644 index 8ed0487..0000000 --- a/MelonLoader/Patches/Managers/CustomLevelShower_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if FIX -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(CustomLevelShower))] - public static class CustomLevelShower_Patch - { - [HarmonyPatch(nameof(CustomLevelShower.Show))] - [HarmonyPostfix] - private static void Show(CustomLevelShower __instance) - { - foreach (Transform transform in __instance.pages) - { - StringStore.TranslateTextTransform(transform); - } - } - } -} -#endif \ No newline at end of file diff --git a/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs b/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs deleted file mode 100644 index 3d05ff1..0000000 --- a/MelonLoader/Patches/Managers/DifficultyMgr_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(DifficultyMgr))] - public static class DifficultyMgr_Patch - { - [HarmonyPatch(nameof(DifficultyMgr.Update))] - [HarmonyPostfix] - private static void DifficultyMgr_Update(DifficultyMgr __instance) - { - __instance.t = StringStore.TranslateText(__instance.t); - __instance.t.autoSizeTextContainer = false; - } - } -} diff --git a/MelonLoader/Patches/Managers/DrawCardManager_Patch.cs b/MelonLoader/Patches/Managers/DrawCardManager_Patch.cs deleted file mode 100644 index 0db3ecf..0000000 --- a/MelonLoader/Patches/Managers/DrawCardManager_Patch.cs +++ /dev/null @@ -1,78 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.BaseTextObjects; -using System.Text.RegularExpressions; -using UnityEngine; -using UnityEngine.TextCore.Text; -using static MelonLoader.MelonLogger; - -namespace PvZ_Fusion_Translator.Patches.GameObjects -{ - [HarmonyPatch(typeof(DrawCardManager))] - public static class DrawCardManager_Patch - { - public static TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - [HarmonyPatch(nameof(DrawCardManager.Awake))] - [HarmonyPostfix] - private static void Awake(DrawCardManager __instance) - { - fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - [HarmonyPatch(nameof(DrawCardManager.UpdateText))] - [HarmonyPostfix] - private static void Postfix_UpdateText(DrawCardManager __instance) - { - KeyValuePair regexPair = new KeyValuePair("抽取次数:\n(\\d+)/(\\d+)\n当前up植物:\n([^\\s]+)\nup刷新倒计时:\n(\\d+)", "Draw Count:\n{0}/{1}\nCurrent Up:\n{2}\nNext Up in: \n{3}s"); - - foreach(TextMeshProUGUI txt in __instance.texts) - { - if(Regex.IsMatch(txt.text, regexPair.Key)) - { - txt.text = TranslateGashaponText(txt.text, regexPair.Key, regexPair.Value, __instance.up); - txt.font = fontAsset; - } - } - } - - public static string TranslateGashaponText(string originalText, string pattern, string fallback, PlantType up) - { - string res = ""; - string fStr = ""; - Match match = Regex.Match(originalText, pattern); - if(match.Success) - { - GroupCollection groups = match.Groups; - fStr = StringStore.translationStringRegex.ContainsKey(pattern) ? StringStore.translationStringRegex[pattern] : fallback; - List dynamicParts = []; - for(int i = 1; i < groups.Count; i++) - { - string group = groups[i].Value; - string translatedGroup = ""; - if(i == 3 && up != PlantType.Peashooter) - { - translatedGroup = Utils.GetPlantNameFromAlmanac(up); - } - else - { - translatedGroup = StringStore.TranslateText(group); - } - dynamicParts.Add(translatedGroup); - } - res = string.Format(fStr, [.. dynamicParts]); - } - return res; - } - - /*[HarmonyPatch(nameof(DrawCardManager.Update))] - [HarmonyPostfix] - private static void Postfix_Update(DrawCardManager __instance) - { - Postfix_UpdateText(__instance); - }*/ - } -} - diff --git a/MelonLoader/Patches/Managers/EndlessMgr_Patch.cs b/MelonLoader/Patches/Managers/EndlessMgr_Patch.cs deleted file mode 100644 index de57cbf..0000000 --- a/MelonLoader/Patches/Managers/EndlessMgr_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(EndlessMgr))] - public static class EndlessMgr_Patch - { - [HarmonyPatch(nameof(EndlessMgr.Awake))] - [HarmonyPostfix] - private static void Awake(EndlessMgr __instance) - { - Transform textTransform = __instance.transform.GetChild(2); - if (textTransform != null && textTransform.gameObject.activeSelf) - { - TextMeshProUGUI textTMP = textTransform.GetComponent(); - if (textTMP != null) - { - textTMP = StringStore.TranslateText(textTMP); - } - } - } - } -} diff --git a/MelonLoader/Patches/Managers/Garden_Patch.cs b/MelonLoader/Patches/Managers/Garden_Patch.cs deleted file mode 100644 index 698e2a5..0000000 --- a/MelonLoader/Patches/Managers/Garden_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(Garden))] - public static class Garden_Patch - { - [HarmonyPatch(nameof(Garden.Awake))] - [HarmonyPostfix] - private static void Awake(Garden __instance) - { - foreach (TextMeshPro text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/MelonLoader/Patches/Managers/IZBottomMenu_Patch.cs b/MelonLoader/Patches/Managers/IZBottomMenu_Patch.cs deleted file mode 100644 index 8630912..0000000 --- a/MelonLoader/Patches/Managers/IZBottomMenu_Patch.cs +++ /dev/null @@ -1,52 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(IZBottomMenu))] - public static class IZBottomMenu_Patch - { - [HarmonyPatch(nameof(IZBottomMenu.ChangeString))] - [HarmonyPostfix] - public static void ChangeStringz(IZBottomMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.levelName) - { - string fStr = StringStore.translationStringRegex["([^\\s]+),推荐难度:(\\d+)"]; - string[] parts = text.text.Split(",推荐难度:"); - - if(new Regex("([^\\s]+),推荐难度:(\\d+)").IsMatch(text.text)) - { - string customName = (StringStore.translationString.ContainsKey(parts[0] + "_IZ")) ? parts[0] + "_IZ" : parts[0]; - text.text = string.Format(fStr, StringStore.TranslateText(customName), parts[1]); - } - - text.text = StringStore.TranslateText(text.text); - text.text = text.text.Replace("\n", " "); - } - } - - [HarmonyPatch(nameof(IZBottomMenu.SetLevelName))] - [HarmonyPostfix] - public static void SetLevelName(IZBottomMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.levelName) - { - string fStr = StringStore.translationStringRegex["([^\\s]+),推荐难度:(\\d+)"]; - string[] parts = text.text.Split(",推荐难度:"); - - if (new Regex("([^\\s]+),推荐难度:(\\d+)").IsMatch(text.text)) - { - text.text = string.Format(fStr, StringStore.TranslateText(parts[0]), parts[1]); - } - - text.text = StringStore.TranslateText(text.text); - text.text = text.text.Replace("\n", " "); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Managers/InGameUI_Patch.cs b/MelonLoader/Patches/Managers/InGameUI_Patch.cs deleted file mode 100644 index b9878bc..0000000 --- a/MelonLoader/Patches/Managers/InGameUI_Patch.cs +++ /dev/null @@ -1,87 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.BaseTextObjects; -using System.Text.RegularExpressions; -using Unity.Collections; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(InGameUI))] - public static class InGameUI_Patch - { - public static string travelAdventurePattern = "^旅行冒险 ([^\\s:]+)"; - public static string travelAdventureFallback = "Odyssey Adventure: {0}"; - - [HarmonyPatch(nameof(InGameUI.Start))] - [HarmonyPostfix] - private static void Start(InGameUI __instance) - { - SetLevelName(__instance); - } - - [HarmonyPatch(nameof(InGameUI.SetUniqueText))] - [HarmonyPostfix] - private static void SetUniqueText(InGameUI __instance) - { - SetLevelName(__instance); - } - - [HarmonyPatch(nameof(InGameUI.SetLevelName))] - [HarmonyPostfix] - private static void SetLevelName(InGameUI __instance) - { - foreach (TextMeshProUGUI text in __instance.levelNameText) - { - if (text.text == null) continue; - - string originalText = text.text; - text.text = text.text.Replace("\n", " "); - - Regex checkFusionChallenge = new Regex("^超级([^\\s:]+)(:?挑战1?)"); - Regex checkTravelAdv = new Regex(travelAdventurePattern); - - if(checkTravelAdv.IsMatch(originalText)) - { - text.text = InGameText_Patch.TranslatePlantNameParts(originalText, travelAdventurePattern, travelAdventureFallback); - } - else if (text.text.Contains("配方:") && !checkFusionChallenge.IsMatch(text.text)) - { - string[] lines = text.text.Split(":"); - lines[1] = Utils.GetPlantNameFromAlmanac(lines[1]); - if (lines[1] == "") - { - Log.LogError("Couldn't find plant! (Fusion Showcase)"); - lines[1] = StringStore.TranslateText(lines[1]); - } - text.text = StringStore.TranslateText("配方:") + lines[1]; - text.autoSizeTextContainer = true; - } - else - { - text.text = (StringStore.translationString.ContainsKey(text.text + "_MG")) ? StringStore.TranslateText(text.text + "_MG") : StringStore.TranslateText(text.text); - text.text = text.text.Replace("\n", " "); - } - } - } - - /*[HarmonyPatch(nameof(InGameUI.Update))] - [HarmonyPostfix] - private static void Update(InGameUI __instance) - { - if (!__instance.board.boardTag.isDrawCards) return; - - KeyValuePair regexPair = new KeyValuePair("抽取次数:\n(\\d+)/(\\d+)\n当前up植物:\n([^\\s]+)\nup刷新倒计时:\n(\\d+)", "Draw Count:\n{0}/{1}\nCurrent Up:\n{2}\nNext Up in: \n{3}s"); - - foreach(TextMeshProUGUI txt in __instance.DrawCardsHead.GetComponentsInChildren()) - { - if(Regex.IsMatch(txt.text, regexPair.Key)) - { - txt.text = InGameText_Patch.TranslatePlantNameParts(txt.text, regexPair.Key, regexPair.Value); - } - } - }*/ - } -} diff --git a/MelonLoader/Patches/Managers/PVPScareyPot_Patch.cs b/MelonLoader/Patches/Managers/PVPScareyPot_Patch.cs deleted file mode 100644 index 3302de1..0000000 --- a/MelonLoader/Patches/Managers/PVPScareyPot_Patch.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Il2Cpp; -using UnityEngine; -using HarmonyLib; -using Il2CppPVPScaryPot; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(PVPScareyPot))] - public static class PVPScareyPot_Patch - { - [HarmonyPatch(nameof(PVPScareyPot.Awake))] - [HarmonyPatch(nameof(PVPScareyPot.Start))] - [HarmonyPatch(nameof(PVPScareyPot.AutoRuleUpdate))] - [HarmonyPatch(nameof(PVPScareyPot.RandomCardUpdate))] - [HarmonyPatch(nameof(PVPScareyPot.Update))] - [HarmonyPostfix] - public static void TranslatePlayerDatas(PVPScareyPot __instance) - { - TranslatePlayerData(__instance.player1); - TranslatePlayerData(__instance.player2); - TranslatePlayerData(__instance.currentPlayer); - } - - public static void TranslatePlayerData(PVPScareyPot.PlayerData playerData) - { - if(playerData != null) - { - playerData.textMesh.text = StringStore.TranslateText(playerData.textMesh.text); - playerData.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - } - } -} diff --git a/MelonLoader/Patches/Managers/SaveMenu_Patch.cs b/MelonLoader/Patches/Managers/SaveMenu_Patch.cs deleted file mode 100644 index 0f5ae09..0000000 --- a/MelonLoader/Patches/Managers/SaveMenu_Patch.cs +++ /dev/null @@ -1,37 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(SaveMenu))] - public static class SaveMenu_Patch - { - [HarmonyPatch(nameof(SaveMenu.Start))] - [HarmonyPatch(nameof(SaveMenu.CreateLevelEnter))] - [HarmonyPatch(nameof(SaveMenu.InitLevelSaveEnters))] - [HarmonyPostfix] - private static void Start(SaveMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.menuTitle.text = StringStore.TranslateText(__instance.menuTitle.text); - __instance.menuTitle.font = fontAsset; - - foreach(LevelSaveEnter enter in __instance.GetComponentsInChildren()) - { - LevelSaveEnter_Patch.TranslateEnter(enter); - } - } - - [HarmonyPatch(nameof(SaveMenu.OnEditSelectedButtonClicked))] - [HarmonyPostfix] - private static void OnEditSelectedButtonClicked(SaveMenu __instance) - { - - } - } -} diff --git a/MelonLoader/Patches/Managers/Screen_Patch.cs b/MelonLoader/Patches/Managers/Screen_Patch.cs deleted file mode 100644 index da7c0ed..0000000 --- a/MelonLoader/Patches/Managers/Screen_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(Screen))] - public static class Screen_Patch - { - [HarmonyPatch(nameof(Screen.SetResolution), argumentTypes: [typeof(int), typeof(int), typeof(bool)])] - [HarmonyPrefix] - private static bool SetResolution(Screen __instance) - { - if(EventSystem.current.currentSelectedGameObject != null) - { - if (EventSystem.current.currentSelectedGameObject.TryGetComponent(out TMP_InputField field)) - { - return false; - } - } - return true; - } - } -} diff --git a/MelonLoader/Patches/Managers/TowerManager_Patch.cs b/MelonLoader/Patches/Managers/TowerManager_Patch.cs deleted file mode 100644 index 3088e45..0000000 --- a/MelonLoader/Patches/Managers/TowerManager_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(TowerManager))] - public static class TowerManager_Patch - { - public static List updatedText = []; - - public static void UpdateText() - { - foreach (Transform transform in updatedText) - { - if (transform != null) - { - if(transform.gameObject.active) - { - transform.GetComponent().text = StringStore.TranslateText(transform.GetComponent().text); - } - } - } - } - } -} diff --git a/MelonLoader/Patches/Managers/UIMgr_Patch.cs b/MelonLoader/Patches/Managers/UIMgr_Patch.cs deleted file mode 100644 index e3e1bad..0000000 --- a/MelonLoader/Patches/Managers/UIMgr_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Managers -{ - [HarmonyPatch(typeof(UIMgr))] - public class UIMgr_Patch - { - [HarmonyPatch(nameof(UIMgr.EnterLoseMenu))] - [HarmonyPostfix] - private static void EnterLoseMenu(UIMgr __instance) - { - LoseMenu loseMenu = GameObject.FindObjectOfType(); - loseMenu.title.text = StringStore.TranslateText(loseMenu.title.text); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs deleted file mode 100644 index a226fe5..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs +++ /dev/null @@ -1,30 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using MelonLoader; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine; -//using UnityEngine.TextCore.Text; -//using UnityEngine.UI; -//using static MelonLoader.MelonLogger; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ - -// [HarmonyPatch(typeof(AbyssBagMenu))] -// public static class AbyssBagMenu_Patch -// { -// [HarmonyPatch(nameof(AbyssBagMenu.Awake))] -// [HarmonyPostfix] -// private static void Awake_Post(AbyssCheckInBag __instance) -// { -// foreach(TextMeshProUGUI text in __instance.transform.FindChild("Background").GetComponentsInChildren()) -// { -// text.text = text.text + "_深渊"; -// text.text = StringStore.TranslateText("背包_深渊"); -// text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); -// } -// AbyssMenu2.Instance.UpdateIcons(); -// } -// } -//} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs deleted file mode 100644 index f83d585..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs +++ /dev/null @@ -1,54 +0,0 @@ -#if FIX -using System.Text.RegularExpressions; -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using MelonLoader; - -namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -{ - [HarmonyPatch(typeof(AbyssBuffButton))] - public static class AbyssBuffButton_Patch - { - [HarmonyPatch(nameof(AbyssBuffButton.SetType))] - [HarmonyPostfix] - private static void SetType(AbyssBuffButton __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Regex regex = new Regex("([^\\s]+)\n价格:(\\d+)"); - - if (regex.IsMatch(__instance.description.text)) - { - Match match = regex.Match(__instance.description.text); - int groupCount = match.Groups.Count; - - List dynamicParts = []; - - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = StringStore.translationString.ContainsKey(groupValue) ? StringStore.translationString[groupValue] : groupValue; - dynamicParts.Add(translatedValue); - MelonLogger.Msg(translatedValue); - } - - __instance.description.text = string.Format(StringStore.translationStringRegex["([^\\s]+)\n价格:(\\d+)"], [.. dynamicParts]); - __instance.description.font = fontAsset; - } - } - - [HarmonyPatch(nameof(AbyssBuffButton.SetSold))] - [HarmonyPostfix] - private static void SetSold(AbyssBuffButton __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.description.text = StringStore.TranslateText(__instance.description.text); - __instance.description.font = fontAsset; - } - } -} -#endif \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssBuffData_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBuffData_Patch.cs deleted file mode 100644 index 0858150..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssBuffData_Patch.cs +++ /dev/null @@ -1,125 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using MelonLoader; -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using System.Text; -//using System.Text.Json; -//using System.Threading.Tasks; -//using Unity.VisualScripting; -//using UnityEngine; - -//namespace PvZ_Fusion_Translator.Patches.Managers -//{ -// [HarmonyPatch(typeof(AbyssBuffData))] -// public static class AbyssBuffData_Patch -// { -// [HarmonyPatch(nameof(AbyssBuffData.LoadData))] -// [HarmonyPostfix] -// public static void Pre_LoadData(AbyssBuffData __instance) -// { -// string originalAbyssBuffStr = Resources.Load("AbyssBuffData").text; -// Dictionary> originalAbyssBuffData = JsonSerializer.Deserialize>>(originalAbyssBuffStr); -// List infos = originalAbyssBuffData["infos"]; -// Il2CppSystem.Collections.Generic.Dictionary> result = new(); - -// string abyssBuffDataDir = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), "abyss_buffs.json"); -// if (!File.Exists(abyssBuffDataDir)) -// { -// File.WriteAllText(abyssBuffDataDir, originalAbyssBuffStr); -// } - -// Dictionary abyssBuffData = JsonSerializer.Deserialize>(File.ReadAllText(abyssBuffDataDir)); - -// for (int i = 0; i < infos.Count; i++) -// { -// AbyssBuffInfo originalTuple = infos[i]; -// Il2CppSystem.ValueTuple translatedTuple = new(); - -// translatedTuple.Item1 = abyssBuffData.ContainsKey(originalTuple.name) ? abyssBuffData[originalTuple.name] : originalTuple.name; -// translatedTuple.Item2 = abyssBuffData.ContainsKey(originalTuple.introduce) ? abyssBuffData[originalTuple.introduce] : originalTuple.introduce; -// translatedTuple.Item3 = originalTuple.value; - -// foreach (var x in AbyssBuffData.buffDatas) -// { -// if (x.Value.Item1 == originalTuple.name) -// { -// AbyssBuffData.buffDatas[x.Key] = translatedTuple; -// break; -// } -// } -// } -// } -// } - -// public enum AbyssBuffClone -// { -// 生存_聚塑, -// 生存_启命, -// 生存_坚定, -// 生存_弥合, -// 生存_警戒, -// 生存_霸体, -// 生存_共存, -// 生存_护盾, -// 生存_治疗, -// 生存_主宰, -// 寒冰_聚塑, -// 寒冰_刺骨, -// 寒冰_凛风, -// 寒冰_冻结, -// 寒冰_保护, -// 寒冰_折磨, -// 寒冰_扩散, -// 寒冰_凝神, -// 寒冰_破冰, -// 寒冰_永冻, -// 魅惑_聚塑, -// 魅惑_感应, -// 魅惑_催眠, -// 魅惑_无畏, -// 魅惑_脆弱, -// 魅惑_黑曜, -// 魅惑_转世, -// 魅惑_支援, -// 魅惑_沉重, -// 魅惑_共鸣, -// 烈焰_聚塑, -// 烈焰_爆破, -// 烈焰_怒火, -// 烈焰_红唇, -// 烈焰_融化, -// 烈焰_燃烧, -// 烈焰_浴火, -// 烈焰_鬼火, -// 烈焰_诅咒, -// 烈焰_太阳, -// 通用_断水, -// 通用_千斤, -// 通用_急迫, -// 通用_折扣, -// 通用_密植, -// 通用_超级, -// 通用_究极, -// 通用_极速, -// 通用_强力, -// 通用_专注, -// 通用_迸发, -// 通用_投资, -// 通用_机遇, -// 通用_命运, -// 通用_时停, -// 通用_升级, -// 蒜毒_聚塑, -// 蒜毒_腐蚀, -// 蒜毒_侵蚀, -// 蒜毒_血清, -// 蒜毒_混乱, -// 蒜毒_虚弱, -// 蒜毒_反胃, -// 蒜毒_虫噬, -// 蒜毒_百毒, -// 蒜毒_爆裂 -// } -//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs deleted file mode 100644 index 9353590..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs +++ /dev/null @@ -1,133 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader.TinyJSON; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Text.Json; -using System.Text.RegularExpressions; -using UnityEngine.TextCore.Text; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.Modes.Abyss -{ - /*[HarmonyPatch(typeof(AbyssBuffMenu))] - public static class AbyssBuffMenu_Patch - { - public static Dictionary abyssBuffData = new Dictionary(); - - [HarmonyPatch(nameof(AbyssBuffMenu.Awake))] - [HarmonyPostfix] - public static void Post_Awake(AbyssBuffMenu __instance) - { - LoadAbyssBuffData(); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - - TranslateWindows(__instance, fontAsset); - } - - [HarmonyPatch(nameof(AbyssBuffMenu.SelectWindow))] - [HarmonyPostfix] - public static void Post_SelectWindow(AbyssBuffMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - TranslateWindows(__instance, fontAsset); - } - - [HarmonyPatch(nameof(AbyssBuffMenu.SetFavorite))] - [HarmonyPostfix] - public static void Post_SetFavorite(AbyssBuffMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - public static void TranslateWindows(AbyssBuffMenu __instance, TMP_FontAsset fontAsset) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - if (abyssBuffData.ContainsKey(text.text)) - { - text.text = abyssBuffData[text.text]; - } - else - { - string translatedRegex = TranslateAbyssBuffRegex(text.text); - if (translatedRegex != null) - { - text.text = translatedRegex; - } - } - - text.font = fontAsset; - } - } - - public static void LoadAbyssBuffData() - { - abyssBuffData.Clear(); - - string abyssBuffText = "{}"; - - if(!Utils.useLocal) - { - string abyssBuffsContent = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/abyss_buffs.json").Result; - - if(abyssBuffsContent != null) - { - abyssBuffText = abyssBuffsContent; - } - else - { - string abyssBuffsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "abyss_buffs.json"); - if(File.Exists(abyssBuffsPath)) - { - abyssBuffText = File.ReadAllText(abyssBuffsPath); - } - } - } - else - { - abyssBuffText = File.ReadAllText(Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), "abyss_buffs.json")); - } - - abyssBuffData = JsonSerializer.Deserialize>(abyssBuffText); - } - - public static string TranslateAbyssBuffRegex(string originalText) - { - foreach (var x in abyssBuffData) - { - if (x.Key.Contains("{value}")) - { - string pattern = Regex.Escape(x.Key).Replace("\\{value}", "(\\d+)"); - if (Regex.IsMatch(originalText, pattern)) - { - var regex = new Regex(pattern); - var match = regex.Match(originalText); - - return string.Format(x.Value.Replace("value", "0"), match.Groups[1].Value); - } - } - } - - return null; - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs deleted file mode 100644 index 413a7a6..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs +++ /dev/null @@ -1,31 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using MelonLoader; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine; -//using UnityEngine.TextCore.Text; -//using UnityEngine.UI; -//using static MelonLoader.MelonLogger; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ - -// [HarmonyPatch(typeof(AbyssCheckInBag))] -// public static class AbyssCheckInBag_Patch -// { -// [HarmonyPatch(nameof(AbyssCheckInBag.MoveFromBag))] -// [HarmonyPostfix] -// private static void MoveFromBag(AbyssCheckInBag __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } - -// [HarmonyPatch(nameof(AbyssCheckInBag.SellIcon))] -// [HarmonyPostfix] -// private static void SellIcon(AbyssCheckInBag __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } -// } -//} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs deleted file mode 100644 index fede3de..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs +++ /dev/null @@ -1,26 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects -//{ -// [HarmonyPatch(typeof(AbyssCheckSellMenu))] -// public static class AbyssCheckSellMenu_Patch -// { -// [HarmonyPatch(nameof(AbyssCheckSellMenu.SellIcon))] -// [HarmonyPostfix] -// private static void SellIcon(AbyssCheckSellMenu __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } - -// [HarmonyPatch(nameof(AbyssCheckSellMenu.MoveInBag))] -// [HarmonyPostfix] -// private static void MoveInBag(AbyssCheckSellMenu __instance) -// { -// AbyssMenu2.Instance.UpdateIcons(); -// } -// } -//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs deleted file mode 100644 index 549f1e7..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs +++ /dev/null @@ -1,48 +0,0 @@ -//using System.Text.RegularExpressions; -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using MelonLoader; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine.TextCore.Text; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(AbyssDevelopMenu))] -// public static class AbyssDevelopMenu_Patch -// { - -// [HarmonyPatch(nameof(AbyssDevelopMenu.UpdateInfo))] -// [HarmonyPostfix] -// private static void UpdateInfo(AbyssDevelopMenu __instance) -// { -// __instance.currentMoney.text = StringStore.TranslateText(__instance.currentMoney.text); -// __instance.upgradeTextInfo.text = StringStore.TranslateText(__instance.upgradeTextInfo.text); - -// TextMeshProUGUI upgradeCostText = __instance.transform.FindChild("UpgradeCost").GetComponent(); -// TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - -// string regexStr = "([^\\s]+)\n当前等级:([^\\s]+)\n\n升级条件:\n([^\\s]+)\n\n升级消耗:([^\\s]+)"; - -// Regex regex = new Regex(regexStr); - -// if (regex.IsMatch(upgradeCostText.text)) -// { -// Match match = regex.Match(upgradeCostText.text); -// int groupCount = match.Groups.Count; - -// List dynamicParts = []; - -// for (int i = 1; i < groupCount; i++) -// { -// string groupValue = match.Groups[i].Value; -// string translatedValue = StringStore.translationString.ContainsKey(groupValue) ? StringStore.translationString[groupValue] : groupValue; -// dynamicParts.Add(translatedValue); -// } - -// upgradeCostText.text = string.Format(StringStore.translationStringRegex[regexStr], [.. dynamicParts]); -// upgradeCostText.font = fontAsset; -// } -// } -// } -//} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssGoods_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssGoods_Patch.cs deleted file mode 100644 index 70a5b12..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssGoods_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Abyss -{ - /*[HarmonyPatch(typeof(AbyssGoods))] - public static class AbyssGoods_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(AbyssGoods.Start))] - private static void Start(AbyssGoods __instance) - { - __instance.costText.text = StringStore.TranslateText(__instance.costText.text, false); - __instance.costText_shadow.text = StringStore.TranslateText(__instance.costText_shadow.text, false); - __instance.hasText.text = StringStore.TranslateText(__instance.hasText.text, false); - __instance.hasText_shadow.text = StringStore.TranslateText(__instance.hasText_shadow.text, false); - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssInfo_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssInfo_Patch.cs deleted file mode 100644 index 1ac118d..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssInfo_Patch.cs +++ /dev/null @@ -1,12 +0,0 @@ -//using System; -//using System.Collections.Generic; -//using System.Linq; -//using System.Text; -//using System.Threading.Tasks; - -//namespace PvZ_Fusion_Translator.Patches.Managers -//{ -// public class AbyssInfo_Patch -// { -// } -//} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs deleted file mode 100644 index ab7e8d1..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Abyss -{ - /*[HarmonyPatch(typeof(AbyssLevelEnter))] - public static class AbyssLevelEnter_Patch - { - [HarmonyPatch(nameof(AbyssLevelEnter.SetLevel))] - [HarmonyPostfix] - private static void SetLevel(AbyssLevelEnter __instance) - { - __instance.levelName = StringStore.TranslateText(__instance.levelName); - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssMenu2_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssMenu2_Patch.cs deleted file mode 100644 index 2749e73..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssMenu2_Patch.cs +++ /dev/null @@ -1,104 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using MelonLoader; -//using PvZ_Fusion_Translator.AssetStore; -//using UnityEngine; -//using UnityEngine.TextCore.Text; -//using UnityEngine.UI; -//using static MelonLoader.MelonLogger; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ - -// [HarmonyPatch(typeof(AbyssMenu2))] -// public static class AbyssMenu2_Patch -// { -// private static void UpdateAbyss2Text(AbyssMenu2 __instance) -// { -// TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - -// __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); -// __instance.buffCountText.font = fontAsset; - -// __instance.money.text = StringStore.TranslateText(__instance.money.text); -// __instance.money.font = fontAsset; - -// __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); -// __instance.refreshText.font = fontAsset; - -// __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); -// __instance.statistics.font = fontAsset; - -// Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; -// if (buffTextTransform != null) StringStore.TranslateTextTransform(buffTextTransform); - -// Transform moneyTransform = __instance.transform.FindChild("Money").transform; -// if (moneyTransform != null) StringStore.TranslateTextTransform(moneyTransform); - -// Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; -// if (buffCountTextTransform != null) StringStore.TranslateTextTransform(buffCountTextTransform); - -// Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; -// if (refreshTextTransform != null) StringStore.TranslateTextTransform(refreshTextTransform); - -// Transform optionsTransform = __instance.transform.FindChild("Options").transform; -// foreach (AbyssBuffButton abyssBuffButton in optionsTransform.GetComponentsInChildren()) -// { -// foreach (TextMeshProUGUI textMesh in abyssBuffButton.GetComponentsInChildren()) -// { -// textMesh.text = StringStore.TranslateText(textMesh.text); -// } -// } - -// foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) -// { -// text.text = StringStore.TranslateText(text.text); -// text.font = fontAsset; -// } -// } - -// [HarmonyPatch(nameof(AbyssMenu2.Start))] -// [HarmonyPostfix] -// private static void Start(AbyssMenu2 __instance) -// { -// UpdateAbyss2Text(__instance); - -// Utils.ConvertButtonText(__instance.transform, "Help"); - -// // custom bag text :D - -// __instance.transform.FindChild("Bag").FindChild("text").GetComponent().text += "_深渊"; - -// Utils.ConvertButtonText(__instance.transform, "Bag"); -// } - -// [HarmonyPatch(nameof(AbyssMenu2.UpdateIcons))] -// [HarmonyPostfix] -// private static void UpdateIcons(AbyssMenu2 __instance) -// { -// UpdateAbyss2Text(__instance); -// } - -// [HarmonyPatch(nameof(AbyssMenu2.UpdateBuff))] -// [HarmonyPostfix] -// private static void UpdateBuff(AbyssMenu2 __instance) -// { -// UpdateAbyss2Text(__instance); -// } - -// [HarmonyPatch(nameof(AbyssMenu2.BuyBuff))] -// [HarmonyPostfix] -// private static void BuyBuff(AbyssMenu2 __instance) -// { -// UpdateAbyss2Text(__instance); -// } - -// [HarmonyPatch(nameof(AbyssMenu2.ShowBag))] -// [HarmonyPostfix] -// private static void ShowBag(AbyssMenu2 __instance) -// { -// UpdateAbyss2Text(__instance); -// } -// } -//} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssMenu_Patch.cs deleted file mode 100644 index 93c1b32..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssMenu_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using Unity.VisualScripting; -using UnityEngine; -using System.Text.RegularExpressions; -using UnityEngine.UI; -using MelonLoader.Utils; - -namespace PvZ_Fusion_Translator.Patches.Modes.Abyss -{ - /*[HarmonyPatch(typeof(AbyssMenu))] - public static class AbyssMenu_Patch - { - [HarmonyPatch(nameof(AbyssMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AbyssMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.levelInfo) - { - txt.text = StringStore.TranslateText(txt.text, pattern: "第(\\d+)关\n场景:([^\\s]+)\n总波数:(\\d+)波\n特殊环境:([^\\s]+)\n难度:(\\d+)"); - txt.font = fontAsset; - } - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - - [HarmonyPatch(nameof(AbyssMenu.UpdateLevelInfo))] - [HarmonyPostfix] - private static void UpdateLevelInfo(AbyssMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.levelInfo) - { - txt.text = StringStore.TranslateText(txt.text, pattern: "第(\\d+)关\n场景:([^\\s]+)\n总波数:(\\d+)波\n特殊环境:([^\\s]+)\n难度:(\\d+)"); - txt.font = fontAsset; - } - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs deleted file mode 100644 index ee1c2d3..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs +++ /dev/null @@ -1,57 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.Modes.Abyss -{ - /*[HarmonyPatch(typeof(AbyssSelectBuffWindow))] - public static class AbyssSelectBuffWindow_Patch - { - [HarmonyPatch(nameof(AbyssSelectBuffWindow.OnAnimOver))] - [HarmonyPostfix] - private static void OnAnimOver(AbyssSelectBuffWindow __instance) - { - TranslateBuffWindow(__instance); - } - - [HarmonyPatch(nameof(AbyssSelectBuffWindow.SetBuff))] - [HarmonyPostfix] - private static void SetBuff(AbyssSelectBuffWindow __instance) - { - TranslateBuffWindow(__instance); - } - - public static void TranslateBuffWindow(AbyssSelectBuffWindow __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - AbyssBuffMenu_Patch.LoadAbyssBuffData(); - - foreach (TextMeshProUGUI titleText in __instance.titleText) - { - if (AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(titleText.text)) - { - if(titleText.name.Contains("shadow")) - { - titleText.text = Utils.RemoveColorTags(AbyssBuffMenu_Patch.abyssBuffData[titleText.text]); - } - else - { - titleText.text = AbyssBuffMenu_Patch.abyssBuffData[titleText.text]; - } - } - titleText.font = fontAsset; - } - - string translatedIntroduceText = AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(__instance.introduce.text) ? AbyssBuffMenu_Patch.abyssBuffData[__instance.introduce.text] : AbyssBuffMenu_Patch.TranslateAbyssBuffRegex(__instance.introduce.text); - - if (translatedIntroduceText != null) - { - __instance.introduce.text = translatedIntroduceText; - __instance.introduce.font = fontAsset; - } - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs deleted file mode 100644 index 3ed38cd..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs +++ /dev/null @@ -1,55 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using Il2CppTMPro; -//using MelonLoader; -//using PvZ_Fusion_Translator.AssetStore; -//using Unity.VisualScripting; -//using UnityEngine; -//using System.Text.RegularExpressions; - -//namespace PvZ_Fusion_Translator.Patches.GameObjects -//{ -// [HarmonyPatch(typeof(AbyssSettlementMenu))] -// public static class AbyssSettlementMenu_Patch -// { - -// [HarmonyPatch(nameof(AbyssSettlementMenu.InitSettle))] -// [HarmonyPostfix] -// private static void InitSettle(AbyssSettlementMenu __instance) -// { -// TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - -// string[] regexStrList = [ -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", -// "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)" -// ]; - -// foreach(string regexStr in regexStrList) -// { -// Regex regex = new Regex(regexStr); - -// if (regex.IsMatch(__instance.settleInfo.text)) -// { -// Match match = regex.Match(__instance.settleInfo.text); -// int groupCount = match.Groups.Count; - -// List dynamicParts = []; - -// for (int i = 1; i < groupCount; i++) -// { -// string groupValue = match.Groups[i].Value; -// string translatedValue = StringStore.translationString.ContainsKey(groupValue) ? StringStore.translationString[groupValue] : groupValue; -// dynamicParts.Add(translatedValue); -// } - -// __instance.settleInfo.text = string.Format(StringStore.translationStringRegex[regexStr], [.. dynamicParts]); -// __instance.settleInfo.font = fontAsset; -// } -// } -// } -// } -//} diff --git a/MelonLoader/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs b/MelonLoader/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs deleted file mode 100644 index 18946f0..0000000 --- a/MelonLoader/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Abyss -{ - /*[HarmonyPatch(typeof(AbyssStoreMenu))] - public static class AbyssStoreMenu_Patch - { - [HarmonyPatch(nameof(AbyssStoreMenu.Update))] - [HarmonyPostfix] - private static void Update(AbyssStoreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - text.font = fontAsset; - } - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Harvest/GardenBagMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/GardenBagMenu_Patch.cs deleted file mode 100644 index 958b0dc..0000000 --- a/MelonLoader/Patches/Modes/Harvest/GardenBagMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(GardenBagMenu))] - public static class GardenBagMenu_Patch - { - [HarmonyPatch(nameof(GardenBagMenu.Awake))] - [HarmonyPostfix] - private static void Awake(GardenBagMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Transform closeButtonTransform = __instance.transform.Find("Close"); - foreach(TextMeshProUGUI text in closeButtonTransform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("合上"); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/GardenCard_Patch.cs b/MelonLoader/Patches/Modes/Harvest/GardenCard_Patch.cs deleted file mode 100644 index d1baac8..0000000 --- a/MelonLoader/Patches/Modes/Harvest/GardenCard_Patch.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(GardenCard))] - public static class GardenCard_Patch - { - [HarmonyPatch(nameof(GardenCard.Start))] - [HarmonyPostfix] - private static void Start(GardenCard __instance) - { - __instance.text.text = StringStore.TranslateText(__instance.text.text).Replace("26", "16"); - } - - [HarmonyPatch(nameof(GardenCard.ChangeCardSprite))] - [HarmonyPostfix] - private static void ChangeCardSprite(GardenCard __instance) - { - __instance.text.text = StringStore.TranslateText(__instance.text.text).Replace("26", "16"); - } - } -} diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs deleted file mode 100644 index 2f5c947..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureConfirmMenu))] - public static class TreasureConfirmMenu_Patch - { - [HarmonyPatch(nameof(TreasureConfirmMenu.SetText))] - [HarmonyPostfix] - private static void SetText(TreasureConfirmMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs deleted file mode 100644 index 1033f57..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureEquipmentMenu))] - public static class TreasureEquipmentMenu_Patch - { - [HarmonyPatch(nameof(TreasureEquipmentMenu.Awake))] - [HarmonyPostfix] - private static void Awake(TreasureEquipmentMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureEquipmentMenu.UpdateCards))] - [HarmonyPostfix] - private static void UpdateCards(TreasureEquipmentMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs deleted file mode 100644 index e133b8f..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs +++ /dev/null @@ -1,30 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureEvacuateMenu))] - public static class TreasureEvacuateMenu_Patch - { - [HarmonyPatch(nameof(TreasureEvacuateMenu.Start))] - [HarmonyPostfix] - private static void Start(TreasureEvacuateMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - if(txt.name.Contains("text (1)")) - { - txt.name = txt.name + "_EVACUATE"; - } - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs deleted file mode 100644 index df5b950..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureMainMenu))] - public static class TreasureMainMenu_Patch - { - [HarmonyPatch(nameof(TreasureMainMenu.Update))] - [HarmonyPostfix] - private static void Update(TreasureMainMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureManager_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureManager_Patch.cs deleted file mode 100644 index 9e9f92f..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureManager_Patch.cs +++ /dev/null @@ -1,31 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureManager))] - public static class TreasureManager_Patch - { - [HarmonyPatch(nameof(TreasureManager.Update))] - [HarmonyPostfix] - private static void Update(TreasureManager __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach(TextMeshProUGUI txt in __instance.evaText) - { - txt.autoSizeTextContainer = false; - - if (txt.text != "Evacuate") - { - txt.text = StringStore.TranslateText(txt.text); - txt.name = txt.text + "_EVACUATE"; - txt.font = fontAsset; - } - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs deleted file mode 100644 index 05c3d8c..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs +++ /dev/null @@ -1,25 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureStoreMenu))] - public static class TreasureStoreMenu_Patch - { - [HarmonyPatch(nameof(TreasureStoreMenu.InitCards))] - [HarmonyPostfix] - private static void InitCards(TreasureStoreMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs deleted file mode 100644 index fc8c177..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs +++ /dev/null @@ -1,63 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppSystem; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; -using UnityEngine.UI; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureUpgradeMenu))] - public static class TreasureUpgradeMenu_Patch - { - [HarmonyPatch(nameof(TreasureUpgradeMenu.Start))] - [HarmonyPostfix] - private static void Start(TreasureUpgradeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureUpgradeMenu.UpgradeWareHouse))] - [HarmonyPostfix] - private static void UpgradeWareHouse(TreasureUpgradeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureUpgradeMenu.InitWareHouseUpgrade))] - [HarmonyPostfix] - private static void InitWareHouseUpgrade(TreasureUpgradeMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - - foreach (Text txt in __instance.GetComponentsInChildren()) - { - GameObject newTxtObj = Utils.ConvertToTextMeshProUGUI(txt.gameObject, txt.transform.parent, "text"); - TextMeshProUGUI newTxt = newTxtObj.GetComponent(); - newTxt.text = StringStore.TranslateText("植物商店"); - newTxt.autoSizeTextContainer = true; - newTxt.color = new Color(0, 0, 0.3922f, 1); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs b/MelonLoader/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs deleted file mode 100644 index edddd80..0000000 --- a/MelonLoader/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs +++ /dev/null @@ -1,64 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Harvest -{ - [HarmonyPatch(typeof(TreasureWarehouseMenu))] - public static class TreasureWarehouseMenu_Patch - { - [HarmonyPatch(nameof(TreasureWarehouseMenu.InitCards))] - [HarmonyPostfix] - private static void InitCards(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureWarehouseMenu.QuickSell))] - [HarmonyPostfix] - private static void QuickSell(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureWarehouseMenu.FastSell))] - [HarmonyPostfix] - private static void FastSell(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - - [HarmonyPatch(nameof(TreasureWarehouseMenu.EnterStore))] - [HarmonyPostfix] - private static void EnterStore(TreasureWarehouseMenu __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/MultipleChoiceMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/MultipleChoiceMenu_Patch.cs deleted file mode 100644 index a8371aa..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/MultipleChoiceMenu_Patch.cs +++ /dev/null @@ -1,61 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.TextCore.Text; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(MultipleChoiceMenu))] - public static class MultipleChoiceMenu_Patch - { - public static TMP_FontAsset fontAsset => FontStore.LoadTMPFont(Utils.Language.ToString()); - - [HarmonyPatch(nameof(MultipleChoiceMenu.Awake))] - [HarmonyPatch(nameof(MultipleChoiceMenu.Cancel))] - [HarmonyPatch(nameof(MultipleChoiceMenu.Refresh))] - [HarmonyPatch(nameof(MultipleChoiceMenu.TurnPage))] - [HarmonyPatch(nameof(MultipleChoiceMenu.UpdateWindow))] - [HarmonyPostfix] - public static void Awake(MultipleChoiceMenu __instance) - { - foreach(BaseWindow window in __instance.windows) - { - TranslateWindowText(window.title); - TranslateWindowText(window.introduce); - } - - foreach(TheButton button in __instance.GetComponentsInChildren()) - { - foreach(TextMeshProUGUI txt in button.GetComponentsInChildren()) - { - txt.text = StringStore.translationString.ContainsKey(txt.text + "_MC") ? StringStore.TranslateText(txt.text + "_MC") : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } - - public static void TranslateWindowText(TextMeshProUGUI txt) - { - txt.font = fontAsset; - if(StringStore.customLevelString.ContainsKey(txt.text)) - { - txt.text = StringStore.customLevelString[txt.text]; - } - else if(Utils.GetPlantNameFromAlmanac(txt.text) != "") - { - txt.text = Utils.GetPlantNameFromAlmanac(txt.text); - } - else - { - txt.text = StringStore.translationString.ContainsKey(txt.text + "_MC") ? StringStore.TranslateText(txt.text + "_MC") : StringStore.TranslateText(txt.text); - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/OppositeBuffManager_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/OppositeBuffManager_Patch.cs deleted file mode 100644 index a29838f..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/OppositeBuffManager_Patch.cs +++ /dev/null @@ -1,52 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - /*[HarmonyPatch(typeof(OppositeBuffManager))] - public static class OppositeBuffManager_Patch - { - public static Dictionary buffLinks = TravelMgr_Patch.buffLinks; - public static Dictionary> translatedTravelBuffs = TravelMgr_Patch.translatedTravelBuffs; - public static string badPattern = @"^但(.*)"; - public static string badFormat = StringStore.translationStringRegex.ContainsKey(badPattern) ? StringStore.translationStringRegex[badPattern] : "But, {0}"; - public static TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - [HarmonyPatch(nameof(OppositeBuffManager.SetText))] - [HarmonyPostfix] - private static void SetText(OppositeBuffManager __instance) - { - *//*if (TravelMgr_Patch.travelBuffString.ContainsKey(__result)) - { - __result = TravelMgr_Patch.travelBuffString[__result]; - } - else if(TravelMgr_Patch.travelBuffString.ContainsKey(TravelMgr_Patch.RemoveBuffName(__result))) - { - __result = TravelMgr_Patch.travelBuffString[TravelMgr_Patch.RemoveBuffName(__result)]; - }*//* - } - - public static void TranslateOppositeText(Il2CppSystem.Collections.Generic.List textList, Il2CppSystem.Object buff, bool isBad = false) - { - string buffText = TravelMgr.Instance.GetText(buff); - - foreach (var text in textList) - { - if (isBad) - { - text.text = string.Format(badFormat, buffText); - } - else - { - text.text = buffText; - } - - text.font = fontAsset; - } - } - }*/ -} diff --git a/MelonLoader/Patches/Modes/Odyssey/ShootingManager_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/ShootingManager_Patch.cs deleted file mode 100644 index 514e1a9..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/ShootingManager_Patch.cs +++ /dev/null @@ -1,583 +0,0 @@ -using HarmonyLib; -using Il2CppGameLevel.RogueShooting; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(ShootingManager))] - public static class ShootingManager_Patch - { - [HarmonyPatch(nameof(ShootingManager.RegisterCoreBuff))] - [HarmonyPatch(nameof(ShootingManager.RegisterExpertBuff))] - [HarmonyPatch(nameof(ShootingManager.RegisterGetPlantBuff))] - [HarmonyPatch(nameof(ShootingManager.RegisterOtherBuff))] - [HarmonyPostfix] - public static void UpgradeBuff(ShootingManager __instance, ref Il2Cpp.MultipleChoiceMenu menu) - { - MultipleChoiceMenu_Patch.Awake(menu); - } - - public static void GetBuffs() - { - /*#region code - - AbyssSwordStar t0 = new(); - Bamboo t1 = new(); - BigChomper t4 = new(); - BigGatling t5 = new(); - CabbageCannon t6 = new(); - Cabbagepult t7 = new(); - Cactus t8 = new(); - Caltrop t9 = new(); - CaltropNut t10 = new(); - CattailLour t11 = new(); - CherryChomper t12 = new(); - CherryGatling t13 = new(); - CherrySquash t14 = new(); - Chomper t15 = new(); - Cornpult t17 = new(); - DoomCactus t20 = new(); - DoomChomper t21 = new(); - DoomSniper t22 = new(); - EmeraleBlover t23 = new(); - FireMelon t24 = new(); - FumeShroom t25 = new(); - GarlicFume t26 = new(); - GloomShroom t28 = new(); - GoldCabbage t29 = new(); - HelmetGatling t30 = new(); - HypnoEmperor t31 = new(); - HypnoNut t32 = new(); - HypnoShroom t33 = new(); - IceFumeShroom t34 = new(); - IcePuff t35 = new(); - IFVIronPuff t36 = new(); - IronPuff t37 = new(); - LanternSplit t38 = new(); - LanternUmbrella t39 = new(); - LaserUmbrella t40 = new(); - LotusBamboo t41 = new(); - Melonpult t42 = new(); - NuclearSquash t43 = new(); - ObsidianSpike t44 = new(); - ObsidianWallNut t45 = new(); - PeaMine t46 = new(); - Peashooter t47 = new(); - PortalCorn t48 = new(); - PotatoMine t49 = new(); - ScaredyDoom t54 = new(); - ScaredyShroom t55 = new(); - SmallPuff t57 = new(); - SniperPea t58 = new(); - SnowGatlingPuff t59 = new(); - SpikeRock t61 = new(); - Squalour t62 = new(); - Squash t63 = new(); - StarFruit t64 = new(); - SuperChomper t66 = new(); - SuperHypno t67 = new(); - SuperMelon t68 = new(); - SuperStar t69 = new(); - SuperThreePeater t70 = new(); - SwordStar t71 = new(); - TallNut t72 = new(); - ThreeMine t73 = new(); - ThreePeater t74 = new(); - ThreeSquash t75 = new(); - UltimateBamboo t76 = new(); - UltimateBigChomper t77 = new(); - UltimateBigGatling t78 = new(); - UltimateBlover t79 = new(); - UltimateCabbage t80 = new(); - UltimateCabbageCannon t81 = new(); - UltimateCactus t82 = new(); - UltimateChomper t83 = new(); - UltimateCorn t84 = new(); - UltimateDoomScared t85 = new(); - UltimateFume t86 = new(); - UltimateGatling t87 = new(); - UltimateGloom t88 = new(); - UltimateHelmetGatling t89 = new(); - UltimateHypno t90 = new(); - UltimateLanternSplit t91 = new(); - UltimateMelon t92 = new(); - UltimateMinigun t93 = new(); - UltimatePoisonFume t94 = new(); - UltimateSniperGatling t95 = new(); - UltimateSpring t96 = new(); - UltimateStar t97 = new(); - UltimateStarTorch t98 = new(); - UltimateTallNut t99 = new(); - UltimateWinterMelon t100 = new(); - Umbrellaleaf t101 = new(); - WallNut t103 = new(); - WinterMelon t104 = new(); - - Dictionary t = new(); - - #region 3 - - if(t0.Buffs != null) - { - Utils.TryAdd(t, t0.Role, t0.Role); - } - - if(t1.Buffs != null) - { - Utils.TryAdd(t, t1.Role, t1.Role); - } - - if(t4.Buffs != null) - { - Utils.TryAdd(t, t4.Role, t4.Role); - } - - if(t5.Buffs != null) - { - Utils.TryAdd(t, t5.Role, t5.Role); - } - - if(t6.Buffs != null) - { - Utils.TryAdd(t, t6.Role, t6.Role); - } - - if(t7.Buffs != null) - { - Utils.TryAdd(t, t7.Role, t7.Role); - } - - if(t8.Buffs != null) - { - Utils.TryAdd(t, t8.Role, t8.Role); - } - - if(t9.Buffs != null) - { - Utils.TryAdd(t, t9.Role, t9.Role); - } - - if(t10.Buffs != null) - { - Utils.TryAdd(t, t10.Role, t10.Role); - } - - if(t11.Buffs != null) - { - Utils.TryAdd(t, t11.Role, t11.Role); - } - - if(t12.Buffs != null) - { - Utils.TryAdd(t, t12.Role, t12.Role); - } - - if(t13.Buffs != null) - { - Utils.TryAdd(t, t13.Role, t13.Role); - } - - if(t14.Buffs != null) - { - Utils.TryAdd(t, t14.Role, t14.Role); - } - - if(t15.Buffs != null) - { - Utils.TryAdd(t, t15.Role, t15.Role); - } - - if(t17.Buffs != null) - { - Utils.TryAdd(t, t17.Role, t17.Role); - } - - if(t20.Buffs != null) - { - Utils.TryAdd(t, t20.Role, t20.Role); - } - - if(t21.Buffs != null) - { - Utils.TryAdd(t, t21.Role, t21.Role); - } - - if(t22.Buffs != null) - { - Utils.TryAdd(t, t22.Role, t22.Role); - } - - if(t23.Buffs != null) - { - Utils.TryAdd(t, t23.Role, t23.Role); - } - - if(t24.Buffs != null) - { - Utils.TryAdd(t, t24.Role, t24.Role); - } - - if(t25.Buffs != null) - { - Utils.TryAdd(t, t25.Role, t25.Role); - } - - if(t26.Buffs != null) - { - Utils.TryAdd(t, t26.Role, t26.Role); - } - - if(t28.Buffs != null) - { - Utils.TryAdd(t, t28.Role, t28.Role); - } - - if(t29.Buffs != null) - { - Utils.TryAdd(t, t29.Role, t29.Role); - } - - if(t30.Buffs != null) - { - Utils.TryAdd(t, t30.Role, t30.Role); - } - - if(t31.Buffs != null) - { - Utils.TryAdd(t, t31.Role, t31.Role); - } - - if(t32.Buffs != null) - { - Utils.TryAdd(t, t32.Role, t32.Role); - } - - if(t33.Buffs != null) - { - Utils.TryAdd(t, t33.Role, t33.Role); - } - - if(t34.Buffs != null) - { - Utils.TryAdd(t, t34.Role, t34.Role); - } - - if(t35.Buffs != null) - { - Utils.TryAdd(t, t35.Role, t35.Role); - } - - if(t36.Buffs != null) - { - Utils.TryAdd(t, t36.Role, t36.Role); - } - - if(t37.Buffs != null) - { - Utils.TryAdd(t, t37.Role, t37.Role); - } - - if(t38.Buffs != null) - { - Utils.TryAdd(t, t38.Role, t38.Role); - } - - if(t39.Buffs != null) - { - Utils.TryAdd(t, t39.Role, t39.Role); - } - - if(t40.Buffs != null) - { - Utils.TryAdd(t, t40.Role, t40.Role); - } - - if(t41.Buffs != null) - { - Utils.TryAdd(t, t41.Role, t41.Role); - } - - if(t42.Buffs != null) - { - Utils.TryAdd(t, t42.Role, t42.Role); - } - - if(t43.Buffs != null) - { - Utils.TryAdd(t, t43.Role, t43.Role); - } - - if(t44.Buffs != null) - { - Utils.TryAdd(t, t44.Role, t44.Role); - } - - if(t45.Buffs != null) - { - Utils.TryAdd(t, t45.Role, t45.Role); - } - - if(t46.Buffs != null) - { - Utils.TryAdd(t, t46.Role, t46.Role); - } - - if(t47.Buffs != null) - { - Utils.TryAdd(t, t47.Role, t47.Role); - } - - if(t48.Buffs != null) - { - Utils.TryAdd(t, t48.Role, t48.Role); - } - - if(t49.Buffs != null) - { - Utils.TryAdd(t, t49.Role, t49.Role); - } - - if(t54.Buffs != null) - { - Utils.TryAdd(t, t54.Role, t54.Role); - } - - if(t55.Buffs != null) - { - Utils.TryAdd(t, t55.Role, t55.Role); - } - - if(t57.Buffs != null) - { - Utils.TryAdd(t, t57.Role, t57.Role); - } - - if(t58.Buffs != null) - { - Utils.TryAdd(t, t58.Role, t58.Role); - } - - if(t59.Buffs != null) - { - Utils.TryAdd(t, t59.Role, t59.Role); - } - - if(t61.Buffs != null) - { - Utils.TryAdd(t, t61.Role, t61.Role); - } - - if(t62.Buffs != null) - { - Utils.TryAdd(t, t62.Role, t62.Role); - } - - if(t63.Buffs != null) - { - Utils.TryAdd(t, t63.Role, t63.Role); - } - - if(t64.Buffs != null) - { - Utils.TryAdd(t, t64.Role, t64.Role); - } - - if(t66.Buffs != null) - { - Utils.TryAdd(t, t66.Role, t66.Role); - } - - if(t67.Buffs != null) - { - Utils.TryAdd(t, t67.Role, t67.Role); - } - - if(t68.Buffs != null) - { - Utils.TryAdd(t, t68.Role, t68.Role); - } - - if(t69.Buffs != null) - { - Utils.TryAdd(t, t69.Role, t69.Role); - } - - if(t70.Buffs != null) - { - Utils.TryAdd(t, t70.Role, t70.Role); - } - - if(t71.Buffs != null) - { - Utils.TryAdd(t, t71.Role, t71.Role); - } - - if(t72.Buffs != null) - { - Utils.TryAdd(t, t72.Role, t72.Role); - } - - if(t73.Buffs != null) - { - Utils.TryAdd(t, t73.Role, t73.Role); - } - - if(t74.Buffs != null) - { - Utils.TryAdd(t, t74.Role, t74.Role); - } - - if(t75.Buffs != null) - { - Utils.TryAdd(t, t75.Role, t75.Role); - } - - if(t76.Buffs != null) - { - Utils.TryAdd(t, t76.Role, t76.Role); - } - - if(t77.Buffs != null) - { - Utils.TryAdd(t, t77.Role, t77.Role); - } - - if(t78.Buffs != null) - { - Utils.TryAdd(t, t78.Role, t78.Role); - } - - if(t79.Buffs != null) - { - Utils.TryAdd(t, t79.Role, t79.Role); - } - - if(t80.Buffs != null) - { - Utils.TryAdd(t, t80.Role, t80.Role); - } - - if(t81.Buffs != null) - { - Utils.TryAdd(t, t81.Role, t81.Role); - } - - if(t82.Buffs != null) - { - Utils.TryAdd(t, t82.Role, t82.Role); - } - - if(t83.Buffs != null) - { - Utils.TryAdd(t, t83.Role, t83.Role); - } - - if(t84.Buffs != null) - { - Utils.TryAdd(t, t84.Role, t84.Role); - } - - if(t85.Buffs != null) - { - Utils.TryAdd(t, t85.Role, t85.Role); - } - - if(t86.Buffs != null) - { - Utils.TryAdd(t, t86.Role, t86.Role); - } - - if(t87.Buffs != null) - { - Utils.TryAdd(t, t87.Role, t87.Role); - } - - if(t88.Buffs != null) - { - Utils.TryAdd(t, t88.Role, t88.Role); - } - - if(t89.Buffs != null) - { - Utils.TryAdd(t, t89.Role, t89.Role); - } - - if(t90.Buffs != null) - { - Utils.TryAdd(t, t90.Role, t90.Role); - } - - if(t91.Buffs != null) - { - Utils.TryAdd(t, t91.Role, t91.Role); - } - - if(t92.Buffs != null) - { - Utils.TryAdd(t, t92.Role, t92.Role); - } - - if(t93.Buffs != null) - { - Utils.TryAdd(t, t93.Role, t93.Role); - } - - if(t94.Buffs != null) - { - Utils.TryAdd(t, t94.Role, t94.Role); - } - - if(t95.Buffs != null) - { - Utils.TryAdd(t, t95.Role, t95.Role); - } - - if(t96.Buffs != null) - { - Utils.TryAdd(t, t96.Role, t96.Role); - } - - if(t97.Buffs != null) - { - Utils.TryAdd(t, t97.Role, t97.Role); - } - - if(t98.Buffs != null) - { - Utils.TryAdd(t, t98.Role, t98.Role); - } - - if(t99.Buffs != null) - { - Utils.TryAdd(t, t99.Role, t99.Role); - } - - if(t100.Buffs != null) - { - Utils.TryAdd(t, t100.Role, t100.Role); - } - - if(t101.Buffs != null) - { - Utils.TryAdd(t, t101.Role, t101.Role); - } - - if(t103.Buffs != null) - { - Utils.TryAdd(t, t103.Role, t103.Role); - } - - if(t104.Buffs != null) - { - Utils.TryAdd(t, t104.Role, t104.Role); - } - - #endregion - - File.WriteAllText("tge_roles.json", FileLoader.SerializeWithIndentation(t)); - - #endregion*/ - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/SynergyDisplay_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/SynergyDisplay_Patch.cs deleted file mode 100644 index 2ec60a3..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/SynergyDisplay_Patch.cs +++ /dev/null @@ -1,32 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; -using UnityEngine; -using MelonLoader; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(SynergyDisplay))] - public static class SynergyDisplay_Patch - { - [HarmonyPatch(nameof(SynergyDisplay.Start))] - [HarmonyPostfix] - public static void Start(SynergyDisplay __instance) - { - __instance.text.text = TranslateInvestDisplay(__instance.text.text); - } - - public static string TranslateInvestDisplay(string originalText) - { - string[] parts = originalText.Split("\n\n"); - List translatedParts = new List(); - foreach(string part in parts) - { - translatedParts.Add(StringStore.TranslateColorText(part)); - } - return String.Join("\n\n", translatedParts); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelAdvantureMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelAdvantureMenu_Patch.cs deleted file mode 100644 index 4411728..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelAdvantureMenu_Patch.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelAdvantureMenu))] - public static class TravelAdvantureMenu_Patch - { - [HarmonyPatch(nameof(TravelAdvantureMenu.Awake))] - [HarmonyPostfix] - public static void Awake(TravelAdvantureMenu __instance) - { - foreach(CustomButton_enterGame button in __instance.GetComponentsInChildren()) - { - string plantName = Utils.GetPlantNameFromAlmanac(button.levelName.text); - if(Utils.Language == Utils.LanguageEnum.Arabic) - { - button.levelName.text = StringStore.TranslateText(button.levelName.text); - } - else - { - button.levelName.text = (plantName != "") ? plantName : StringStore.TranslateText(button.levelName.text); - } - } - } - - [HarmonyPatch(nameof(TravelAdvantureMenu.LookWeak))] - [HarmonyPostfix] - public static void LookWeak(TravelAdvantureMenu __instance) - { - Awake(__instance); - } - - [HarmonyPatch(nameof(TravelAdvantureMenu.LookUlti))] - [HarmonyPostfix] - public static void LookUlti(TravelAdvantureMenu __instance) - { - Awake(__instance); - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs deleted file mode 100644 index 84c83bc..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs +++ /dev/null @@ -1,35 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; -using UnityEngine; -using MelonLoader; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelBuffMenu))] - public static class TravelBuffMenu_Patch - { - [HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions))] - [HarmonyPostfix] - public static void RefeshOptions(TravelBuffMenu __instance) - { - foreach (TravelBuffOptionButton button in __instance.options) - { - TravelBuffOptionButton_Patch.TranslateOptionButton(button); - } - } - - [HarmonyPatch(nameof(TravelBuffMenu.Awake))] - [HarmonyPostfix] - public static void Awake(TravelBuffMenu __instance) - { - Transform refreshTransform = __instance.transform.Find("Refresh"); - foreach (TextMeshProUGUI text in refreshTransform.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs deleted file mode 100644 index 7d583df..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs +++ /dev/null @@ -1,27 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; -//using System.Text.Encodings.Web; -//using System.Text.Json; - -//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -//{ -// [HarmonyPatch(typeof(TravelBuffMgr))] -// public static class TravelBuffMgr_Patch -// { -// [HarmonyPatch(nameof(TravelBuffMgr.Awake))] -// [HarmonyPostfix] -// private static void Awake(TravelBuffMgr __instance) -// { -// __instance.text = AssetStore.StringStore.TranslateText(__instance.text); -// __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); -// } - -// [HarmonyPatch(nameof(TravelBuffMgr.ShowText), new Type[] { typeof(int), typeof(int) })] -// [HarmonyPostfix] -// private static void ShowText(TravelBuffMgr __instance) -// { -// __instance.text = AssetStore.StringStore.TranslateText(__instance.text); -// __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); -// } -// } -//} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs deleted file mode 100644 index a20704f..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs +++ /dev/null @@ -1,51 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using static MelonLoader.MelonLogger; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelBuffOptionButton))] - public static class TravelBuffOptionButton_Patch - { - [HarmonyPatch(nameof(TravelBuffOptionButton.Awake))] - [HarmonyPostfix] - public static void Awake(TravelBuffOptionButton __instance) - { - TranslateOptionButton(__instance); - } - - [HarmonyPatch(nameof(TravelBuffOptionButton.OnAnimOver))] - [HarmonyPostfix] - public static void OnAnimOver(TravelBuffOptionButton __instance) - { - TranslateOptionButton(__instance); - } - - public static void TranslateOptionButton(TravelBuffOptionButton button) - { - if(TravelMgr_Patch.travelBuffString.ContainsKey(button.introduce.text)) - { - string translatedBuff = travelBuffString[button.introduce.text]; - button.introduce.text = AddBuffName(translatedBuff); - } - - if(!Utils.CheckForUntranslatedText(button.introduce.text)) - { - button.introduce.text = AddBuffName(button.introduce.text); - } - - if(!TravelMgr_Patch.travelBuffString.ContainsKey(button.introduce.text) && Utils.CheckForUntranslatedText(button.introduce.text)) - { - button.introduce.text = StringStore.TranslateText(button.introduce.text); - } - } - } - - //List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - //string buff = (__instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText("无"); - //__instance.introduce.text = buff; -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs deleted file mode 100644 index fbed59a..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelBuff_Patch.cs +++ /dev/null @@ -1,18 +0,0 @@ -//using HarmonyLib; -//using Il2Cpp; - -//namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -//{ -// [HarmonyPatch(typeof(TravelBuff))] -// public static class TravelBuff_Patch -// { -// [HarmonyPatch(nameof(TravelBuff.OnMouseUpAsButton))] -// [HarmonyPostfix] -// private static void OnMouseUpAsButton() -// { -// if (TravelBuffMgr.Instance == null) return; -// TravelBuffMgr.Instance.text = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text); -// TravelBuffMgr.Instance.text2 = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text2); -// } -// } -//} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelInvestMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelInvestMenu_Patch.cs deleted file mode 100644 index bef66f2..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelInvestMenu_Patch.cs +++ /dev/null @@ -1,32 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelInvestMenu))] - public static class TravelInvestMenu_Patch - { - [HarmonyPatch(nameof(TravelInvestMenu.Start))] - [HarmonyPostfix] - private static void Start(TravelInvestMenu __instance) - { - Transform titleText = __instance.transform.Find("Title"); - TextMeshProUGUI shadowText = titleText.GetComponent(); - - TextMeshProUGUI regularText = titleText.transform.Find("Title2").GetComponent(); - regularText.text = StringStore.TranslateText(regularText.text); - - shadowText.text = Utils.RemoveColorTags(regularText.text); - } - - [HarmonyPatch(nameof(TravelInvestMenu.RefreshBuff))] - [HarmonyPostfix] - private static void RefreshBuff(TravelInvestMenu __instance, ref TravelBuffOptionButton option) - { - TravelBuffOptionButton_Patch.TranslateOptionButton(option); - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs deleted file mode 100644 index 53c1360..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs +++ /dev/null @@ -1,70 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; -using UnityEngine; -using MelonLoader; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelLookBuff))] - public static class TravelLookBuff_Patch - { - [HarmonyPatch(nameof(TravelLookBuff.Clear))] - [HarmonyPostfix] - public static void Post_Clear(TravelLookBuff __instance) - { - __instance.introduce.text = StringStore.TranslateText("无"); - __instance.set = false; - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelLookBuff.OnMouseUpAsButton))] - [HarmonyPostfix] - public static void Post_OnMouseUpAsButton(TravelLookBuff __instance) - { - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelLookBuff.SetBuff))] - [HarmonyPostfix] - public static void Post_SetBuff(TravelLookBuff __instance) - { - /*SortedDictionary buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - string buffText = buffSet.ContainsKey(__instance.buffIndex) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); - __instance.introduce.text = buffText;*/ - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Introduce").GetComponentsInChildren()) - { - if(TravelMgr_Patch.travelBuffString.ContainsKey(text.text)) - { - string translatedBuff = travelBuffString[text.text]; - text.text = AddBuffName(translatedBuff); - } - - if(!Utils.CheckForUntranslatedText(text.text)) - { - text.text = AddBuffName(text.text); - } - - if(!TravelMgr_Patch.travelBuffString.ContainsKey(text.text) && Utils.CheckForUntranslatedText(text.text)) - { - text.text = StringStore.TranslateText(text.text); - } - } - - foreach (TextMeshProUGUI text in __instance.transform.FindChild("Images").FindChild("Button").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs deleted file mode 100644 index cda2c7a..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs +++ /dev/null @@ -1,46 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelLookMenu))] - public static class TravelLookMenu_Patch - { - public static string savedAssetString = ""; - - [HarmonyPatch(nameof(TravelLookMenu.Start))] - [HarmonyPostfix] - private static void Postfix_Start(TravelLookMenu __instance) - { - foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText(txt.text); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - Transform quitButtonTransform = __instance.transform.Find("Quit"); - foreach (TextMeshProUGUI txt in quitButtonTransform.GetComponentsInChildren()) - { - txt.text = StringStore.TranslateText("合上"); - txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); - } - - __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); - savedAssetString = __instance.treasureText.text; - } - - [HarmonyPatch(nameof(TravelLookMenu.Update))] - [HarmonyPostfix] - private static void Update(TravelLookMenu __instance) - { - if (savedAssetString != __instance.treasureText.text) - { - __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); - savedAssetString = __instance.treasureText.text; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs deleted file mode 100644 index e96322e..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelMgr_Patch.cs +++ /dev/null @@ -1,367 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Threading.Tasks; -using Unity.Collections; -using UnityEngine.Rendering; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - public class TravelBuffInfo - { - public string name = ""; - public string desc = ""; - - public TravelBuffInfo(string name_a = "", string desc_a = "") - { - name = name_a; - desc = desc_a; - } - } - - public class TravelBuffSet - { - public SortedDictionary advancedBuffs = new(); - public SortedDictionary ultimateBuffs = new(); - public SortedDictionary debuffs = new(); - public SortedDictionary unlocks = new(); - public SortedDictionary investmentBuffs = new(); - private Dictionary> _travelBuffSets = []; - - public TravelBuffSet() - { - advancedBuffs = new(); - ultimateBuffs = new(); - debuffs = new(); - unlocks = new(); - investmentBuffs = new(); - - _travelBuffSets = new() - { - { "advancedBuffs", advancedBuffs }, - { "ultimateBuffs", ultimateBuffs }, - { "debuffs", debuffs }, - { "unlocks", unlocks }, - { "investmentBuffs", investmentBuffs } - }; - } - - public SortedDictionary TryGet(string name) - { - switch(name) - { - case "advancedBuffs": - return advancedBuffs; - case "ultimateBuffs": - return ultimateBuffs; - case "debuffs": - return debuffs; - case "unlocks": - return unlocks; - case "investmentBuffs": - return investmentBuffs; - default: - return null; - } - } - - public IEnumerator>> GetEnumerator() - { - foreach(var item in _travelBuffSets) - { - yield return new(item.Key, item.Value); - } - } - } - - [HarmonyPatch(typeof(TravelMgr))] - public static class TravelMgr_Patch - { - public static readonly TravelBuffSet templateTravelBuffs = new(); - - public static TravelBuffSet dumpedTravelBuffs = new(); - - public static TravelBuffSet translatedTravelBuffs = new(); - - public static Dictionary travelBuffString = new() - { - - }; - - public static Dictionary buffLinks = new() - { - { BuffType.AdvancedBuff, "advancedBuffs" }, - { BuffType.UltimateBuff, "ultimateBuffs" }, - { BuffType.Debuff, "debuffs" }, - { BuffType.UnlockPlant, "unlocks" }, - { BuffType.InvestmentBuff, "investmentBuffs" } - }; - - [HarmonyPatch(nameof(TravelMgr.GetText))] - [HarmonyPostfix] - public static void GetText(TravelMgr __instance, ref string __result) - { - if (travelBuffString.ContainsKey(__result)) - { - __result = travelBuffString[__result]; - } - else if(travelBuffString.ContainsKey(RemoveBuffName(__result))) - { - __result = travelBuffString[RemoveBuffName(__result)]; - } - else - { - __result = StringStore.TranslateText(__result); - } - } - - public static void DumpTravelBuffs() - { - TravelMgr.Instance.GetPlantBuffUnlockCount(PlantType.DoomGatling); - - dumpedTravelBuffs = new(); - travelBuffString.Clear(); - - foreach (var pair in TravelDictionary.advancedBuffsText) - { - Utils.TryAdd(dumpedTravelBuffs.advancedBuffs, (int)pair.Key, new TravelBuffInfo("", pair.Value)); - Utils.TryAdd(travelBuffString, pair.Value, pair.Value); - } - - foreach (var pair in TravelDictionary.ultimateBuffsText) - { - Utils.TryAdd(dumpedTravelBuffs.ultimateBuffs, (int)pair.Key, new TravelBuffInfo("", pair.Value)); - Utils.TryAdd(travelBuffString, pair.Value, pair.Value); - } - - foreach (var pair in TravelDictionary.debuffData) - { - Utils.TryAdd(dumpedTravelBuffs.debuffs, (int)pair.Key, new TravelBuffInfo("", pair.Value.Item1)); - Utils.TryAdd(travelBuffString, pair.Value.Item1, pair.Value.Item1); - } - - foreach (var pair in TravelDictionary.unlocksText) - { - Utils.TryAdd(dumpedTravelBuffs.unlocks, (int)pair.Key, new TravelBuffInfo("", pair.Value)); - Utils.TryAdd(travelBuffString, pair.Value, pair.Value); - } - - foreach (var pair in TravelMgr.InvestBuffsData) - { - Utils.TryAdd(dumpedTravelBuffs.investmentBuffs, (int)pair.Key, new TravelBuffInfo("", pair.Value.GetDescription())); - Utils.TryAdd(travelBuffString, pair.Value.GetDescription(), pair.Value.GetDescription()); - } - - File.WriteAllText(Path.Combine(GetAssetDir(AssetType.Dumps), "travel_buffs.json"), SerializeWithIndentation(dumpedTravelBuffs)); - - string translatedTravelBuffsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "travel_buffs.json"); - - if (!File.Exists(translatedTravelBuffsPath)) - { - File.WriteAllText(translatedTravelBuffsPath, SerializeWithIndentation(dumpedTravelBuffs)); - translatedTravelBuffs = dumpedTravelBuffs; - } - } - - //System.Text.Json.JsonSerializer.Deserialize>>(travelBuffsContent); - public static void GenerateTranslatedTravelBuffs(string travelBuffsContent) - { - if (!Core.isInitialized) return; - - DumpTravelBuffs(); - - TravelBuffSet travelBuffs = Newtonsoft.Json.JsonConvert.DeserializeObject(travelBuffsContent); - translatedTravelBuffs = travelBuffs; - travelBuffString.Clear(); - - foreach(var i in travelBuffs) - { - var originalBuffSet = dumpedTravelBuffs.TryGet(i.Item1); - foreach(var j in originalBuffSet) - { - TravelBuffInfo originalBuff = j.Value; - var translatedBuffSet = travelBuffs.TryGet(i.Item1); - - if (j.Value.desc == originalBuff.desc) - { - if (translatedBuffSet.ContainsKey(j.Key)) - { - Utils.TryAdd(travelBuffString, originalBuff.desc, translatedBuffSet[j.Key].desc); - } - } - else if(j.Value.desc == RemoveBuffName(originalBuff.desc)) - { - if (translatedBuffSet.ContainsKey(j.Key)) - { - Utils.TryAdd(travelBuffString, originalBuff.desc, translatedBuffSet[j.Key].desc); - } - } - - /*var translatedBuffSet = travelBuffs[i.Key]; - if(translatedBuffSet.ContainsKey(j.Key)) - { - string translatedBuff = travelBuffs[i.Key][j.Key]; - travelBuffString[originalBuff] = translatedBuff; - }*/ - } - } - - string travelBuffsToSave = SerializeWithIndentation(TravelMgr_Patch.translatedTravelBuffs); - string stringDir = GetAssetDir(AssetType.Strings, Utils.Language); - File.WriteAllText(Path.Combine(stringDir, "travel_buffs.json"), travelBuffsToSave); - } - - public static string MatchTravelBuff(string originalText) - { - string res = ""; - - foreach (var i in dumpedTravelBuffs) - { - foreach (var j in dumpedTravelBuffs.TryGet(i.Item1)) - { - if (j.Value.desc == originalText || j.Value.desc == RemoveBuffName(originalText)) - { - var translatedBuffSet = translatedTravelBuffs.TryGet(i.Item1); - if (translatedBuffSet.ContainsKey(j.Key)) - { - res = translatedBuffSet[j.Key].desc; - } - break; - } - } - - if (res != "") break; - } - - return res; - } - - public static string RemoveBuffName(string buffText) - { - string res = buffText; - int firstColon = res.IndexOf(":"); - if(firstColon > 0) - { - res = res.Substring(firstColon + 1); - } - return res; - } - - public static Dictionary modifierNameDict = new Dictionary() - { - { "advancedBuffs", "COMMON_MODIFIER_TAG" }, - { "ultimateBuffs", "EPIC_MODIFIER_TAG" }, - { "debuffs", "ZOMBIE_MODIFIER_TAG" }, - { "unlocks", "UNLOCK_MODIFIER_TAG" }, - { "investmentBuffs", "INVEST_MODIFIER_TAG" } - }; - - public static Dictionary fallbackNameDict = new Dictionary() - { - { "COMMON_MODIFIER_TAG", "Common Modifier" }, - { "EPIC_MODIFIER_TAG", "Epic Modifier" }, - { "ZOMBIE_MODIFIER_TAG", "Zombie Modifier" }, - { "UNLOCK_MODIFIER_TAG", "Unlock Modifier" }, - { "INVEST_MODIFIER_TAG", "Investment Modifier" } - }; - - public static string TranslateNameTag(string originalText) - { - string res = originalText; - - string nameTag = modifierNameDict[originalText]; - res = StringStore.translationString.ContainsKey(nameTag) ? StringStore.TranslateText(nameTag) : fallbackNameDict[nameTag]; - - return res; - } - - public static ValueTuple FindBuffData(string buffText) - { - ValueTuple res = new(); - foreach(var pair1 in translatedTravelBuffs) - { - foreach(var pair2 in pair1.Item2) - { - if(buffText == pair2.Value.desc) - { - if(pair2.Value.name != "") - { - res.Item1 = pair2.Value.name; - res.Item4 = true; - } - else - { - res.Item1 = TranslateNameTag(pair1.Item1); - res.Item4 = false; - } - res.Item2 = pair2.Key; - } - } - } - - foreach(var pair1 in dumpedTravelBuffs) - { - foreach(var pair2 in pair1.Item2) - { - if(buffText == pair2.Value.desc) - { - if(pair2.Value.name != "") - { - res.Item1 = pair2.Value.name; - res.Item4 = true; - } - else - { - res.Item1 = TranslateNameTag(pair1.Item1); - res.Item4 = false; - } - res.Item2 = pair2.Key; - } - } - } - - string finalBuffText = buffText; - if(travelBuffString.ContainsKey(buffText)) - { - finalBuffText = travelBuffString[buffText]; - } - else - { - finalBuffText = StringStore.TranslateText(buffText); - } - res.Item3 = finalBuffText; - - return res; - } - - public static string fallbackFBuffStr = "{0}: {1}"; - - public static string AddBuffName(string buffText) - { - string translatedBuff = buffText; - if(Utils.CheckForUntranslatedText(buffText)) - { - if(travelBuffString.ContainsKey(buffText)) - { - translatedBuff = travelBuffString[buffText]; - } - } - var buffData = FindBuffData(translatedBuff); - if(buffData.Item1 != null && buffData.Item3 != null) - { - string buffFStr = StringStore.translationStringRegex.ContainsKey("BUFF_NAME_FORMAT") ? StringStore.translationStringRegex["BUFF_NAME_FORMAT"] : "{0}: {1}"; - string fBuffDesc = string.Format(buffFStr, buffData.Item1, buffData.Item3); - translatedBuff = fBuffDesc; - } - - return translatedBuff; - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs deleted file mode 100644 index 5d58593..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelRefresh_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelRefresh))] - public static class TravelRefresh_Patch - { - [HarmonyPatch(nameof(TravelRefresh.Awake))] - [HarmonyPostfix] - private static void Awake(TravelRefresh __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); - } - - [HarmonyPatch(nameof(TravelRefresh.OnMouseUpAsButton))] - [HarmonyPostfix] - private static void OnMouseUpAsButton(TravelRefresh __instance) - { - __instance.text = StringStore.TranslateText(__instance.text); - __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelStoreWindow_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelStoreWindow_Patch.cs deleted file mode 100644 index b8fc49f..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelStoreWindow_Patch.cs +++ /dev/null @@ -1,93 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using System.Text.RegularExpressions; -using UnityEngine; -using static Il2CppSystem.Globalization.TimeSpanFormat; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelStoreWindow))] - public static class TravelStoreWindow_Patch - { - [HarmonyPatch(nameof(TravelStoreWindow.SetType))] - [HarmonyPostfix] - private static void SetType(TravelStoreWindow __instance) - { - /*var buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; - - string buff = __instance.show != null && __instance.introduce.text != "词条已选完" ? buffSet[__instance.buffIndex] : StringStore.TranslateText("词条已选完");*/ - string originalText = __instance.introduce.text; - string affinityPattern = "([\\s\\S]+)(\\\n)([\\s\\S]+)(<\\/color>)"; - if(Regex.IsMatch(__instance.introduce.text, affinityPattern, options: RegexOptions.Singleline)) - { - Match match = Regex.Match(__instance.introduce.text, affinityPattern, options: RegexOptions.Singleline); - string startText = match.Groups[1].Value; - string affinityText = match.Groups[3].Value; - string affinities = TranslateAffinities(affinityText); - __instance.introduce.text = AddBuffName(startText) + affinities; - } - else - { - __instance.introduce.text = AddBuffName(originalText); - } - - foreach (var text in __instance.buttonText) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(TravelStoreWindow.UpdateButtonText))] - [HarmonyPostfix] - private static void UpdateButtonText(TravelStoreWindow __instance) - { - foreach (var text in __instance.buttonText) - { - text.text = StringStore.TranslateText(text.text); - } - } - - public static string TranslateAffinities(string originalText) - { - string result = ""; - List translatedAffinities = []; - - string[] lines = originalText.Split('\n'); - - foreach(string line in lines) - { - if (string.IsNullOrEmpty(line)) continue; - - string fStr = StringStore.translationStringRegex.ContainsKey("【([^\\s]+)】_IV") ? StringStore.translationStringRegex["【([^\\s]+)】_IV"] : "[{0}]"; - - // Extract dynamic parts from the original text - var regex = new Regex("【([^\\s]+)】"); - var match = regex.Match(line); - int groupCount = match.Groups.Count; - - // List to hold formatted dynamic parts - List dynamicParts = []; - - // Loop through each group and determine its translation - for (int i = 1; i < groupCount; i++) - { - string groupValue = match.Groups[i].Value; - string translatedValue = StringStore.translationString.ContainsKey(groupValue) - ? StringStore.translationString[groupValue] - : groupValue; - dynamicParts.Add(translatedValue); - } - - // Format the output string with dynamic parts - string translatedAffinity = string.Format(fStr, [.. dynamicParts]); - translatedAffinities.Add(translatedAffinity); - } - - result = "\n" + "" + String.Join("\n", translatedAffinities) + ""; - return result; - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs deleted file mode 100644 index dc07b75..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelStore_Patch.cs +++ /dev/null @@ -1,96 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelStore))] - public static class TravelStore_Patch - { - [HarmonyPatch(nameof(TravelStore.Start))] - [HarmonyPostfix] - private static void Start(TravelStore __instance) - { - TranslateStoreText(__instance); - } - - [HarmonyPatch(nameof(TravelStore.Update))] - [HarmonyPostfix] - private static void Update(TravelStore __instance) - { - TranslateStoreText(__instance); - } - - [HarmonyPatch(nameof(TravelStore.RefreshBuff))] - [HarmonyPostfix] - private static void RefreshBuff(TravelStore __instance) - { - TranslateStoreText(__instance); - } - - [HarmonyPatch(nameof(TravelStore.SelectBuff))] - [HarmonyPostfix] - private static void SelectBuff(TravelStore __instance, ref TravelStoreWindow window) - { - TranslateStoreText(__instance); - - foreach (var text in window.buttonText) - { - text.text = StringStore.TranslateText(text.text); - } - - __instance.investText.text = TranslateInvestText(__instance.investText.text); - __instance.investTextshadow.text = TranslateInvestText(__instance.investTextshadow.text); - } - - public static void TranslateStoreText(TravelStore __instance) - { - __instance.investText.text = TranslateInvestText(__instance.investText.text); - __instance.investTextshadow.text = TranslateInvestText(__instance.investTextshadow.text); - - foreach (var text in __instance.pointText) - { - text.text = StringStore.TranslateText(text.text); - } - foreach (var text in __instance.refreshText) - { - text.text = StringStore.TranslateText(text.text); - } - foreach(var text in __instance.transform.Find("Quit").GetComponentsInChildren()) - { - text.text = StringStore.TranslateText("合上"); - } - } - - public static string TranslateInvestText(string investText) - { - string res = investText; - - if(!Utils.CheckForUntranslatedText(res)) - { - return res; - } - - string[] investStats = investText.Split("\n\n"); - List translatedInvestStats = new List(); - foreach(string investStat in investStats) - { - string[] lines = investStat.Split("\n"); - List translatedLines = new List(); - foreach(string line in lines) - { - translatedLines.Add(StringStore.TranslateColorText(line)); - } - string translatedInvestStat = String.Join("\n", translatedLines); - translatedInvestStats.Add(translatedInvestStat); - } - - res = String.Join("\n\n", translatedInvestStats); - - return res; - } - } -} diff --git a/MelonLoader/Patches/Modes/Odyssey/TravelSynergyMenu_Patch.cs b/MelonLoader/Patches/Modes/Odyssey/TravelSynergyMenu_Patch.cs deleted file mode 100644 index 4c1f8a0..0000000 --- a/MelonLoader/Patches/Modes/Odyssey/TravelSynergyMenu_Patch.cs +++ /dev/null @@ -1,107 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; -using UnityEngine; -using System.Text.RegularExpressions; - -namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey -{ - [HarmonyPatch(typeof(TravelSynergyMenu))] - public static class TravelSynergyMenu_Patch - { - [HarmonyPatch(nameof(TravelSynergyMenu.Awake))] - [HarmonyPostfix] - public static void Awake(TravelSynergyMenu __instance) - { - Transform background = __instance.transform.Find("Background"); - Transform tip = __instance.transform.Find("Text (TMP)"); - - foreach(TextMeshProUGUI text in background.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - - foreach (TextMeshProUGUI text in tip.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } - - [HarmonyPatch(typeof(SynergyNode))] - public static class SynergyNode_Patch - { - [HarmonyPatch(nameof(SynergyNode.InitNode))] - [HarmonyPostfix] - public static void InitNode(SynergyNode __instance) - { - int firstNewlineIndex = __instance.synergyTitle.text.IndexOf("\n"); - string title = __instance.synergyTitle.text.Substring(0, firstNewlineIndex); - string description = __instance.synergyTitle.text.Substring(firstNewlineIndex + 1); - description = (description.Substring(0, 8) == "") ? description.Substring(8) : description; - - string pattern = @"]+>[\s\S]*?(?:<\/color>|$)|(?:<(?!color=)|[^<])+"; - string smallPattern = @"(]+>)(.*?)()"; - MatchCollection matches = Regex.Matches(description, pattern); - string translatedDescription = ""; - foreach(Match match in matches) - { - Match colorMatch = Regex.Match(match.Value, smallPattern, RegexOptions.Singleline); - if (colorMatch.Success) - { - translatedDescription += colorMatch.Groups[1].Value + TranslateSegment(colorMatch.Groups[2].Value) + colorMatch.Groups[3].Value; - } - else - { - translatedDescription += TranslateSegment(match.Value) + "\n"; - } - } - - __instance.synergyTitle.text = "" + StringStore.TranslateColorText(title) + "\n" + translatedDescription; - } - - public static string TranslateSegment(string text) - { - string res = ""; - - List parts = SplitSecondNewLines(text); - - foreach(string part in parts) - { - string temp = ""; - string[] lines = part.Split('\n'); - if(lines.Length > 1) - { - temp = StringStore.TranslateText(lines[0]) + "\n" + StringStore.TranslateText(lines[1]); - } - res += temp + "\n"; - } - return res.Substring(0, res.Length - 1); - } - - public static List SplitSecondNewLines(string originalText) - { - List results = new List(); - - string[] lines = originalText.Split('\n'); - for (int i = 0; i < lines.Length; i += 2) - { - string res = ""; - if(i + 1 < lines.Length) - { - res = lines[i] + "\n" + lines[i + 1]; - results.Add(res); - } - else - { - res = lines[i]; - results.Add(res); - } - } - - return results; - } - } -} diff --git a/MelonLoader/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs deleted file mode 100644 index 0564ff5..0000000 --- a/MelonLoader/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs +++ /dev/null @@ -1,77 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Starbound -{ - [HarmonyPatch(typeof(AdvantureEvolutionMenu))] - public static class AdvantureEvolutionMenu_Patch - { - [HarmonyPatch(nameof(AdvantureMenu.Awake))] - [HarmonyPostfix] - public static void Awake(AdvantureEvolutionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - Transform baseWindow = __instance.transform.Find("BaseWindow"); - Transform advancedWindow = __instance.transform.Find("AdvancedWindow"); - - if(baseWindow != null) - { - foreach(TextMeshProUGUI text in baseWindow.GetComponentsInChildren()) - { - if(text.gameObject.name.Contains("Name")) - { - text.text = Utils.GetPlantNameFromAlmanac(__instance.thePlantType); - } - } - } - - if (advancedWindow != null) - { - foreach (TextMeshProUGUI text in advancedWindow.GetComponentsInChildren()) - { - if (text.gameObject.name.Contains("Name")) - { - text.text = Utils.GetPlantNameFromAlmanac(__instance.thePlantType); - } - } - } - } - - [HarmonyPatch(nameof(AdvantureEvolutionMenu.UpdateText))] - [HarmonyPostfix] - public static void UpdateText(AdvantureEvolutionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureEvolutionMenu.RollEvolution))] - [HarmonyPostfix] - public static void RollEvolution(AdvantureEvolutionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureEvolutionMenu.RollEvolutionGood))] - [HarmonyPostfix] - public static void RollEvolutionGood(AdvantureEvolutionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs deleted file mode 100644 index 4f9751f..0000000 --- a/MelonLoader/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs +++ /dev/null @@ -1,21 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Starbound -{ - [HarmonyPatch(typeof(AdvantureHelpMenu))] - public static class AdvantureHelpMenu_Patch - { - [HarmonyPatch(nameof(AdvantureHelpMenu.InitText))] - [HarmonyPostfix] - private static void InitText(AdvantureHelpMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs deleted file mode 100644 index 46814ba..0000000 --- a/MelonLoader/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs +++ /dev/null @@ -1,28 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Starbound -{ - [HarmonyPatch(typeof(AdvantureMenu2))] - public static class AdvantureMenu2_Patch - { - [HarmonyPatch(nameof(AdvantureMenu2.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureMenu2 __instance) - { - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureMenu2.AdjustDifficulty))] - [HarmonyPostfix] - private static void AdjustDifficulty(AdvantureMenu2 __instance) - { - __instance.difficulty.text = StringStore.TranslateText(__instance.difficulty.text); - } - } -} diff --git a/MelonLoader/Patches/Modes/Starbound/AdvantureMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureMenu_Patch.cs deleted file mode 100644 index 91c593b..0000000 --- a/MelonLoader/Patches/Modes/Starbound/AdvantureMenu_Patch.cs +++ /dev/null @@ -1,64 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Starbound -{ - [HarmonyPatch(typeof(AdvantureMenu))] - public static class AdvantureMenu_Patch - { - [HarmonyPatch(nameof(AdvantureMenu.Start))] - [HarmonyPostfix] - private static void Start(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.ChangeDifficulty))] - [HarmonyPostfix] - private static void ChangeDifficulty(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.GetChapterDifficulty))] - [HarmonyPostfix] - private static void GetChapterDifficulty(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.UpdateChapterDifficulty))] - [HarmonyPostfix] - private static void UpdateChapterDifficulty(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - [HarmonyPatch(nameof(AdvantureMenu.UpdateStarCount))] - [HarmonyPostfix] - private static void UpdateStarCount(AdvantureMenu __instance) - { - TranslateAdvantureMenu(__instance); - } - - public static void TranslateAdvantureMenu(AdvantureMenu __instance) - { - bool hasSBString = StringStore.translationString.ContainsKey(__instance.difficulty.text + "_SB"); - __instance.difficulty.text = Utils.RemoveSizeTags(hasSBString ? StringStore.TranslateText(__instance.difficulty.text + "_SB") : StringStore.TranslateText(__instance.difficulty.text)); - __instance.chapterDifficulty.text = StringStore.TranslateText(__instance.chapterDifficulty.text); - __instance.starCount.text = StringStore.TranslateText(__instance.starCount.text); - - foreach (TextMeshProUGUI text in __instance.title) - { - text.text = StringStore.TranslateText(text.text); - } - - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs deleted file mode 100644 index 2aac117..0000000 --- a/MelonLoader/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs +++ /dev/null @@ -1,56 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Starbound -{ - [HarmonyPatch(typeof(AdvantureMissionMenu))] - public static class AdvantureMissionMenu_Patch - { - [HarmonyPatch(nameof(AdvantureMissionMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureMissionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.contant.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - //foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - //{ - // text.text = StringStore.TranslateText(text.text); - //} - } - - [HarmonyPatch(nameof(AdvantureMissionMenu.InitText))] - [HarmonyPostfix] - private static void InitText(AdvantureMissionMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.contant.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - //foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - //{ - // text.text = StringStore.TranslateText(text.text); - //} - } - - [HarmonyPatch(nameof(AdvantureMissionMenu.SwitchAward))] - [HarmonyPostfix] - private static void SwitchAward(AdvantureMissionMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.contant.GetComponentsInChildren()) - { - text.text = StringStore.TranslateColorText(text.text); - } - - //foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - //{ - // text.text = StringStore.TranslateText(text.text); - //} - } - } -} diff --git a/MelonLoader/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs b/MelonLoader/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs deleted file mode 100644 index 2b8c4b1..0000000 --- a/MelonLoader/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs +++ /dev/null @@ -1,61 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Starbound -{ - [HarmonyPatch(typeof(AdvantureStarMenu))] - public static class AdvantureStarMenu_Patch - { - [HarmonyPatch(nameof(AdvantureStarMenu.Awake))] - [HarmonyPostfix] - private static void Awake(AdvantureStarMenu __instance) - { - foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.GetNodes))] - [HarmonyPostfix] - private static void GetNodes(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.UpdateStarText))] - [HarmonyPostfix] - private static void UpdateStarText(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.InitTalents))] - [HarmonyPostfix] - private static void InitTalents(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - - [HarmonyPatch(nameof(AdvantureStarMenu.ResetAward))] - [HarmonyPostfix] - private static void ResetAward(AdvantureStarMenu __instance) - { - foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) - { - text.text = StringStore.TranslateText(text.text); - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomButton_enterGame_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/CustomButton_enterGame_Patch.cs deleted file mode 100644 index a99986d..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomButton_enterGame_Patch.cs +++ /dev/null @@ -1,104 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppGameLevel; -using Il2CppGameLevel.EventNodes; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Threading.Tasks; -using Unity.VisualScripting.FullSerializer; -using UnityEngine; -using UnityEngine.UIElements; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomButton_enterGame))] - public static class CustomButton_enterGame_Patch - { - [HarmonyPatch(nameof(CustomButton_enterGame.LoadOnlineLevelAsync))] - [HarmonyPostfix] - public static void LoadOnlineLevelAsync(CustomButton_enterGame __instance) - { - string dumpPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_data.json"); - Dictionary dumpData = new Dictionary(); - - if (!File.Exists(dumpPath)) - { - File.WriteAllText(dumpPath, System.Text.Json.JsonSerializer.Serialize(dumpData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - - dumpData = JsonSerializer.Deserialize>(File.ReadAllText(dumpPath)); - - string dumpStringsPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_strings.json"); - Dictionary dumpStringsData = new Dictionary(); - - if (!File.Exists(dumpStringsPath)) - { - File.WriteAllText(dumpStringsPath, System.Text.Json.JsonSerializer.Serialize(dumpStringsData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - - dumpStringsData = JsonSerializer.Deserialize>(File.ReadAllText(dumpStringsPath)); - - var level = __instance; - - if(level.onlineLevelInfo != null) - { - string levelId = level.onlineLevelInfo.levelId; - if(levelId != null) - { - SerializedLevelData serializedLevel = level.serializedLevel; - if(CustomLevelMenu_Patch.translatedLevelData.ContainsKey(levelId)) - { - TranslatedLevelData levelData = CustomLevelMenu_Patch.translatedLevelData[levelId]; - level.levelName.text = levelData.name; - serializedLevel.name = levelData.name; - serializedLevel.boardConfig.startTip = levelData.startTip; - } - else - { - TranslatedLevelData dumpedLevelData = new TranslatedLevelData(level.onlineLevelInfo.levelName, serializedLevel.boardConfig.startTip); - - if (dumpData.ContainsKey(levelId)) - { - dumpData[levelId] = dumpedLevelData; - } - else - { - dumpData.Add(levelId, dumpedLevelData); - } - } - - /*level.levelData.SerializedLevelData - foreach()*/ - } - } - else - { - level.levelName.text = StringStore.TranslateText(level.levelName.text); - } - - File.WriteAllText(dumpPath, System.Text.Json.JsonSerializer.Serialize(dumpData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - File.WriteAllText(dumpStringsPath, System.Text.Json.JsonSerializer.Serialize(dumpStringsData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - } -} \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomLevelMenu_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/CustomLevelMenu_Patch.cs deleted file mode 100644 index 31eead2..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomLevelMenu_Patch.cs +++ /dev/null @@ -1,175 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using Newtonsoft.Json; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Threading.Tasks; -using System.Threading.Tasks; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomLevelMenu))] - public static class CustomLevelMenu_Patch - { - public static Dictionary translatedLevelData = new Dictionary(); - public static float requestTimer = 0f; - - [HarmonyPatch(nameof(CustomLevelMenu.LoadOnlineFiles))] - [HarmonyPostfix] - public static void LoadOnlineFiles(CustomLevelMenu __instance) - { - if (!Utils.useLocal) - { - LoadOnlineData(); - } - else - { - LoadLocalData(); - } - } - - [HarmonyPatch(nameof(CustomLevelMenu.InitLocalWindows))] - [HarmonyPostfix] - public static void InitWindows(CustomLevelMenu __instance) - { - TranslateLevelButtons(__instance); - } - - [HarmonyPatch(nameof(CustomLevelMenu.InitOnlineWindow))] - [HarmonyPostfix] - public static void InitOnlineWindow(CustomLevelMenu __instance) - { - TranslateLevelButtons(__instance); - } - - [HarmonyPatch(nameof(CustomLevelMenu.ReloadFiles))] - [HarmonyPostfix] - public static void ReloadFiles(CustomLevelMenu __instance) - { - TranslateLevelButtons(__instance); - } - - public static void TranslateLevelButtons(CustomLevelMenu __instance) - { - string dumpPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_data.json"); - Dictionary dumpData = new Dictionary(); - - if (!File.Exists(dumpPath)) - { - File.WriteAllText(dumpPath, System.Text.Json.JsonSerializer.Serialize(dumpData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - - foreach(CustomButton_enterGame level in __instance.levels) - { - if(level.onlineLevelInfo != null) - { - string levelId = level.onlineLevelInfo.levelId; - if(levelId != null) - { - if(translatedLevelData.ContainsKey(levelId)) - { - TranslatedLevelData levelData = translatedLevelData[levelId]; - level.levelName.text = levelData.name; - level.serializedLevel.name = levelData.name; - level.serializedLevel.boardConfig.startTip = levelData.startTip; - } - else - { - TranslatedLevelData dumpedLevelData = new TranslatedLevelData(level.onlineLevelInfo.levelName, level.serializedLevel.boardConfig.startTip); - dumpData.Add(levelId, dumpedLevelData); - } - } - } - else - { - level.levelName.text = StringStore.TranslateText(level.levelName.text); - } - } - - File.WriteAllText(dumpPath, System.Text.Json.JsonSerializer.Serialize(dumpData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - - public static async System.Threading.Tasks.Task> GetTranslatedLevelData() - { - string levelDataString = Utils.GetDataFromWeb($"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/custom_level_data.json").Result; - if(levelDataString != null) - { - Dictionary levelDataJson = JsonConvert.DeserializeObject>(levelDataString); - return levelDataJson; - } - else - { - new CancellationTokenSource().Cancel(); - return null; - } - } - - public static void LoadOnlineData() - { - if (requestTimer <= 0) - { - requestTimer = 5f; // 5 seconds in between request attempts to prevent any issues with github - - translatedLevelData = new Dictionary(); - - var translatedLevelDataRequest = System.Threading.Tasks.Task.Run(() => GetTranslatedLevelData()); - - if (translatedLevelDataRequest.Result != null) - { - translatedLevelData = translatedLevelDataRequest.Result; - Log.LogInfo($"Successfully loaded level data for {Utils.Language.ToString()}!"); - } - else - { - Log.LogError($"Couldn't find level data for {Utils.Language.ToString()}!"); - } - } - else - { - Log.LogInfo($"Please wait before requesting levels again! Current cooldown: {Math.Round(requestTimer, 3)}s"); - } - } - - public static void LoadLocalData() - { - translatedLevelData = new Dictionary(); - string assetDir = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), "custom_level_data.json"); - if (!File.Exists(assetDir)) - { - File.CreateText(assetDir); - File.WriteAllText(assetDir, "{}"); - } - string levelDataString = File.ReadAllText(assetDir); - Dictionary levelDataJson = JsonConvert.DeserializeObject>(levelDataString); - translatedLevelData = levelDataJson; - } - } - - public class TranslatedLevelData - { - public string name { get; set; } - public string startTip { get; set; } - - public TranslatedLevelData(string name, string startTip) - { - this.name = name; - this.startTip = startTip; - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_event_Patch_B.cs b/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_event_Patch_B.cs deleted file mode 100644 index b0cd093..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_event_Patch_B.cs +++ /dev/null @@ -1,29 +0,0 @@ -/*using MelonLoader; -using HarmonyLib; -using UnityEngine; -using Il2Cpp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using Il2CppGameLevel; -using PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomMenuPage_event))] - public static class CustomMenuPage_event_Patch - { - [HarmonyPatch(nameof(CustomMenuPage_event.InitializeNodeEditor))] - [HarmonyPostfix] - public static void InitializeNodeEditor(CustomMenuPage_event __instance) - { - RuntimeEventNodeEditor_Patch.Update(__instance.nodeEditor); - NodeInfoPanel_Patch.UpdatePanelContent(__instance.nodeInfoPanel); - } - } -} -*/ \ No newline at end of file diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_initZombies_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_initZombies_Patch.cs deleted file mode 100644 index cc0df54..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_initZombies_Patch.cs +++ /dev/null @@ -1,32 +0,0 @@ -using MelonLoader; -using HarmonyLib; -using UnityEngine; -using Il2Cpp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomMenuPage_initZombies))] - public static class CustomMenuPage_initZombies_Patch - { - [HarmonyPatch(nameof(CustomMenuPage_initZombies.SubWave))] - [HarmonyPostfix] - public static void SubWave(CustomMenuPage_initZombies __instance) - { - __instance.currentWaveText.text = StringStore.TranslateText(__instance.currentWaveText.text); - } - - [HarmonyPatch(nameof(CustomMenuPage_initZombies.AddWave))] - [HarmonyPostfix] - public static void AddWave(CustomMenuPage_initZombies __instance) - { - __instance.currentWaveText.text = StringStore.TranslateText(__instance.currentWaveText.text); - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_page3_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_page3_Patch.cs deleted file mode 100644 index 7b0d4dd..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_page3_Patch.cs +++ /dev/null @@ -1,34 +0,0 @@ -using MelonLoader; -using HarmonyLib; -using UnityEngine; -using Il2Cpp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomMenu_page3))] - public static class CustomMenuPage_page3_Patch - { - [HarmonyPatch(nameof(CustomMenu_page3.UpdateCardsText))] - [HarmonyPostfix] - public static void UpdateCardsText(CustomMenu_page3 __instance) - { - string plantName = Utils.GetPlantNameFromAlmanac(__instance.nameText.text); - __instance.nameText.text = (plantName != "") ? (plantName) : StringStore.TranslateText(__instance.nameText.text); - } - - [HarmonyPatch(nameof(CustomMenu_page3.UpdateAdvancedInfo))] - [HarmonyPostfix] - public static void UpdateAdvancedInfo(CustomMenu_page3 __instance) - { - string plantName = Utils.GetPlantNameFromAlmanac(__instance.nameText.text); - __instance.nameText.text = (plantName != "") ? (plantName) : StringStore.TranslateText(__instance.nameText.text); - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_shooting_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_shooting_Patch.cs deleted file mode 100644 index a019938..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomMenuPage_shooting_Patch.cs +++ /dev/null @@ -1,65 +0,0 @@ -using MelonLoader; -using HarmonyLib; -using UnityEngine; -using Il2Cpp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomMenuPage_shooting))] - public static class CustomMenuPage_shooting_Patch - { - [HarmonyPatch(nameof(CustomMenuPage_shooting.CreateRoute))] - [HarmonyPostfix] - public static void CreateRoute(CustomMenuPage_shooting __instance) - { - TranslateRoutes(__instance); - } - - [HarmonyPatch(nameof(CustomMenuPage_shooting.CreateStage))] - [HarmonyPostfix] - public static void CreateStage(CustomMenuPage_shooting __instance) - { - TranslateRoutes(__instance); - } - - [HarmonyPatch(nameof(CustomMenuPage_shooting.Awake))] - [HarmonyPostfix] - public static void Awake(CustomMenuPage_shooting __instance) - { - TranslateRoutes(__instance); - } - - [HarmonyPatch(nameof(CustomMenuPage_shooting.SearchRoute))] - [HarmonyPostfix] - public static void SearchRoute(CustomMenuPage_shooting __instance) - { - TranslateRoutes(__instance); - } - - [HarmonyPatch(nameof(CustomMenuPage_shooting.SearchAllRoute))] - [HarmonyPostfix] - public static void SearchAllRoute(CustomMenuPage_shooting __instance) - { - TranslateRoutes(__instance); - } - - public static void TranslateRoutes(CustomMenuPage_shooting __instance) - { - foreach(TextMeshProUGUI text in __instance.scollContent.GetComponentsInChildren()) - { - if (text.name == "PlantText") - { - string plantName = Utils.GetPlantNameFromAlmanac(text.text); - text.text = (plantName != "") ? plantName : StringStore.TranslateText(text.text); - } - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/CustomOnlineMenu_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/CustomOnlineMenu_Patch.cs deleted file mode 100644 index 103d448..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/CustomOnlineMenu_Patch.cs +++ /dev/null @@ -1,80 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppGameLevel; -using Il2CppTMPro; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Threading.Tasks; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor -{ - [HarmonyPatch(typeof(CustomOnlineMenu))] - public static class CustomOnlineMenu_Patch - { - [HarmonyPatch(nameof(CustomOnlineMenu.EditLevel))] - [HarmonyPostfix] - public static void EditLevel(CustomOnlineMenu __instance) - { - TranslateLevelName(__instance); - } - - [HarmonyPatch(nameof(CustomOnlineMenu.Start))] - [HarmonyPostfix] - public static void Start(CustomOnlineMenu __instance) - { - TranslateLevelName(__instance); - } - - public static void TranslateLevelName(CustomOnlineMenu __instance) - { - string translatedText = StringStore.TranslateText(__instance.title.text); - __instance.title.text = translatedText; - __instance.title2.text = translatedText; - - TranslateLevelData(__instance.levelData); - } - - public static void TranslateLevelData(CustomLevelData levelData) - { - Dictionary dumpData = new Dictionary(); - - if(levelData != null) - { - string levelId = levelData.levelId; - if(levelId != null) - { - if(CustomLevelMenu_Patch.translatedLevelData.ContainsKey(levelId)) - { - TranslatedLevelData translatedLevelData = CustomLevelMenu_Patch.translatedLevelData[levelId]; - levelData.Name = translatedLevelData.name; - levelData.SerializedLevelData.name = translatedLevelData.name; - levelData.SerializedLevelData.boardConfig.startTip = translatedLevelData.startTip; - } - else - { - TranslatedLevelData dumpedLevelData = new TranslatedLevelData(levelData.Name, levelData.SerializedLevelData.boardConfig.startTip); - dumpData.Add(levelId, dumpedLevelData); - } - } - } - else - { - levelData.Name = StringStore.TranslateText(levelData.Name); - } - - string dumpPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_data.json"); - File.WriteAllText(dumpPath, System.Text.Json.JsonSerializer.Serialize(dumpData, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs deleted file mode 100644 index 91d43fc..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs +++ /dev/null @@ -1,49 +0,0 @@ -using HarmonyLib; -using Il2CppGameLevel.EventNodes; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.BaseTextObjects; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes -{ - [HarmonyPatch(typeof(RuntimeEventNodeEditor))] - public static class RuntimeEventNodeEditor_Patch - { - public static TMP_FontAsset fontAsset => FontStore.LoadTMPFont(Utils.Language.ToString()); - - [HarmonyPatch(nameof(RuntimeEventNodeEditor.Update))] - [HarmonyPostfix] - public static void Update(RuntimeEventNodeEditor __instance) - { - // translate the new screens (3.7) - TranslateFullTransform(__instance.nodeInfoPanel.transform); - TranslateFullTransform(__instance.attributePanel.transform); - TranslateFullTransform(__instance.canvas.transform); - if(__instance.TryGetComponent(out EventNodeContextMenu eventNodeContextMenu)) - { - TranslateFullTransform(eventNodeContextMenu.transform); - } - } - - public static void TranslateFullTransform(Transform transform) - { - if (transform == null) return; - - foreach(TextMeshProUGUI txt in transform.GetComponentsInChildren()) - { - txt.text = RuntimeNodeUI_Patch.TranslateCodeText(txt.text); - txt.font = fontAsset; - } - - foreach(TMP_InputField inputField in transform.GetComponentsInChildren()) - { - TMP_InputField_Patch.OnEnable(inputField); - foreach(TextMeshProUGUI txt in inputField.GetComponentsInChildren(true)) - { - txt.text = RuntimeNodeUI_Patch.TranslateCodeText(txt.text); - } - } - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs deleted file mode 100644 index 540f243..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs +++ /dev/null @@ -1,143 +0,0 @@ -using HarmonyLib; -using Il2CppGameLevel.EventNodes; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.BaseTextObjects; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes -{ - [HarmonyPatch(typeof(RuntimeNodeUI))] - public static class RuntimeNodeUI_Patch - { - [HarmonyPatch(nameof(RuntimeNodeUI.Awake))] - [HarmonyPatch(nameof(RuntimeNodeUI.CreatePorts))] - [HarmonyPatch(nameof(RuntimeNodeUI.CreateValueEditUI))] - [HarmonyPatch(nameof(RuntimeNodeUI.GetPortUI))] - [HarmonyPatch(nameof(RuntimeNodeUI.UpdateDisplay))] - [HarmonyPatch(nameof(RuntimeNodeUI.UpdateSelectionVisual))] - [HarmonyPatch(nameof(RuntimeNodeUI.UpdateVisable))] - [HarmonyPostfix] - public static void Post_UpdateDisplay(RuntimeNodeUI __instance) - { - if (!__instance.isActiveAndEnabled) return; - - if (__instance.Node == null) return; - - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - __instance.titleText.text = TranslateCodeText(__instance.titleText.text); - __instance.titleText.font = fontAsset; - - foreach(TextMeshProUGUI txt in __instance.inputPortsContainer.GetComponentsInChildren()) - { - txt.text = TranslateCodeText(txt.text); - txt.font = fontAsset; - } - - foreach(TextMeshProUGUI txt in __instance.outputPortsContainer.GetComponentsInChildren()) - { - txt.text = TranslateCodeText(txt.text); - txt.font = fontAsset; - } - - if ( - __instance.GetComponentsInChildren().Count == 0 - && __instance.GetComponentsInChildren().Count == 0 - && __instance.Node.nodeType != "PlantTypeValueNode" - && __instance.Node.nodeType != "SinglePlantTypeListNode" - && __instance.Node.nodeType != "ZombieTypeValueNode" - ) return; - - if (__instance.Node != null) - { - if(__instance.Node.nodeType == "PlantTypeValueNode") - { - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if(txt.gameObject.name.Contains("Label")) - { - if (Utils.CheckForUntranslatedText(txt.text)) - { - PlantTypeValueNode castedNode = __instance.Node.TryCast(); - if (castedNode != null) - { - string portName = castedNode.value_PortName; - string plantName = Utils.GetPlantNameFromAlmanac(castedNode.value, removeTags: true); - txt.text = (plantName != "") ? plantName : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } - } - } - - if(__instance.Node.nodeType == "SinglePlantTypeListNode") - { - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if (txt.gameObject.name.Contains("Label")) - { - if (Utils.CheckForUntranslatedText(txt.text)) - { - SinglePlantTypeListNode castedNode = __instance.Node.TryCast(); - if (castedNode != null) - { - string portName = castedNode.plantTypeList_PortName; - string plantName = Utils.GetPlantNameFromAlmanac(castedNode.plantType, removeTags: true); - txt.text = (plantName != "") ? plantName : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } - } - } - - if(__instance.Node.nodeType == "ZombieTypeValueNode") - { - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - if(txt.gameObject.name.Contains("Label")) - { - if(Utils.CheckForUntranslatedText(txt.text)) - { - ZombieTypeValueNode castedNode = __instance.Node.TryCast(); - if(castedNode != null) - { - string portName = castedNode.value_PortName; - string zombieName = Utils.GetZombieNameFromAlmanac(castedNode.value, removeTags: true); - txt.text = (zombieName != "") ? zombieName : StringStore.TranslateText(txt.text); - txt.font = fontAsset; - } - } - } - } - } - } - - if(__instance.GetComponentsInChildren().Count > 0) - { - foreach(TMP_Dropdown dropdown in __instance.GetComponentsInChildren()) - { - TMP_Dropdown_Patch.CreateDropdownList(dropdown); - } - } - - if(__instance.GetComponentsInChildren().Count > 0) - { - foreach(TMP_InputField inputField in __instance.GetComponentsInChildren()) - { - TMP_InputField_Patch.OnEnable(inputField); - foreach(TextMeshProUGUI txt in inputField.GetComponentsInChildren(true)) - { - txt.text = TranslateCodeText(txt.text); - } - } - } - } - - public static string TranslateCodeText(string originalText) - { - return StringStore.translationString.ContainsKey(originalText + "_code") ? StringStore.TranslateText(originalText + "_code") : StringStore.TranslateText(originalText); - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/GameLevel/LevelManager_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/GameLevel/LevelManager_Patch.cs deleted file mode 100644 index 57b919a..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/GameLevel/LevelManager_Patch.cs +++ /dev/null @@ -1,280 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppGameLevel; -using Il2CppGameLevel.EventNodes; -using MelonLoader; -using PvZ_Fusion_Translator.AssetStore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Threading.Tasks; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel -{ - [HarmonyPatch(typeof(LevelManager))] - public static class LevelManager_Patch - { - [HarmonyPatch(nameof(LevelManager.SaveLevelData))] - [HarmonyPrefix] - public static void Pre_SaveLevelData(LevelManager __instance, ref SerializedLevelData serializedLevelData) - { - if (serializedLevelData.name == "未命名关卡") - { - serializedLevelData.name = StringStore.translationString.ContainsKey("LEVEL_UNNAMED") ? StringStore.TranslateText("LEVEL_UNNAMED") : "Unnamed"; - } - } - - public static void ExportLevelStrings(SerializedLevelData serializedLevelData) - { - string levelDataString = JsonUtility.ToJson(serializedLevelData); - ReferenceLevelData referenceLevelData = Newtonsoft.Json.JsonConvert.DeserializeObject(levelDataString); - EventNodeGraph eventNodeGraph = serializedLevelData.eventNodeGraph; - eventNodeGraph.BuildCache(); - - List stringValueNodeIds = new List(); - List stringConcatNodeIds = new List(); - List showTextNodeIds = new List(); - List addOptionNodeIds = new List(); - - foreach (var reference in referenceLevelData.references.RefIds) - { - string nodeType = reference.data.nodeType; - string nodeId = reference.data.nodeId; - - if (nodeType == "ShowTextNode") - { - if(!showTextNodeIds.Contains(nodeId)) - { - showTextNodeIds.Add(nodeId); - } - } - else if (nodeType == "AddMultipleChoiceOptionNode") - { - if(!addOptionNodeIds.Contains(nodeId)) - { - addOptionNodeIds.Add(nodeId); - } - } - } - - foreach (var reference in referenceLevelData.references.RefIds) - { - string nodeType = reference.data.nodeType; - string nodeId = reference.data.nodeId; - - switch(nodeType) - { - case "StringValueNode": - case "FloatToStringNode": - case "StringConcatNode": - stringValueNodeIds.Add(nodeId); - if(nodeType == "StringConcatNode") - { - stringConcatNodeIds.Add(nodeId); - } - break; - default: - break; - } - } - - Dictionary> stringConcatNodePairs = new(); - - foreach(var connection in eventNodeGraph.connections) - { - string sourceNodeId = connection.sourceNodeId; - string sourcePortName = connection.sourcePortName; - string targetNodeId = connection.targetNodeId; - string targetPortName = connection.targetPortName; - - if(stringValueNodeIds.Contains(sourceNodeId)) - { - if(stringConcatNodeIds.Contains(targetNodeId)) - { - if(stringConcatNodePairs.ContainsKey(targetNodeId)) - { - ValueTuple temp = stringConcatNodePairs[targetNodeId]; - switch(targetPortName) - { - case "A": - temp.Item1 = sourceNodeId; - stringConcatNodePairs[targetNodeId] = temp; - break; - case "B": - temp.Item2 = sourceNodeId; - stringConcatNodePairs[targetNodeId] = temp; - break; - default: - break; - } - } - else - { - stringConcatNodePairs.Add(targetNodeId, new ValueTuple()); - ValueTuple temp = stringConcatNodePairs[targetNodeId]; - switch(targetPortName) - { - case "A": - temp.Item1 = sourceNodeId; - stringConcatNodePairs[targetNodeId] = temp; - break; - case "B": - temp.Item2 = sourceNodeId; - stringConcatNodePairs[targetNodeId] = temp; - break; - default: - break; - } - } - } - } - } - - string GetStringNodeValue(EventNodeBase eventNodeBase) - { - string stringValue = ""; - - switch(eventNodeBase.nodeType) - { - case "StringValueNode": - StringValueNode stringNode = eventNodeBase.TryCast(); - stringValue = stringNode.value; - break; - case "FloatToStringNode": - stringValue = "([^\\s]+)"; - break; - case "StringConcatNode": - StringConcatNode stringConcatNode = eventNodeBase.TryCast(); - stringConcatNode.InitializeConnections(eventNodeGraph); - stringValue = GetStringNodeValue(stringConcatNode.aSourceNode) + GetStringNodeValue(stringConcatNode.bSourceNode); - break; - default: - break; - } - - return stringValue; - } - - string baseDumpDir = FileLoader.GetAssetDir(FileLoader.AssetType.Dumps); - string levelDumpDir = Path.Combine(baseDumpDir, "CustomLevels.json"); - if (!File.Exists(levelDumpDir)) File.WriteAllText(levelDumpDir, "{}"); - Dictionary dump = JsonSerializer.Deserialize>(File.ReadAllText(levelDumpDir)); - - foreach(string showTextNodeId in showTextNodeIds) - { - ShowTextNode showTextNode = eventNodeGraph.GetNodeById(showTextNodeId).TryCast(); - showTextNode.InitializeConnections(eventNodeGraph); - string value = GetStringNodeValue(showTextNode.textSourceNode); - if (!dump.ContainsKey(value)) - { - dump.Add(value, value); - } - } - - foreach(string addOptionId in addOptionNodeIds) - { - AddMultipleChoiceOptionNode addOptionNode = eventNodeGraph.GetNodeById(addOptionId).TryCast(); - addOptionNode.InitializeConnections(eventNodeGraph); - string titleValue = GetStringNodeValue(addOptionNode.titleSourceNode); - if (!dump.ContainsKey(titleValue)) - { - dump.Add(titleValue, titleValue); - } - string descriptionValue = GetStringNodeValue(addOptionNode.descriptionSourceNode); - if (!dump.ContainsKey(descriptionValue)) - { - dump.Add(descriptionValue, descriptionValue); - } - } - - File.WriteAllText(levelDumpDir, JsonSerializer.Serialize(dump, new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping - })); - } - - // reference level data classes - - public class ReferenceLevelData - { - public References references { get; set; } - } - - public class Data - { - public string nodeId { get; set; } - public string nodeType { get; set; } - public Position position { get; set; } - public string nodeName { get; set; } - public string plant_PortName { get; set; } - public string column_PortName { get; set; } - public string row_PortName { get; set; } - public string plantType_PortName { get; set; } - public object value { get; set; } - public string value_PortName { get; set; } - public string plantTypeA_PortName { get; set; } - public string plantTypeB_PortName { get; set; } - public string equal_PortName { get; set; } - public string trigger_PortName { get; set; } - public string count_PortName { get; set; } - public string output_PortName { get; set; } - public string index_PortName { get; set; } - public string plants_PortName { get; set; } - public string plantList_PortName { get; set; } - public string loopBody_PortName { get; set; } - public string currentPlant_PortName { get; set; } - public string currentIndex_PortName { get; set; } - public string onCompleted_PortName { get; set; } - public string condition_PortName { get; set; } - public string then_PortName { get; set; } - public string else_PortName { get; set; } - public string a_PortName { get; set; } - public string b_PortName { get; set; } - public string result_PortName { get; set; } - public string shouldReset_PortName { get; set; } - public string onCount_PortName { get; set; } - public int? startValue { get; set; } - public string valueA_PortName { get; set; } - public string valueB_PortName { get; set; } - public string greater_PortName { get; set; } - public string less_PortName { get; set; } - public string displayText { get; set; } - public double? duration { get; set; } - public string text_PortName { get; set; } - public string duration_PortName { get; set; } - public string int_PortName { get; set; } - public string float_PortName { get; set; } - } - - public class Position - { - public double x { get; set; } - public double y { get; set; } - } - - public class References - { - public int version { get; set; } - public List RefIds { get; set; } - } - - public class RefId - { - public int rid { get; set; } - public Type type { get; set; } - public Data data { get; set; } - } - - public class Type - { - public string @class { get; set; } - public string ns { get; set; } - public string asm { get; set; } - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/RhythmGame/RhythmGameChartEditorUI_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/RhythmGame/RhythmGameChartEditorUI_Patch.cs deleted file mode 100644 index 1cd3db6..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/RhythmGame/RhythmGameChartEditorUI_Patch.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Il2Cpp; -using Il2CppRhythmGameEditor; -using Il2CppRhythmGame; -using HarmonyLib; -using UnityEngine; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.RhythmGameEditor -{ - [HarmonyPatch(typeof(RhythmGameChartEditorUI))] - public static class RhythmGameChartEditorUI_Patch - { - [HarmonyPatch(nameof(RhythmGameChartEditorUI.Awake))] - [HarmonyPostfix] - public static void Awake(RhythmGameChartEditorUI __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach(TextMeshProUGUI txt in __instance.GetComponentsInChildren()) - { - txt.font = fontAsset; - if (!Utils.CheckForUntranslatedText(txt.text)) continue; - txt.text = StringStore.TranslateText(txt.text); - } - - foreach(TextMeshProUGUI txt in __instance.dropdown.GetComponentsInChildren(true)) - { - txt.text = StringStore.TranslateText(txt.text); - } - } - - [HarmonyPatch(nameof(RhythmGameChartEditorUI.Start))] - [HarmonyPostfix] - public static void Start(RhythmGameChartEditorUI __instance) - { - Awake(__instance); - } - - [HarmonyPatch(nameof(RhythmGameChartEditorUI.InitializeSubSystems))] - [HarmonyPostfix] - public static void InitializeSubSystems(RhythmGameChartEditorUI __instance) - { - Awake(__instance); - } - - [HarmonyPatch(nameof(RhythmGameChartEditorUI.Update))] - [HarmonyPostfix] - public static void Update(RhythmGameChartEditorUI __instance) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - foreach(TextMeshProUGUI txt in __instance.transform.Find("TopPanel").GetComponentsInChildren()) - { - txt.font = fontAsset; - txt.text = StringStore.TranslateText(txt.text); - } - - foreach(TheButton btn in __instance.transform.GetComponentsInChildren()) - { - foreach(TextMeshProUGUI txt in btn.GetComponentsInChildren()) - { - if (!Utils.CheckForUntranslatedText(txt.text)) continue; - txt.text = StringStore.TranslateText(txt.text); - } - } - - foreach(TextMeshProUGUI txt in __instance.dropdown.GetComponentsInChildren(true)) - { - if (!Utils.CheckForUntranslatedText(txt.text)) continue; - txt.text = Utils.RemoveSizeTags(StringStore.TranslateText(txt.text)); - } - } - - [HarmonyPatch(nameof(RhythmGameChartEditorUI.UpdateUI))] - [HarmonyPostfix] - public static void UpdateUI(RhythmGameChartEditorUI __instance) - { - foreach(TextMeshProUGUI txt in __instance.dropdown.GetComponentsInChildren(true)) - { - txt.text = StringStore.TranslateText(txt.text); - } - } - - [HarmonyPatch(nameof(RhythmGameChartEditorUI.UpdateSelectedNoteInfo))] - [HarmonyPostfix] - public static void UpdateSelectedNoteInfo(RhythmGameChartEditorUI __instance) - { - __instance.selectedNoteInfoText.text = StringStore.TranslateText(__instance.selectedNoteInfoText.text); - } - } -} diff --git a/MelonLoader/Patches/Modes/Super Editor/RhythmGame/RhythmGameManager_Patch.cs b/MelonLoader/Patches/Modes/Super Editor/RhythmGame/RhythmGameManager_Patch.cs deleted file mode 100644 index e9e3eff..0000000 --- a/MelonLoader/Patches/Modes/Super Editor/RhythmGame/RhythmGameManager_Patch.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using Il2Cpp; -using Il2CppRhythmGame; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; - -namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.RhythmGameEditor -{ - [HarmonyPatch(typeof(RhythmGameManager))] - public static class RhythmGameManager_Patch - { - [HarmonyPatch(nameof(RhythmGameManager.Awake))] - [HarmonyPatch(nameof(RhythmGameManager.ComboUpdate))] - [HarmonyPostfix] - public static void Awake(RhythmGameManager __instance) - { - if(__instance.comboText) - { - __instance.comboText.autoSizeTextContainer = false; - __instance.comboText.ForceMeshUpdate(); - } - } - - [HarmonyPatch(nameof(RhythmGameManager.OnNoteClicked))] - [HarmonyPostfix] - public static void OnNoteClicked(RhythmGameManager __instance) - { - if (!__instance.particle) return; - - TextParticle txtParticle = __instance.particle.GetComponent(); - if(txtParticle) - { - TextMeshPro txt = txtParticle.text.GetComponent(); - - if(txt) - { - string originalKey = StringStore.translationString.FirstOrDefault(x => x.Value == txt.text).Key; - txt.text = StringStore.translationString.ContainsKey(originalKey + "_RG") ? StringStore.TranslateText(originalKey + "_RG") : StringStore.TranslateText(txt.text); - txt.autoSizeTextContainer = false; - txt.ForceMeshUpdate(); - } - } - } - } -} diff --git a/MelonLoader/Patches/OtherManagers/AchievementClip_Patch.cs b/MelonLoader/Patches/OtherManagers/AchievementClip_Patch.cs deleted file mode 100644 index 3b295f4..0000000 --- a/MelonLoader/Patches/OtherManagers/AchievementClip_Patch.cs +++ /dev/null @@ -1,71 +0,0 @@ -/*using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using Newtonsoft.Json; -using PvZ_Fusion_Translator.AssetStore; -using static PvZ_Fusion_Translator.FileLoader; -using static PvZ_Fusion_Translator.Patches.Managers.AlmanacPlantBank_Patch; - -namespace PvZ_Fusion_Translator.Patches.OtherManagers -{ - [HarmonyPatch(typeof(AchievementClip))] - public static class AchievementClip_Patch - { - [HarmonyPatch(nameof(AchievementClip.Start))] - [HarmonyPostfix] - private static void Start(AchievementClip __instance) - { - #if MULTI_LANGUAGE - string currentLanguage = Utils.Language.ToString(); - string achievementDir = GetAssetDir(AssetType.Almanac, Utils.Language); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(currentLanguage); - #else - string achievementDir = GetAssetDir(AssetType.Almanac); - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(); - #endif - string path = Path.Combine(achievementDir, "AchievementsTextTranslate.json"); - - #if OBFUSCATE - if (CheckSumStore.IsModified(path)) - { - Log.LogError("File {0} was modified!", path); - return; - } - #endif - - if (!File.Exists(path)) return; - - string json; - json = File.ReadAllText(path); - Dictionary achievementsTexts = new Dictionary(); - achievementsTexts = JsonConvert.DeserializeObject>(json); - - TextMeshProUGUI text1 = __instance.introduce.transform.GetChild(1).GetComponent(); - TextMeshProUGUI text2 = __instance.introduce.transform.GetChild(2).GetComponent(); - TextMeshProUGUI name1 = __instance.image.transform.GetChild(0).GetComponent(); - - - text1.text = achievementsTexts[__instance._index].Name; - text1.font = fontAsset; - text2.text = achievementsTexts[__instance._index].Name; - text2.font = fontAsset; - name1.text = achievementsTexts[__instance._index].Text; - name1.font = fontAsset; - } - } - - public class AchievementObject - { - public Achievement achievement { get; set; } - public string Name { get; set; } - public string Text { get; set; } - - public AchievementObject(Achievement achievement = Achievement.Welcome, string name = "", string text = "") - { - this.achievement = achievement; - Name = name; - Text = text; - } - } -} -*/ \ No newline at end of file diff --git a/MelonLoader/Patches/OtherManagers/GardenUI_Patch.cs b/MelonLoader/Patches/OtherManagers/GardenUI_Patch.cs deleted file mode 100644 index 6219f62..0000000 --- a/MelonLoader/Patches/OtherManagers/GardenUI_Patch.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using PvZ_Fusion_Translator.AssetStore; -using UnityEngine; -using Il2CppZenGarden; - -namespace PvZ_Fusion_Translator.Patches.OtherManagers -{ - [HarmonyPatch(typeof(GardenUI))] - public static class GardenUI_Patch - { - [HarmonyPatch(nameof(GardenUI.Update))] - [HarmonyPostfix] - public static void Update(GardenUI __instance) - { - __instance.currentPageText = StringStore.TranslateText(__instance.currentPageText, false); - - // Transform PageText = __instance.transform.Find("PageText"); - // StringStore.TranslateTextTransform(PageText.transform); - } - } -} diff --git a/MelonLoader/Patches/OtherManagers/MenuText_Patch.cs b/MelonLoader/Patches/OtherManagers/MenuText_Patch.cs deleted file mode 100644 index be63d9f..0000000 --- a/MelonLoader/Patches/OtherManagers/MenuText_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if FIX -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.OtherManagers -{ - [HarmonyPatch(typeof(MenuText))] - public static class MenuText_Patch - { - [HarmonyPatch(nameof(MenuText.UpdateText), new Type[] { typeof(string) })] - [HarmonyPostfix] - private static void UpdateTextPatch(MenuText __instance) - { - TextMeshProUGUI text_1 = __instance.transform.GetChild(0).Find("text1").GetComponent(); - text_1.text = StringStore.TranslateText(text_1.text); - TextMeshProUGUI text = __instance.transform.GetChild(0).Find("text").GetComponent(); - text.text = StringStore.TranslateText(text_1.text); - } - } -} -#endif \ No newline at end of file diff --git a/MelonLoader/Patches/OtherManagers/ThanksMenu_Patch.cs b/MelonLoader/Patches/OtherManagers/ThanksMenu_Patch.cs deleted file mode 100644 index 267a80b..0000000 --- a/MelonLoader/Patches/OtherManagers/ThanksMenu_Patch.cs +++ /dev/null @@ -1,23 +0,0 @@ -using HarmonyLib; -using Il2Cpp; -using Il2CppTMPro; -using PvZ_Fusion_Translator.AssetStore; - -namespace PvZ_Fusion_Translator.Patches.OtherManagers -{ - [HarmonyPatch(typeof(ThanksMenu))] - public class ThanksMenu_Patch - { - [HarmonyPostfix] - [HarmonyPatch(nameof(ThanksMenu.Update))] - private static void Update(ThanksMenu __instance) - { - TextMeshProUGUI textTransform = __instance.transform.GetChild(0).GetComponent(); - if (textTransform != null) - { - textTransform.text = StringStore.TranslateText(textTransform.text); - textTransform.autoSizeTextContainer = true; - } - } - } -} \ No newline at end of file diff --git a/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj b/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj deleted file mode 100644 index 816e321..0000000 --- a/MelonLoader/PvZ Fusion Translator [MelonLoader].csproj +++ /dev/null @@ -1,596 +0,0 @@ - - - net6.0 - enable - disable - PvZ_Fusion_Translator - default - false - 1.0.0.0 - 1.0.0.0 - en-US - PvZ_Fusion_Translator - latest - enable - Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate - D:\PvZ Fusion\Game Files - AnyCPU;ARM64;x64 - - - - - - - - - - - - - - - - - - - - - - - $(GamePath)\Mods\AudioImportLib.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Assembly-CSharp.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2CppMono.Security.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2Cppmscorlib.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2CppSystem.Configuration.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2CppSystem.Core.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2CppSystem.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2CppSystem.Xml.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2Cpp__Generated.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.2D.Animation.Runtime.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.Burst.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.Burst.Unsafe.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.Collections.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.Collections.LowLevel.ILSupport.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.InternalAPIEngineBridge.001.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.Mathematics.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.RenderPipeline.Universal.ShaderLibrary.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.RenderPipelines.Core.Runtime.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.RenderPipelines.Universal.Runtime.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.TextMeshPro.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Unity.VisualScripting.Core.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.AccessibilityModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.AIModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.AndroidJNIModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.AnimationModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ARModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.AssetBundleModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.AudioModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ClothModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ContentLoadModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.CoreModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.CrashReportingModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.DirectorModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.DSPGraphModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.GameCenterModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.GIModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.GridModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.HotReloadModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ImageConversionModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.IMGUIModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.InputModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.JSONSerializeModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.LocalizationModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ParticleSystemModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.PerformanceReportingModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.Physics2DModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.PhysicsModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ProfilerModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.PropertiesModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.ScreenCaptureModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.SharedInternalsModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.SpriteMaskModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.SpriteShapeModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.StreamingModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.SubstanceModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.SubsystemsModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TerrainModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TerrainPhysicsModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TextCoreFontEngineModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TextCoreTextEngineModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TextRenderingModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TilemapModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.TLSModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UI.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UIElementsModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UIModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UmbraModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityAnalyticsCommonModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityAnalyticsModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityConnectModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityCurlModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityTestProtocolModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityWebRequestAssetBundleModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityWebRequestAudioModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityWebRequestModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityWebRequestTextureModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.UnityWebRequestWWWModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.VehiclesModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.VFXModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.VideoModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.VRModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.WindModule.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\UnityEngine.XRModule.dll - - - $(GamePath)\MelonLoader\net6\MelonLoader.dll - - - $(GamePath)\MelonLoader\net6\0Harmony.dll - - - $(GamePath)\MelonLoader\net6\Il2CppInterop.Runtime.dll - - - $(GamePath)\MelonLoader\net6\Il2CppInterop.Common.dll - - - $(GamePath)\MelonLoader\Il2CppAssemblies\Il2CppCore.dll - - - - - - True - false - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;DEBUG;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;TESTING;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;TESTING;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;CHEAT;TESTING;DEBUG - - - - $(DefineConstants);CHEAT;DEBUG - - - - $(DefineConstants);CHEAT;DEBUG - - - - $(DefineConstants);CHEAT;DEBUG - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE - - - - $(DefineConstants);OTHER;OBFUSCATE - - - - $(DefineConstants);OTHER;OBFUSCATE - - - - $(DefineConstants);OTHER;OBFUSCATE - - - - $(DefineConstants);MULTI_LANGUAGE;OBFUSCATE;RELEASE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MelonLoader/Utils.cs b/MelonLoader/Utils.cs deleted file mode 100644 index 375a205..0000000 --- a/MelonLoader/Utils.cs +++ /dev/null @@ -1,704 +0,0 @@ -using Harmony; -using Il2Cpp; -using Il2CppTMPro; -using MelonLoader; -using MelonLoader.TinyJSON; -using Newtonsoft.Json; -using PvZ_Fusion_Translator.AssetStore; -using PvZ_Fusion_Translator.Patches.GameObjects; -using PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; -using PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; -using PvZ_Fusion_Translator.Patches.Modes.Super_Editor; -using System.Diagnostics; -using System.Reflection; -using System.Text.RegularExpressions; -using Unity.Burst.Intrinsics; -using UnityEngine; -using UnityEngine.Events; -using UnityEngine.Experimental.Rendering; -using UnityEngine.UI; -using static MelonLoader.MelonLogger; -using static PvZ_Fusion_Translator.FileLoader; - -namespace PvZ_Fusion_Translator -{ - public class Utils - { - internal static bool TryReplaceTexture2D(Texture2D ogTexture) - { - if (ogTexture != null) - { - if (TextureStore.textureDict.TryGetValue(ogTexture.name, out byte[] textureData)) - { - try - { - ImageConversion.LoadImage(ogTexture, textureData); - - Log.LogDebug("OK! Replaced Texture " + ogTexture.name); - - ogTexture.name = "replaced_" + ogTexture.name; - return true; - } - catch (Exception ex) - { - Log.LogError("Failed to replace texture: " + ogTexture.name); - Log.LogError(ex.ToString()); - } - } - } - return false; - } - - internal static Texture2D LoadImage(string path) - { - if (!File.Exists(path)) - { - throw new FileNotFoundException($"The image file at path '{path}' does not exist."); - } - - byte[] array = File.ReadAllBytes(path); - Texture2D texture2D = new(2, 2, GraphicsFormat.R8G8B8A8_UNorm, TextureCreationFlags.None, 1, IntPtr.Zero, null); - ImageConversion.LoadImage(texture2D, array); - return texture2D; - } - - internal static Texture2D LoadImage(byte[] bytes) - { - if (bytes == null) - { - throw new FileNotFoundException($"Byte array was null."); - } - - byte[] array = bytes; - Texture2D texture2D = new(2, 2, GraphicsFormat.R8G8B8A8_UNorm, TextureCreationFlags.None, 1, IntPtr.Zero, null); - ImageConversion.LoadImage(texture2D, array); - return texture2D; - } - - public static Color HexToColor(string hex) - { - - hex = hex.Replace("#", ""); - - float r = int.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber) / 255f; - float g = int.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber) / 255f; - float b = int.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber) / 255f; - - return new Color(r, g, b); - } - - public static void OpenSaveDirectory() - { - string saveDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData", "LocalLow", "LanPiaoPiao", "PlantsVsZombiesRH"); - Process.Start("explorer.exe", saveDirectory); - } - - public static void OpenOnlineAlmanac() - { - string website = "https://carroti4ch.itch.io/almanac"; - Process.Start(new ProcessStartInfo(website) { UseShellExecute = true }); - } - - public static string RemoveColorTags(string text) - { - if (string.IsNullOrEmpty(text)) - return text ?? string.Empty; - - // Remove opening color tags like - string withoutOpenTags = Regex.Replace(text, @"]+>", string.Empty, RegexOptions.IgnoreCase); - // Remove closing color tags like - string withoutCloseTags = Regex.Replace(withoutOpenTags, @"", string.Empty, RegexOptions.IgnoreCase); - return withoutCloseTags; - } - - public static string RemoveSizeTags(string text) - { - if (string.IsNullOrEmpty(text)) - return text ?? string.Empty; - - // Remove opening size tags like - string withoutOpenTags = Regex.Replace(text, @"]+>", string.Empty, RegexOptions.IgnoreCase); - // Remove closing size tags like - string withoutCloseTags = Regex.Replace(withoutOpenTags, @"", string.Empty, RegexOptions.IgnoreCase); - return withoutCloseTags; - } - - public static string RemoveFormatTags(string text) - { - if (string.IsNullOrEmpty(text)) - return text ?? string.Empty; - - string withoutUnderlineTags = Regex.Replace(text, @"", string.Empty, RegexOptions.IgnoreCase); - string withoutUnderlineCloseTags = Regex.Replace(withoutUnderlineTags, @"", string.Empty, RegexOptions.IgnoreCase); - string withoutItalicTags = Regex.Replace(withoutUnderlineCloseTags, @"", string.Empty, RegexOptions.IgnoreCase); - string withoutItalicCloseTags = Regex.Replace(withoutItalicTags, @"", string.Empty, RegexOptions.IgnoreCase); - - return withoutItalicCloseTags; - } - - public static string RemoveAllTags(string text) - { - if (string.IsNullOrEmpty(text)) - return text ?? string.Empty; - - return RemoveColorTags(RemoveSizeTags(RemoveFormatTags(text))); - } - - public static GameObject ConvertToTextMeshProUGUI(GameObject originalText, Transform parent, string name) - { - GameObject newObj = new GameObject(name); - newObj.transform.position = originalText.transform.position; - newObj.AddComponent(); - newObj.AddComponent(); - newObj.AddComponent(); - newObj.transform.SetParent(parent); - newObj.transform.localScale = Vector3.one; - - UnityEngine.Object.Destroy(originalText); - return newObj; - } - - public static void ConvertButtonText(Transform original, string name) - { - TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); - - Transform transform = original.FindChild(name); - Transform textTransform = transform.FindChild("text"); - string text = textTransform.GetComponent().text; - Color color = textTransform.GetComponent().color; - - TextMeshProUGUI newGoBackText = Utils.ConvertToTextMeshProUGUI(textTransform.gameObject, transform, "text2").GetComponent(); - newGoBackText.autoSizeTextContainer = true; - newGoBackText.text = StringStore.TranslateText(text, false); - newGoBackText.font = fontAsset; - newGoBackText.color = color; - } - - public static string GetPlantNameFromAlmanac(PlantType thePlantType, bool removeTags = false, bool log = false) - { - bool foundPlantName = false; - string thePlantName = ""; - - if(plantIndices.ContainsKey((int)thePlantType)) - { - foundPlantName = true; - thePlantName = plantIndices[(int)thePlantType].Value; - } - - if (!foundPlantName) - { - if(log) - { - Log.LogInfo("Couldn't find plant name!"); - } - thePlantName = ""; - } - - thePlantName = (removeTags) ? RemoveAllTags(thePlantName) : thePlantName; - - return thePlantName; - } - - public static string GetPlantNameFromAlmanac(string theOriginalPlantName, bool removeTags = false, bool log = false) - { - bool foundPlantName = false; - string thePlantName = ""; - - if(plantIndiceString.ContainsKey(theOriginalPlantName)) - { - foundPlantName = true; - thePlantName = plantIndiceString[theOriginalPlantName]; - } - - if (!foundPlantName) - { - if(log) - { - Log.LogInfo("Couldn't find plant name!"); - } - thePlantName = ""; - } - - thePlantName = (removeTags) ? RemoveAllTags(thePlantName) : thePlantName; - - return thePlantName; - } - - public static string GetZombieNameFromAlmanac(ZombieType theZombieType, bool removeTags = false) - { - string json; - string theZombieName = ""; - - string currentLanguage = Utils.Language.ToString(); - - json = AlmanacZombieMenu_Patch.almanacJson; - Il2CppAlmanacData.AlmanacData zombieData = JsonUtility.FromJson(json); - - foreach (Il2CppAlmanacData.ZombieInfo zombieInfo in zombieData.zombies) - { - if ((int)zombieInfo.theZombieType == (int)theZombieType) - { - theZombieName = zombieInfo.name; - } - } - - theZombieName = (removeTags) ? RemoveAllTags(theZombieName) : theZombieName; - - return theZombieName; - } - - public static Dictionary> plantIndices = new Dictionary>(); - public static Dictionary plantIndiceString = new Dictionary(); - - public static void RegisterPlantIndices() - { - plantIndices = new Dictionary>(); - plantIndiceString = new Dictionary(); - string originalJson; - string translatedJson; - - string currentLanguage = Utils.Language.ToString(); - string almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); - string dumpDir = GetAssetDir(AssetType.Dumps); - string originalPath = Path.Combine(dumpDir, "LawnStrings.json"); - string path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); - - if ((!File.Exists(originalPath))) - { - Log.LogError($"LawnStrings.json file not found at path: {originalPath}"); - } - else - { - try - { - originalJson = File.ReadAllText(originalPath); - translatedJson = AlmanacPlantMenu_Patch.almanacJson; - Il2CppAlmanacData.AlmanacData originalPlantData = JsonUtility.FromJson(originalJson); - Il2CppAlmanacData.AlmanacData translatedPlantData = JsonUtility.FromJson(translatedJson); - - foreach (Il2CppAlmanacData.PlantInfo originalPlantInfo in originalPlantData.plants) - { - if(!plantIndiceString.ContainsKey(originalPlantInfo.name)) - { - plantIndiceString.Add(originalPlantInfo.name, originalPlantInfo.name); - } - Il2CppAlmanacData.PlantInfo translatedPlantInfo = null; - - foreach (Il2CppAlmanacData.PlantInfo info in translatedPlantData.plants) - { - if (info.seedType == originalPlantInfo.seedType) - { - translatedPlantInfo = info; - } - } - - if (translatedPlantInfo != null) - { - if(translatedPlantInfo.name != null) - { - KeyValuePair temp = new KeyValuePair(translatedPlantInfo.seedType, translatedPlantInfo.name); - plantIndices.Add(originalPlantInfo.seedType, temp); - plantIndiceString[originalPlantInfo.name] = translatedPlantInfo.name; - } - } - } - } - catch (Exception e) - { - Log.LogError(e); - } - } - } - - public static void TryAdd(Dictionary dict, A key, B val) - { - if (dict.ContainsKey(key)) - { - dict[key] = val; - } - else - { - dict.Add(key, val); - } - } - - public static void TryAdd(SortedDictionary dict, A key, B val) - { - if (dict.ContainsKey(key)) - { - dict[key] = val; - } - else - { - dict.Add(key, val); - } - } - - public static AssetBundle GetAssetBundle(Assembly assembly, string assetBundlePath, bool log = false) - { - try - { - if (assembly != null) - { - Stream manifestResourceStream = assembly.GetManifestResourceStream($"PvZ_Fusion_Translator.Resources.{assetBundlePath}"); - using (manifestResourceStream) - { - if (manifestResourceStream == null) - { - throw new Exception("Stream was null."); - } - - byte[] array = new byte[manifestResourceStream.Length]; - manifestResourceStream.Read(array, 0, array.Length); - AssetBundle assetBundle = AssetBundle.LoadFromMemory(array); - ArgumentNullException.ThrowIfNull(assetBundle, "assetBundle"); - if(log) - { - Log.LogDebug($"AssetBundle {assetBundlePath} has successfully been loaded."); - } - return assetBundle; - } - } - - throw new Exception($"AssetBundle {assetBundlePath} was null."); - } - catch (Exception value) - { - throw new ArgumentException($"Failed to load {assetBundlePath}. \n{value}"); - } - } - - public static AssetBundle GetAssetBundle(string path) - { - AssetBundle assetBundle = AssetBundle.LoadFromFile(path); - return assetBundle; - } - - /*public static Dictionary> recipeLinks = new Dictionary>(); - - public static void RegisterRecipeLinks() - { - recipeLinks.Clear(); - - Il2CppSystem.Array mixData = MixData.data.Cast(); - int rows = mixData.GetLength(0); - int columns = mixData.GetLength(1); - - foreach (PlantType plantType in Enum.GetValues(typeof(PlantType))) - { - int seedType = (int)plantType; - - recipeLinks.Add(seedType, new()); - - if (seedType > 0) - { - foreach (PlantType checkType in Enum.GetValues(typeof(PlantType))) - { - if (checkType > 0) - { - int[] checks = [mixData.GetValue(seedType, (int)checkType).Unbox(), mixData.GetValue((int)checkType, seedType).Unbox()]; - - if (checks[0] != 0) - { - recipeLinks[seedType].Add(checks[0]); - } - - if (checks[1] != 0) - { - recipeLinks[seedType].Add(checks[1]); - } - } - } - } - if (recipeLinks[seedType].Count > 0) - { - Log.LogDebug($"Found {recipeLinks[seedType].Count} fusions for {seedType}!"); - } - } - }*/ - - public static Regex untranslatedRegex = new("\\p{IsCJKUnifiedIdeographs}+"); - - public static bool CheckForUntranslatedText(string text) - { - try - { - Match match = untranslatedRegex.Match(text); - return match.Success; - } - catch(Exception e) - { - Log.LogError(e); - } - return false; - } - - public static bool useLocal = MelonPreferences.GetEntryValue("PvZ_Fusion_Translator", "UseLocal"); - - public static void WarnLocalData() - { - BaseMenu newMenu = GameAPP.UIManager.Push(UIType.ConfirmMenu, GameAPP.canvasUp); - ConfirmMenu confirmMenu = newMenu.gameObject.GetComponent(); - - string modeTo = (Utils.useLocal) ? "online mode" : "local mode"; - confirmMenu.SetTitle($"WARNING: This button is meant for translator testing and can overwrite/interfere with the translation files saved in your installation. Proceed with caution. You are switching to {modeTo}.\nOnline Mode: Default, strings will auto-sync with the latest version when opening the game\nLocal Mode: Strings are only loaded from your installaion and do not update (meant for translators)"); - confirmMenu.transform.Find("window/text").GetComponent().text = Utils.RemoveColorTags(confirmMenu.transform.Find("window/text").GetComponent().text); - UIButton confirmButton = confirmMenu.transform.Find("Image").GetComponent(); - UIButton cancelButton = confirmMenu.transform.Find("Image2").GetComponent(); - - confirmButton.clickEvent = new UnityEvent(); - confirmButton.clickEvent.AddListener(new Action(() => SwapLocalData())); - confirmButton.clickEvent.AddListener(new Action(() => CursorChange.SetDefaultCursor())); - confirmButton.clickEvent.AddListener(new Action(() => GameAPP.UIManager.Pop())); - } - - public static void SwapLocalData() - { - Utils.useLocal = (Utils.useLocal) ? false : true; - MelonPreferences.SetEntryValue("PvZ_Fusion_Translator", "UseLocal", Utils.useLocal); - ChangeLanguage(Utils.Language.ToString()); - string sourceMsg = "" + (!(Utils.useLocal) ? "Translation Source:\nOnline" : "Translation Source:\nLocal"); - OptLanguageBtn_Patch.FlashMessage(OptLanguageBtn_Patch.toggleSlots[2], sourceMsg, 0.1f, false); - CursorChange.SetDefaultCursor(); - } - - public static async Task GetDataFromWeb(string url, bool isLog = true) - { - if (isLog) - { - Log.LogInfo($"Attempting to read {url}"); - } - HttpClient client = new HttpClient(); - try - { - var dataRequest = await client.GetAsync(url); - if(dataRequest.StatusCode == System.Net.HttpStatusCode.OK) - { - if (isLog) - { - Log.LogInfo($"Successfully loaded data from {url}!"); - } - - string content = await dataRequest.Content.ReadAsStringAsync(); - return content; - } - else - { - if (isLog) - { - Log.LogError($"Failed to load data from {url}! Falling back..."); - Log.LogError($"Status code: {dataRequest.StatusCode}"); - } - new CancellationTokenSource().Cancel(); - return null; - } - } - catch(Exception ex) - { - Log.LogError($"Failed to load data from {url}! Falling back..."); - Log.LogError(ex); - new CancellationTokenSource().Cancel(); - return null; - } - } - - public static async Task GetByteDataFromWeb(string url, bool isLog = true) - { - if (isLog) - { - Log.LogInfo($"Attempting to read {url}"); - } - HttpClient client = new HttpClient(); - try - { - var dataRequest = await client.GetAsync(url); - if (dataRequest.StatusCode == System.Net.HttpStatusCode.OK) - { - if (isLog) - { - Log.LogInfo($"Successfully loaded data from {url}!"); - } - - byte[] content = await dataRequest.Content.ReadAsByteArrayAsync(); - return content; - } - else - { - if (isLog) - { - Log.LogError($"Failed to load data from {url}! Falling back..."); - Log.LogError($"Status code: {dataRequest.StatusCode}"); - } - new CancellationTokenSource().Cancel(); - return null; - } - } - catch(Exception ex) - { - Log.LogError($"Failed to load data from {url}! Falling back..."); - Log.LogError(ex); - new CancellationTokenSource().Cancel(); - return null; - } - } - - public static async Task GetDataFromWebWithInput(string url, bool isLog = true) - { - if (isLog) - { - Log.LogInfo($"Attempting to read {url}"); - } - HttpClient client = new HttpClient(); - - using var request = new HttpRequestMessage() - { - Method = HttpMethod.Get, - RequestUri = new Uri(url) - }; - request.Headers.Add("Accept", "*/*"); - request.Headers.Add("Accept-Encoding", "gzip, deflate, br"); - request.Headers.Add("User-Agent", "TranslatorMod"); - - - var dataRequest = await client.SendAsync(request); - if(dataRequest.StatusCode == System.Net.HttpStatusCode.OK) - { - if (isLog) - { - Log.LogInfo($"Successfully loaded data from {url}!"); - } - - string content = await dataRequest.Content.ReadAsStringAsync(); - return content; - } - else - { - if (isLog) - { - Log.LogError($"Failed to load data from {url}! Falling back..."); - Log.LogError($"Status code: {dataRequest.StatusCode}"); - } - new CancellationTokenSource().Cancel(); - return null; - } - } - - public static int CalculateGameVersion(string gameVersion) - { - int res = 0; - string[] gameVersionParts = gameVersion.Split('.'); - - int startingPower = (int)Math.Max(gameVersionParts.Length, 3); - for (int i = 0; i < startingPower; i++) - { - int factor = 0; - if (i < gameVersionParts.Length) - { - factor = int.Parse(gameVersionParts[i]); - } - int power = startingPower - i; - res += factor * (int)Math.Pow(10, power - 1); - } - - return res; - } - - #if MULTI_LANGUAGE - internal static void ChangeLanguage(string language) - { - OldLanguage = Language; - - if (Enum.TryParse(language, out Utils.LanguageEnum lang)) - { - Utils.Language = lang; - } - else - { - // Handle invalid language string - Log.LogError($"Invalid language string: {language}"); - } - - //WarningStore.isWarningMessageLoaded = false; - FontStore.Reload(); - StringStore.Reload(); - TextureStore.Reload(); - FileLoader.SaveLanguage(); - RegisterPlantIndices(); - Zombie_Patch.LoadHPStrings(); - } - #endif - - #if MULTI_LANGUAGE - public static Utils.LanguageEnum OldLanguage; - #endif - - public static Utils.LanguageEnum Language; - - public static bool customTextures = !MelonPreferences.GetEntryValue("PvZ_Fusion_Translator", "DefaultTextures"); - public static bool customAudio = !MelonPreferences.GetEntryValue("PvZ_Fusion_Translator", "DefaultAudio"); - - public enum LanguageEnum - { - // first column - English, - Chinese_cn, - French, - //Italian, - German, - Spanish, - - - // second column - //Portuguese, - //Javanese, - //Filipino, - Vietnamese, - Indonesian, - //Russian, //NOTE: legacy language - Japanese, - - - // third column - Korean, - Ukrainian, - // Slovak, - //Polish, - //Turkish, - Arabic, - Romanian, - - LANG_END - } - - public static Dictionary LanguageNames = new Dictionary() - { - { LanguageEnum.English, "English"}, - { LanguageEnum.Chinese_cn, "简体中文"}, - { LanguageEnum.French, "Français"}, - { LanguageEnum.German, "Deutsch"}, - { LanguageEnum.Spanish, "Español"}, - { LanguageEnum.Vietnamese, "Tiếng Việt"}, - { LanguageEnum.Indonesian, "Bahasa Indonesia"}, - { LanguageEnum.Japanese, "日本語"}, - { LanguageEnum.Korean, "한국어"}, - { LanguageEnum.Ukrainian, "українська"}, - { LanguageEnum.Arabic, "ﺔﻴﺑﺮﻌﻟا"}, - { LanguageEnum.Romanian, "Română"} - }; - - public static Dictionary ToggleNames = new Dictionary() - { - { ToggleEnum.Textures, "Change Texture\nSource"}, - { ToggleEnum.Audio, "Change Audio\nSource"}, - { ToggleEnum.SwapLocal, "Change Translation\nSource"} - }; - - public enum ToggleEnum - { - Textures, - Audio, - SwapLocal, - TOGGLE_END - } - } -} \ No newline at end of file diff --git a/PvZ Fusion Translator.sln b/PvZ Fusion Translator.sln deleted file mode 100644 index 7b38d36..0000000 --- a/PvZ Fusion Translator.sln +++ /dev/null @@ -1,146 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.7.11911.148 stable -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}" - ProjectSection(SolutionItems) = preProject - README.md = README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PvZ Fusion Translator [BepInEx]", "BepInEx\PvZ Fusion Translator [BepInEx].csproj", "{395E60A0-A884-61F2-EF18-BC94BB7D9C69}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PvZ Fusion Translator [MelonLoader]", "MelonLoader\PvZ Fusion Translator [MelonLoader].csproj", "{A058E167-7411-D3CA-0C9F-40F030C12860}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - DebugEnglish|Any CPU = DebugEnglish|Any CPU - DebugEnglish|ARM64 = DebugEnglish|ARM64 - DebugEnglish|x64 = DebugEnglish|x64 - DebugObfuscate|Any CPU = DebugObfuscate|Any CPU - DebugObfuscate|ARM64 = DebugObfuscate|ARM64 - DebugObfuscate|x64 = DebugObfuscate|x64 - DebugTesting|Any CPU = DebugTesting|Any CPU - DebugTesting|ARM64 = DebugTesting|ARM64 - DebugTesting|x64 = DebugTesting|x64 - ReleaseEnglish|Any CPU = ReleaseEnglish|Any CPU - ReleaseEnglish|ARM64 = ReleaseEnglish|ARM64 - ReleaseEnglish|x64 = ReleaseEnglish|x64 - ReleaseMulti|Any CPU = ReleaseMulti|Any CPU - ReleaseMulti|ARM64 = ReleaseMulti|ARM64 - ReleaseMulti|x64 = ReleaseMulti|x64 - ReleaseObfuscate|Any CPU = ReleaseObfuscate|Any CPU - ReleaseObfuscate|ARM64 = ReleaseObfuscate|ARM64 - ReleaseObfuscate|x64 = ReleaseObfuscate|x64 - ReleaseOther|Any CPU = ReleaseOther|Any CPU - ReleaseOther|ARM64 = ReleaseOther|ARM64 - ReleaseOther|x64 = ReleaseOther|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|Any CPU.Build.0 = Debug|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|ARM64.Build.0 = Debug|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|x64.ActiveCfg = Debug|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.Debug|x64.Build.0 = Debug|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|Any CPU.ActiveCfg = DebugEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|Any CPU.Build.0 = DebugEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|ARM64.ActiveCfg = DebugEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|ARM64.Build.0 = DebugEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|x64.ActiveCfg = DebugEnglish|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugEnglish|x64.Build.0 = DebugEnglish|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|Any CPU.ActiveCfg = DebugObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|Any CPU.Build.0 = DebugObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|ARM64.ActiveCfg = DebugObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|ARM64.Build.0 = DebugObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|x64.ActiveCfg = DebugObfuscate|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugObfuscate|x64.Build.0 = DebugObfuscate|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|Any CPU.ActiveCfg = DebugTesting|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|Any CPU.Build.0 = DebugTesting|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|ARM64.ActiveCfg = DebugTesting|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|ARM64.Build.0 = DebugTesting|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|x64.ActiveCfg = DebugTesting|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.DebugTesting|x64.Build.0 = DebugTesting|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|Any CPU.ActiveCfg = ReleaseEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|Any CPU.Build.0 = ReleaseEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|ARM64.ActiveCfg = ReleaseEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|ARM64.Build.0 = ReleaseEnglish|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|x64.ActiveCfg = ReleaseEnglish|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseEnglish|x64.Build.0 = ReleaseEnglish|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|Any CPU.ActiveCfg = ReleaseMulti|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|Any CPU.Build.0 = ReleaseMulti|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|ARM64.ActiveCfg = ReleaseMulti|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|ARM64.Build.0 = ReleaseMulti|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|x64.ActiveCfg = ReleaseMulti|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseMulti|x64.Build.0 = ReleaseMulti|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|Any CPU.ActiveCfg = ReleaseObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|Any CPU.Build.0 = ReleaseObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|ARM64.ActiveCfg = ReleaseObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|ARM64.Build.0 = ReleaseObfuscate|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|x64.ActiveCfg = ReleaseObfuscate|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseObfuscate|x64.Build.0 = ReleaseObfuscate|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|Any CPU.ActiveCfg = ReleaseOther|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|Any CPU.Build.0 = ReleaseOther|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|ARM64.ActiveCfg = ReleaseOther|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|ARM64.Build.0 = ReleaseOther|Any CPU - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|x64.ActiveCfg = ReleaseOther|x64 - {395E60A0-A884-61F2-EF18-BC94BB7D9C69}.ReleaseOther|x64.Build.0 = ReleaseOther|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.Debug|ARM64.Build.0 = Debug|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.Debug|x64.ActiveCfg = Debug|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.Debug|x64.Build.0 = Debug|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugEnglish|Any CPU.ActiveCfg = DebugEnglish|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugEnglish|Any CPU.Build.0 = DebugEnglish|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugEnglish|ARM64.ActiveCfg = DebugEnglish|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugEnglish|ARM64.Build.0 = DebugEnglish|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugEnglish|x64.ActiveCfg = DebugEnglish|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugEnglish|x64.Build.0 = DebugEnglish|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugObfuscate|Any CPU.ActiveCfg = DebugObfuscate|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugObfuscate|Any CPU.Build.0 = DebugObfuscate|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugObfuscate|ARM64.ActiveCfg = DebugObfuscate|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugObfuscate|ARM64.Build.0 = DebugObfuscate|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugObfuscate|x64.ActiveCfg = DebugObfuscate|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugObfuscate|x64.Build.0 = DebugObfuscate|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugTesting|Any CPU.ActiveCfg = DebugTesting|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugTesting|Any CPU.Build.0 = DebugTesting|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugTesting|ARM64.ActiveCfg = DebugTesting|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugTesting|ARM64.Build.0 = DebugTesting|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugTesting|x64.ActiveCfg = DebugTesting|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.DebugTesting|x64.Build.0 = DebugTesting|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseEnglish|Any CPU.ActiveCfg = ReleaseEnglish|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseEnglish|Any CPU.Build.0 = ReleaseEnglish|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseEnglish|ARM64.ActiveCfg = ReleaseEnglish|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseEnglish|ARM64.Build.0 = ReleaseEnglish|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseEnglish|x64.ActiveCfg = ReleaseEnglish|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseEnglish|x64.Build.0 = ReleaseEnglish|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseMulti|Any CPU.ActiveCfg = ReleaseMulti|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseMulti|Any CPU.Build.0 = ReleaseMulti|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseMulti|ARM64.ActiveCfg = ReleaseMulti|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseMulti|ARM64.Build.0 = ReleaseMulti|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseMulti|x64.ActiveCfg = ReleaseMulti|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseMulti|x64.Build.0 = ReleaseMulti|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseObfuscate|Any CPU.ActiveCfg = ReleaseObfuscate|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseObfuscate|Any CPU.Build.0 = ReleaseObfuscate|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseObfuscate|ARM64.ActiveCfg = ReleaseObfuscate|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseObfuscate|ARM64.Build.0 = ReleaseObfuscate|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseObfuscate|x64.ActiveCfg = ReleaseObfuscate|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseObfuscate|x64.Build.0 = ReleaseObfuscate|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseOther|Any CPU.ActiveCfg = ReleaseOther|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseOther|Any CPU.Build.0 = ReleaseOther|Any CPU - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseOther|ARM64.ActiveCfg = ReleaseOther|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseOther|ARM64.Build.0 = ReleaseOther|ARM64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseOther|x64.ActiveCfg = ReleaseOther|x64 - {A058E167-7411-D3CA-0C9F-40F030C12860}.ReleaseOther|x64.Build.0 = ReleaseOther|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {ECF1E7B1-C1AD-41F5-BC76-4862410A89AA} - EndGlobalSection -EndGlobal diff --git a/PvZ Fusion Translator.sln.DotSettings.user b/PvZ Fusion Translator.sln.DotSettings.user new file mode 100644 index 0000000..8f0047e --- /dev/null +++ b/PvZ Fusion Translator.sln.DotSettings.user @@ -0,0 +1,5 @@ + + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded \ No newline at end of file diff --git a/PvZ Fusion Translator.slnx b/PvZ Fusion Translator.slnx new file mode 100644 index 0000000..ae87c1e --- /dev/null +++ b/PvZ Fusion Translator.slnx @@ -0,0 +1,7 @@ + + + + + + + diff --git a/README.md b/README.md index b0992a5..ec3ebf4 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,3 @@ PvZ Fusion Translator is a **Melon Mod** that allows for an easier method of tra # Contribution If you'd like to contribute in any way, please join us on our [Discord](https://discord.gg/DPAC5ZVJ8T). - diff --git a/Source/AssetStore/AudioStore.cs b/Source/AssetStore/AudioStore.cs new file mode 100644 index 0000000..639065a --- /dev/null +++ b/Source/AssetStore/AudioStore.cs @@ -0,0 +1,166 @@ +// ReSharper disable once RedundantUsingDirective +using System.Reflection; +// ReSharper disable once RedundantUsingDirective +using HarmonyLib; + +namespace PvZ_Fusion_Translator.AssetStore; + +internal static class AudioStore +{ + public static readonly Dictionary AudioClips = []; + + public static Dictionary AudioClipNames = []; + + private static bool s_overrideEnabled; + + private static readonly string s_customAudioPath = Path.Combine(Core.ModDirectory, "[Custom Audios]"); + + private static readonly string[] s_allowedExts = [".wav", ".mp3", ".ogg"]; + + public static Canvas Canvas { get; set; } + + public static RectTransform SongRectTransform { get; private set; } + + public static void Init() => LoadAudios(); + + public static void LoadAudios() + { + if (!Directory.Exists(s_customAudioPath)) + Directory.CreateDirectory(s_customAudioPath); + + var audioFiles = Directory.GetFiles(s_customAudioPath, "*", SearchOption.AllDirectories); + var ovrClip = audioFiles.SingleOrDefault(f => Path.GetFileNameWithoutExtension(f) == "REPLACE_ALL"); + + if (ovrClip == null) + foreach (var clip in audioFiles + .Where(file => s_allowedExts.Contains(Path.GetExtension(file))) + .Select(file => AudioImportLibAPI.LoadAudioClip(file))) + { + AudioClips.Add(clip.name, clip); + Log.LogInfo("Added Override: " + clip.name); + } + else + { + var clip = AudioImportLibAPI.LoadAudioClip(ovrClip); + AudioClips.Add(clip.name, clip); + s_overrideEnabled = true; + Log.LogInfo("Added Override: " + clip.name); + } +#if MELONLOADER + var audioSourceType = typeof(AudioSource); + var sourceMethodName = "Play"; + var prefixMethod = typeof(AudioStore).GetMethod(nameof(AudioPlayPatch), BindingFlags.Static | BindingFlags.Public); + + if (prefixMethod == null) + { + Log.LogError($"Couldn't find method named \"AudioPlayPatch\" in type <{typeof(AudioStore)}>."); + return; + } + + _ = Core.Instance.HarmonyInstance.Patch( + AccessTools.Method(audioSourceType, sourceMethodName), + new HarmonyMethod(prefixMethod) + ); + + Core.Instance.HarmonyInstance.Patch( + AccessTools.Method(audioSourceType, sourceMethodName, [typeof(ulong)]), + new HarmonyMethod(prefixMethod) + ); +#endif + } + + public static void InitializeCanvas() + { + Debug.Assert(ModFeatures.IsAudioTesting, nameof(ModFeatures.IsAudioTesting)); + + if (Canvas != null) + return; // Prevent duplicate canvas creation + + Canvas = new GameObject("AudioSourceCanvas").AddComponent(); + Canvas.renderMode = RenderMode.ScreenSpaceOverlay; + + var scaler = Canvas.gameObject.AddComponent(); + scaler.uiScaleMode = UnityEngine.UI.CanvasScaler.ScaleMode.ScaleWithScreenSize; + scaler.referenceResolution = new(1920, 1080); + + Canvas.gameObject.AddComponent(); + + // Add a RectTransform for positioning text + var songTextObject = new GameObject("SongText"); + songTextObject.transform.SetParent(Canvas.transform); + + SongRectTransform = songTextObject.AddComponent(); + SongRectTransform.anchorMin = new(1, 1); // Top-right corner + SongRectTransform.anchorMax = new(1, 1); + SongRectTransform.pivot = new(1, 1); + SongRectTransform.anchoredPosition = new(-20, -20); // Adjust margin + + // Add a TextMeshPro component for the text + var textComponent = songTextObject.AddComponent(); + textComponent.alignment = TextAlignmentOptions.Right; + textComponent.fontSize = 24; + textComponent.color = Color.white; + textComponent.text = "Current Song: None"; // Placeholder + } + + public static void AudioSources() + { + if (!Directory.Exists(s_customAudioPath)) + Directory.CreateDirectory(s_customAudioPath); + + var path = Path.Combine(s_customAudioPath, "audio_source.json"); + + if (!File.Exists(path)) + { + Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); + return; + } + + var json = File.ReadAllText(path); + AudioClipNames = System.Text.Json.JsonSerializer.Deserialize>(json); + } + + public static (string, string) GetAudioSource(string clipName) => + AudioClipNames.TryGetValue(clipName, out var audioSource) ? audioSource : ("Music", "Source Unknown"); + + public static void UpdateAudioSourceText(string clipName, string sourceName) + { + if (SongRectTransform == null) + InitializeCanvas(); + + var textComponent = SongRectTransform.GetComponent(); + + if (textComponent != null) + textComponent.text = $"Current Song: {clipName}\nSource: {sourceName}"; + } + + public static void AudioPlayPatch(AudioSource __instance) + { + if (Core.Instance.ConfigDefaultAudio.Value) + return; + + if (__instance.clip == null) + return; + + if (RhythmGameManager.Instance != null && __instance.clip.name == "loon") + return; + + if (ModFeatures.IsAudioTesting) + Log.LogInfo($"Playing \"{__instance.clip.name}\" from object \"{__instance.gameObject.name}\""); + + var audioClipName = s_overrideEnabled ? "REPLACE_ALL" : __instance.clip.name; + + if (AudioClips.TryGetValue(audioClipName, out var replaceClip)) + { + __instance.pitch = 1; + __instance.clip = replaceClip; + } + + if (!ModFeatures.IsAudioTesting) + return; + + // Update the displayed audio source + var (name, source) = GetAudioSource(__instance.clip.name); + UpdateAudioSourceText(name, source); + } +} diff --git a/Source/AssetStore/DllStore.cs b/Source/AssetStore/DllStore.cs new file mode 100644 index 0000000..ed7eeeb --- /dev/null +++ b/Source/AssetStore/DllStore.cs @@ -0,0 +1,111 @@ +#if false +using System.Diagnostics; + +namespace PvZ_Fusion_Translator.AssetStore; + +public static class DllStore +{ + public static readonly Dictionary DLLData = new() + { + { "Blooms_QOL.dll", null }, + { "PvZ_Fusion_Translator.dll", null }, + }; + + public static bool UpdateOnClose { get; set; } + + public static void Init(string gameVersion) => TryGetNewDll(gameVersion); + + public static void TryGetNewDll(string gameVersion) + { + var ableToUpdate = true; + var unableReason = ""; + + var getGameVersionRequest = Utils.GetDataFromWeb( + "https://raw.githubusercontent.com/SillyStar-Github/PvZF-Translation-DLLs/refs/heads/main/CURRENT_GAME_VER" + ) + .Result; + + if (getGameVersionRequest != null) + { + Log.LogDebug( + $"Requst game version: {getGameVersionRequest} -> {Utils.CalculateGameVersion(getGameVersionRequest)}" + ); + + Log.LogDebug($"This game version: {gameVersion} -> {Utils.CalculateGameVersion(gameVersion)}"); + + if (Utils.CalculateGameVersion(getGameVersionRequest) != Utils.CalculateGameVersion(gameVersion)) + { + ableToUpdate = false; + unableReason = "Incorrect game version..."; + } + } + else + { + ableToUpdate = false; + unableReason = "Couldn't get latest game version info..."; + } + + if (ableToUpdate) + foreach (var key in DLLData.Keys) + { + var newDllRequest = Utils.GetByteDataFromWeb( + $"https://raw.githubusercontent.com/SillyStar-Github/PvZF-Translation-DLLs/refs/heads/main/{key}" + ) + .Result; + + if (newDllRequest != null) + { + DLLData[key] = newDllRequest; + SaveNewDll(key); + } + else + Log.LogError($"Couldn't get latest {key} data!"); + } + else + Log.LogError($"Unable to update! {unableReason}"); + } + + public static void SaveNewDll(string name) + { + var newDllData = DLLData[name]; + + if (newDllData == null) + return; + + var basePath = MelonEnvironment.ModsDirectory; + var toSavePath = Path.Combine(basePath, name + ".update"); + File.WriteAllBytes(toSavePath, newDllData); + } + + public static void UpdateNewDll() + { + UpdateOnClose = DLLData.Any(pair => pair.Value is not null); + + if (!UpdateOnClose) + { + Log.LogError("Cannot update on close! All .dll data is null!"); + return; + } + + var assembly = Core.Instance.MelonAssembly.Assembly; + const string ProgramName = "PvZ_Fusion_Translator.Resources.ModUpdateUtil.exe"; + + using var exeResourceStream = assembly.GetManifestResourceStream(ProgramName); + var tempPath = Path.Combine(MelonEnvironment.ModsDirectory, "ModUpdateUtil.exe"); + + // ReSharper disable once PossibleNullReferenceException + using (var fileStream = File.Create(tempPath)) + exeResourceStream.CopyTo(fileStream); + + Process.Start( + new ProcessStartInfo + { + FileName = tempPath, + Arguments = + $"{Environment.ProcessId} {string.Join(",", DLLData.Keys)} \"{MelonEnvironment.ModsDirectory}\"", + UseShellExecute = true, + } + ); + } +} +#endif diff --git a/Source/AssetStore/FontStore.cs b/Source/AssetStore/FontStore.cs new file mode 100644 index 0000000..68f7bb4 --- /dev/null +++ b/Source/AssetStore/FontStore.cs @@ -0,0 +1,117 @@ +namespace PvZ_Fusion_Translator.AssetStore; + +public static class FontStore +{ + internal static readonly Dictionary FontAssetDict = [], FontAssetDictSecondary = []; + + internal static void Init() + { + var fontsDir = Path.Combine(Core.ModDirectory, "[Custom Fonts]"); + var assetBundle = Utils.GetAssetBundle(Path.Combine(fontsDir, "translation")); + + if (ModFeatures.IsMultiLanguage) + { + foreach (var file in assetBundle.GetAllAssetNames()) + { + var fileName = Path.GetFileNameWithoutExtension(file); + + if (fileName.EndsWith("_almanac") || fileName.EndsWith("_fallback")) + continue; + + var fontAsset = assetBundle.LoadAsset(file); + FontAssetDict.Add(fileName, fontAsset); + Log.LogInfo($"Font for language '{fileName}' loaded"); + } + + InitFallback(assetBundle); + } + else + { + var defaultFontDir = Path.Combine("[Custom Fonts]", "English.ttf"); + var defaultFont = FontHandler.LoadTMPFont(defaultFontDir, true); + FontAssetDict.Add("English", defaultFont); + } + } + + internal static void InitFallback(AssetBundle assetBundle) + { + foreach (var file in assetBundle.GetAllAssetNames()) + { + var fileName = Path.GetFileNameWithoutExtension(file); + + if (!fileName.EndsWith("_almanac") && !fileName.EndsWith("_fallback")) + continue; + + var fallbackFont = assetBundle.LoadAsset(file); + var fileNameLanguage = fileName.Replace("_fallback", "").Replace("_almanac", ""); + Utils.TryAdd(FontAssetDictSecondary, fileName, fallbackFont); + + if (ModFeatures.IsDebug) + Log.LogInfo($"Fallback font for language '{fileNameLanguage}' loaded"); + } + + AddFallback(); + } + + public static void AddFallback() + { + foreach (var lang in FontAssetDict.Keys) + { + FontAssetDict[lang].fallbackFontAssetTable ??= new(); + + if (FontAssetDictSecondary.TryGetValue(lang, out var value)) + { + FontAssetDict[lang].fallbackFontAssetTable.Add(value); + Log.LogInfo("Fallback font for language '" + lang + "' added"); + continue; + } + + if (FontAssetDictSecondary.TryGetValue(lang + "_almanac", out var valueAlmanac)) + { + FontAssetDict[lang].fallbackFontAssetTable.Add(valueAlmanac); + Log.LogInfo("Fallback font for language '" + lang + "' added"); + continue; + } + + if (!FontAssetDictSecondary.TryGetValue(lang + "_fallback", out var valueFallback)) + continue; + + FontAssetDict[lang].fallbackFontAssetTable.Add(valueFallback); + Log.LogInfo("Fallback font for language '" + lang + "' added"); + } + } + + public static TMP_FontAsset LoadTMPFont(string language) + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + + if (!FontAssetDict.TryGetValue(language.ToLower(), out var font)) + return FontAssetDict.GetValueOrDefault("english"); + + if (ModFeatures.IsDebug && font.fallbackFontAssetTable != null) + Log.LogInfo( + $"Fallback font for language '{language}' loaded. The name of the FB Font is{font.fallbackFontAssetTable[0].name}" + ); + + return font; + } + + public static TMP_FontAsset LoadTMPFont() + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + var defaultFont = FontAssetDict["English"]; + return defaultFont; + } + + public static TMP_FontAsset LoadTMPFontAlmanac(string language) => + FontAssetDictSecondary.TryGetValue(language.ToLower(), out var first) ? first : + FontAssetDictSecondary.TryGetValue(language.ToLower() + "_almanac", out var second) ? second : + FontAssetDict.GetValueOrDefault("english"); + + public static void Reload() + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + // Get the current language and load its corresponding font. + _ = LoadTMPFont(Utils.Language.ToString()); + } +} diff --git a/Source/AssetStore/StringStore.cs b/Source/AssetStore/StringStore.cs new file mode 100644 index 0000000..97668a6 --- /dev/null +++ b/Source/AssetStore/StringStore.cs @@ -0,0 +1,613 @@ +using PvZ_Fusion_Translator.Patches.BaseTextObjects; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.AssetStore; + +public static class StringStore +{ + // ReSharper disable once CollectionNeverQueried.Global + internal static readonly Dictionary StringsDict = []; + + public static readonly Dictionary TranslationStringRegex = new(); + + public static readonly Dictionary TranslationString = new(); + + public static readonly Dictionary CustomLevelStringRegex = new(); + + public static readonly Dictionary CustomLevelString = new(); + + public static readonly Dictionary IZLevelTipDictionary = new(); + + public static readonly Dictionary IZTipCollectionString = new(); + + public static readonly Dictionary FSLevelTipDictionary = new(); + + public static readonly Dictionary FSTipCollectionString = new(); + + public static readonly Dictionary> PatchesStore = new() + { + { + "Difficulty", new() + { + { "English", "Difficulty:" }, + { "French", "Difficulté:" }, + { "Italian", "Difficoltà:" }, + { "German", "Schwierigkeit:" }, + { "Spanish", "Dificultad:" }, + { "Portuguese", "Dificuldade:" }, + { "Filipino", "Ang Hirap:" }, + { "Vietnamese", "Độ Khó:" }, + { "Indonesian", "Kesulitan:" }, + { "Russian", "Сложность:" }, + { "Japanese", "困難:" }, + { "Korean", "난이도:" }, + { "Javanese", "Kesulitan:" }, + { "Polish", "Trudność:" }, + { "Hungarian", "Nehézség:" }, + { "Arabic", "صعوبة:" }, + // { "Ukrainian" , "Складність:" }, + // { "Slovak" , "Náročnosť:" }, + } + }, + { + "Zombies", new() + { + { "English", "Zombies:" }, + { "French", "Les Zombies:" }, + { "Italian", "Zombi:" }, + { "German", "Zombies:" }, + { "Spanish", "Zombis:" }, + { "Portuguese", "Zumbis:" }, + { "Filipino", "Mga Zombie:" }, + { "Vietnamese", "Thây Ma:" }, + { "Indonesian", "Zombi:" }, + { "Russian", "Зомби:" }, + { "Japanese", "ゾンビ:" }, + { "Korean", "좀비:" }, + { "Javanese", "Mayit:" }, + { "Polish", "Zombi:" }, + { "Hungarian", "Zombik:" }, + { "Arabic", "الزومبي:" }, + // { "Ukrainian" , "Зомбі:" }, + // { "Slovak" , "Zombíci:"} + } + }, + }; + + internal static void Init() => FileLoader.LoadStrings(); + + internal static void Reload() + { + TranslationString.Clear(); + TranslationStringRegex.Clear(); + CustomLevelString.Clear(); + CustomLevelStringRegex.Clear(); + IZLevelTipDictionary.Clear(); + IZTipCollectionString.Clear(); + FSLevelTipDictionary.Clear(); + FSTipCollectionString.Clear(); + InGameText_Patch.CurrentText = ""; + Utils.RegisterPlantIndices(); + FileLoader.LoadStrings(); + } + + public static TextMeshPro TranslateText(TextMeshPro originalTMP, bool isLog = false) + { + var fontAsset = FontStore.LoadTMPFont(ModFeatures.IsMultiLanguage ? Utils.Language.ToString() : null); + var translatedText = TranslateText(originalTMP.text); + originalTMP.font = fontAsset; + originalTMP.text = translatedText; + return originalTMP; + } + + public static TextMeshProUGUI TranslateText(TextMeshProUGUI originalTMP, bool isLog = false) + { + var fontAsset = ModFeatures.IsMultiLanguage + ? FontStore.LoadTMPFont(Utils.Language.ToString()) + : FontStore.LoadTMPFont(); + + var translatedText = TranslateText(originalTMP.text); + originalTMP.font = fontAsset; + originalTMP.text = translatedText; + return originalTMP; + } + + public static string TranslateText(string originalText, bool isLog = false) + { + var text = DoTranslateText(originalText); + + if (!ModFeatures.IsDebug) + return text; + + Regex regex = new("\\p{IsCJKUnifiedIdeographs}+"); + var match = regex.Match(text); + + if (match.Success) + FileLoader.DumpUntranslatedStrings(text); + + return text; + } + + public static string TranslateText(string originalText, string pattern, bool isLog = false) + { + if (TestRegex(originalText, pattern)) + { + if (TranslationStringRegex.TryGetValue(pattern, out var value)) + { + // Extract dynamic parts from the original text + var regex = new Regex(pattern); + var match = regex.Match(originalText); + var groupCount = match.Groups.Count; + + if (isLog) + Log.LogDebug("Text found in translationStringRegex {0}: {1}", match, groupCount); + + // List to hold formatted dynamic parts + List dynamicParts = []; + + // Loop through each group and determine its translation + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + var translatedValue = DoTranslateString(groupValue); + dynamicParts.Add(translatedValue); + } + + // Format the output string with dynamic parts + return string.Format(value, [..dynamicParts]); + } + + if (!CustomLevelStringRegex.TryGetValue(pattern, out var value1)) + return originalText; + + { + // Extract dynamic parts from the original text + var regex = new Regex(pattern); + var match = regex.Match(originalText); + var groupCount = match.Groups.Count; + + if (isLog) + Log.LogDebug("Text found in customLevelStringRegex {0}: {1}", match, groupCount); + + // List to hold formatted dynamic parts + List dynamicParts = []; + + // Loop through each group and determine its translation + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + var translatedValue = CustomLevelString.GetValueOrDefault(groupValue, groupValue); + dynamicParts.Add(translatedValue); + } + + // Format the output string with dynamic parts + return string.Format(value1, [..dynamicParts]); + } + } + + if (isLog) + Log.LogDebug($"Text '{originalText}' not translated"); + + FileLoader.DumpUntranslatedStrings(originalText); + return originalText; + } + + public static string DoTranslateString(string originalText, bool isLog = false) + { + if (string.IsNullOrEmpty(originalText)) + { + if (isLog) + Log.LogError("Text Null or Empty"); + + return string.Empty; + } + + if (TranslationString.TryGetValue(originalText, out var s)) + { + if (isLog) + Log.LogDebug($"Text '{originalText} found in translationString"); + + return s; + } + + if (IZTipCollectionString.TryGetValue(originalText, out var translateString)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in izTipCollectionString"); + + return translateString; + } + + if (FSTipCollectionString.TryGetValue(originalText, out var doTranslateString)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in fsTipCollectionString"); + + return doTranslateString; + } + + if (CustomLevelString.TryGetValue(originalText, out var s1)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in customLevelString"); + + return s1; + } + + if (!Utils.PlantIndiceString.TryGetValue(originalText, out var translateString1)) + return originalText; + + if (isLog) + Log.LogDebug($"Text '{originalText}' found in plantIndiceString"); + + return translateString1; + } + + public static string DoTranslateText(string originalText, bool isLog = false) + { + if (string.IsNullOrEmpty(originalText)) + { + if (isLog) + Log.LogError("Text Null or Empty"); + + return string.Empty; + } + + if (!Utils.CheckForUntranslatedText(originalText) && !originalText.Contains('_')) + return originalText; + + if (TranslationString.TryGetValue(originalText, out var text)) + { + if (isLog) + Log.LogDebug($"Text '{originalText} found in translationString"); + + return text; + } + + if (IZTipCollectionString.TryGetValue(originalText, out var translateText)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in izTipCollectionString"); + + return translateText; + } + + if (FSTipCollectionString.TryGetValue(originalText, out var doTranslateText)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in fsTipCollectionString"); + + return doTranslateText; + } + + if (CustomLevelString.TryGetValue(originalText, out var text1)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in customLevelString"); + + return text1; + } + + if (Utils.PlantIndiceString.TryGetValue(originalText, out var translateText1)) + { + if (isLog) + Log.LogDebug($"Text '{originalText}' found in plantIndiceString"); + + return translateText1; + } + + // Regex-based dynamic translation + foreach (var entry in TranslationStringRegex) + if (TestRegex(originalText, entry.Key)) + { + // Extract dynamic parts from the original text + var regex = new Regex(entry.Key); + var match = regex.Match(originalText); + var groupCount = match.Groups.Count; + + if (isLog) + Log.LogDebug("Text found in translationStringRegex {0}: {1}", match, groupCount); + + // List to hold formatted dynamic parts + List dynamicParts = []; + + // Loop through each group and determine its translation + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + var translatedValue = DoTranslateString(groupValue); + dynamicParts.Add(translatedValue); + } + + // Format the output string with dynamic parts + return string.Format(entry.Value, [..dynamicParts]); + } + + foreach (var entry in CustomLevelStringRegex) + if (TestRegex(originalText, entry.Key)) + { + // Extract dynamic parts from the original text + var regex = new Regex(entry.Key); + var match = regex.Match(originalText); + var groupCount = match.Groups.Count; + + if (isLog) + Log.LogDebug("Text found in customLevelRegex {0}: {1}", match, groupCount); + + // List to hold formatted dynamic parts + List dynamicParts = []; + + // Loop through each group and determine its translation + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + var translatedValue = CustomLevelString.GetValueOrDefault(groupValue, groupValue); + dynamicParts.Add(translatedValue); + } + + // Format the output string with dynamic parts + return string.Format(entry.Value, [..dynamicParts]); + } + + if (isLog) + Log.LogDebug($"Text '{originalText}' not translated"); + + if (Utils.CheckForUntranslatedText(originalText)) + FileLoader.DumpUntranslatedStrings(originalText); + + return originalText; + } + + public static string TranslateColorText(string originalText, bool isLog = false) + { + var text = TranslateColorSegments(originalText); + + if (!ModFeatures.IsDebug) + return text; + + Regex regex = new("\\p{IsCJKUnifiedIdeographs}+"); + var match = regex.Match(text); + + if (match.Success) + // Log.LogDebug("Untranslated String: " + match.Value); + FileLoader.DumpUntranslatedStrings(text); + + return text; + } + + public static string TranslateColorSegments(string input) + { + var result = ""; + const string Pattern = @"]+>[\s\S]*?(?:<\/color>|$)|(?:<(?!color=)|[^<])+"; + const string SmallPattern = "(]+>)(.*?)()"; + var matches = Regex.Matches(input, Pattern); + + for (var i = 0; i < matches.Count; i++) + { + var match = matches[i]; + + if (Regex.Match(match.Value, SmallPattern, RegexOptions.Singleline).Success) + result += TranslateColorSegment(match.Value); + else + result += DoTranslateText(match.Value); + } + + return result; + } + + public static string TranslateColorSegment(string input) + { + const string Pattern = "(]+>)(.*?)()"; + var match = Regex.Match(input, Pattern, RegexOptions.Singleline); + var translatedText = DoTranslateText(match.Groups[2].Value); + + if (Utils.CheckForUntranslatedText(translatedText)) + FileLoader.DumpUntranslatedStrings(translatedText); + + return match.Groups[1].Value + translatedText + match.Groups[3].Value; + } + + public static bool TestRegex(string originalText, string pattern, bool singleLine = false) + { + var options = singleLine ? RegexOptions.None : RegexOptions.Singleline; + return Regex.IsMatch(originalText, pattern, options); + } + + private static TextAlignmentOptions TextAnchorToTMPAlignment(TextAnchor anchor) => + anchor switch + { + TextAnchor.UpperLeft => TextAlignmentOptions.TopLeft, + TextAnchor.UpperCenter => TextAlignmentOptions.Top, + TextAnchor.UpperRight => TextAlignmentOptions.TopRight, + TextAnchor.MiddleLeft => TextAlignmentOptions.MidlineLeft, + TextAnchor.MiddleCenter => TextAlignmentOptions.Center, + TextAnchor.MiddleRight => TextAlignmentOptions.MidlineRight, + TextAnchor.LowerLeft => TextAlignmentOptions.BottomLeft, + TextAnchor.LowerCenter => TextAlignmentOptions.Bottom, + TextAnchor.LowerRight => TextAlignmentOptions.BottomRight, + _ => TextAlignmentOptions.Center, + }; + + public static TextMeshProUGUI ConvertToTextMeshPro( + UnityEngine.UI.Text oldText, + TMP_FontAsset fontAsset, + bool isLog = false + ) + { + if (oldText == null) + { + Log.LogError("UnityEngine.UI.Text component is null."); + return null; + } + + if (fontAsset == null) + { + Log.LogError("TMP_FontAsset is null. Conversion cannot proceed."); + return null; + } + + // Log.LogInfo($"Converting UnityEngine.UI.Text: {oldText.name}"); + + var textObject = oldText.gameObject; + + // Preserve text content and settings + var originalText = oldText.text; + originalText = TranslateText(originalText, isLog); + var alignment = oldText.alignment; + var color = oldText.color; + + // Remove old Text component + UnityEngine.Object.DestroyImmediate(oldText); + + // Add TextMeshProUGUI component + var newTMP = textObject.AddComponent(); + + if (newTMP == null) + { + Log.LogError($"Failed to add TextMeshProUGUI to object: {textObject.name}"); + return null; + } + + // Configure TextMeshProUGUI + newTMP.text = originalText; + newTMP.color = color; + newTMP.alignment = TextAnchorToTMPAlignment(alignment); + newTMP.font = fontAsset; + + // Log.LogInfo($"Successfully converted {textObject.name} to TextMeshProUGUI."); + + return newTMP; + } + + public static void TranslateTextTransform( + Transform baseTransform, + bool isAutoTextContainer = false, + bool isLog = false + ) + { + if (!baseTransform) + return; + + var currentLanguage = ModFeatures.IsMultiLanguage ? Utils.Language.ToString() : null; + var fontAsset = FontStore.LoadTMPFont(currentLanguage); + + if (fontAsset == null) + { + Log.LogError( + ModFeatures.IsMultiLanguage + ? $"Font for language '{currentLanguage}' not found. Translation aborted." + : "Font not found. Translation aborted." + ); + + return; + } + + // Local function for processing transforms + void ProcessTextTransform(Transform textTransform) + { + if (!textTransform) + return; + + // Handle TextMeshPro components + var textTMP = textTransform.GetComponent(); + + if (textTMP) + { + textTMP.text = TranslateText(textTMP.text, isLog); + textTMP.autoSizeTextContainer = isAutoTextContainer; + textTMP.font = fontAsset; + } + + var textTmpugui = textTransform.GetComponent(); + + if (textTmpugui) + { + textTmpugui.text = TranslateText(textTmpugui.text, isLog); + textTmpugui.enableAutoSizing = isAutoTextContainer; + textTmpugui.font = fontAsset; + } + + // Handle UnityEngine.UI.Text components + var textUI = textTransform.GetComponent(); + + if (textUI) + ConvertToTextMeshPro(textUI, fontAsset, isLog); + } + + // Process specific text paths + ProcessTextTransform(baseTransform.Find("text")); + ProcessTextTransform(baseTransform.Find("text1")); + // ProcessTextTransform(baseTransform.Find("text2")); + + var shadowTransform = baseTransform.Find("text/shadow"); + + if (shadowTransform) + ProcessTextTransform(shadowTransform); + + shadowTransform = baseTransform.Find("text1/shadow"); + + if (shadowTransform) + ProcessTextTransform(shadowTransform); + + if (!ModFeatures.IsTesting) + return; + + var childTransform = baseTransform.GetChild(0); + + if (childTransform) + ProcessTextTransform(childTransform); + } + + public static void TranslateTextUI(TextMeshPro textTMP, bool? isAutoTextContainer = null, bool isLog = false) + { + var currentLanguage = Utils.Language.ToString(); + + if (!textTMP) + return; + + textTMP.text = TranslateText(textTMP.text, isLog); + + if (isAutoTextContainer != null) + textTMP.autoSizeTextContainer = isAutoTextContainer.Value; + + textTMP.font = FontStore.LoadTMPFont(currentLanguage); + } + + public static void TranslateTextUI(TextMeshProUGUI textTMP, bool? isAutoTextContainer = null, bool isLog = false) + { + var currentLanguage = Utils.Language.ToString(); + + if (!textTMP) + return; + + var origText = textTMP.text; + + textTMP.text = TranslateText(origText, isLog) == "" ? origText : TranslateText(origText, isLog); + + if (isAutoTextContainer != null) + textTMP.autoSizeTextContainer = isAutoTextContainer.Value; + + if (origText != textTMP.text) + textTMP.font = FontStore.LoadTMPFont(currentLanguage); + } + + public static void TranslateTextUI(TMP_InputField textInput) + { + var currentLanguage = Utils.Language.ToString(); + + if (!textInput) + return; + + var oriText = textInput.m_Text; + textInput.m_Text = TranslateText(oriText); + textInput.m_OriginalText = TranslateText(oriText); + textInput.fontAsset = FontStore.LoadTMPFont(currentLanguage); + } + + public static void LogAll() + { + Log.LogInfo("Logging all StringStore entries."); + Log.LogInfo("Regex Entries: {0}", TranslationStringRegex.Count); + Log.LogInfo("String Entries: {0}", TranslationString.Count); + } +} diff --git a/Source/AssetStore/TextureStore.cs b/Source/AssetStore/TextureStore.cs new file mode 100644 index 0000000..f030b7a --- /dev/null +++ b/Source/AssetStore/TextureStore.cs @@ -0,0 +1,55 @@ +using System.Collections; + +namespace PvZ_Fusion_Translator.AssetStore; + +public static class TextureStore +{ + internal static readonly Dictionary TextureDict = [], SpriteDict = []; + + internal static void Init() => FileLoader.LoadTextures(); + + internal static void Reload() + { + TextureDict.Clear(); + + if (ModFeatures.IsMultiLanguage) + RestoreTextures(); + + FileLoader.LoadTextures(); + } + + public static IEnumerator ReplaceTexturesCoroutine() + { + while (true) + { + ReplaceTextures(); + yield return new WaitForSeconds(0.5f); // Adjust this interval as needed + } // ReSharper disable once IteratorNeverReturns + } + + public static void ReplaceTextures() + { + foreach (var texture in Resources + .FindObjectsOfTypeAll() + .Where(texture => !texture.name.StartsWith("replaced_"))) + Utils.TryReplaceTexture2D(texture); + } + + public static void RestoreTextures() + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + + Texture2D[] textures = Resources.FindObjectsOfTypeAll(); + + foreach (var texture in textures.Where(texture => texture != null)) + texture.name = texture.name.Replace("replaced_", ""); + } + + public static void LogAll() + { + Log.LogInfo("Logging all TextureStore entries."); + + foreach (var entry in TextureDict) + Log.LogInfo("TextureDict Entry: " + entry.Key + " | " + entry.Value); + } +} diff --git a/Source/AssetStore/WarningStore.cs b/Source/AssetStore/WarningStore.cs new file mode 100644 index 0000000..1544dfd --- /dev/null +++ b/Source/AssetStore/WarningStore.cs @@ -0,0 +1,285 @@ +#if false +namespace PvZ_Fusion_Translator.AssetStore; + +public static class WarningStore +{ + private static readonly Dictionary s_warningMessages = new() + { + { + "English", + (""" + The only valid source of this translation is from this community: + discord.gg/DPAC5ZVJ8T. If you got this anywhere else like + Plants Hybrid and superhybrid.online, they stole it. + Stray away from other sources as they may contain viruses. + Please visit our community for future updates. + """, "Okay! Got it.") + }, + { + "French", + (""" + La seule source valide pour cette traduction provient de cette + communauté :discord.gg/DPAC5ZVJ8T. Si vous l'avez obtenue + ailleurs, comme Plants Hybrid ou superhybrid.online, ils l'ont volée. + Évitez les autres sources, car elles peuvent contenir des virus. + Veuillez visiter notre communauté pour les mises à jour futures. + """, "D'accord !") + }, + { + "Italian", + (""" + L'unica fonte valida di questa traduzione è questa community: + discord.gg/DPAC5ZVJ8T. Se l'hai ottenuta altrove, come + Plants Hybrid e superhybrid.online, l'hanno rubata. + Evita altre fonti, potrebbero contenere virus. + Visita la nostra community per aggiornamenti futuri. + """, "Va bene! Ho capito.") + }, + { + "German", + (""" + Die einzige gültige Quelle für diese Übersetzung stammt aus + dieser Community: discord.gg/DPAC5ZVJ8T. Wenn Sie diese + irgendwo anders gefunden haben, z. B. bei Plants Hybrid oder + superhybrid.online, dann haben sie sie gestohlen. + Meiden Sie andere Quellen, da diese Viren enthalten könnten. + Bitte besuchen Sie unsere Community für zukünftige Updates. + """, "Okay, verstanden!") + }, + { + "Spanish", + (""" + La única fuente válida de esta traducción proviene de esta + comunidad: discord.gg/DPAC5ZVJ8T. Si la obtuvo en cualquier + otro lugar como Plants Hybrid o superhybrid.online, la robaron. + Manténgase alejado de otras fuentes, ya que podrían contener virus. + Por favor, visite nuestra comunidad para futuras actualizaciones. + """, "¡Entendido!") + }, + { + "Portuguese", + (""" + O lugar original e seguro dessa tradução vem daqui: + discord.gg/DPAC5ZVJ8T. Se você baixou ela de qualquer + lugar como Plants Hybrid ou superhybrid.online, eles + roubaram. Evite baixar deles, pode conter vírus. + Por favor, visite nossa comunidade para atualizações futuras. + """, "Okay, entendido.") + }, + { + "Filipino", + (""" + Ang tanging opisyal na source ng pagsasaling ito ay mula + lamang dito: discord.gg/DPAC5ZVJ8T. Kung nakuha nmo ito kahit + saan pa tulad ng Plants Hybrid at superhybrid.online, ito ay ninakaw. + Lumayo sa ibang source dahil posibleng may kasamang virus. + Paki-bisita ang aming komunidad para sa mga darating na update. + """, "Naiintindihan!") + }, + { + "Vietnamese", + (""" + Nguồn duy nhất hợp lệ của bản dịch này là từ cộng + đồng này: discord.gg/DPAC5ZVJ8T. Nếu bạn nhận + được nó ở bất cứ nơi nào khác như Plants Hybrid + hoặc superhybrid.online, họ đã ăn cắp nó. + Tránh xa các nguồn khác vì chúng có thể chứa + virus. Hãy ghé thăm cộng đồng của chúng tôi để + cập nhật trong tương lai. + """, "Đồng ý!") + }, + { + "Indonesian", + (""" + Satu-satunya sumber resmi dari terjemahan ini adalah + komunitas kami: discord.gg/DPAC5ZVJ8T. Jika Anda + mendapatkannya dari sumber lain seperti Plants Hybrid + dan superhybrid.online, mereka mencurinya. + Jauhi sumber lain karena mungkin ada virus. + Silakan kunjungi komunitas kami untuk pembaruan berikutnya. + """, "Oke! Mengerti.") + }, + { + "Russian", (""" + Единственный проверенный источник этого перевода — + сообщество discord.gg/DPAC5ZVJ8T. + Или же его замена https://t.me/nekoshkindom + Если вы скачали этот мод где-либо ещё, возможно он содержит вирусы. + Программист перевода: LancerX0. + Переводчик: Nekosha. + """, "Хорошо!") + }, + { + "Japanese", (""" + この翻訳の唯一の有効なソースは、このコミュニティからです: + discord.gg/DPAC5ZVJ8T.Plants Hybridやsuperhybrid.online、 + YoutubeのBlue Flyが作っているもの、他のどこかでこれを入手した場合、 + 彼らはそれを盗んだことになります。ウイルスが含まれている可能性があるので、 + 他のソースからは離れてください。今後のアップデートについては、 + 私たちのコミュニティをご覧ください。 + """, + "了解しました!") + }, + { + "Korean", (""" + 이 번역은 Bloom(discord.gg/DPAC5ZVJ8T)에서만 + 제공됩니다. Bloom 디스코드 이외의 다른서드 파티 사이트, + 예를 들어 Plants Hybrid 및 superhybrid.online, 또는 + 유튜브 Blue Fly등에서 제공하는 파일은 무단으로 재배포된 것이며, + 이런 사이트들에는 바이러스가 포함되어 있을 가능성이 높습니다. + 향후 업데이트를 위해 저희 디스코드를 방문해 주세요. + """, + "확인") + }, + { + "Javanese", (""" + Sumber mung sing sah kanggo terjemahan iki saka komunitas iki: + discord.gg/DPAC5ZVJ8T. Yen sampeyan nemokake iki ing papan + liya kaya Plants Hybrid lan superhybrid.online, iku dicolong. + Aja nyedhaki sumber liya amarga bisa ngandhut virus. Mangga + ngunjungi komunitas kita kanggo nganyari ing mangsa ngarep. + """, + "Oke! Ngertos.") + }, + { + "Polish", (""" + Jedynym wiarygodnym źródłem tego tłumaczenia jest ta społeczność: + discord.gg/DPAC5ZVJ8T. Jeśli znalazłeś to gdziekolwiek indziej, np. + Plants Hybrid i superhybrid.online, ukradli to. + Omijaj inne źródła, ponieważ mogą zawierać wirusy. + Odwiedź naszą społeczność, aby uzyskać przyszłe aktualizacje. + """, + "Okay! Rozumiem.") + }, + { + "Hungarian", ( + """ + Ennek a fordításnak az egyetlen érvényes forrása ebből a közösségből származik: + discord.gg/DPAC5ZVJ8T. Ha ezt valahol máshol szerezted, például + Plants Hybrid és superhybrid.online oldalakon, akkor ők lopták. + Kerüld a többi forrást, mert vírusokat tartalmazhatnak. + Kérjük, látogass el közösségünkbe a jövőbeli frissítésekért. + """, + "Oké! Értem.") + }, + { + "Arabic", (""" + The only valid source of this translation is from this community: + discord.gg/DPAC5ZVJ8T. If you got this anywhere else like + Plants Hybrid and superhybrid.online, they stole it. + Stray away from other sources as they may contain viruses. + Please visit our community for future updates. + """, + "Okay! Got it.") + }, + // { "OTHER" , ("A única fonte válida dessa tradução é desta\ncomunidade: discord.gg/DPAC5ZVJ8T. Se você obteve \nisso em qualquer lugar como Plants Hybrid\ne superhybrid.online,ou Blue Fly do Youtube,\nelses roubaram. Fique longe de sites falsos. Por favor,\nvisite nossa comunidade para futuras atualizações.", "¡Okei! Entendido.") }, + // { "OTHER" , ("Ang translation na ito ay galing dito lamang:\ndiscord.gg/DPAC5ZVJ8T. Pag nakuha niyo ito sa iba pa\nkagaya ng Plants Hybrid o superhybrid.online, anumang\nginawagawa ng Blue Fly mula sa Youtube, o anumang\nSub2Unlock links, scam sila. MAG INGAT dahil\nkasi baka may virus 'jan. Join kayo sa discord namin!\nFilipino Translation by ColinPogi", "Tayo magsi-laro!") }, + }; + + public static bool IsWarningMessageLoaded { get; set; } + + public static string WarningMessage { get; set; } = + "La única fuente válida de esta traducción proviene de esta\ncomunidad: discord.gg/DPAC5ZVJ8T. Si la obtuvo en cualquier\notro lugar como Plants Hybrid o superhybrid.online, la robaron.\nManténgase alejado de otras fuentes, ya que podrían contener virus.\nPor favor, visite nuestra comunidad para futuras actualizaciones."; + + public static string OkayButton { get; set; } = "¡Entendido!"; + + // ReSharper disable once UnusedTupleComponentInReturnValue + public static (string, string) GetWarningMessage(Utils.LanguageEnum language) + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + + return s_warningMessages.TryGetValue(language.ToString(), out var message) + ? message + : s_warningMessages["English"]; // Default to English if language code is not found + } + + public static void WarningLoad(NoticeMenu noticeMenu) + { + if (noticeMenu == null || noticeMenu.transform == null) + { + Log.LogWarning("[WarningStore] NoticeMenu or transform is null - ABORTING"); + return; + } + + if (!ModFeatures.IsMultiLanguage) + return; + + try + { + var (localizedWarningMessage, _) = GetWarningMessage(Utils.Language); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + Transform warningTransform = noticeMenu.transform.Find("窗口"); + + if (warningTransform == null) + { + Log.LogWarning("[WarningStore] '窗口' transform not found - ABORTING"); + return; + } + + var warningTextTransform = warningTransform.Find("文字"); + var warningTextShadowTransform = warningTransform.Find("文字2"); + + if (warningTextTransform == null || warningTextShadowTransform == null) + { + Log.LogWarning("[WarningStore] Could not find text components (文字/文字2)"); + return; + } + + var warningText = warningTextTransform.GetComponent(); + var shadowText = warningTextShadowTransform.GetComponent(); + + if (warningText == null || shadowText == null) + { + Log.LogWarning("[WarningStore] TextMeshProUGUI components missing"); + return; + } + + warningText.text = localizedWarningMessage; + shadowText.text = localizedWarningMessage; + + if (fontAsset != null) + { + warningText.font = fontAsset; + shadowText.font = fontAsset; + } + else + Log.LogWarning("[WarningStore] Font asset is null"); + + Log.LogInfo("Warning message loaded successfully!"); + } + catch (Exception e) + { + Log.LogError($"Critical error in WarningLoad: {e}"); + } + } + + public static void WarningReload(Utils.LanguageEnum language, NoticeMenu noticeMenu) + { + if (!ModFeatures.IsMultiLanguage) + { + if (IsWarningMessageLoaded) + return; + + WarningStore.WarningLoad(); + IsWarningMessageLoaded = true; + return; + } + + if (noticeMenu == null) + { + Log.LogWarning("[WarningStore] NoticeMenu is null in WarningReload"); + return; + } + + if (Utils.OldLanguage.ToString() == language.ToString() && Utils.OldLanguage.ToString() != "English") + return; + + if (IsWarningMessageLoaded) + return; + + WarningLoad(noticeMenu); + IsWarningMessageLoaded = true; + } +} +#endif diff --git a/Source/Core.cs b/Source/Core.cs new file mode 100644 index 0000000..7d908d7 --- /dev/null +++ b/Source/Core.cs @@ -0,0 +1,275 @@ +global using UnityEngine; +#if MELONLOADER +global using MelonLoader; +global using MelonLoader.Logging; +global using MelonLoader.Utils; +global using Il2Cpp; +global using Il2CppAlmanacData; +global using Il2CppCore; +global using Il2CppGameLevel; +global using Il2CppGameLevel.Abyss; +global using Il2CppGameLevel.EventNodes; +global using Il2CppGameLevel.RogueShooting; +global using Il2CppPVPScaryPot; +global using Il2CppRhythmGame; +global using Il2CppRhythmGameEditor; +global using Il2CppTMPro; +global using Il2CppZenGarden; +global using AudioImportLibAPI = AudioImportLib.API; +global using Il2CppAlmanacDataClass = Il2CppAlmanacData.AlmanacData; +global using Il2CppLevelData = Il2Cpp.LevelData; +global using Il2CppPlantInfo = Il2CppAlmanacData.PlantInfo; +#elif BEPINEX +global using AlmanacData; +global using BepInEx; +global using BepInEx.Configuration; +global using BepInEx.Logging; +global using BepInEx.Unity.IL2CPP; +global using BepInEx.Unity.IL2CPP.Utils; +global using Core; +global using GameLevel; +global using GameLevel.Abyss; +global using GameLevel.EventNodes; +global using GameLevel.RogueShooting; +global using PVPScaryPot; +global using RhythmGame; +global using RhythmGameEditor; +global using TMPro; +global using ZenGarden; +global using AudioImportLibAPI = AudioImportLib.BepInEx.API; +global using Il2CppAlmanacDataClass = AlmanacData.AlmanacData; +global using Il2CppLevelData = LevelData; +global using Il2CppPlantInfo = AlmanacData.PlantInfo; +#endif +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.Managers; +using PvZ_Fusion_Translator.Patches.Modes.Super_Editor; +#if MELONLOADER +[assembly: + MelonGame("LanPiaoPiao", "PlantsVsZombiesRH"), + MelonInfo( + typeof(PvZ_Fusion_Translator.Core), + "PvZ Fusion Translator", + "231.0.0", + "dynaslash / arifrios1st / lancerx0 / JustNull / Dakosha / Mamoru-kun / cassidy / Teyliu / Emik" + )] +#endif + +namespace PvZ_Fusion_Translator; +#pragma warning disable CA1822 // ReSharper disable once ClassNeverInstantiated.Global +#if MELONLOADER +public class Core : MelonMod +#elif BEPINEX +[BepInPlugin("PVZFusionTranslator_BepInEx", "PvZ Fusion Translator", "3.1.1"), BepInProcess("PlantsVsZombiesRH.exe")] +public class Core : BasePlugin +#endif +{ +#if BEPINEX + public sealed class UnityCoroutineHelper : MonoBehaviour + { + // ReSharper disable once MemberHidesStaticFromOuterClass + public static UnityCoroutineHelper Instance { get; private set; } + + public void Awake() => Instance = this; + } +#endif + public static string ModDirectory => +#if MELONLOADER + Path.Combine(MelonEnvironment.ModsDirectory, "PvZ_Fusion_Translator"); +#elif BEPINEX + Path.Combine(Paths.PluginPath, "PvZ_Fusion_Translator"); +#endif + public static bool IsInitialized { get; set; } + + public static Core Instance { get; private set; } +#if MELONLOADER + public MelonPreferences_Entry ConfigDefaultAudio, ConfigDefaultTextures, ConfigUseLocal; + + public MelonPreferences_Entry ConfigLanguage; + + private object _replaceTextureRoutine; +#elif BEPINEX + public static MonoBehaviour MonoInstance { get; private set; } + + public ConfigEntry ConfigDefaultAudio, ConfigDefaultTextures, ConfigUseLocal; + + public ConfigEntry ConfigLanguage; + + public new static ManualLogSource Log { get; private set; } + + private Coroutine _replaceTextureRoutine; +#endif + private static DateTime? s_dtStartToast; + + private static string s_toastText; +#if MELONLOADER + public static object Coroutine(System.Collections.IEnumerator enumerator) => + MelonCoroutines.Start(enumerator); +#elif BEPINEX + public static Coroutine Coroutine(System.Collections.IEnumerator enumerator) => + MonoInstance.StartCoroutine(enumerator); +#endif +#if MELONLOADER + public override void OnInitializeMelon() +#elif BEPINEX + public override void Load() +#endif + { + Instance = this; + LoadConfig(); + + if (ModFeatures.IsMultiLanguage) + FileLoader.LoadLanguage(); + + _replaceTextureRoutine = Coroutine(TextureStore.ReplaceTexturesCoroutine()); + TextureStore.Init(); + StringStore.Init(); + AudioStore.Init(); + FontStore.Init(); +#if MELONLOADER + base.OnInitializeMelon(); +#elif BEPINEX + Log = base.Log; + Utils.RegisterPlantIndices(); + MonoInstance = AddComponent(); + HarmonyLib.Harmony.CreateAndPatchAll(System.Reflection.Assembly.GetExecutingAssembly()); +#endif + IsInitialized = true; + } +#if MELONLOADER + public override void OnLateInitializeMelon() + { + FileLoader.LoadTravelBuffs(); + Utils.RegisterPlantIndices(); + } + + public override void OnDeinitializeMelon() + { + MelonCoroutines.Stop(_replaceTextureRoutine); + + if (ModFeatures.IsMultiLanguage) + FileLoader.SaveLanguage(); + } +#elif BEPINEX + public override bool Unload() + { + if (_replaceTextureRoutine != null) + { + MonoInstance.StopCoroutine(_replaceTextureRoutine); + Log.LogDebug("Coroutine Stopped"); + } + + FileLoader.SaveLanguage(); + return true; + } +#endif + public static void ShowToast(string message) + { + s_toastText = message; + s_dtStartToast = new(DateTime.Now.Ticks); + } +#if MELONLOADER + public override void OnLateUpdate() +#elif BEPINEX + public void OnUpdate() +#endif + { + if (ModFeatures.IsDebug) + ModFeatures.OnLateUpdate(); + + if (Input.GetKeyDown(KeyCode.Insert)) + Utils.OpenSaveDirectory(); + + if (Input.GetKeyDown(KeyCode.PageUp)) + Utils.OpenOnlineAlmanac(); + + TowerManager_Patch.UpdateText(); + + if (CustomLevelMenu_Patch.RequestTimer <= 0) + return; + + CustomLevelMenu_Patch.RequestTimer -= Time.deltaTime; + + if (CustomLevelMenu_Patch.RequestTimer < 0) + CustomLevelMenu_Patch.RequestTimer = 0; + } +#if MELONLOADER + public override void OnGUI() +#elif BEPINEX + public void OnGUI() +#endif + { + if (!ModFeatures.IsDebug) + return; + + if (s_dtStartToast is null) + return; + + GUI.Button(new(10, 10, 200, 20), $"\n{s_toastText}\n"); + var timeSpan = DateTime.Now - s_dtStartToast; + TimeSpan t = new(0, 0, 0, 2); + + if (timeSpan > t) + s_dtStartToast = null; + } +#if MELONLOADER + private void LoadConfig() + { + var category = MelonPreferences.CreateCategory("PvZ_Fusion_Translator", "Fusion Translator Settings"); + + ConfigDefaultTextures = category.CreateEntry("DefaultTextures", false); + ConfigDefaultAudio = category.CreateEntry("DefaultAudio", false); + ConfigUseLocal = category.CreateEntry("UseLocal", false); + ConfigLanguage = category.CreateEntry("Language", "English"); + + MelonPreferences.Save(); + } +#elif BEPINEX + private void LoadConfig() + { + const string MainCategory = "PvZ_Fusion_Translator"; + + if (!Config.TryGetEntry(new(MainCategory, "DefaultTextures"), out ConfigDefaultTextures)) + ConfigDefaultTextures = Config.Bind( + new(MainCategory, "DefaultTextures"), + false, + new("Use Default Textures + Translation Textures", new AcceptableValueList(true, false)) + ); + + Debug.Assert(Config.TryGetEntry(new(MainCategory, "DefaultTextures"), out ConfigDefaultTextures)); + + if (!Config.TryGetEntry(new(MainCategory, "DefaultAudio"), out ConfigDefaultAudio)) + ConfigDefaultAudio = Config.Bind( + new(MainCategory, "DefaultAudio"), + false, + new("Use Default Audio", new AcceptableValueList(true, false)) + ); + + Debug.Assert(Config.TryGetEntry(new(MainCategory, "DefaultAudio"), out ConfigDefaultAudio)); + + if (!Config.TryGetEntry(new(MainCategory, "UseLocal"), out ConfigDefaultAudio)) + ConfigUseLocal = Config.Bind( + new(MainCategory, "UseLocal"), + false, + new("Use Local", new AcceptableValueList(true, false)) + ); + + Debug.Assert(Config.TryGetEntry(new(MainCategory, "DefaultAudio"), out ConfigDefaultAudio)); + + string[] supportedLanguages = + [ + "English", "French", "Italian", "German", "Spanish", "Portuguese", "Indonesian", + "Vietnamese", "Javanese", "Russian", "Japanese", "Korean", + ]; + + if (!Config.TryGetEntry(new(MainCategory, "Language"), out ConfigLanguage)) + ConfigLanguage = Config.Bind( + new(MainCategory, "Language"), + "English", + new("Load the Game in this Language", new AcceptableValueList(supportedLanguages)) + ); + + Debug.Assert(Config.TryGetEntry(new(MainCategory, "Language"), out ConfigLanguage)); + } +#endif +} diff --git a/Source/FileLoader.cs b/Source/FileLoader.cs new file mode 100644 index 0000000..fd413e3 --- /dev/null +++ b/Source/FileLoader.cs @@ -0,0 +1,1166 @@ +using Il2CppInterop.Runtime.InteropTypes.Arrays; +using Newtonsoft.Json; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.GameObjects; +using PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; +using PvZ_Fusion_Translator.Patches.Modes.Odyssey; +using System.Text.Encodings.Web; +using System.Text.Json; + +namespace PvZ_Fusion_Translator; + +// ReSharper disable AssignNullToNotNullAttribute Unity.UnknownResource +internal static class FileLoader +{ + internal enum AssetType + { + Textures, Strings, Dumps, Almanac, Sprites, + } + + public static string GetAssetDir(AssetType assetType, Utils.LanguageEnum? language = null) + { + var languagePath = language.HasValue + ? "Localization" + Path.DirectorySeparatorChar + language + : string.Empty; + + return Path.Combine(Core.ModDirectory, languagePath, assetType.ToString()); + } + + // private static string GetAssetDir(AssetType assetType) => + // Path.Combine(Core.Instance.modsDirectory, assetType.ToString()); + + internal static void LoadStrings() => LoadStrings(Utils.Language); + + internal static void LoadStrings(Utils.LanguageEnum language) + { + var stringDir = GetAssetDir(AssetType.Strings, Utils.Language); + + if (!Directory.Exists(stringDir)) + Directory.CreateDirectory(stringDir); + + if (!Core.Instance.ConfigUseLocal.Value) + { + // load translationStrings + var translationStringsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/translation_strings.json" + ) + .Result; + + if (translationStringsContent != null) + LoadTranslationStrings(translationStringsContent); + else + { + var translationStringsPath = Path.Combine( + GetAssetDir(AssetType.Strings, Utils.Language), + "translation_strings.json" + ); + + if (File.Exists(translationStringsPath)) + LoadTranslationStrings(File.ReadAllText(translationStringsPath)); + } + + // load translationRegexs + var translationRegexsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/translation_regexs.json" + ) + .Result; + + if (translationRegexsContent != null) + LoadTranslationRegexs(translationRegexsContent); + else + { + var translationRegexsPath = Path.Combine( + GetAssetDir(AssetType.Strings, Utils.Language), + "translation_regexs.json" + ); + + if (File.Exists(translationRegexsPath)) + LoadTranslationRegexs(File.ReadAllText(translationRegexsPath)); + } + + var customLevelStringsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/customlevel_strings.json" + ) + .Result; + + if (customLevelStringsContent != null) + LoadCustomLevelStrings(customLevelStringsContent); + else + { + var customLevelStringsPath = Path.Combine( + GetAssetDir(AssetType.Strings, Utils.Language), + "customlevel_strings.json" + ); + + if (File.Exists(customLevelStringsPath)) + LoadCustomLevelStrings(File.ReadAllText(customLevelStringsPath)); + } + + // load translationRegexs + var customLevelRegexsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/customlevel_regexs.json" + ) + .Result; + + if (customLevelRegexsContent != null) + LoadCustomLevelRegexs(customLevelRegexsContent); + else + { + var customLevelRegexsPath = Path.Combine( + GetAssetDir(AssetType.Strings, Utils.Language), + "customlevel_regexs.json" + ); + + if (File.Exists(customLevelRegexsPath)) + LoadCustomLevelRegexs(File.ReadAllText(customLevelRegexsPath)); + } + + // load changelog + + LoadChangelogText(); + + // load tips + var izTipsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/tips_iz.json" + ) + .Result; + + if (izTipsContent != null) + LoadIZStrings(izTipsContent); + else + { + var izTipsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "tips_iz.json"); + + if (File.Exists(izTipsPath)) + LoadIZStrings(File.ReadAllText(izTipsPath)); + } + + var fsTipsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/tips_fs.json" + ) + .Result; + + if (fsTipsContent != null) + LoadFsStrings(fsTipsContent); + else + { + var fsTipsPath = Path.Combine(GetAssetDir(AssetType.Strings, Utils.Language), "tips_fs.json"); + + if (File.Exists(fsTipsPath)) + LoadFsStrings(File.ReadAllText(fsTipsPath)); + } + + // load almanacs + + var almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); + + if (!Directory.Exists(almanacDir)) + Directory.CreateDirectory(almanacDir); + + var plantAlmanacContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Almanac/LawnStringsTranslate.json" + ) + .Result; + + if (plantAlmanacContent != null) + AlmanacPlantMenu_Patch.LoadPlantAlmanacData(plantAlmanacContent); + else + { + var path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); + + if (File.Exists(path)) + AlmanacPlantMenu_Patch.LoadPlantAlmanacData(File.ReadAllText(path)); + } + + var zombieAlmanacContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Almanac/ZombieStringsTranslate.json" + ) + .Result; + + if (zombieAlmanacContent != null) + AlmanacZombieMenu_Patch.AlmanacJson = zombieAlmanacContent; + else + { + var path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); + + if (File.Exists(path)) + AlmanacZombieMenu_Patch.AlmanacJson = File.ReadAllText(path); + } + + var detailStringsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Almanac/DetailStringsTranslate.json" + ) + .Result; + + if (detailStringsContent != null) + LoadDetailStrings(detailStringsContent); + else + { + var path = Path.Combine(almanacDir, "DetailStringsTranslate.json"); + + if (File.Exists(path)) + LoadDetailStrings(File.ReadAllText(path)); + } + + // load travel_buffs + + LoadTravelBuffs(); + + // load abyss buffs + + //Patches.Modes.Abyss.AbyssBuffMenu_Patch.LoadAbyssBuffData(); + + SaveStrings(); + DumpJson(); + } + else + { + if (!Directory.Exists(stringDir)) + Directory.CreateDirectory(stringDir); + + try + { + foreach (var filepath in Directory.EnumerateFiles(stringDir, "*.json", SearchOption.AllDirectories)) + { + var fileName = Path.GetFileNameWithoutExtension(filepath); + StringStore.StringsDict[fileName] = filepath; + + if (ModFeatures.IsDebug) + Log.LogInfo("Loading File : " + filepath); + + var jsonString = File.ReadAllText(filepath); + + if (fileName.EndsWith("translation_strings")) + LoadTranslationStrings(jsonString); + else if (fileName.EndsWith("translation_regexs")) + LoadTranslationRegexs(jsonString); + else if (fileName.EndsWith("customlevel_strings")) + LoadCustomLevelStrings(jsonString); + else if (fileName.EndsWith("customlevel_regexs")) + LoadCustomLevelRegexs(jsonString); + else if (fileName.EndsWith("tips_iz")) + LoadIZStrings(jsonString); + else if (fileName.EndsWith("tips_fs")) + LoadFsStrings(jsonString); + //else if(fileName.EndsWith("abyss_buffs")) + //{ + // Patches.Modes.Abyss.AbyssBuffMenu_Patch.LoadAbyssBuffData(); + //} + else if (fileName.EndsWith("travel_buffs")) + LoadTravelBuffs(); + } + + var almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); + + if (!Directory.Exists(almanacDir)) + Directory.CreateDirectory(almanacDir); + + var plantAlmanacPath = Path.Combine(almanacDir, "LawnStringsTranslate.json"); + + if (File.Exists(plantAlmanacPath)) + AlmanacPlantMenu_Patch.LoadPlantAlmanacData(File.ReadAllText(plantAlmanacPath)); + + var zombieAlmanacPath = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); + + if (File.Exists(zombieAlmanacPath)) + AlmanacZombieMenu_Patch.AlmanacJson = File.ReadAllText(zombieAlmanacPath); + + var detailStringsPath = Path.Combine(almanacDir, "DetailStringsTranslate.json"); + + if (File.Exists(detailStringsPath)) + LoadDetailStrings(File.ReadAllText(detailStringsPath)); + + LoadChangelogText(); + + SaveStrings(); + DumpJson(); + } + catch (Exception e) + { + Log.LogError("Error loading string."); + Log.LogError(e.GetType() + " " + e.Message); + } + } + + Log.LogInfo("Strings loaded successfully."); + } + + internal static void LoadTranslationStrings(string content) + { + var dictionary = + System.Text.Json.JsonSerializer.Deserialize>(content); + + foreach (var (key, value) in dictionary) + StringStore.TranslationString[key] = value; + } + + internal static void LoadTranslationRegexs(string content) + { + var dictionary = + System.Text.Json.JsonSerializer.Deserialize>(content); + + foreach (var (key, value) in dictionary) + StringStore.TranslationStringRegex[key] = value; + + Zombie_Patch.LoadHpStrings(); + } + + internal static void LoadCustomLevelStrings(string content) + { + var dictionary = + System.Text.Json.JsonSerializer.Deserialize>(content); + + foreach (var (key, value) in dictionary) + StringStore.CustomLevelString[key] = value; + } + + internal static void LoadCustomLevelRegexs(string content) + { + var dictionary = + System.Text.Json.JsonSerializer.Deserialize>(content); + + foreach (var (key, value) in dictionary) + StringStore.CustomLevelStringRegex[key] = value; + } + + internal static void LoadIZStrings(string content) + { + var (izLevelData, _) = DumpIZStrings(); + + var izTranslatedTips = System.Text.Json.JsonSerializer.Deserialize>(content); + + foreach (var level in izLevelData) + { + var data = level.text; + var levelData = JsonUtility.FromJson(data); + + if (levelData.tips == null) + continue; + + if (!izTranslatedTips.ContainsKey(level.name) || + StringStore.IZTipCollectionString.ContainsKey(levelData.tips)) + continue; + + StringStore.IZLevelTipDictionary.Add(level.name, izTranslatedTips[level.name]); + StringStore.IZTipCollectionString.Add(levelData.tips, izTranslatedTips[level.name]); + } + } + + internal static void LoadFsStrings(string content) + { + var (fusionShowcaseData, _) = DumpFSStrings(); + + var fsTranslatedTips = System.Text.Json.JsonSerializer.Deserialize>(content); + + foreach (var level in fusionShowcaseData) + { + var data = level.text; + var levelData = JsonUtility.FromJson(data); + + if (levelData.tips == null) + continue; + + if (!fsTranslatedTips.ContainsKey(level.name) || + StringStore.FSTipCollectionString.ContainsKey(levelData.tips)) + continue; + + StringStore.FSLevelTipDictionary.Add(level.name, fsTranslatedTips[level.name]); + StringStore.FSTipCollectionString.Add(levelData.tips, fsTranslatedTips[level.name]); + } + } + + internal static void LoadDetailStrings(string content) + { + var (detailStringsData, _) = DumpDetailStrings(); + + var translatedDetailStrings = System.Text.Json.JsonSerializer.Deserialize>(content); + AlmanacSelectMenu_Patch.DetailStrings = translatedDetailStrings; + + foreach (var detailString in detailStringsData.details) + if (translatedDetailStrings.TryGetValue(detailString.title, out var s)) + AlmanacSelectMenu_Patch.DetailTranslateStrings[detailString.text] = s; + } + + internal static void LoadChangelogText() + { + var stringDir = GetAssetDir(AssetType.Strings, Utils.Language); + var changelogDir = Path.Combine(stringDir, "changelog.txt"); + + if (!File.Exists(changelogDir)) + File.WriteAllText(changelogDir, ""); + + var changelogText = File.ReadAllText(changelogDir); + + if (!Core.Instance.ConfigUseLocal.Value) + { + var changelogContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/changelog.txt" + ) + .Result; + + if (changelogContent != null) + changelogText = changelogContent; + } + else + changelogText = File.ReadAllText(changelogDir); + + NoticePauseMenu_Patch.ChangelogText = changelogText; + } + + internal static void LoadTravelBuffs() + { + if (!Core.Instance.ConfigUseLocal.Value) + { + var travelBuffsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/travel_buffs.json" + ) + .Result; + + if (travelBuffsContent != null) + TravelMgr_Patch.GenerateTranslatedTravelBuffs(travelBuffsContent); + else + { + var travelBuffsPath = Path.Combine( + GetAssetDir(AssetType.Strings, Utils.Language), + "travel_buffs.json" + ); + + if (File.Exists(travelBuffsPath)) + TravelMgr_Patch.GenerateTranslatedTravelBuffs(File.ReadAllText(travelBuffsPath)); + } + } + else + { + var stringDir = GetAssetDir(AssetType.Strings, Utils.Language); + + foreach (var jsonString in from filepath in + Directory.EnumerateFiles(stringDir, "*.json", SearchOption.AllDirectories) + let fileName = Path.GetFileNameWithoutExtension(filepath) + let jsonString = File.ReadAllText(filepath) + where fileName.EndsWith("travel_buffs") + select jsonString) + TravelMgr_Patch.GenerateTranslatedTravelBuffs(jsonString); + } + } + + internal static void LoadTextures() + { + // Default or Custom Texturse -> English Textures -> Localized Textures + try + { + if (!Core.Instance.ConfigDefaultTextures.Value) + LoadCustomTextures(); + } + catch (Exception e) + { + Log.LogError("Error loading texture setting."); + Log.LogError($"{e.GetType()} {e.Message}"); + } + + if (ModFeatures.IsMultiLanguage) + { + LoadLocalizedTextures(Utils.Language); + LoadLocalizedSprites(Utils.Language); + } + else + LoadLocalizedTextures(); + + Log.LogInfo("Textures loaded successfully."); + } + + // ReSharper disable once FunctionComplexityOverflow + internal static void LoadLocalizedTextures(Utils.LanguageEnum? language = null) + { + var textureDir = GetAssetDir(AssetType.Textures, language); + + if (!Directory.Exists(textureDir)) + Directory.CreateDirectory(textureDir); + + try + { + var localTocDir = Path.Combine(textureDir, "Texture_TOC.json"); + + if (!File.Exists(localTocDir)) + File.WriteAllText(localTocDir, "{}"); + + var localTocContent = File.ReadAllText(localTocDir); + var localToc = System.Text.Json.JsonSerializer.Deserialize>(localTocContent); + + var basePath = Core.ModDirectory; + + if (!Core.Instance.ConfigUseLocal.Value) + { + var textureTocRequest = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Textures/Texture_TOC.json" + ) + .Result; + + if (textureTocRequest != null) + { + var textureToc = + JsonConvert.DeserializeObject>(textureTocRequest); + + List toDownload = new(); + + foreach (var pair in textureToc) + { + if (!localToc.TryGetValue(pair.Key, out var value)) + { + toDownload.Add(pair.Key); + continue; + } + + if (pair.Value != value) + toDownload.Add(pair.Key); + + if (!File.Exists(Path.Combine(basePath, pair.Key))) + toDownload.Add(pair.Key); + } + + var toWriteText = SerializeWithIndentation(textureToc); + File.WriteAllText(localTocDir, toWriteText); + + foreach (var path in toDownload) + { + var downloadPath = Path.Combine(basePath, path); + + const string BaseUrl = + "https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; + + var imageData = Utils.GetByteDataFromWeb($"{BaseUrl}{path}").Result; + + if (imageData == null) + continue; + + var fileName = Path.GetFileName(downloadPath); + _ = Utils.LoadImage(imageData); + TextureStore.TextureDict[fileName] = imageData; + + if (!Directory.Exists(Path.GetDirectoryName(downloadPath))) + Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); + + File.WriteAllBytes(downloadPath, imageData); + } + } + } + + foreach (var filepath in Directory.EnumerateFiles(textureDir, "*.png", SearchOption.AllDirectories)) + { + if (filepath.Contains("[Custom Textures]", StringComparison.OrdinalIgnoreCase) && + Core.Instance.ConfigDefaultTextures.Value) + continue; + + if (!localToc.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) && + SerializeWithIndentation(localToc) != "{}") + continue; + + if (ModFeatures.IsDebug) + Log.LogDebug("Loading File : " + filepath); + + var imageData = File.ReadAllBytes(filepath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.TextureDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; + } + } + + catch (Exception e) + { + Log.LogError("Error loading Texture."); + Log.LogError(e.GetType() + " " + e.Message); + } + } + + internal static void LoadLocalizedSprites(Utils.LanguageEnum? language = null) + { + var textureDir = GetAssetDir(AssetType.Sprites, language); + + if (!Directory.Exists(textureDir)) + Directory.CreateDirectory(textureDir); + + try + { + var trueTextureDir = GetAssetDir(AssetType.Textures, language); + var localToc = new Dictionary(); + var localTocDir = Path.Combine(trueTextureDir, "Texture_TOC.json"); + + if (!File.Exists(localTocDir)) + File.WriteAllText(localTocDir, "{}"); + + var localTocContent = File.ReadAllText(localTocDir); + localToc = System.Text.Json.JsonSerializer.Deserialize>(localTocContent); + + var basePath = Core.ModDirectory; + + if (!Core.Instance.ConfigUseLocal.Value) + { + var textureTocRequest = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Textures/Texture_TOC.json" + ) + .Result; + + if (textureTocRequest != null) + { + var textureToc = + JsonConvert.DeserializeObject>(textureTocRequest); + + List toDownload = new(); + + foreach (var pair in textureToc) + { + if (!localToc.TryGetValue(pair.Key, out var value)) + { + toDownload.Add(pair.Key); + continue; + } + + if (pair.Value != value) + toDownload.Add(pair.Key); + + if (!File.Exists(Path.Combine(basePath, pair.Key))) + toDownload.Add(pair.Key); + } + + var toWriteText = SerializeWithIndentation(textureToc); + File.WriteAllText(localTocDir, toWriteText); + + foreach (var path in toDownload) + { + var downloadPath = Path.Combine(basePath, path); + + var baseUrl = + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; + + var url = baseUrl + path; + + var imageData = Utils.GetByteDataFromWeb(url).Result; + + if (imageData != null) + { + var fileName = Path.GetFileName(downloadPath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.SpriteDict[fileName] = imageData; + + if (!Directory.Exists(Path.GetDirectoryName(downloadPath))) + Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); + + File.WriteAllBytes(downloadPath, imageData); + } + } + } + } + + foreach (var filepath in Directory.EnumerateFiles(textureDir, "*.png", SearchOption.AllDirectories)) + { + if (filepath.Contains("[Custom Textures]", StringComparison.OrdinalIgnoreCase) && + Core.Instance.ConfigDefaultTextures.Value) + continue; + + if (!localToc.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) && + SerializeWithIndentation(localToc) != "{}") + continue; + + if (ModFeatures.IsDebug) + Log.LogDebug("Loading File (Sprite): " + filepath); + + var imageData = File.ReadAllBytes(filepath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.SpriteDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; + } + } + + catch (Exception e) + { + Log.LogError("Error loading Texture."); + Log.LogError(e.GetType() + " " + e.Message); + } + } + + internal static void LoadDefaultTextures() + { + if (!Core.Instance.ConfigDefaultTextures.Value) + return; + + var textureDefaultDir = Path.Combine( + Core.ModDirectory, + nameof(AssetType.Dumps), + "Default Textures [Do Not Remove]" + ); + + if (!Directory.Exists(textureDefaultDir)) + Directory.CreateDirectory(textureDefaultDir); + + try + { + var trueTextureDir = Path.Combine(Core.ModDirectory, "[Custom Textures]"); + var localToc = new Dictionary(); + var localTocDir = Path.Combine(trueTextureDir, "Default_TOC.json"); + + if (!File.Exists(localTocDir)) + File.WriteAllText(localTocDir, "{}"); + + var localTocContent = File.ReadAllText(localTocDir); + localToc = System.Text.Json.JsonSerializer.Deserialize>(localTocContent); + + var basePath = Core.ModDirectory; + + if (!Core.Instance.ConfigUseLocal.Value) + { + var textureTocRequest = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/{Uri.EscapeDataString("[Custom Textures]")}/Default_TOC.json" + ) + .Result; + + if (textureTocRequest != null) + { + var textureToc = + JsonConvert.DeserializeObject>(textureTocRequest); + + List toDownload = new(); + + foreach (var pair in textureToc) + { + if (!localToc.TryGetValue(pair.Key, out var value)) + { + toDownload.Add(pair.Key); + continue; + } + + if (pair.Value != value) + toDownload.Add(pair.Key); + + if (!File.Exists(Path.Combine(basePath, pair.Key))) + toDownload.Add(pair.Key); + } + + var toWriteText = SerializeWithIndentation(textureToc); + File.WriteAllText(localTocDir, toWriteText); + + foreach (var path in toDownload) + { + var downloadPath = Path.Combine(basePath, path); + + var baseUrl = + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; + + var url = baseUrl + path; + + var imageData = Utils.GetByteDataFromWeb(url).Result; + + if (imageData != null) + { + var fileName = Path.GetFileName(downloadPath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.TextureDict[fileName] = imageData; + + if (!Directory.Exists(Path.GetDirectoryName(downloadPath))) + Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); + + File.WriteAllBytes(downloadPath, imageData); + } + } + } + } + + foreach (var filepath in Directory.EnumerateFiles( + textureDefaultDir, + "*.png", + SearchOption.AllDirectories + )) + { + if (!localToc.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) && + SerializeWithIndentation(localToc) != "{}") + continue; + + var imageData = File.ReadAllBytes(filepath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.TextureDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; + } + } + + catch (Exception e) + { + Log.LogError("Error loading Texture."); + Log.LogError(e.GetType() + " " + e.Message); + } + } + + internal static void LoadCustomTextures() + { + var texturePackDir = Path.Combine(Core.ModDirectory, "[Custom Textures]"); + + if (!Directory.Exists(texturePackDir)) + Directory.CreateDirectory(texturePackDir); + + try + { + var trueTextureDir = Path.Combine(Core.ModDirectory, "[Custom Textures]"); + var localToc = new Dictionary(); + var localTocDir = Path.Combine(trueTextureDir, "Custom_TOC.json"); + + if (!File.Exists(localTocDir)) + File.WriteAllText(localTocDir, "{}"); + + var localTocContent = File.ReadAllText(localTocDir); + localToc = System.Text.Json.JsonSerializer.Deserialize>(localTocContent); + + var basePath = Core.ModDirectory; + + if (!Core.Instance.ConfigUseLocal.Value) + { + var textureTocRequest = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/{Uri.EscapeDataString("[Custom Textures]")}/Custom_TOC.json" + ) + .Result; + + if (textureTocRequest != null) + { + var textureToc = + JsonConvert.DeserializeObject>(textureTocRequest); + + List toDownload = new(); + + foreach (var pair in textureToc) + { + if (!localToc.TryGetValue(pair.Key, out var value)) + { + toDownload.Add(pair.Key); + continue; + } + + if (pair.Value != value) + { + toDownload.Add(pair.Key); + continue; + } + + if (!File.Exists(Path.Combine(basePath, pair.Key))) + toDownload.Add(pair.Key); + } + + var toWriteText = SerializeWithIndentation(textureToc); + File.WriteAllText(localTocDir, toWriteText); + + foreach (var path in toDownload) + { + var downloadPath = Path.Combine(basePath, path); + + var baseUrl = + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/"; + + var url = baseUrl + path; + + var imageData = Utils.GetByteDataFromWeb(url).Result; + + if (imageData != null) + { + var fileName = Path.GetFileName(downloadPath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.TextureDict[fileName] = imageData; + + if (!Directory.Exists(Path.GetDirectoryName(downloadPath))) + Directory.CreateDirectory(Path.GetDirectoryName(downloadPath)); + + File.WriteAllBytes(downloadPath, imageData); + } + } + } + } + + foreach (var filepath in Directory.EnumerateFiles(texturePackDir, "*.png", SearchOption.AllDirectories)) + { + if (!localToc.ContainsKey(filepath.Replace(basePath + "\\", "").Replace("\\", "/")) && + SerializeWithIndentation(localToc) != "{}") + continue; + + var imageData = File.ReadAllBytes(filepath); + var texture2D = Utils.LoadImage(imageData); + TextureStore.TextureDict[Path.GetFileNameWithoutExtension(filepath)] = imageData; + } + } + + catch (Exception e) + { + Log.LogError("Error loading Texture."); + Log.LogError(e.GetType() + " " + e.Message); + } + } + + internal static void SaveStrings() + { + var stringDir = GetAssetDir(AssetType.Strings, ModFeatures.IsMultiLanguage ? Utils.Language : null); + + if (!Directory.Exists(stringDir)) + Directory.CreateDirectory(stringDir); + + // save regexs + + var translationStringRegex = SerializeWithIndentation(StringStore.TranslationStringRegex, 2); + + File.WriteAllText(Path.Combine(stringDir, "translation_regexs.json"), translationStringRegex); + + // save strings + + var translationString = SerializeWithIndentation(StringStore.TranslationString, 2); + + File.WriteAllText(Path.Combine(stringDir, "translation_strings.json"), translationString); + + // save iz tips + + var izTipCollectionString = SerializeWithIndentation(StringStore.IZLevelTipDictionary, 1, ' '); + + File.WriteAllText(Path.Combine(stringDir, "tips_iz.json"), izTipCollectionString); + + // save fs tips + + var fsLevelTipDictionary = SerializeWithIndentation(StringStore.FSLevelTipDictionary); + + File.WriteAllText(Path.Combine(stringDir, "tips_fs.json"), fsLevelTipDictionary); + + // save changelog + + if (NoticePauseMenu_Patch.ChangelogText != "") + File.WriteAllText(Path.Combine(stringDir, "changelog.txt"), NoticePauseMenu_Patch.ChangelogText); + + // save abyss buffs + + //if(Patches.Modes.Abyss.AbyssBuffMenu_Patch.abyssBuffData != new Dictionary()) + //{ + // string abyssBuffData = SerializeWithIndentation(Patches.Modes.Abyss.AbyssBuffMenu_Patch.abyssBuffData, 2); + // File.WriteAllText(Path.Combine(stringDir, "abyss_buffs.json"), abyssBuffData); + //} + + // save almanacs + + var almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); + + if (AlmanacPlantMenu_Patch.AlmanacJson != "") + { + var plantAlmanac = SerializeWithIndentation(AlmanacPlantMenu_Patch.AlmanacJson); + + File.WriteAllText( + Path.Combine(almanacDir, "LawnStringsTranslate.json"), + AlmanacPlantMenu_Patch.AlmanacJson + ); + } + + if (AlmanacZombieMenu_Patch.AlmanacJson != "") + { + var zombieAlmanac = SerializeWithIndentation(AlmanacZombieMenu_Patch.AlmanacJson); + + File.WriteAllText( + Path.Combine(almanacDir, "ZombieStringsTranslate.json"), + AlmanacZombieMenu_Patch.AlmanacJson + ); + } + + if (AlmanacSelectMenu_Patch.DetailStrings != new Dictionary()) + { + var detailStrings = SerializeWithIndentation(AlmanacSelectMenu_Patch.DetailStrings); + + File.WriteAllText(Path.Combine(almanacDir, "DetailStringsTranslate.json"), detailStrings); + } + } + + public static string SerializeWithIndentation(T value, int size = 4, char indentChar = ' ') + { + var stringWriter = new StringWriter(); + + using (JsonTextWriter writer = new(stringWriter)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = size; + writer.IndentChar = indentChar; + + Newtonsoft.Json.JsonSerializer serializer = new(); + serializer.Serialize(writer, value, typeof(T)); + } + + return stringWriter.ToString(); + } + + public static void DumpJson() + { + var dumpDir = GetAssetDir(AssetType.Dumps); + + if (!Directory.Exists(dumpDir)) + Directory.CreateDirectory(dumpDir); + + var lawnStrings = Resources.Load("LawnStrings").text; + var zombieStrings = Resources.Load("ZombieStrings").text; + //string AbyssBuffData = Resources.Load("AbyssBuffData").text; + File.WriteAllText(Path.Combine(dumpDir, "LawnStrings.json"), lawnStrings); + File.WriteAllText(Path.Combine(dumpDir, "ZombieStrings.json"), zombieStrings); + //File.WriteAllText(Path.Combine(dumpDir, "AbyssBuffData.json"), AbyssBuffData); + + // dump iz tips + var izDump = DumpIZStrings(); + var izLevelData = izDump.Item1; + var izLevelDataDump = izDump.Item2; + + File.WriteAllText( + Path.Combine(dumpDir, "tips_iz.json"), + System.Text.Json.JsonSerializer.Serialize( + izLevelDataDump, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + + // dump fusion showcase tips + var fusionShowcaseDump = DumpFSStrings(); + var fusionShowcaseData = fusionShowcaseDump.Item1; + var fusionShowcaseDataDump = fusionShowcaseDump.Item2; + + File.WriteAllText( + Path.Combine(dumpDir, "tips_fs.json"), + System.Text.Json.JsonSerializer.Serialize( + fusionShowcaseDataDump, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + + // dump almanac mechanics + var (_, detailStrings) = DumpDetailStrings(); + + File.WriteAllText( + Path.Combine(dumpDir, "DetailStrings.json"), + System.Text.Json.JsonSerializer.Serialize( + detailStrings, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + } + + public static ValueTuple, Dictionary> DumpIZStrings() + { + var izLevelData = Resources.LoadAll("izleveldata"); + var izLevelDataDump = new Dictionary(); + + foreach (var level in izLevelData) + { + var data = level.text; + var levelData = JsonUtility.FromJson(data); + + if (levelData.tips != null) + izLevelDataDump.Add(level.name, levelData.tips); + } + + return (izLevelData, izLevelDataDump); + } + + public static (Il2CppArrayBase, Dictionary) DumpFSStrings() + { + var fusionShowcaseData = Resources.LoadAll("leveldata/explore"); + var fusionShowcaseDataDump = new Dictionary(); + + foreach (var level in fusionShowcaseData) + { + var data = level.text; + var levelData = JsonUtility.FromJson(data); + + if (levelData.tips != null) + fusionShowcaseDataDump.Add(level.name, levelData.tips); + } + + return (fusionShowcaseData, fusionShowcaseDataDump); + } + + public static (Il2CppAlmanacDataClass, Dictionary) DumpDetailStrings() + { + var detailStringsData = Resources.Load("detailstrings").text; + var detailStrings = JsonUtility.FromJson(detailStringsData); + Dictionary detailStringsDump = new(); + + foreach (var detailString in detailStrings.details) + detailStringsDump[detailString.title] = detailString.text; + + return (detailStrings, detailStringsDump); + } + + public static void DumpUntranslatedStrings(string text) + { + Debug.Assert(ModFeatures.IsDebug, nameof(ModFeatures.IsDebug)); + Log.LogDebug($"Untranslated String: {text}"); + var dumpDir = GetAssetDir(AssetType.Dumps); + var jsonFile = Path.Combine(dumpDir, "UntranslatedStrings.json"); + + if (!Directory.Exists(dumpDir)) + Directory.CreateDirectory(dumpDir); + + if (!File.Exists(jsonFile)) + File.WriteAllText(jsonFile, "{}"); // Initialize empty JSON object + + var json = File.ReadAllText(jsonFile); + var untranslatedStrings = System.Text.Json.JsonSerializer.Deserialize>(json); + + if (!untranslatedStrings.TryAdd(text, text)) + return; + + JsonSerializerOptions options = new() + { + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + WriteIndented = true, + }; + + File.WriteAllText(jsonFile, System.Text.Json.JsonSerializer.Serialize(untranslatedStrings, options)); + } + + internal static void LoadLanguage() + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + + try + { + // Load the language preference as a string and parse it into the enum + var languageName = Core.Instance.ConfigLanguage.Value; + + if (Enum.TryParse(languageName, out Utils.LanguageEnum loadedLanguage)) + Utils.Language = loadedLanguage; + else + { + Log.LogWarning($"Invalid language '{languageName}' found in preferences. Falling back to English."); + Utils.Language = Utils.LanguageEnum.English; // Default fallback + } + + Log.LogWarning($"Loaded language {languageName}"); + } + catch (Exception e) + { + Log.LogError("Error loading language setting."); + Log.LogError($"{e.GetType()} {e.Message}"); + } + + Log.LogInfo($"Language has been loaded: {Utils.Language}"); + } + + internal static void SaveLanguage() + { + Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + + try + { + // Save the current language as a string + Core.Instance.ConfigLanguage.Value = Utils.Language.ToString(); + + // Ensure changes are written to the config file + // MelonPreferences.Save(); + } + catch (Exception e) + { + Log.LogError("Error saving language setting."); + Log.LogError($"{e.GetType()} {e.Message}"); + } + // Log.LogInfo($"Language has been saved: {Utils.Language}"); + } +} diff --git a/Source/FontHandler.cs b/Source/FontHandler.cs new file mode 100644 index 0000000..dd730fc --- /dev/null +++ b/Source/FontHandler.cs @@ -0,0 +1,43 @@ +namespace PvZ_Fusion_Translator; + +public static class FontHandler +{ + public static Font LoadFont(string pathFromModFolder, bool throwException) + { + var fontFilePath = Path.Combine(Core.ModDirectory, pathFromModFolder); + + if (!File.Exists(fontFilePath)) + { + if (throwException) + Log.LogWarning($"Font not found at path: '{fontFilePath}'."); + + return null; + } + + Font font = new(); + Font.Internal_CreateFontFromPath(font, fontFilePath); + return font; + } + + public static TMP_FontAsset ConvertToTMP(this Font font) + { + var fontAsset = TMP_FontAsset.CreateFontAsset(font); + + if (fontAsset != null) + return fontAsset; + + Log.LogWarning($"Failed to create TMP_FontAsset from font '{font.name}'."); + return null; + } + + public static TMP_FontAsset LoadTMPFont(string pathFromModFolder, bool throwException) + { + var font = LoadFont(pathFromModFolder, throwException); + + if (!font) + return null; + + var fontAsset = font.ConvertToTMP(); + return fontAsset; + } +} diff --git a/Source/Log.cs b/Source/Log.cs new file mode 100644 index 0000000..04bd92f --- /dev/null +++ b/Source/Log.cs @@ -0,0 +1,60 @@ +// ReSharper disable once RedundantUsingDirective +using System.Drawing; + +namespace PvZ_Fusion_Translator; + +internal static class Log +{ +#if MELONLOADER + public static void LogDebug(object txt) => Melon.Logger.Msg(ColorARGB.Gray, txt); + + public static void LogDebug(string txt) => Melon.Logger.Msg(ColorARGB.Gray, txt); + + public static void LogDebug(string txt, params object[] args) => + Melon.Logger.Msg(ColorARGB.Gray, txt, args); + + public static void LogInfo(object txt) => Melon.Logger.Msg(ColorARGB.Blue, txt); + + public static void LogInfo(string txt) => Melon.Logger.Msg(ColorARGB.Blue, txt); + + public static void LogInfo(string txt, params object[] args) => + Melon.Logger.Msg(ColorARGB.Blue, txt, args); + + public static void LogWarning(object txt) => Melon.Logger.Warning(txt); + + public static void LogWarning(string txt) => Melon.Logger.Warning(txt); + + public static void LogWarning(string txt, params object[] args) => Melon.Logger.Warning(txt, args); + + public static void LogError(object txt) => Melon.Logger.Error(txt); + + public static void LogError(string txt) => Melon.Logger.Error(txt); + + public static void LogError(string txt, params object[] args) => Melon.Logger.Error(txt, args); +#elif BEPINEX + + public static void LogDebug(object txt) => Core.Log.LogDebug(txt); + + public static void LogDebug(string txt) => Core.Log.LogDebug(txt); + + public static void LogDebug(string txt, params object[] args) => Core.Log.LogDebug(string.Format(txt, args)); + + public static void LogInfo(object txt) => Core.Log.LogInfo(txt); + + public static void LogInfo(string txt) => Core.Log.LogInfo(txt); + + public static void LogInfo(string txt, params object[] args) => Core.Log.LogInfo(string.Format(txt, args)); + + public static void LogWarning(object txt) => Core.Log.LogWarning(txt); + + public static void LogWarning(string txt) => Core.Log.LogWarning(txt); + + public static void LogWarning(string txt, params object[] args) => Core.Log.LogWarning(string.Format(txt, args)); + + public static void LogError(object txt) => Core.Log.LogError(txt); + + public static void LogError(string txt) => Core.Log.LogError(txt); + + public static void LogError(string txt, params object[] args) => Core.Log.LogError(string.Format(txt, args)); +#endif +} diff --git a/Source/ModFeatures.cs b/Source/ModFeatures.cs new file mode 100644 index 0000000..c0c411d --- /dev/null +++ b/Source/ModFeatures.cs @@ -0,0 +1,106 @@ +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator; + +public static class ModFeatures +{ + public enum ModType + { + ReloadStrings, ReloadTextures, ExportLevelStrings, + } + + private class ModFeature + { + public string Name { get; private set; } + + public ModType ModType { get; private set; } + + public KeyCode KeyCode { get; private set; } + + public bool IsActive { get; set; } + + public ModFeature(string name, ModType modType, KeyCode keyCode, bool defaultValue = false) + { + Name = name; + ModType = modType; + KeyCode = keyCode; + IsActive = defaultValue; + } + + public void ToggleFeature() + { + switch (ModType) + { + case ModType.ReloadStrings: + StringStore.Reload(); + Core.ShowToast("Strings Reloaded!"); + return; + case ModType.ReloadTextures: + TextureStore.Reload(); + Core.ShowToast("Textures Reloaded!"); + return; + case ModType.ExportLevelStrings: + { + var customMenu = UnityEngine.Object.FindObjectOfType(); + + if (!customMenu) + return; + + if (customMenu.isActiveAndEnabled) + { + Patches.Modes.Super_Editor.GameLevel.LevelManager_Patch + .ExportLevelStrings(customMenu.LevelData); + + Core.ShowToast("Dumped level strings!"); + } + + return; + } + } + } + } + + public static bool IsDebug { get; } = IsDefined("PVZ_FUSION_TRANSLATOR_DEBUG"); + + public static bool IsTesting { get; } = IsDefined("PVZ_FUSION_TRANSLATOR_TESTING"); + + public static bool IsAudioTesting { get; } = IsDefined("PVZ_FUSION_TRANSLATOR_AUDIO_TESTING"); + + public static bool IsMultiLanguage { get; } = IsDefined("PVZ_FUSION_TRANSLATOR_MULTI_LANGUAGE", true); + + private static Dictionary s_featureLists = new() + { + { ModType.ReloadStrings, new("Reload Strings", ModType.ReloadStrings, KeyCode.Home, true) }, + { ModType.ReloadTextures, new("Reload Textures", ModType.ReloadTextures, KeyCode.End, true) }, + { + ModType.ExportLevelStrings, + new("Export Level Strings", ModType.ExportLevelStrings, KeyCode.N, true) + }, + }; + + public static void ToggleFeature(ModType modType) + { + if (!s_featureLists.ContainsKey(modType)) + return; + + s_featureLists[modType].ToggleFeature(); + } + + public static void OnLateUpdate() + { + foreach (var (type, feature) in s_featureLists) + if (feature.KeyCode != KeyCode.None && Enum.IsDefined(typeof(KeyCode), feature.KeyCode)) + if (Input.GetKeyDown(feature.KeyCode)) + feature.ToggleFeature(); + } + + static bool IsDefined(string env, bool fallback = false) + { + var ret = + Environment.GetEnvironmentVariable(env)?.ToUpperInvariant() is not "FALSE" and not "0" and var value && + (!string.IsNullOrWhiteSpace(value) || fallback); + + Log.LogInfo($"The feature '{env}' is {(ret ? "enabled" : "disabled")}."); + return ret; + } +} diff --git a/Source/Patches/BaseTextObjects/InGameText_Patch.cs b/Source/Patches/BaseTextObjects/InGameText_Patch.cs new file mode 100644 index 0000000..695c26a --- /dev/null +++ b/Source/Patches/BaseTextObjects/InGameText_Patch.cs @@ -0,0 +1,369 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.Modes.Odyssey; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.Patches.BaseTextObjects; + +[HarmonyPatch(typeof(InGameText))] +public static class InGameText_Patch +{ +#pragma warning disable CA2211 + public static string CurrentText = ""; +#pragma warning restore CA2211 + [HarmonyPatch(nameof(InGameText.ShowText)), HarmonyPostfix] + public static void ShowText(InGameText __instance) => TranslateInGameText(__instance); + + [HarmonyPatch(nameof(InGameText.DebugWarning)), HarmonyPostfix] + public static void DebugWarning(InGameText __instance) => TranslateInGameText(__instance); + + [HarmonyPatch(nameof(InGameText.Update)), HarmonyPostfix] + public static void Update(InGameText __instance) => TranslateInGameText(__instance); + + public static void TranslateInGameText(InGameText __instance) + { + TextMeshProUGUI txt = null; + + if (__instance.textMesh == null || __instance.textHead == null) + { + if (__instance.TryGetComponent(out TextMeshProUGUI selfTxt)) + txt = selfTxt; + } + else + txt = __instance.textMesh; + + if (txt == null) + return; + + if (!txt.gameObject.active) + return; + + TranslateInGameTextMesh(txt); + } + + public static void TranslateInGameTextMesh(TextMeshProUGUI txt) + { + if (txt == null) + return; + + if (txt.text == CurrentText) + return; + + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var originalText = txt.text; + var lockedPlantMatch = CheckLockedMessage(originalText); + var travelMatch = TravelMgr_Patch.MatchTravelBuff(originalText); + var godsGachaCheck = CheckGodsGachaPopup(originalText); + var godsGachaMatch = ""; + var superEditorPlantMatch = CheckSuperEditorPopup(originalText); + var customLevelRegexMatch = CheckCustomLevelRegex(originalText); + var qualityCheckMatch = CheckQualityUpgrade(originalText); + + godsGachaMatch = godsGachaCheck switch + { + 1 or 2 or 3 => TranslateGodsGachaPopup(originalText, godsGachaCheck), + _ => godsGachaMatch, + }; + + if (godsGachaMatch != "") + { + txt.text = godsGachaMatch; + + if (txt.gameObject.name.Contains("main")) + { + originalText = txt.text; + var shadowText = txt.transform.parent.Find("Text_shadow"); + + if (shadowText != null) + shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); + } + } + else if (travelMatch != "") + { + txt.text = TravelMgr_Patch.AddBuffName(travelMatch); + + if (txt.gameObject.name.Contains("main")) + { + originalText = txt.text; + var shadowText = txt.transform.parent.Find("Text_shadow"); + + if (shadowText != null) + shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); + } + } + else if (qualityCheckMatch != "") + txt.text = qualityCheckMatch; + else if (superEditorPlantMatch != "") + txt.text = superEditorPlantMatch; + else if (lockedPlantMatch != "") + txt.text = lockedPlantMatch; + else if (customLevelRegexMatch != "") + txt.text = customLevelRegexMatch; + else if (Regex.Match(txt.text, "(]*>.*?)", RegexOptions.Singleline).Success && + !StringStore.TranslationString.ContainsKey(txt.text) && + !StringStore.FSTipCollectionString.ContainsKey(txt.text) && + !StringStore.IZTipCollectionString.ContainsKey(txt.text) && + !StringStore.CustomLevelString.ContainsKey(txt.text)) + { + txt.text = StringStore.TranslateColorText(txt.text, true); + + if (txt.gameObject.name.Contains("main")) + { + originalText = txt.text; + var shadowText = txt.transform.parent.Find("Text_shadow"); + + if (shadowText != null) + shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); + } + } + else + { + txt.text = StringStore.TranslateText(txt.text, true); + + if (txt.gameObject.name.Contains("main")) + { + originalText = txt.text; + var shadowText = txt.transform.parent.Find("Text_shadow"); + + if (shadowText != null) + shadowText.GetComponent().text = Utils.RemoveColorTags(originalText); + } + } + + txt.font = fontAsset; + + CurrentText = txt.text; + } + + public const string NamePlantedPattern = "种植了:([^\\s]+)"; + public const string NameUpgradedPattern = @"升级成功:([^\s]+) -> ([^\s]+)"; + public const string NameAlreadyPlantedPattern = "场上已经有一个([^\\s]+)了"; + public const string UpgradePathRemovedPattern = "已移除路线:([^\\s]+)"; + + public const string LockedPlantPattern = @"^([\s\S]+)\+([\S]+)$"; + public const string MultiLockedPlantPattern = @"^或 ([\s\S]+)\+([\S]+)$"; + + public const string QualityChangePattern = + """ + 诸神注视着你,并选中了一个他们喜欢的词条 + 植物【([\S]+)】的词条【强化:([\S]+)】获得品质升级 + 当前品质:([\S]+) + """; + + public static readonly Dictionary FallbackFStrs = new() + { + { NamePlantedPattern, "{0} planted!" }, + { NameUpgradedPattern, "{0} successfully upgraded to {1}!" }, + { NameAlreadyPlantedPattern, "{0} already exists on the lawn!" }, + { UpgradePathRemovedPattern, "Upgrade Path removed for {0}" }, + { @"([^\s]+)\((\d+)\)", "{0}({1})" }, + { LockedPlantPattern, "{0} + {1}" }, + { MultiLockedPlantPattern, "or {0} + {1}" }, + { + QualityChangePattern, + """ + The gods are watching you, and they have granted you an upgrade! + The {1} upgrade for {0} has been upgraded. + Current Quality: {2} + """ + }, + }; + + public static int CheckGodsGachaPopup(string originalText) + { + var res = 0; + + if (Regex.IsMatch(originalText, NamePlantedPattern)) + res = 1; + else if (Regex.IsMatch(originalText, NameUpgradedPattern)) + res = 2; + else if (Regex.IsMatch(originalText, NameAlreadyPlantedPattern)) + res = 3; + + return res; + } + + public static string TranslateGodsGachaPopup(string originalText, int type) => + type switch + { + 1 => StringStore.TranslateText(originalText, NamePlantedPattern), + 2 => StringStore.TranslateText(originalText, NameUpgradedPattern), + 3 => StringStore.TranslateText(originalText, NameAlreadyPlantedPattern), + _ => originalText, + }; + + public static string TranslatePlantNameParts(string originalText, string pattern) + { + var res = ""; + var match = Regex.Match(originalText, pattern); + + if (!match.Success) + return res; + + var groups = match.Groups; + + var fStr = StringStore.TranslationStringRegex.TryGetValue(pattern, out var value) + ? value + : FallbackFStrs[pattern]; + + List dynamicParts = []; + + for (var i = 1; i < groups.Count; i++) + { + var group = groups[i].Value; + var plantName = Utils.GetPlantNameFromAlmanac(group); + dynamicParts.Add(plantName); + } + + res = string.Format(fStr, [..dynamicParts]); + + return res; + } + + public static string TranslatePlantNameParts(string originalText, string pattern, string fallback) + { + var res = ""; + var match = Regex.Match(originalText, pattern); + + if (!match.Success) + return res; + + var groups = match.Groups; + + var fStr = StringStore.TranslationStringRegex.GetValueOrDefault(pattern, fallback); + + List dynamicParts = []; + + for (var i = 1; i < groups.Count; i++) + { + var group = groups[i].Value; + var plantName = Utils.GetPlantNameFromAlmanac(group); + + if (plantName == "") + plantName = StringStore.TranslateText(group); + + dynamicParts.Add(plantName); + } + + res = string.Format(fStr, [..dynamicParts]); + + return res; + } + + public static string CheckSuperEditorPopup(string originalText) + { + var res = ""; + + if (Regex.IsMatch(originalText, UpgradePathRemovedPattern)) + res = StringStore.TranslateText(originalText, UpgradePathRemovedPattern); + else if (Regex.IsMatch(originalText, "当前全部基础植物:(.*)")) + { + const string Pattern = "当前全部基础植物:(.*)"; + var match = Regex.Match(originalText, Pattern); + + if (!match.Success) + return res; + + var groups = match.Groups; + var plantNameGroup = groups[1].Value; + var plantNames = plantNameGroup.Split(" "); + var plantRes = ""; + const string ShortPattern = @"([^\s]+)\((\d+)\)"; + + foreach (var shortMatch in plantNames + .Select(plantName => Regex.Match(plantName, ShortPattern)) + .Where(shortMatch => shortMatch.Success)) + { + var fStr = StringStore.TranslationStringRegex.TryGetValue(ShortPattern, out var value) + ? value + : FallbackFStrs[ShortPattern]; + + var shortRes = string.Format( + fStr, + [Utils.GetPlantNameFromAlmanac(shortMatch.Groups[1].Value), shortMatch.Groups[2].Value] + ); + + plantRes += shortRes + " "; + } + + res = StringStore.TranslateText("当前全部基础植物:" + plantRes); + } + + return res; + } + + public static string CheckLockedMessage(string originalText) + { + var res = ""; + + var lockedPlantRegex = new Regex(LockedPlantPattern); + // var multiLockedPlantRegex = new Regex(MultiLockedPlantPattern); + + if (!lockedPlantRegex.IsMatch(originalText)) + return res; + + if (originalText.Contains('\n')) + { + var lines = originalText.Split("\n"); + + if (!lockedPlantRegex.IsMatch(lines[0])) + return res; + + var firstLine = lines[0]; + var match = lockedPlantRegex.Match(firstLine); + var groups = match.Groups; + + if (Utils.PlantIndiceString.ContainsKey(groups[1].Value) && + Utils.PlantIndiceString.ContainsKey(groups[2].Value)) + { + firstLine = StringStore.TranslateText(firstLine, LockedPlantPattern); + var translatedLines = new List { firstLine }; + + for (var i = 1; i < lines.Length; i++) + { + var nextLine = lines[i]; + var translatedNextLine = StringStore.TranslateText(nextLine, MultiLockedPlantPattern); + translatedLines.Add(translatedNextLine); + } + + res = string.Join("\n", translatedLines); + } + else + return ""; + } + else + { + if (!lockedPlantRegex.IsMatch(originalText)) + return res; + + var match = lockedPlantRegex.Match(originalText); + var groups = match.Groups; + + if (Utils.PlantIndiceString.ContainsKey(groups[1].Value) && + Utils.PlantIndiceString.ContainsKey(groups[2].Value)) + res = StringStore.TranslateText(originalText, LockedPlantPattern); + else + return ""; + } + + return res; + } + + public static string CheckCustomLevelRegex(string originalText) => + StringStore.TranslationStringRegex.All(p => !StringStore.TestRegex(originalText, p.Key)) && + StringStore.CustomLevelStringRegex.FirstOrDefault(p => StringStore.TestRegex(originalText, p.Key)) is + { Key: var key } + ? StringStore.TranslateText(originalText, key) + : null; + + public static string CheckQualityUpgrade(string originalText) + { + var res = ""; + + if (Regex.IsMatch(originalText, QualityChangePattern)) + res = StringStore.TranslateText(originalText, QualityChangePattern); + + return res; + } +} diff --git a/Source/Patches/BaseTextObjects/TMP_Dropdown_Patch.cs b/Source/Patches/BaseTextObjects/TMP_Dropdown_Patch.cs new file mode 100644 index 0000000..0d8ca89 --- /dev/null +++ b/Source/Patches/BaseTextObjects/TMP_Dropdown_Patch.cs @@ -0,0 +1,49 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.BaseTextObjects; + +[HarmonyPatch(typeof(TMP_Dropdown))] +public static class TMP_Dropdown_Patch +{ + [HarmonyPatch(nameof(TMP_Dropdown.Awake)), HarmonyPatch(nameof(TMP_Dropdown.Start)), + HarmonyPatch(nameof(TMP_Dropdown.Show)), HarmonyPatch(nameof(TMP_Dropdown.SetValue)), HarmonyPostfix] + public static void Awake(TMP_Dropdown __instance) + { + if (__instance.captionText) + { + var txt = __instance.captionText; + + txt.text = StringStore.TranslationString.ContainsKey(txt.text + "_code") + ? StringStore.TranslateText(txt.text + "_code") + : StringStore.TranslateText(txt.text); + } + + if (__instance.itemText) + { + var txt = __instance.itemText; + + txt.text = StringStore.TranslationString.ContainsKey(txt.text + "_code") + ? StringStore.TranslateText(txt.text + "_code") + : StringStore.TranslateText(txt.text); + } + + foreach (var dropdownItem in __instance.m_Items) + { + var txt = dropdownItem.text; + + txt.text = StringStore.TranslationString.ContainsKey(txt.text + "_code") + ? StringStore.TranslateText(txt.text + "_code") + : StringStore.TranslateText(txt.text); + } + } + + [HarmonyPatch(nameof(TMP_Dropdown.CreateDropdownList))] + public static void CreateDropdownList(TMP_Dropdown __instance) + { + foreach (var txt in __instance.GetComponentsInChildren(true)) + txt.text = StringStore.TranslationString.ContainsKey(txt.text + "_code") + ? StringStore.TranslateText(txt.text + "_code") + : StringStore.TranslateText(txt.text); + } +} diff --git a/Source/Patches/BaseTextObjects/TMP_InputField_Patch.cs b/Source/Patches/BaseTextObjects/TMP_InputField_Patch.cs new file mode 100644 index 0000000..dead5d1 --- /dev/null +++ b/Source/Patches/BaseTextObjects/TMP_InputField_Patch.cs @@ -0,0 +1,20 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.BaseTextObjects; + +[HarmonyPatch(typeof(TMP_InputField))] +public static class TMP_InputField_Patch +{ + [HarmonyPatch(nameof(TMP_InputField.OnEnable)), HarmonyPostfix] + public static void OnEnable(TMP_InputField __instance) + { + if (string.IsNullOrEmpty(__instance.text)) + return; + + var text = StringStore.TranslateText(__instance.text); + __instance.m_Text = StringStore.TranslateText(text); + __instance.m_OriginalText = StringStore.TranslateText(text); + __instance.m_TextComponent.text = StringStore.TranslateText(text); + } +} diff --git a/Source/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs b/Source/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs new file mode 100644 index 0000000..2351352 --- /dev/null +++ b/Source/Patches/BaseTextObjects/TextMeshProUGUI_Patch.cs @@ -0,0 +1,95 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.Patches.Managers; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.BaseTextObjects; + +[HarmonyPatch(typeof(TextMeshProUGUI))] +public static class TextMeshProUGUI_Patch +{ + [HarmonyPatch(nameof(TextMeshProUGUI.OnEnable)), HarmonyPostfix] + private static void OnEnable(TextMeshProUGUI __instance) + { + if (string.IsNullOrEmpty(__instance.text)) + return; + + __instance.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + if (!Utils.CheckForUntranslatedText(__instance.text) && !__instance.text.Contains('_')) + return; + + if (__instance.transform.parent != null) + { + if (__instance.transform.parent.name.Contains("DrawCardsText")) + return; + + if (__instance.transform.parent.parent != null) + if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) + return; + } + + __instance = StringStore.TranslateText(__instance); + __instance.autoSizeTextContainer = false; + + if (__instance.name.StartsWith("LevelName")) + { + __instance.text = __instance.text.Replace("\n", " "); + + if (__instance.name is "LevelName2" or "LevelName3" && + !(__instance.gameObject.transform.parent.name.Contains("Difficulty") || + __instance.gameObject.name.Contains("Difficulty"))) + TowerManager_Patch.UpdatedText.Add(__instance.transform); + } + + if (__instance.transform.parent == null || !__instance.transform.parent.name.StartsWith("Window")) + return; + + __instance.fontSizeMin = 10; + __instance.fontSize = 12; + // __instance.ForceMeshUpdate(); + } +#if false + [HarmonyPatch(nameof(TextMeshProUGUI.Awake)), HarmonyPostfix] + private static void Awake(TextMeshProUGUI __instance) + { + if (string.IsNullOrEmpty(__instance.text)) + return; + + if (__instance.transform.parent.parent != null) + if (__instance.transform.parent.parent.name.Contains("AbyssBagMenu")) + return; + + __instance = StringStore.TranslateText(__instance); + __instance.autoSizeTextContainer = false; + + if (__instance.transform.parent != null && __instance.transform.parent.name.StartsWith("Window")) + { + __instance.fontSizeMin = 10; + __instance.fontSize = 12; + } + + if (__instance.text == "Полный Хаос" && + __instance.transform.parent.parent.Find("Image").GetComponent().activeSprite.name == + "Present") + __instance.text += "\nБесконечно"; + + // __instance.ForceMeshUpdate(); + } +#endif +} +#if false +[HarmonyPatch(typeof(TMP_SubMeshUI))] +public static class TMP_SubMeshUI_Patch +{ + [HarmonyPatch(nameof(TMP_SubMeshUI.OnEnable)), HarmonyPostfix] + public static void OnEnable(TMP_SubMeshUI __instance) + { + if (string.IsNullOrEmpty(__instance.textComponent.text)) + return; + + var text = StringStore.TranslateText(__instance.textComponent.text); + __instance.m_TextComponent.text = StringStore.TranslateText(text); + __instance.textComponent.text = StringStore.TranslateText(text); + } +} +#endif diff --git a/Source/Patches/BaseTextObjects/TextMeshPro_Patch.cs b/Source/Patches/BaseTextObjects/TextMeshPro_Patch.cs new file mode 100644 index 0000000..90e1d25 --- /dev/null +++ b/Source/Patches/BaseTextObjects/TextMeshPro_Patch.cs @@ -0,0 +1,37 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.BaseTextObjects; + +[HarmonyPatch(typeof(TextMeshPro))] +public static class TextMeshPro_Patch +{ + [HarmonyPatch(nameof(TextMeshPro.OnEnable)), HarmonyPostfix] + private static void OnEnable(TextMeshPro __instance) + { + if (string.IsNullOrEmpty(__instance.text)) + return; + + if (__instance.transform.parent.name.Contains("DrawCardsText")) + return; + + if (__instance.transform.parent.name.StartsWith("AlmanacHelp") || + __instance.transform.parent.name.StartsWith("CardBank")) + { + __instance = StringStore.TranslateText(__instance); + __instance.autoSizeTextContainer = false; + return; + } + + if (__instance.transform.name.Contains("AlmanacZombie") || + __instance.transform.name.Contains("AlmanacPlant") || + __instance.transform.name.Contains("Name") || + __instance.transform.name.Contains("Tips") || + __instance.transform.parent.name.Contains("Signboard") || + __instance.transform.parent.name.Contains("text")) + return; + + __instance = StringStore.TranslateText(__instance); + __instance.autoSizeTextContainer = true; + } +} diff --git a/Source/Patches/GameObjects/AlmanacBuffMenu_Patch.cs b/Source/Patches/GameObjects/AlmanacBuffMenu_Patch.cs new file mode 100644 index 0000000..82a0eb3 --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacBuffMenu_Patch.cs @@ -0,0 +1,98 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Drawing; +using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacBuffMenu))] +public static class AlmanacBuffMenu_Patch +{ + [HarmonyPatch(nameof(AlmanacBuffMenu.Awake)), HarmonyPostfix] + public static void Post_Awake(AlmanacBuffMenu __instance) + { + foreach (var cardUI in __instance.cards) + { + var cardInfo = __instance.cardInfos[cardUI]; + var buffData = FindBuffData(cardInfo.description); + + if (buffData.Item1 == null || buffData.Item3 == null) + continue; + + cardUI.cost.text = buffData.Item4 ? buffData.Item1 : $"{buffData.Item1} #{buffData.Item2}"; + } + + Post_OnCardClick(__instance); + } + + [HarmonyPatch(nameof(AlmanacBuffMenu.SetAllCards)), HarmonyPatch(nameof(AlmanacBuffMenu.Start)), + HarmonyPatch(nameof(AlmanacBuffMenu.InitMenu)), HarmonyPostfix] + public static void Post_SetAllCards(AlmanacBuffMenu __instance) + { + foreach (var cardUI in __instance.cards) + { + var cardInfo = __instance.cardInfos[cardUI]; + var buffData = FindBuffData(cardInfo.description); + + if (buffData.Item1 == null || buffData.Item3 == null) + continue; + + cardUI.cost.text = buffData.Item4 ? buffData.Item1 : $"{buffData.Item1} #{buffData.Item2}"; + } + + Post_OnToolClick(__instance); + + Post_OnCardClick(__instance); + } + + [HarmonyPatch(nameof(AlmanacBuffMenu.OnToolClick)), HarmonyPostfix] + public static void Post_OnToolClick(AlmanacBuffMenu __instance) + { + foreach (var txt in __instance.toolButton.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } + + [HarmonyPatch(nameof(AlmanacBuffMenu.OnCardClick)), HarmonyPostfix] + public static void Post_OnCardClick(AlmanacBuffMenu __instance) + { + var buffData = FindBuffData(__instance.buffDescription.text); + + if (buffData.Item1 == null || buffData.Item3 == null) + return; + + __instance.buffTitle.text = buffData.Item4 ? buffData.Item1 : $"{buffData.Item1} #{buffData.Item2}"; + __instance.buffTitle.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var buffFStr = StringStore.TranslationStringRegex.GetValueOrDefault("BUFF_NAME_FORMAT", "{0}: {1}"); + + var fBuffDesc = string.Format(buffFStr, buffData.Item1, buffData.Item3); + __instance.buffDescription.text = buffData.Item4 ? fBuffDesc + "\n\n" : buffData.Item3 + "\n\n"; + __instance.buffDescription.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var colorHex = StringStore.TranslationString.ContainsKey("MOD_ALMANAC_COL") + ? StringStore.TranslateText("MOD_ALMANAC_COL") + : "#000000"; + + var descriptionColor = ColorTranslator.FromHtml(colorHex); + + __instance.buffDescription.color = new( + descriptionColor.R / 255.0f, + descriptionColor.G / 255.0f, + descriptionColor.B / 255.0f + ); + + __instance.buffDescription.fontSizeMax = 18; + __instance.buffDescription.margin = new(8, 4, 25, 0); + + __instance.buffDescription.enableWordWrapping = true; + __instance.buffDescription.overflowMode = TextOverflowModes.ScrollRect; + + Canvas.ForceUpdateCanvases(); + __instance.buffDescription.ForceMeshUpdate(); + + Post_OnToolClick(__instance); + } +} diff --git a/Source/Patches/GameObjects/AlmanacCardUI_Patch.cs b/Source/Patches/GameObjects/AlmanacCardUI_Patch.cs new file mode 100644 index 0000000..c870a04 --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacCardUI_Patch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacCardUI))] +public static class AlmanacCardUI_Patch +{ + [HarmonyPatch(nameof(AlmanacCardUI.Awake)), HarmonyPostfix] + public static void Awake(AlmanacCardUI __instance) + { + if (!Utils.CheckForUntranslatedText(__instance.cost.text)) + return; + + __instance.cost.text = StringStore.TranslateText(__instance.cost.text); + } +#if false + [HarmonyPatch(nameof(AlmanacCardUI.OnPointerDown)), HarmonyPostfix] + public static void OnPointerDown(AlmanacCardUI __instance) + { + foreach (var almanacCardUI in __instance.menu.GetComponentsInChildren()) + Awake(almanacCardUI); + } +#endif +} diff --git a/Source/Patches/GameObjects/AlmanacPlantMenu_Patch.cs b/Source/Patches/GameObjects/AlmanacPlantMenu_Patch.cs new file mode 100644 index 0000000..b6d26c3 --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacPlantMenu_Patch.cs @@ -0,0 +1,94 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacPlantMenu))] +public static class AlmanacPlantMenu_Patch +{ +#pragma warning disable CA2211 + public static string AlmanacJson = ""; +#pragma warning restore CA2211 + public static readonly Dictionary PlantInfoDict = new(); + + [HarmonyPatch(nameof(AlmanacPlantMenu.Awake)), HarmonyPostfix] + private static void Awake(AlmanacPlantMenu __instance) + { + var font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in from text in __instance.GetComponentsInChildren(true) + let isPlantName = text.gameObject.name.Contains("Name") && text.transform.parent.name != "Background" + where text.gameObject.name != "Description" && !isPlantName && !text.gameObject.name.Contains("Cost") + select text) + { + text.text = StringStore.TranslateText(text.text); + text.font = font; + text.autoSizeTextContainer = true; + } + + foreach (var almanacCardUI in __instance.GetComponentsInChildren()) + AlmanacCardUI_Patch.Awake(almanacCardUI); + + // skin button resize + + var window = __instance.window; + var skinButton = window.skinButton; + // var skinTextObj = skinButton.transform.Find("text_1").gameObject; + skinButton.transform.localScale /= 1.75f; + skinButton.transform.localPosition = new(0.0f, 111.345f, 0.0f); + skinButton.transform.GetChild(1).Translate(new(-0.35f, 0)); + skinButton.transform.GetChild(2).Translate(new(0.35f, 0)); + } + + [HarmonyPatch(nameof(AlmanacPlantMenu.SearchChanged)), HarmonyPrefix] + public static bool SearchChanged(AlmanacPlantMenu __instance, ref TMP_InputField inputField) + { + var search = inputField.text; + + if (search == StringStore.TranslateText("搜索") || search == "") + return true; + + var currentLanguage = Utils.Language.ToString(); + // var almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); + // var path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); + _ = FontStore.LoadTMPFont(currentLanguage); + + var plantData = JsonUtility.FromJson(AlmanacJson); + Il2CppSystem.Collections.Generic.List searchedPlants = new(); + + foreach (var plantInfo in plantData.plants) + if (plantInfo.name.ToLower().Contains(search.ToLower()) || + $"{plantInfo.seedType}".ToLower().StartsWith(search.ToLower())) + searchedPlants.Add((PlantType)plantInfo.seedType); + + __instance.ShowPlants(searchedPlants); + return false; + } + + [HarmonyPatch(nameof(AlmanacPlantMenu.ShowPlants), typeof(Il2CppSystem.Func)), + HarmonyPostfix] + public static void ShowPlants(AlmanacPlantMenu __instance, ref Func condition) + { + foreach (var cardUI in __instance.cards) + AlmanacCardUI_Patch.Awake(cardUI); + } + + [HarmonyPatch(nameof(AlmanacPlantMenu.ClassicMix)), HarmonyPostfix] + public static void ClassicMix(AlmanacPlantMenu __instance) + { + foreach (var cardUI in __instance.cards) + AlmanacCardUI_Patch.Awake(cardUI); + } + + public static void LoadPlantAlmanacData(string json) + { + if (json == null) + return; + + AlmanacJson = json; + var plantData = JsonUtility.FromJson(AlmanacJson); + + foreach (var plantInfo in plantData.plants) + PlantInfoDict[plantInfo.seedType] = plantInfo; + } +} diff --git a/Source/Patches/GameObjects/AlmanacPlantWindow_Patch.cs b/Source/Patches/GameObjects/AlmanacPlantWindow_Patch.cs new file mode 100644 index 0000000..c401707 --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacPlantWindow_Patch.cs @@ -0,0 +1,71 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacPlantWindow))] +public static class AlmanacPlantWindow_Patch +{ + [HarmonyPatch(nameof(AlmanacPlantWindow.UpdateText)), HarmonyPostfix] + private static void UpdateText(AlmanacPlantWindow __instance) + { + var currentLanguage = Utils.Language.ToString(); + // var almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); + // var path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); + // var moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); + + var hasAlmanacFont = false; + + if (FontStore.FontAssetDictSecondary.ContainsKey((currentLanguage + "_almanac").ToLower()) || + FontStore.FontAssetDictSecondary.ContainsKey(currentLanguage.ToLower())) + { + _ = FontStore.LoadTMPFontAlmanac(currentLanguage); + hasAlmanacFont = true; + } + + var fontAsset = hasAlmanacFont + ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) + : FontStore.LoadTMPFont(Utils.Language.ToString()); + + // var plantData = JsonUtility.FromJson(AlmanacPlantMenu_Patch.AlmanacJson); + + if (!AlmanacPlantMenu_Patch.PlantInfoDict.ContainsKey((int)__instance.currentPlantType)) + return; + + var plantInfo = AlmanacPlantMenu_Patch.PlantInfoDict[(int)__instance.currentPlantType]; + + foreach (var text in __instance.showedPlantName) + { + text.autoSizeTextContainer = false; + text.text = $"{Utils.RemoveSizeTags(plantInfo.name)} ({plantInfo.seedType})"; + text.font = fontAsset; + text.fontSizeMax = 21; + } + + var toTrim = Environment.NewLine.ToCharArray(); + + __instance.showedPlantIntroduce.text = + $""" + {Utils.RemoveSizeTags(plantInfo.info)} + + {Utils.RemoveSizeTags(plantInfo.introduce)} + + {Utils.RemoveSizeTags(plantInfo.cost).TrimStart(toTrim)} + + + """; + + __instance.showedPlantIntroduce.font = fontAsset; + __instance.showedPlantIntroduce.fontSizeMax = 21; + __instance.showedPlantIntroduce.margin = new(6, 2, 12, 0); + + __instance.showedPlantIntroduce.enableWordWrapping = true; + __instance.showedPlantIntroduce.overflowMode = TextOverflowModes.ScrollRect; + + Canvas.ForceUpdateCanvases(); + __instance.showedPlantIntroduce.ForceMeshUpdate(); + + var textHeight = __instance.showedPlantIntroduce.preferredHeight; + __instance.plantTextContent.sizeDelta = new(__instance.plantTextContent.sizeDelta.x, textHeight); + } +} diff --git a/Source/Patches/GameObjects/AlmanacSelectMenu_Patch.cs b/Source/Patches/GameObjects/AlmanacSelectMenu_Patch.cs new file mode 100644 index 0000000..60c384f --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacSelectMenu_Patch.cs @@ -0,0 +1,40 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacSelectMenu))] +public static class AlmanacSelectMenu_Patch +{ +#pragma warning disable CA2211 + public static Dictionary DetailStrings = new(); +#pragma warning restore CA2211 + public static readonly Dictionary DetailTranslateStrings = new(); + + [HarmonyPatch(nameof(AlmanacSelectMenu.Awake)), HarmonyPostfix] + public static void Awake(AlmanacSelectMenu __instance) + { + TranslateAlmanacSelectMenu(__instance); + + foreach (var uiButton in __instance.GetComponentsInChildren() + .Where(uiButton => uiButton.gameObject.name.Contains("Selection(Clone)"))) + uiButton.clickEvent.AddListener(new Action(() => { TranslateAlmanacSelectMenu(__instance); })); + } + + [HarmonyPatch(nameof(AlmanacSelectMenu.InitMenu)), HarmonyPostfix] + public static void InitMenu(AlmanacSelectMenu __instance) => TranslateAlmanacSelectMenu(__instance); + + public static void TranslateAlmanacSelectMenu(AlmanacSelectMenu __instance) + { + var font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = DetailTranslateStrings.TryGetValue(txt.text, out var s) + ? s + : StringStore.TranslateText(txt.text); + + txt.font = font; + } + } +} diff --git a/Source/Patches/GameObjects/AlmanacZombieMenu_Patch.cs b/Source/Patches/GameObjects/AlmanacZombieMenu_Patch.cs new file mode 100644 index 0000000..24b7ca0 --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacZombieMenu_Patch.cs @@ -0,0 +1,28 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacZombieMenu))] +public static class AlmanacZombieMenu_Patch +{ +#pragma warning disable CA2211 + public static string AlmanacJson = ""; +#pragma warning restore CA2211 + [HarmonyPatch(nameof(AlmanacZombieMenu.Start)), HarmonyPostfix] + private static void Start(AlmanacZombieMenu __instance) + { + var font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in from text in __instance.GetComponentsInChildren(true) + where !text.gameObject.name.Contains("Cost") + let isZombieName = text.gameObject.name.Contains("Name") && text.transform.parent.name != "Background" + where text.gameObject.name != "Description" && !isZombieName + select text) + { + text.text = StringStore.TranslateText(text.text); + text.font = font; + text.autoSizeTextContainer = true; + } + } +} diff --git a/Source/Patches/GameObjects/AlmanacZombieWindow_Patch.cs b/Source/Patches/GameObjects/AlmanacZombieWindow_Patch.cs new file mode 100644 index 0000000..5a4efa6 --- /dev/null +++ b/Source/Patches/GameObjects/AlmanacZombieWindow_Patch.cs @@ -0,0 +1,80 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(AlmanacZombieWindow))] +public static class AlmanacZombieWindow_Patch +{ + [HarmonyPatch(nameof(AlmanacZombieWindow.UpdateText)), HarmonyPostfix] + private static void UpdateText(AlmanacZombieWindow __instance) + { + var currentLanguage = Utils.Language.ToString(); + // var almanacDir = GetAssetDir(AssetType.Almanac, Utils.Language); + // var path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); + var hasAlmanacFont = false; + + if (FontStore.FontAssetDictSecondary.ContainsKey((currentLanguage + "_almanac").ToLower()) || + FontStore.FontAssetDictSecondary.ContainsKey(currentLanguage.ToLower())) + { + _ = FontStore.LoadTMPFontAlmanac(currentLanguage); + hasAlmanacFont = true; + } + + var fontAsset = hasAlmanacFont + ? FontStore.LoadTMPFontAlmanac(Utils.Language.ToString()) + : FontStore.LoadTMPFont(Utils.Language.ToString()); + + var zombieAlmanacData = JsonUtility.FromJson(AlmanacZombieMenu_Patch.AlmanacJson); + var zombieDataDic = ZombieDataManager.zombieDataDic; + + foreach (var zombieInfo in zombieAlmanacData.zombies) + if (zombieInfo.theZombieType == __instance.currentZombieType) + { + foreach (var text in __instance.showedZombieName) + { + text.autoSizeTextContainer = false; + text.text = $"{Utils.RemoveSizeTags(zombieInfo.name)} ({(int)zombieInfo.theZombieType})"; + text.font = fontAsset; + text.fontSizeMax = 21; + } + + var zombieData = zombieDataDic[__instance.currentZombieType]; + + var spawnInfo = ""; + + var spawnInfoFormat = + StringStore.TranslationStringRegex.GetValueOrDefault("出怪等级: (\\d+)\n出怪权重: (\\d+)"); + + if (spawnInfoFormat != null) + spawnInfo = string.Format(spawnInfoFormat, [zombieData.summonLevel, zombieData.summonWeight]) + + "\n\n"; + + __instance.showedZombieIntroduce.text = + $""" + {Utils.RemoveSizeTags(zombieInfo.info)} + + {spawnInfo}{Utils.RemoveSizeTags(zombieInfo.introduce)} + + + """; + + __instance.showedZombieIntroduce.font = fontAsset; + __instance.showedZombieIntroduce.fontSizeMax = 21; + __instance.showedZombieIntroduce.margin = new(3, 2, 12, 0); + + __instance.showedZombieIntroduce.enableWordWrapping = true; + __instance.showedZombieIntroduce.overflowMode = TextOverflowModes.ScrollRect; + + Canvas.ForceUpdateCanvases(); + __instance.showedZombieIntroduce.ForceMeshUpdate(); + + var textHeight = __instance.showedZombieIntroduce.preferredHeight; + + __instance.zombieTextContent.sizeDelta = new( + __instance.zombieTextContent.sizeDelta.x, + textHeight + ); + } + } +} diff --git a/Source/Patches/GameObjects/Almanac_Patch.cs b/Source/Patches/GameObjects/Almanac_Patch.cs new file mode 100644 index 0000000..d98ca71 --- /dev/null +++ b/Source/Patches/GameObjects/Almanac_Patch.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(Almanac))] +public static class Almanac_Patch +{ + [HarmonyPatch(nameof(Almanac.Awake)), HarmonyPostfix] + private static void Awake(Almanac __instance) => TranslateAlmanacMenu(__instance); +#if false + [HarmonyPatch(nameof(Almanac.OldAlmanac)), HarmonyPostfix] + private static void OldAlmanac(Almanac __instance) => TranslateAlmanacMenu(__instance); +#endif + [HarmonyPatch(nameof(Almanac.AnimSwitch)), HarmonyPostfix] + private static void AnimSwitch(Almanac __instance) => TranslateAlmanacMenu(__instance); + + public static void TranslateAlmanacMenu(Almanac __instance) + { + var font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in __instance + .GetComponentsInChildren() + .Where(text => !text.gameObject.name.Contains("Cost"))) + { + text.text = StringStore.TranslateText(text.text == "关闭" ? "合上" : text.text); + text.font = font; + } + } +} diff --git a/Source/Patches/GameObjects/BaseMenu_Patch.cs b/Source/Patches/GameObjects/BaseMenu_Patch.cs new file mode 100644 index 0000000..741a4f8 --- /dev/null +++ b/Source/Patches/GameObjects/BaseMenu_Patch.cs @@ -0,0 +1,48 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(BaseMenu))] +public static class BaseMenu_Patch +{ + [HarmonyPatch(nameof(BaseMenu.Awake)), HarmonyPrefix] + private static void Pre_Awake(BaseMenu __instance) + { + if (__instance.name.Contains("NoticePauseMenu")) + NoticePauseMenu_Patch.Pre_Awake(__instance); + } + + [HarmonyPatch(nameof(BaseMenu.Awake)), HarmonyPostfix] + private static void Post_Awake(BaseMenu __instance) + { + if (__instance.name.Contains("NoticePauseMenu")) + NoticePauseMenu_Patch.Post_Awake(__instance); + + if (__instance.name.StartsWith("MainMenu(Clone)")) + MainMenu_Patch.AnimOver(__instance); + + if (__instance.name.StartsWith("PlantDamageMenu")) + PlantDamageMenu_Patch.Awake(__instance); + + TranslateBaseMenuTransform(__instance, "Level"); + TranslateBaseMenuTransform(__instance, "Levels"); + TranslateBaseMenuTransform(__instance, "CustomLevel"); + + StringStore.TranslateTextTransform(__instance.transform.Find("Goback")); + StringStore.TranslateTextTransform(__instance.transform.Find("Switich")); + } + + public static void TranslateBaseMenuTransform(BaseMenu __instance, string levelsName) + { + var levels = __instance.transform.Find(levelsName); + + if (levels == null) + return; + + var children = levels.GetComponentsInChildren(true).ToList(); + + foreach (var child in children.Where(child => child.name is "Nextpage" or "LastPage" or "BackToIndex")) + StringStore.TranslateTextTransform(child); + } +} diff --git a/Source/Patches/GameObjects/Board_Patch.cs b/Source/Patches/GameObjects/Board_Patch.cs new file mode 100644 index 0000000..3caf107 --- /dev/null +++ b/Source/Patches/GameObjects/Board_Patch.cs @@ -0,0 +1,17 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(Board))] +public static class Board_Patch +{ + [HarmonyPatch(nameof(Board.Update)), HarmonyPostfix] + private static void Update(Board __instance) + { + foreach (var spriteRenderer in __instance.GetComponentsInChildren() + .Where(sr => sr.sprite != null) + .Where(sr => TextureStore.SpriteDict.ContainsKey(sr.sprite.name) && sr.drawMode != SpriteDrawMode.Sliced)) + spriteRenderer.drawMode = SpriteDrawMode.Sliced; + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs new file mode 100644 index 0000000..e3e5063 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/Advanture_Btn_Patch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(Advanture_Btn))] +public static class Advanture_Btn_Patch +{ + [HarmonyPatch(nameof(Advanture_Btn.Start)), HarmonyPostfix] + private static void Start(Advanture_Btn __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + var originalKey = StringStore.TranslationString.FirstOrDefault(x => x.Value == txt.text).Key; + + txt.text = StringStore.TranslationString.ContainsKey(originalKey + "_MG") + ? StringStore.TranslateText(originalKey + "_MG") + : StringStore.TranslateText(txt.text); + + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/BackToIndex_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/BackToIndex_Patch.cs new file mode 100644 index 0000000..8be4542 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/BackToIndex_Patch.cs @@ -0,0 +1,14 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(BackToIndex))] +public class BackToIndex_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(BackToIndex.Awake))] + public static void Awake(BackToIndex __instance) => + StringStore.TranslateTextTransform(__instance.transform.GetChild(0)); +} +#endif diff --git a/Source/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs new file mode 100644 index 0000000..4172eea --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/CustomLevelEnter_Patch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(CustomLevelEnter))] +public static class CustomLevelEnter_Patch +{ + [HarmonyPatch(nameof(CustomLevelEnter.Start)), HarmonyPostfix] + private static void Start(CustomLevelEnter __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + var originalKey = StringStore.TranslationString.FirstOrDefault(x => x.Value == txt.text).Key; + + txt.text = StringStore.TranslationString.ContainsKey(originalKey + "_IZ") + ? StringStore.TranslateText(originalKey + "_IZ") + : StringStore.TranslateText(txt.text); + + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs new file mode 100644 index 0000000..f3126de --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/ExploreMakeSceneButton_Patch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(ExploreMakeSceneButton))] +public class ExploreMakeSceneButton_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(ExploreMakeSceneButton.Start))] + public static void Start(ExploreMakeSceneButton __instance) + { + __instance.sceneText.text = StringStore.TranslationString.ContainsKey(__instance.sceneText.text + "_FS") + ? StringStore.TranslateText(__instance.sceneText.text + "_FS") + : StringStore.TranslateText(__instance.sceneText.text); + + __instance.sceneText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs new file mode 100644 index 0000000..490ef0b --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/ExploreMakeZombieButton_Patch.cs @@ -0,0 +1,15 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(ExploreMakeZombieButton))] +public class ExploreMakeZombieButton_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(ExploreMakeZombieButton.Start))] + public static void Start(ExploreMakeZombieButton __instance) + { + __instance.sceneText.text = Utils.GetZombieNameFromAlmanac(__instance.theZombieType); + __instance.sceneText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/GodShootingLevelButton_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/GodShootingLevelButton_Patch.cs new file mode 100644 index 0000000..dd685c7 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/GodShootingLevelButton_Patch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(GodShootingLevelButton))] +public static class GodShootingLevelButton_Patch +{ + [HarmonyPatch(nameof(GodShootingLevelButton.Awake)), HarmonyPostfix] + private static void Awake(GodShootingLevelButton __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + var originalKey = StringStore.TranslationString.FirstOrDefault(x => x.Value == txt.text).Key; + + txt.text = StringStore.TranslationString.ContainsKey(originalKey + "_GS") + ? StringStore.TranslateText(originalKey + "_GS") + : StringStore.TranslateText(txt.text); + + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs new file mode 100644 index 0000000..9d5ff7a --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/InGameBtn_Patch.cs @@ -0,0 +1,35 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(InGameBtn))] +public static class InGameBtn_Patch +{ + [HarmonyPatch(nameof(InGameBtn.Start)), HarmonyPostfix] + private static void Start(InGameBtn __instance) + { + var sceneText = __instance.transform.FindChild("SceneText"); + + if (sceneText != null) + { + var sceneTextTMP = sceneText.transform.GetComponent(); + + if (sceneTextTMP != null) + StringStore.TranslateText(sceneTextTMP); + + var sceneTextShadow = sceneText.transform.FindChild("SceneText"); + + if (sceneTextShadow != null) + { + var sceneTextShadowTMP = sceneTextShadow.transform.GetComponent(); + + if (sceneTextShadowTMP != null) + StringStore.TranslateText(sceneTextShadowTMP); + } + } + + foreach (var text in __instance.transform.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/LevelSaveEnter_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/LevelSaveEnter_Patch.cs new file mode 100644 index 0000000..6ed8041 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/LevelSaveEnter_Patch.cs @@ -0,0 +1,14 @@ +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +public static class LevelSaveEnter_Patch +{ + public static void TranslateEnter(LevelSaveEnter __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.text.text = StringStore.TranslateText(__instance.text.text); + __instance.text.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs new file mode 100644 index 0000000..e898902 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/MainMenu_Btn_Patch.cs @@ -0,0 +1,25 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(MainMenu_Btn))] +public static class MainMenu_Btn_Patch +{ + public static List speechBubbles = new List(); + + [HarmonyPatch(nameof(MainMenu_Btn.OnMouseEnter)), HarmonyPostfix] + private static void OnMouseEnter(MainMenu_Btn __instance) + { + string textToShow = null; + + if (__instance.transform.parent.name == "recipe") + textToShow = "探索模式"; + else if (__instance.name == "mysterious") + textToShow = "神秘模式"; + + if (textToShow != null) + InGameText.Instance.ShowText(textToShow, 2.0f); + } +} +#endif diff --git a/Source/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs new file mode 100644 index 0000000..257f2d9 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/NormalBtn_Patch.cs @@ -0,0 +1,21 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(NormalBtn))] +public class NormalBtn_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(NormalBtn.OnMouseUpAsButton))] + public static void OnMouseUpAsButton(NormalBtn __instance) + { + if (__instance.transform.childCount <= 0) + return; + + var banTransform = __instance.transform.GetChild(0); + + if (banTransform != null) + banTransform.GetComponent().text = + StringStore.TranslateText(banTransform.GetComponent().text); + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs new file mode 100644 index 0000000..986f1f8 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/OptLanguageBtn_Patch.cs @@ -0,0 +1,415 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using Object = UnityEngine.Object; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +public sealed class OptionButtonData +{ + public OptionBtn Button { get; init; } + + public Vector3 Position { get; init; } + + /// if it is the "Next" button. + public Utils.LanguageEnum? Language { get; set; } + + /// if it is the "Next" button. + public Utils.ToggleEnum? Toggle { get; set; } + + public bool IsNextButton { get; set; } + + public bool Shifted; +} + +internal static class OptLanguageBtn_Patch +{ + public static readonly Dictionary LanguageBtnDict = new(), ToggleBtnDict = new(); + + private static bool s_buttonsCreated, s_togglesCreated; + + // ReSharper disable once NotAccessedField.Local + private static OptionBtn s_cachedTemplateButton, s_cachedTemplateToggleButton; + + private const float + StartX = 4.3241f + 2.56f, + StartY = 2.7769f, + YSpacing = 1.2505f, + ToggleStartX = 4.3241f, + ToggleStartY = -0.9746f; + + private static List s_availableLanguages; + + private static List s_availableToggles; + + private const int LanguagesPerPage = 5; + + private static int s_currentPage; + + // 5 language buttons + 1 next button + public static readonly OptionBtn[] ButtonSlots = new OptionBtn[6], ToggleSlots = new OptionBtn[3]; + + public static void CreateLanguageButtons(OptionBtn templateButton) + { + if (s_buttonsCreated) + return; + + s_buttonsCreated = true; + s_cachedTemplateButton = templateButton; + + s_availableLanguages = Enum.GetValues(typeof(Utils.LanguageEnum)) + .Cast() + .Where(lang => lang != Utils.LanguageEnum.LangEnd) + .ToList(); + + for (var i = 0; i < 6; i++) + { + var newButton = Object.Instantiate(templateButton, templateButton.transform.parent); + newButton.tag = "LangOpt"; + + foreach (var child in newButton.GetComponentsInChildren()) + child.tag = "LangOpt"; + + newButton.optionType = 80 + i; + + var yPos = StartY - i * YSpacing; + Vector3 pos = new(StartX, yPos); + newButton.transform.position = pos; + + ButtonSlots[i] = newButton; + + LanguageBtnDict[newButton.GetInstanceID()] = new() + { + Button = newButton, + Position = pos, + }; + } + + UpdatePage(); + } + + public static void CreateToggleButtons(OptionBtn templateButton) + { + if (s_togglesCreated) + return; + + s_togglesCreated = true; + s_cachedTemplateToggleButton = templateButton; + + s_availableToggles = Enum.GetValues() + .Where(lang => lang != Utils.ToggleEnum.ToggleEnd) + .ToList(); + + for (var i = 0; i < 3; i++) + { + var newButton = Object.Instantiate(templateButton, templateButton.transform.parent); + newButton.tag = "LangOpt"; + + foreach (var child in newButton.GetComponentsInChildren()) + child.tag = "LangOpt"; + + newButton.optionType = 100 + i; + + var yPos = ToggleStartY - i * YSpacing; + Vector3 pos = new(ToggleStartX, yPos); + newButton.transform.position = pos; + + ToggleSlots[i] = newButton; + + ToggleBtnDict[newButton.GetInstanceID()] = new() + { + Button = newButton, + Position = pos, + }; + } + + UpdatePage(); + } + + private static void UpdatePage() + { + var startIndex = s_currentPage * LanguagesPerPage; + var langCount = s_availableLanguages.Count; + var toggleCount = s_togglesCreated ? s_availableToggles.Count : 0; + + for (var i = 0; i < 5; i++) + { + var btn = ButtonSlots[i]; + var data = LanguageBtnDict[btn.GetInstanceID()]; + + if (startIndex + i < langCount) + { + var lang = s_availableLanguages[startIndex + i]; + data.Language = lang; + data.IsNextButton = false; + btn.gameObject.SetActive(true); + + var languageName = Utils.LanguageNames.TryGetValue(lang, out var name) ? name : lang.ToString(); + UpdateButtonText(btn, languageName, FontStore.LoadTMPFont(lang.ToString())); + } + else + { + data.Language = null; + data.IsNextButton = false; + btn.gameObject.SetActive(false); + } + } + + if (s_togglesCreated) + for (var i = 0; i < 3; i++) + { + var btn = ToggleSlots[i]; + var data = ToggleBtnDict[btn.GetInstanceID()]; + + if (i < toggleCount) + { + var toggle = s_availableToggles[i]; + data.Toggle = toggle; + data.IsNextButton = false; + btn.gameObject.SetActive(true); + + var buttonText = Utils.ToggleNames.TryGetValue(toggle, out var name) + ? name + : toggle.ToString(); + + UpdateButtonText( + btn, + StringStore.TranslateText(buttonText), + FontStore.LoadTMPFont(Utils.Language.ToString()) + ); + + string sourceMsg; + + switch (i) + { + case 0: + sourceMsg = + $"Texture Source:\n{(Core.Instance.ConfigDefaultTextures.Value ? "Default" : "Custom")}"; + + FlashMessage(btn, sourceMsg, 0.1f, false); + break; + case 1: + sourceMsg = + $"Audio Source:\n{(Core.Instance.ConfigDefaultAudio.Value ? "Default" : "Custom")}"; + + FlashMessage(btn, sourceMsg, 0.1f, false); + break; + case 2: + sourceMsg = + $"Translation Source:\n{(Core.Instance.ConfigUseLocal.Value ? "Local" : "Online")}"; + + FlashMessage(btn, sourceMsg, 0.1f, false); + break; + } + } + else + { + data.Language = null; + data.IsNextButton = false; + btn.gameObject.SetActive(false); + } + } + + // "Next" button always visible at index 5 + var nextBtn = ButtonSlots[5]; + var nextData = LanguageBtnDict[nextBtn.GetInstanceID()]; + nextData.Language = null; + nextData.IsNextButton = true; + nextBtn.gameObject.SetActive(true); + UpdateButtonText(nextBtn, "Next"); + } + + public static void UpdateButtonText(OptionBtn button, string languageName, TMP_FontAsset fontAsset = null) + { + var defaultAsset = FontStore.LoadTMPFont("English"); + + for (var i = 0; i < 3; i++) + { + var textTransform = button.transform.GetChild(i); + + if (textTransform == null) + continue; + + if (i == 0) + textTransform.gameObject.SetActive(false); + + var text = textTransform.GetComponent(); + + if (text == null) + continue; + + if (i == 0) + { + text.text = ""; + text.color = Color.red; + } + else + text.text = languageName; + + text.fontSize = 16; + text.font = fontAsset != null ? fontAsset : defaultAsset; + text.autoSizeTextContainer = false; + } + } + + public static void FlashMessage(OptionBtn button, string message, float yShift = 0.0f, bool useTimer = true) + { + var child = button.transform.GetChild(0); + + if (child == null) + return; + + var text = child.GetComponent(); + var originalMsg = ""; + + if (text != null) + { + originalMsg = text.text; + text.text = message; + var isToggle = ToggleBtnDict.TryGetValue(button.GetInstanceID(), out _); + + if (isToggle) + { + text.transform.position = new( + text.transform.position.x, + text.transform.position.y + (ToggleBtnDict[button.GetInstanceID()].Shifted ? 0.0f : yShift), + text.transform.position.z + ); + + ToggleBtnDict[button.GetInstanceID()].Shifted = true; + } + else + { + text.transform.position = new( + text.transform.position.x, + text.transform.position.y + (LanguageBtnDict[button.GetInstanceID()].Shifted ? 0.0f : yShift), + text.transform.position.z + ); + + LanguageBtnDict[button.GetInstanceID()].Shifted = true; + } + } + + child.gameObject.SetActive(true); + + if (useTimer) + Task.Delay(1000) + .ContinueWith( + _ => + { + if (button == null || child == null || !child.gameObject.activeSelf) + return; + + var buttonData = ToggleBtnDict[button.GetInstanceID()]; + + if (buttonData.Toggle == null) + return; + + var sourceMsg = buttonData.Toggle switch + { + Utils.ToggleEnum.Textures => + $"Texture Source:\n{(Core.Instance.ConfigDefaultAudio.Value ? "Default" : "Custom")}", + Utils.ToggleEnum.Audio => + $"Audio Source:\n{(Core.Instance.ConfigDefaultAudio.Value ? "Default" : "Custom")}", + _ => originalMsg, + }; + + text.text = sourceMsg; + } + ); + } + + private static void ToggleCustomAssets(string type) + { + switch (type) + { + case "Textures": + Core.Instance.ConfigDefaultTextures.Value = !Core.Instance.ConfigDefaultTextures.Value; + TextureStore.Reload(); + Core.Coroutine(TextureStore.ReplaceTexturesCoroutine()); + break; + case "Audio": + Core.Instance.ConfigDefaultAudio.Value = !Core.Instance.ConfigDefaultAudio.Value; + break; + case "SwapLocal": + Utils.WarnLocalData(); + break; + } + } + + [HarmonyPatch(typeof(OptionBtn))] + public static class OptLangBtn_Patch + { + public static void Awake(OptionBtn __instance) + { + if (s_buttonsCreated && s_cachedTemplateButton != null) + return; + + s_buttonsCreated = false; + s_togglesCreated = false; + CreateLanguageButtons(__instance); + CreateToggleButtons(__instance); + } + + [HarmonyPatch("OnMouseUpAsButton"), HarmonyPrefix] + private static void OnMouseUpAsButton(OptionBtn __instance) + { + if (!ModFeatures.IsMultiLanguage) + return; + + if (LanguageBtnDict.TryGetValue(__instance.GetInstanceID(), out var btnData)) + { + if (btnData.IsNextButton) + { + s_currentPage = (s_currentPage + 1) % + (int)Math.Ceiling((float)s_availableLanguages.Count / LanguagesPerPage); + + UpdatePage(); + return; + } + + if (btnData.Language is { } selectedLang) + { + var currentLang = Utils.Language.ToString(); + + if (currentLang == selectedLang.ToString()) + FlashMessage(btnData.Button, "Already Selected!"); + else + { + Utils.ChangeLanguage(selectedLang.ToString()); + Debug.Log($"Language changed to: {selectedLang}"); + FlashMessage(btnData.Button, "Language Changed!"); + } + } + } + + if (!ToggleBtnDict.TryGetValue(__instance.GetInstanceID(), out var toggleData)) + return; + + var toggleType = toggleData.Toggle.ToString(); + ToggleCustomAssets(toggleType); + + switch (toggleType) + { + case "Textures": + FlashMessage(toggleData.Button, "Toggled custom textures!\n(Restart Required)", 0.1f); + break; + case "Audio": + FlashMessage(toggleData.Button, "Toggled custom audio!", 0.1f); + break; + } + } + + [HarmonyPatch(nameof(OptionBtn.Update)), HarmonyPostfix] + private static void Update(OptionBtn __instance) + { + if (!ModFeatures.IsMultiLanguage) + return; + + if (LanguageBtnDict.TryGetValue(__instance.GetInstanceID(), out var btnData)) + btnData.Button.transform.position = btnData.Position; + + if (ToggleBtnDict.TryGetValue(__instance.GetInstanceID(), out var toggleData)) + toggleData.Button.transform.position = toggleData.Position; + } + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs new file mode 100644 index 0000000..87c7a16 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/OptionBtn_Patch.cs @@ -0,0 +1,69 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(OptionBtn))] +public static class OptionBtn_Patch +{ + [HarmonyPatch(nameof(OptionBtn.Awake)), HarmonyPostfix] + private static void Awake(OptionBtn __instance) + { + var text1Transform = __instance.transform.GetChild(0)?.transform; + + if (text1Transform != null) + { + var text1 = text1Transform.GetComponent(); + text1 = StringStore.TranslateText(text1); + text1.autoSizeTextContainer = false; + } + + var textTransform = __instance.transform.GetChild(1)?.transform; + + if (textTransform != null) + { + var text = textTransform.GetComponent(); + text = StringStore.TranslateText(text); + text.autoSizeTextContainer = false; + } + + var text2Transform = __instance.transform.GetChild(2)?.transform; + + if (text2Transform == null) + return; + + var text2 = text2Transform.GetComponent(); + text2 = StringStore.TranslateText(text2); + text2.autoSizeTextContainer = false; + } + + [HarmonyPatch("OnMouseUpAsButton"), HarmonyPostfix] + private static void OnMouseUpAsButtonPostfix(OptionBtn __instance) + { + var text1Transform = __instance.transform.GetChild(0)?.transform; + + if (text1Transform != null) + { + var text1 = text1Transform.GetComponent(); + text1 = StringStore.TranslateText(text1); + text1.autoSizeTextContainer = false; + } + + var textTransform = __instance.transform.GetChild(1)?.transform; + + if (textTransform != null) + { + var text = textTransform.GetComponent(); + text = StringStore.TranslateText(text); + text.autoSizeTextContainer = false; + } + + var text2Transform = __instance.transform.GetChild(2)?.transform; + + if (text2Transform == null) + return; + + var text2 = text2Transform.GetComponent(); + StringStore.TranslateText(text2); + } +} diff --git a/Source/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs new file mode 100644 index 0000000..2f8980f --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/PVPPotBtn_Patch.cs @@ -0,0 +1,41 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(PVPPotBtn))] // ReSharper disable once InconsistentNaming +public class PVPPotBtn_Patch +{ + [HarmonyPostfix] + [HarmonyPatch(nameof(PVPPotBtn.OnMouseUpAsButton))] + public static void OnMouseUpAsButton(PVPPotBtn __instance) + { + Transform sceneText = __instance.transform.FindChild("text"); + + if (sceneText != null) + { + var sceneTextTMP = sceneText.transform.GetComponent(); + + if (sceneTextTMP != null) + sceneTextTMP.text = StringStore.TranslateText(sceneTextTMP.text); + } + + var sceneTextShadow = sceneText.transform.FindChild("text_1"); + + if (sceneTextShadow != null) + { + var sceneTextShadowTMP = sceneTextShadow.transform.GetComponent(); + + if (sceneTextShadowTMP != null) + sceneTextShadowTMP.text = StringStore.TranslateText(sceneTextShadowTMP.text); + } + + if (!__instance.name.Equals("ChangeBg_3") && !__instance.name.Equals("ChangeBg_4")) + return; + + __instance.gameObject.SetActive(false); + __instance.gameObject.SetActive(true); + } +} +#endif diff --git a/Source/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs new file mode 100644 index 0000000..ff5a572 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/PauseMenu_Btn_Patch.cs @@ -0,0 +1,11 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(PauseMenu_Btn))] +public static class PauseMenu_Btn_Patch +{ + [HarmonyPatch(nameof(PauseMenu_Btn.Start)), HarmonyPostfix] + private static void Start(PauseMenu_Btn __instance) => StringStore.TranslateTextTransform(__instance.transform); +} diff --git a/Source/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs new file mode 100644 index 0000000..fe68003 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/SaveMenuBtn_Patch.cs @@ -0,0 +1,18 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(SaveMenuBtn))] +public static class SaveMenuBtn_Patch +{ + [HarmonyPatch(nameof(SaveMenuBtn.OnMouseUpAsButton)), HarmonyPostfix] + private static void OnMouseUpAsButton(SaveMenuBtn __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + __instance.theName.text = StringStore.TranslateText(__instance.theName.text); + __instance.theName.font = fontAsset; + } +} +#endif diff --git a/Source/Patches/GameObjects/ButtonObjects/UIBtn_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/UIBtn_Patch.cs new file mode 100644 index 0000000..401b8f7 --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/UIBtn_Patch.cs @@ -0,0 +1,16 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(UIBtn))] +public static class UIBtn_Patch +{ + [HarmonyPatch(nameof(UIBtn.Awake)), HarmonyPostfix] + private static void Postfix_Awake(UIBtn __instance) + { + if (__instance.TryGetComponent(out BackToIndex component)) + Utils.ConvertButtonText(__instance.transform.parent, component.name); + } +} +#endif diff --git a/Source/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs b/Source/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs new file mode 100644 index 0000000..0d2d7fc --- /dev/null +++ b/Source/Patches/GameObjects/ButtonObjects/UIButton_Patch.cs @@ -0,0 +1,46 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +[HarmonyPatch(typeof(UIButton))] +public static class UIButton_Patch +{ + [HarmonyPatch(typeof(UIButton), nameof(UIButton.Start)), HarmonyPostfix] + public static void Start(UIButton __instance) + { + if (__instance.transform.childCount >= 2) + { + var font = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in __instance.transform.GetComponentsInChildren()) + { + if (__instance.transform.name == "Goback") + text.text = "合上"; + + text.text = StringStore.TranslateText(text.text); + text.font = font; + } + } + else + { + StringStore.TranslateTextTransform(__instance.transform); + + if (__instance.transform.name != "Goback") + return; + + foreach (var text in __instance.transform.GetComponentsInChildren()) + text.text = StringStore.TranslateText("合上"); + } + } + + [HarmonyPatch(nameof(UIButton.OnMouseUpAsButton)), HarmonyPostfix] + public static void Postfix_OnMouseUpAsButton(UIButton __instance) + { + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } +} diff --git a/Source/Patches/GameObjects/Close_Patch.cs b/Source/Patches/GameObjects/Close_Patch.cs new file mode 100644 index 0000000..e52fe75 --- /dev/null +++ b/Source/Patches/GameObjects/Close_Patch.cs @@ -0,0 +1,50 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(Close))] +public static class Close_Patch +{ + [HarmonyPatch(nameof(Close.Start)), HarmonyPostfix] + private static void Close_Start(Close __instance) + { + TextMeshPro closeText = __instance.transform.GetChild(0).GetComponent(); + closeText.text = "合上"; + closeText = StringStore.TranslateText(closeText); + closeText.autoSizeTextContainer = true; + + var almanacTransform = __instance.transform.parent.transform; + var nameTransform = almanacTransform.Find("Name"); + + if (nameTransform != null) + { + var nameTMP = nameTransform.transform.GetComponent(); + + if (nameTMP) + { + nameTMP = StringStore.TranslateText(nameTMP); + nameTMP.autoSizeTextContainer = true; + } + + var nameShadowTransform = nameTransform.Find("NameShadow"); + + if (nameShadowTransform) + { + var nameShadowTMP = nameShadowTransform.transform.GetComponent(); + + if (nameShadowTMP) + { + nameShadowTMP = StringStore.TranslateText(nameShadowTMP); + nameShadowTMP.autoSizeTextContainer = true; + } + } + } + + StringStore.TranslateTextTransform(almanacTransform.Find("Back"), true); + StringStore.TranslateTextTransform(almanacTransform.Find("NextPage")); + StringStore.TranslateTextTransform(almanacTransform.Find("LastPage")); + } +} +#endif diff --git a/Source/Patches/GameObjects/ConfirmMenu_Patch.cs b/Source/Patches/GameObjects/ConfirmMenu_Patch.cs new file mode 100644 index 0000000..cf1d270 --- /dev/null +++ b/Source/Patches/GameObjects/ConfirmMenu_Patch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ConfirmMenu))] +public static class ConfirmMenu_Patch +{ + [HarmonyPatch(nameof(ConfirmMenu.SetTitle)), HarmonyPostfix] + private static void SetTitle(ConfirmMenu __instance) + { + foreach (var title in __instance.title) + { + title.text = StringStore.TranslateText(title.text); + title.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } +} diff --git a/Source/Patches/GameObjects/CrisisZombieWindow_Patch.cs b/Source/Patches/GameObjects/CrisisZombieWindow_Patch.cs new file mode 100644 index 0000000..6949958 --- /dev/null +++ b/Source/Patches/GameObjects/CrisisZombieWindow_Patch.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(CrisisZombieWindow))] +public static class CrisisZombieWindow_Patch +{ + [HarmonyPatch(nameof(CrisisZombieWindow.Start)), HarmonyPostfix] + private static void Start(CrisisZombieWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(CrisisZombieWindow.SetZombieType)), HarmonyPostfix] + private static void SetZombieType(CrisisZombieWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/CustomSettings_Patch.cs b/Source/Patches/GameObjects/CustomSettings_Patch.cs new file mode 100644 index 0000000..31a35b0 --- /dev/null +++ b/Source/Patches/GameObjects/CustomSettings_Patch.cs @@ -0,0 +1,18 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(CustomSettings))] +public static class CustomSettings_Patch +{ + [HarmonyPatch(nameof(CustomSettings.Awake)), HarmonyPostfix] + private static void Awake(CustomSettings __instance) => + __instance.textMesh = StringStore.TranslateText(__instance.textMesh); + + [HarmonyPatch(nameof(CustomSettings.ChangeText)), HarmonyPostfix] + private static void ChangeText(CustomSettings __instance) => + __instance.textMesh = StringStore.TranslateText(__instance.textMesh); +} +#endif diff --git a/Source/Patches/GameObjects/CustomSun_Patch.cs b/Source/Patches/GameObjects/CustomSun_Patch.cs new file mode 100644 index 0000000..8392ad7 --- /dev/null +++ b/Source/Patches/GameObjects/CustomSun_Patch.cs @@ -0,0 +1,42 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(CustomSun))] +public static class CustomSun_Patch +{ + [HarmonyPatch(nameof(CustomSun.Awake)), HarmonyPostfix] + private static void Awake(CustomSun __instance) + { + if (__instance.inputField.gameObject.activeSelf) + { + string oriTextSun = __instance.inputField.m_Text; + __instance.inputField.gameObject.SetActive(false); + __instance.inputField.m_Text = StringStore.TranslateText(oriTextSun); + __instance.inputField.m_OriginalText = StringStore.TranslateText(oriTextSun); + __instance.inputField.gameObject.SetActive(true); + } + + if (__instance.setFlags.gameObject.activeSelf) + { + string oriTextFlags = __instance.setFlags.m_Text; + __instance.setFlags.gameObject.SetActive(false); + __instance.setFlags.m_Text = StringStore.TranslateText(oriTextFlags); + __instance.setFlags.m_OriginalText = StringStore.TranslateText(oriTextFlags); + __instance.setFlags.gameObject.SetActive(true); + } + + Transform lookZombieTransform = __instance.lookZombie.transform.GetChild(0).transform; + + if (lookZombieTransform == null) + return; + + var lookZombieTMP = lookZombieTransform.GetComponent(); + + if (lookZombieTMP != null) + StringStore.TranslateText(lookZombieTMP); + } +} +#endif diff --git a/Source/Patches/GameObjects/EveBuffMenu_Patch.cs b/Source/Patches/GameObjects/EveBuffMenu_Patch.cs new file mode 100644 index 0000000..44e582c --- /dev/null +++ b/Source/Patches/GameObjects/EveBuffMenu_Patch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(EveBuffMenu))] +public static class EveBuffMenu_Patch +{ + [HarmonyPatch(nameof(EveBuffMenu.Start)), HarmonyPostfix] + private static void Start(EveBuffMenu __instance) + { + foreach (var window in __instance.windows) + EveOptionWindow_Patch.TranslateEveOptionWindow(window); + + foreach (var text in __instance.quitButton.GetComponentsInChildren()) + text.text = StringStore.TranslateText("合上"); + } + + [HarmonyPatch(nameof(EveBuffMenu.InitWindows)), HarmonyPostfix] + private static void InitWindows(EveBuffMenu __instance) + { + foreach (var window in __instance.windows) + EveOptionWindow_Patch.TranslateEveOptionWindow(window); + } +} diff --git a/Source/Patches/GameObjects/EveOptionWindow_Patch.cs b/Source/Patches/GameObjects/EveOptionWindow_Patch.cs new file mode 100644 index 0000000..da59511 --- /dev/null +++ b/Source/Patches/GameObjects/EveOptionWindow_Patch.cs @@ -0,0 +1,33 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(EveOptionWindow))] +public static class EveOptionWindow_Patch +{ + [HarmonyPatch(nameof(EveOptionWindow.SetType)), HarmonyPostfix] + private static void SetType(EveOptionWindow __instance) => TranslateEveOptionWindow(__instance); + + [HarmonyPatch(nameof(EveOptionWindow.OnAnimOver)), HarmonyPostfix] + private static void OnAnimOver(EveOptionWindow __instance) => TranslateEveOptionWindow(__instance); + + [HarmonyPatch(nameof(EveOptionWindow.SelectedByRow)), HarmonyPostfix] + private static void SelectedByRow(EveOptionWindow __instance) => TranslateEveOptionWindow(__instance); + + public static void TranslateEveOptionWindow(EveOptionWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + + foreach (var text in __instance.buttonText) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/ExploreEnterWindow_Patch.cs b/Source/Patches/GameObjects/ExploreEnterWindow_Patch.cs new file mode 100644 index 0000000..a5fd0b8 --- /dev/null +++ b/Source/Patches/GameObjects/ExploreEnterWindow_Patch.cs @@ -0,0 +1,56 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ExploreEnterWindow))] +public static class ExploreEnterWindow_Patch +{ + [HarmonyPatch(nameof(ExploreEnterWindow.Awake)), HarmonyPostfix] + private static void Awake(ExploreEnterWindow __instance) + { + var thePlantType = (PlantType)__instance.selfType; + + __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); + + if (__instance.nameText.text == "") + StringStore.TranslateText(__instance.nameText.text); + + __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + [HarmonyPatch(nameof(ExploreEnterWindow.SetInfo)), HarmonyPostfix] + private static void SetInfo(ExploreEnterWindow __instance) + { + var thePlantType = (PlantType)__instance.selfType; + + __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); + + if (__instance.nameText.text == "") + StringStore.TranslateText(__instance.nameText.text); + + __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + [HarmonyPatch(nameof(ExploreEnterWindow.SetIcon)), HarmonyPostfix] + private static void SetIcon(ExploreEnterWindow __instance) + { + var thePlantType = (PlantType)__instance.selfType; + + __instance.nameText.text = Utils.GetPlantNameFromAlmanac(thePlantType); + + if (__instance.nameText.text == "") + StringStore.TranslateText(__instance.nameText.text); + + __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + [HarmonyPatch(nameof(ExploreEnterWindow.SetDisable)), HarmonyPostfix] + private static void SetDisable(ExploreEnterWindow __instance) + { + if (__instance.disabled) + __instance.nameText.text = StringStore.TranslateText("敬请期待"); + + __instance.nameText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } +} diff --git a/Source/Patches/GameObjects/ExploreMakeMenu_Patch.cs b/Source/Patches/GameObjects/ExploreMakeMenu_Patch.cs new file mode 100644 index 0000000..5dd1873 --- /dev/null +++ b/Source/Patches/GameObjects/ExploreMakeMenu_Patch.cs @@ -0,0 +1,59 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ExploreMakeMenu))] +public static class ExploreMakeMenu_Patch +{ + [HarmonyPatch(nameof(ExploreMakeMenu.Awake)), HarmonyPostfix] + private static void Awake(ExploreMakeMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(ExploreMakeMenu.InitMenu)), HarmonyPostfix] + private static void InitMenu(ExploreMakeMenu __instance) + { + _ = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + if (txt.text.Contains("关卡制作中:")) + { + var plantName = Utils.GetPlantNameFromAlmanac(txt.text.Split(":")[1]); + txt.text = string.Format(StringStore.TranslationStringRegex["关卡制作中:([^\\s]+)"], plantName); + } + else + txt.text = StringStore.TranslateText(txt.text); + } + + [HarmonyPatch(nameof(ExploreMakeMenu.ViewScene)), HarmonyPostfix] + private static void ViewScene(ExploreMakeMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(ExploreMakeMenu.InitZombieButtons)), HarmonyPostfix] + private static void InitZombieButtons(ExploreMakeMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/ExploreMenu_Patch.cs b/Source/Patches/GameObjects/ExploreMenu_Patch.cs new file mode 100644 index 0000000..3bbd9e3 --- /dev/null +++ b/Source/Patches/GameObjects/ExploreMenu_Patch.cs @@ -0,0 +1,28 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ExploreMenu))] +public static class ExploreMenu_Patch +{ + [HarmonyPatch(nameof(ExploreMenu.Awake)),HarmonyPostfix] + private static void Awake(ExploreMenu __instance) + { + _ = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + txt.text = StringStore.TranslateText(txt.text); + + // var randomLevelTextTransform = __instance.transform.FindChild("RandomLevel"); + } + + [HarmonyPatch(nameof(ExploreMenu.UpdateWindows)),HarmonyPostfix] + private static void UpdateWindows(ExploreMenu __instance) + { + _ = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + txt.text = StringStore.TranslateText(txt.text); + } +} diff --git a/Source/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs b/Source/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs new file mode 100644 index 0000000..c0b7a8e --- /dev/null +++ b/Source/Patches/GameObjects/FruitNinjaSelectWindow_Patch.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(FruitNinjaSelectWindow))] +public static class FruitNinjaSelectWindow_Patch +{ + [HarmonyPatch(nameof(FruitNinjaSelectWindow.SetType)), HarmonyPostfix] + private static void SetType(FruitNinjaSelectWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(FruitNinjaSelectWindow.OnAnimOver)), HarmonyPostfix] + private static void OnAnimOver(FruitNinjaSelectWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/GardenPlant_Patch.cs b/Source/Patches/GameObjects/GardenPlant_Patch.cs new file mode 100644 index 0000000..0ac3265 --- /dev/null +++ b/Source/Patches/GameObjects/GardenPlant_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(GardenPlant))] +public static class GardenPlant_Patch +{ + [HarmonyPatch(nameof(GardenPlant.Start)), HarmonyPostfix] + private static void Start(GardenPlant __instance) + { + __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); + } + + [HarmonyPatch(nameof(GardenPlant.UpdateInfo)), HarmonyPostfix] + private static void UpdateInfo(GardenPlant __instance) + { + __instance.infoText.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + __instance.infoText.text = StringStore.TranslateText(__instance.infoText.text); + } +} diff --git a/Source/Patches/GameObjects/GardenStoreMenu_Patch.cs b/Source/Patches/GameObjects/GardenStoreMenu_Patch.cs new file mode 100644 index 0000000..1a5dd2f --- /dev/null +++ b/Source/Patches/GameObjects/GardenStoreMenu_Patch.cs @@ -0,0 +1,27 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(GardenStoreMenu))] +public static class GardenStoreMenu_Patch +{ + [HarmonyPatch(nameof(GardenStoreMenu.InitGoodsList)), HarmonyPatch(nameof(GardenStoreMenu.GetDatas)), + HarmonyPatch(nameof(GardenStoreMenu.PurchaseGoods)), HarmonyPatch(nameof(GardenStoreMenu.Update)), + HarmonyPatch(nameof(GardenStoreMenu.Start)), HarmonyPostfix] + public static void TranslateGardenStoreMenu(GardenStoreMenu __instance) + { + foreach (var slot in __instance.GetComponentsInChildren()) + TranslateGardenShopSlot(slot); + } + + [HarmonyPatch(nameof(GardenShopSlot.Start)), HarmonyPostfix] + public static void TranslateGardenShopSlot(GardenShopSlot __instance) + { + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } +} diff --git a/Source/Patches/GameObjects/GodShootingMenu_Patch.cs b/Source/Patches/GameObjects/GodShootingMenu_Patch.cs new file mode 100644 index 0000000..b2e0a72 --- /dev/null +++ b/Source/Patches/GameObjects/GodShootingMenu_Patch.cs @@ -0,0 +1,34 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(GodShootingMenu))] +public static class GodShootingMenu_Patch +{ + [HarmonyPatch(nameof(GodShootingMenu.Start)), HarmonyPostfix] + private static void Start(GodShootingMenu __instance) + { + foreach (var text in __instance.transform.Find("Background").GetComponentsInChildren()) + { + text.autoSizeTextContainer = true; + text.text = StringStore.TranslateText(text.text); + } + + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(GodShootingMenu.ShowRoutes)), HarmonyPostfix] + private static void ShowRoutes(GodShootingMenu __instance) + { + foreach (var route in __instance.routes) + { + if (route.Value == null) + continue; + + foreach (var text in route.Value.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + } +} diff --git a/Source/Patches/GameObjects/LevelResultMenu_Patch.cs b/Source/Patches/GameObjects/LevelResultMenu_Patch.cs new file mode 100644 index 0000000..bd047ff --- /dev/null +++ b/Source/Patches/GameObjects/LevelResultMenu_Patch.cs @@ -0,0 +1,15 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(LevelResultMenu))] +public static class LevelResultMenu_Patch +{ + [HarmonyPatch(nameof(LevelResultMenu.Start)), HarmonyPatch(nameof(LevelResultMenu.ShowResult)), HarmonyPostfix] + public static void Awake(LevelResultMenu __instance) + { + foreach (var txt in __instance.GetComponentsInChildren()) + txt.text = StringStore.TranslateText(txt.text); + } +} diff --git a/Source/Patches/GameObjects/LoseMenu_Patch.cs b/Source/Patches/GameObjects/LoseMenu_Patch.cs new file mode 100644 index 0000000..96862b6 --- /dev/null +++ b/Source/Patches/GameObjects/LoseMenu_Patch.cs @@ -0,0 +1,14 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(LoseMenu))] +public static class LoseMenu_Patch +{ + public static void TranslateLoseMenu(BaseMenu __instance) + { + if (__instance.TryGetComponent(out var loseMenu)) + loseMenu.title.text = StringStore.TranslateText(loseMenu.title.text); + } +} diff --git a/Source/Patches/GameObjects/MainMenu_Patch.cs b/Source/Patches/GameObjects/MainMenu_Patch.cs new file mode 100644 index 0000000..654e61f --- /dev/null +++ b/Source/Patches/GameObjects/MainMenu_Patch.cs @@ -0,0 +1,103 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(MainMenu))] +public class MainMenu_Patch +{ + public static void AnimOver(BaseMenu __instance) + { + var changelogObj = __instance.transform.Find("Grave/UpdateInfoButton"); + + var langObj = UnityEngine.Object.Instantiate( + changelogObj, + changelogObj.position + new Vector3(0.0f, 0.855f), + changelogObj.rotation, + __instance.transform.Find("Grave") + ); + + langObj.name = "LanguagesButton"; + __instance.collider2Ds.Add(langObj.GetComponent()); + var langBtn = langObj.GetComponent(); + + foreach (var text in langObj.GetComponentsInChildren()) + text.text = StringStore.TranslateText("Languages"); + + langBtn.clickEvent = new(); + langBtn.clickEvent.AddListener(new Action(() => OpenLanguageMenu(langBtn.gameObject))); + } + + public static void OpenLanguageMenu(GameObject langBtn) + { + UIMgr.EnterOptionMenu(); + var newOptionsMenu = GameAPP.canvasUp.Find("OptionMenu(Clone)").gameObject; + newOptionsMenu.name = "LanguageMenu"; + + var toKeep = new List { "Background", "F", "Goback" }; + + foreach (var child in newOptionsMenu.GetComponentsInChildren() + .Where(c => !toKeep.Contains(c.name) && !toKeep.Contains(c.parent.name) && c.name != "LanguageMenu")) + child.gameObject.SetActive(false); + + var templateButton = newOptionsMenu.transform.Find("Buttons/F").GetComponent(); + OptLanguageBtn_Patch.OptLangBtn_Patch.Awake(templateButton); + + // var goBackButton = newOptionsMenu.transform.Find("Goback").GetComponent(); + + newOptionsMenu.transform.Find("Buttons/F").gameObject.SetActive(false); + newOptionsMenu.transform.Find("Buttons").gameObject.SetActive(true); + + foreach (var text in newOptionsMenu.transform.Find("Background").GetComponentsInChildren()) + text.text = StringStore.TranslateText("Language Settings"); + + /*GameObject optionMenuAnchor = UnityEngine.Object.Instantiate(assetBundle.LoadAsset("OptionMenu").TryCast(), GameAPP.canvasUp); + optionMenuAnchor.transform.SetParent(newOptionsMenu.transform, false); + Transform messageAnchor = optionMenuAnchor.transform.Find("MessageAnchor"); + Transform plantAnchor = optionMenuAnchor.transform.Find("PlantAnchor"); + + System.Random random = new System.Random(); + var plantTypes = Enum.GetValues(typeof(PlantType)); + PlantType randomPlantChoice = (PlantType)plantTypes.GetValue(random.Next(plantTypes.Length)); + + if(!GameAPP.resourcesManager.plantPrefabs.ContainsKey(randomPlantChoice) || GameAPP.resourcesManager.plantPrefabs[randomPlantChoice] == null) + { + randomPlantChoice = (PlantType)plantTypes.GetValue(random.Next(plantTypes.Length)); + } + + if (GameAPP.resourcesManager.plantPrefabs[randomPlantChoice] != null) + { + GameObject plant = CreatePlant.SetPlantInAlmamac(plantAnchor.position, (int)randomPlantChoice); + plant.transform.SetParent(newOptionsMenu.transform); + SortingGroup sortingGroup = plant.AddComponent(); + sortingGroup.sortingLayerName = "UI"; + sortingGroup.sortingOrder = 20001; + //plant.transform.position = new Vector3(-7.21f, -3.66f); + UnityEngine.Object.Destroy(plant.GetComponent()); + }*/ + + /*GameObject messageObj = new GameObject(); + messageObj.name = "MultilangMessage"; + messageObj.transform.SetParent(newOptionsMenu.transform); + TextMeshProUGUI messageText = messageObj.AddComponent(); + messageObj.transform.localScale = Vector3.one; + messageText.autoSizeTextContainer = false; + messageText.font = FontStore.LoadTMPFont(Utils.LanguageEnum.English.ToString()); + messageText.text = "Hello this is multilanguage choose language over there ------>";*/ + } + + [HarmonyPatch(nameof(MainMenu.EnterUpdateUrl)), HarmonyPrefix] + public static bool Pre_EnterUpdateUrl(MainMenu __instance) + { + System.Diagnostics.Process.Start( + new System.Diagnostics.ProcessStartInfo + { + FileName = "https://github.com/Teyliu/PVZF-Translation", + UseShellExecute = true, + } + ); + + return false; + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/Brain_Patch.cs b/Source/Patches/GameObjects/MinorObjects/Brain_Patch.cs new file mode 100644 index 0000000..844d9ec --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/Brain_Patch.cs @@ -0,0 +1,48 @@ +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(Brain))] +public static class Brain_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(Brain.Awake))] + private static void Awake(Brain __instance) + { + // reposition original points + var pointsTransform = __instance.points.transform; + var pointsObject = __instance.points.gameObject; + pointsTransform.position = new(-6.5f, pointsTransform.position.y, pointsTransform.position.z); + + // instantiate and move new shadow + var pointsShadowObject = UnityEngine.Object.Instantiate(pointsObject, pointsTransform); + pointsShadowObject.SetActive(true); + var pointsShadowTransform = pointsShadowObject.transform; + pointsShadowTransform.position = new(-6.485f, pointsTransform.position.y - 0.015f, pointsTransform.position.z); + + // set points text + var pointsShadowText = pointsShadowObject.GetComponent(); + pointsShadowText.text = __instance.points.text; + pointsShadowText.sortingOrder -= 2; + pointsShadowText.color = Color.black; + } + + [HarmonyPostfix, HarmonyPatch(nameof(Brain.Update))] + private static void Update(Brain __instance) + { + if (__instance.transform.Find("Points").GetChild(0) == null) + return; + + var shadowText = __instance.transform.Find("Points").GetChild(0).GetComponent(); + shadowText.text = __instance.points.text; + } + + [HarmonyPostfix, HarmonyPatch(nameof(Brain.WinAction))] + private static void WinAction(Brain __instance) + { + if (__instance.transform.Find("Points").GetChild(0) == null) + return; + + var shadowText = __instance.transform.Find("Points").GetChild(0).GetComponent(); + shadowText.text = __instance.points.text; + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/DY_Patch.cs b/Source/Patches/GameObjects/MinorObjects/DY_Patch.cs new file mode 100644 index 0000000..922b813 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/DY_Patch.cs @@ -0,0 +1,12 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(DY))] +public static class DyPatch +{ + [HarmonyPostfix, HarmonyPatch(nameof(DY.Update))] + private static void Update(DY __instance) => + __instance.TextMeshPro.text = StringStore.TranslateText(__instance.TextMeshPro.text); +} diff --git a/Source/Patches/GameObjects/MinorObjects/GameLose_Patch.cs b/Source/Patches/GameObjects/MinorObjects/GameLose_Patch.cs new file mode 100644 index 0000000..4160996 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/GameLose_Patch.cs @@ -0,0 +1,20 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.Patches.BaseTextObjects; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(GameLose))] +public static class GameLose_Patch +{ + [HarmonyPatch(nameof(GameLose.UpdateSecondChanceTimer))] + public static void UpdateSecondChanceTimer(GameLose __instance) + { + if (InGameText.Instance == null) + return; + + if (InGameText.Instance.timer < 0) + return; + + InGameText_Patch.TranslateInGameText(InGameText.Instance); + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/HealthSlider_Patch.cs b/Source/Patches/GameObjects/MinorObjects/HealthSlider_Patch.cs new file mode 100644 index 0000000..9af97c4 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/HealthSlider_Patch.cs @@ -0,0 +1,34 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(HealthSlider))] +public static class HealthSlider_Patch +{ +#pragma warning disable CA2211 + public static TMP_FontAsset FontAsset; +#pragma warning restore CA2211 + [HarmonyPatch(nameof(HealthSlider.Start)), HarmonyPostfix] + public static void Post_Start(HealthSlider __instance) + { + if (!FontAsset) + FontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + [HarmonyPatch(nameof(HealthSlider.UpdateText)), HarmonyPostfix] + public static void Post_UpdateText(HealthSlider __instance) + { + if (!FontAsset) + FontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + if (__instance.healthText.font != FontAsset) + __instance.healthText.font = FontAsset; + + foreach (var txt in __instance.healthTextContainer.GetComponentsInChildren(true)) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = FontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs b/Source/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs new file mode 100644 index 0000000..321901a --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/Jigsaw_Patch.cs @@ -0,0 +1,27 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(JigsawClip))] +public static class JigsawClip_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(JigsawClip.Awake))] + private static void Postfix_Awake(JigsawClip __instance) + { + if (!__instance || !__instance.description) + return; + + StringStore.TranslateTextUI(__instance.description); + } + + [HarmonyPostfix, HarmonyPatch(nameof(JigsawClip.Update))] + private static void Postfix_Update(JigsawClip __instance) + { + if (!__instance || !__instance.description) + return; + + if (__instance.description.text != StringStore.TranslateText(__instance.description.text)) + StringStore.TranslateTextUI(__instance.description); + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs b/Source/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs new file mode 100644 index 0000000..ca783a0 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/LanternUmbrella_Patch.cs @@ -0,0 +1,17 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(LanternUmbrella))] +public class LanternUmbrella_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(LanternUmbrella.Update))] + private static void Update(LanternUmbrella __instance) + { + __instance.energyText = StringStore.TranslateText(__instance.energyText); + __instance.energyTextShadow = StringStore.TranslateText(__instance.energyTextShadow); + } +} +#endif diff --git a/Source/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs b/Source/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs new file mode 100644 index 0000000..d0a85a9 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/MagnetBox_Patch.cs @@ -0,0 +1,11 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(MagnetBox))] +public class MagnetBox_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(MagnetBox.Update))] + private static void Update(MagnetBox __instance) => StringStore.TranslateTextTransform(__instance.transform); +} diff --git a/Source/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs b/Source/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs new file mode 100644 index 0000000..d09156c --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/MagnetInterface_Patch.cs @@ -0,0 +1,11 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(MagnetInterface))] +public class MagnetInterface_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(MagnetInterface.Update))] + private static void Update(MagnetInterface __instance) => StringStore.TranslateTextTransform(__instance.transform); +} diff --git a/Source/Patches/GameObjects/MinorObjects/Money_Patch.cs b/Source/Patches/GameObjects/MinorObjects/Money_Patch.cs new file mode 100644 index 0000000..bf7e205 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/Money_Patch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(Money))] +public static class Money_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(Money.Update))] + private static void Update(Money __instance) + { + if (!Utils.CheckForUntranslatedText(__instance.beanCount.text)) + return; + + __instance.beanCount.text = StringStore.TranslateText(__instance.beanCount.text); + __instance.beanCount2.text = StringStore.TranslateText(__instance.beanCount2.text); + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/Plant_Patch.cs b/Source/Patches/GameObjects/MinorObjects/Plant_Patch.cs new file mode 100644 index 0000000..a2a2734 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/Plant_Patch.cs @@ -0,0 +1,51 @@ +#if false +using System.Text.RegularExpressions; +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(Plant))] +public static class Plant_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(Plant.Awake))] + private static void Awake(Plant __instance) + { + if (__instance.thePlantType is not (PlantType.SuperMachineNut or PlantType.MachineNut)) + return; + + __instance.healthSlider.healthText.text = __instance.healthSlider.healthTextShadow.text = + ChangeHPText(__instance.healthSlider.healthTextShadow.text); + } + + [HarmonyPostfix, HarmonyPatch(nameof(Plant.UpdateText))] + private static void Update(Plant __instance) + { + if (__instance.thePlantType is not (PlantType.SuperMachineNut or PlantType.MachineNut)) + return; + + if (__instance.thePlantHealth < __instance.thePlantMaxHealth) + return; + + __instance.healthSlider.healthText.text = __instance.healthSlider.healthTextShadow.text = + ChangeHPText(__instance.healthSlider.healthTextShadow.text); + } + + private static string ChangeHPText(string originalText) + { + var regex = new Regex(@"(\d+)\d\d\d/(\d)000"); + + if (!regex.IsMatch(originalText)) + return originalText; + + var match = regex.Match(originalText); + var groupCount = match.Groups.Count; + + var dynamicParts = new List(); + + for (var i = 1; i < groupCount; i++) + dynamicParts.Add(match.Groups[i].Value); + + return string.Format("{0}k/{1}k", [..dynamicParts]); + } +} +#endif diff --git a/Source/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs b/Source/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs new file mode 100644 index 0000000..40aa856 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/PlayerName_Patch.cs @@ -0,0 +1,15 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(PlayerName))] +public static class PlayerName_Patch +{ + [HarmonyPostfix] + [HarmonyPatch(nameof(PlayerName.Update))] + private static void Update(PlayerName __instance) => + __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); +} +#endif diff --git a/Source/Patches/GameObjects/MinorObjects/PumpinerChestMenu_Patch.cs b/Source/Patches/GameObjects/MinorObjects/PumpinerChestMenu_Patch.cs new file mode 100644 index 0000000..e93cfa5 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/PumpinerChestMenu_Patch.cs @@ -0,0 +1,16 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(PumpinerChestMenu))] +public static class PumpinerChestMenu_Patch +{ + [HarmonyPatch(nameof(PumpinerChestMenu.InitPlants)), HarmonyPostfix] + public static void Post_InitPlants(PumpinerChestMenu __instance) + { + var closeBtnTransform = __instance.transform.Find("SampleButton"); + var txt = closeBtnTransform.GetComponentInChildren(); + txt.text = StringStore.TranslateText("合上"); + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs b/Source/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs new file mode 100644 index 0000000..c00a74b --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/SelectYourPlants_Patch.cs @@ -0,0 +1,20 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(SelectYourPlants))] +public static class SelectYourPlants_Patch +{ + [HarmonyPatch(nameof(SelectYourPlants.Awake)), HarmonyPostfix] + private static void Awake(SelectYourPlants __instance) + { + __instance.TextMeshProUGUI = StringStore.TranslateText(__instance.TextMeshProUGUI); + __instance.TextMeshProUGUI.autoSizeTextContainer = true; + + __instance.TextMeshProUGUI2 = StringStore.TranslateText(__instance.TextMeshProUGUI2); + __instance.TextMeshProUGUI2.autoSizeTextContainer = true; + } +} +#endif diff --git a/Source/Patches/GameObjects/MinorObjects/SpecialCard_Patch.cs b/Source/Patches/GameObjects/MinorObjects/SpecialCard_Patch.cs new file mode 100644 index 0000000..59f9cd0 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/SpecialCard_Patch.cs @@ -0,0 +1,21 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(SpecialCard))] +public static class SpecialCard_Patch +{ + [HarmonyPatch(nameof(SpecialCard.Awake)), HarmonyPatch(nameof(SpecialCard.Start)), + HarmonyPatch(nameof(SpecialCard.ClickedEvent)), HarmonyPostfix] + public static void Post_Awake(SpecialCard __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs b/Source/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs new file mode 100644 index 0000000..11a4e9d --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/TrainingDummy_Patch.cs @@ -0,0 +1,12 @@ +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(TrainingDummy), nameof(TrainingDummy.UpdateHealthText))] +public static class TrainingDummy_Patch +{ + [HarmonyPostfix] + public static void UpdateHealthText(TrainingDummy __instance) => + // Zombie_Patch.TranslateHpUI_T(__instance.healthTextShadow, __instance); + Zombie_Patch.TranslateHpUI_T(__instance.healthText, __instance); +} diff --git a/Source/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs b/Source/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs new file mode 100644 index 0000000..df80c69 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/TreasureMoney_Patch.cs @@ -0,0 +1,12 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(TreasureMoney))] +public static class TreasureMoney_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(TreasureMoney.Update))] + private static void Update(TreasureMoney __instance) => + __instance.text = StringStore.TranslateText(__instance.text); +} diff --git a/Source/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs b/Source/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs new file mode 100644 index 0000000..68b52c0 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/UIProgress2_Patch.cs @@ -0,0 +1,12 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(UIProgress2))] +public static class UIProgress2_Patch +{ + [HarmonyPatch(nameof(UIProgress2.Update)), HarmonyPostfix] + private static void Update(UIProgress2 __instance) => + __instance.t.text = StringStore.TranslateText(__instance.t.text); +} diff --git a/Source/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs b/Source/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs new file mode 100644 index 0000000..1b0ebe6 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/UltimateChomper_Patch.cs @@ -0,0 +1,17 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(UltimateChomper), nameof(UltimateChomper.UpdateText))] +public static class UltimateChomper_Patch +{ + [HarmonyPostfix] + public static void UpdateText(UltimateChomper __instance) + { + StringStore.TranslateText(__instance.killingText); + StringStore.TranslateText(__instance.killingTextShadow); + } +} +#endif diff --git a/Source/Patches/GameObjects/MinorObjects/Zombie_Patch.cs b/Source/Patches/GameObjects/MinorObjects/Zombie_Patch.cs new file mode 100644 index 0000000..49555a5 --- /dev/null +++ b/Source/Patches/GameObjects/MinorObjects/Zombie_Patch.cs @@ -0,0 +1,184 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; + +[HarmonyPatch(typeof(Zombie))] +public static class Zombie_Patch +{ + private static readonly Dictionary s_hpStrings = new() + { + { "最后一击:(\\d+)\nDPS:([^\\s]+)\n总伤害:(\\d+)", "Last Damage: {0}\nDPS: {1}\nTotal: {2}" }, + { + "^HP:(\\d+)/(\\d+)\n一类:(\\d+)/(\\d+)\n二类:(\\d+)/(\\d+)$", + "HP: {0}/{1}\nT1 armor: {2}/{3}\nT2 armor: {4}/{5}" + }, + { "^HP:(\\d+)/(\\d+)\n一类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nT1 armor: {2}/{3}" }, + { "^HP:(\\d+)/(\\d+)\n二类:(\\d+)/(\\d+)$", "HP: {0}/{1}\nT2 armor: {2}/{3}" }, + { @"^HP:(\d+)/(\d+)$", "HP: {0}/{1}" }, + }; + + public static void LoadHpStrings() + { + foreach (var hp in s_hpStrings) + if (StringStore.TranslationStringRegex.TryGetValue(hp.Key, out var value)) + s_hpStrings[hp.Key] = value; + } + + [HarmonyPatch(nameof(Zombie.Start)), HarmonyPostfix] + public static void Start(Zombie __instance) + { + TranslateHpUI(__instance.healthText, __instance); + //TranslateHpUI(__instance.healthTextShadow, __instance); + + if (__instance.healthText.transform.rotation != Quaternion.Euler(0, 0, 0)) + __instance.healthText.transform.rotation = Quaternion.Euler(0f, 0f, 0f); + } + + [HarmonyPatch(nameof(Zombie.UpdateHealthText)), HarmonyPostfix] + public static void Update(Zombie __instance) + { + if (__instance.theZombieType == ZombieType.TrainingDummy || !Board.Instance.showZombieHealth) + return; + + if (__instance.healthText == null) + return; + + TranslateHpUI(__instance.healthText, __instance); + //TranslateHpUI(__instance.healthTextShadow, __instance); + + if (__instance.healthText.transform.rotation != Quaternion.Euler(0f, 0f, 0f)) + __instance.healthText.transform.rotation = Quaternion.Euler(0f, 0f, 0f); + } + + public static void TranslateHpUI(TextMeshPro textTMP, Zombie __instance) + { + if (!textTMP) + return; + + var origText = textTMP.text; + var translatedText = origText; + + if (translatedText == null) + return; + + const string Pattern = "(\\d+)阶\n([\\s\\S]+)"; + + if (StringStore.TestRegex(translatedText, Pattern)) + { + var match = Regex.Match(translatedText, Pattern, RegexOptions.Singleline); + var tier = match.Groups[1].Value; + var healthText = TranslateHpText(match.Groups[2].Value, __instance); + var fStr = StringStore.TranslationStringRegex[Pattern]; + translatedText = string.Format(fStr, [tier, healthText]); + } + else + translatedText = TranslateHpText(origText, __instance); + + textTMP.text = translatedText == origText ? origText : translatedText; + textTMP.autoSizeTextContainer = false; + + if (translatedText != origText) + textTMP.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + public static void TranslateHpUI_T(TextMeshPro textTMP, TrainingDummy __instance) + { + if (!textTMP) + return; + + var origText = textTMP.text; + var translatedText = TranslateHPText_T(origText, __instance); + textTMP.text = translatedText == origText ? origText : translatedText; + textTMP.autoSizeTextContainer = false; + + if (translatedText != origText) + textTMP.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + public static string TranslateHpText(string originalText, Zombie __instance) + { + if (originalText == null) + return null; + + var finalText = __instance.healthText.text; + var fIndex = -1; + var found = false; + + for (var i = 0; i < s_hpStrings.Count; i++) + { + var hp = s_hpStrings.ElementAt(i); + + if (!Regex.Match(originalText, hp.Key, RegexOptions.Singleline).Success) + continue; + + fIndex = i; + found = true; + } + + if (fIndex <= -1 || !found) + return finalText; + + var fStr = s_hpStrings.ElementAt(fIndex).Value; + + return fIndex switch + { + 1 => string.Format( + fStr, + __instance.theHealth, + __instance.theMaxHealth, + __instance.theFirstArmorHealth, + __instance.theFirstArmorMaxHealth, + __instance.theSecondArmorHealth, + __instance.theSecondArmorMaxHealth + ), + 2 => string.Format( + fStr, + __instance.theHealth, + __instance.theMaxHealth, + __instance.theFirstArmorHealth, + __instance.theFirstArmorMaxHealth + ), + 3 => string.Format( + fStr, + __instance.theHealth, + __instance.theMaxHealth, + __instance.theSecondArmorHealth, + __instance.theSecondArmorMaxHealth + ), + 4 => string.Format(fStr, __instance.theHealth, __instance.theMaxHealth), + _ => finalText, + }; + } + + public static string TranslateHPText_T(string originalText, TrainingDummy __instance) + { + var finalText = __instance.healthText.text; + var fIndex = -1; + var found = false; + + for (var i = 0; i < s_hpStrings.Count; i++) + { + var hp = s_hpStrings.ElementAt(i); + var regex = new Regex(hp.Key); + + if (!regex.IsMatch(originalText)) + continue; + + fIndex = i; + found = true; + } + + if (fIndex <= -1 || !found) + return finalText; + + var fStr = s_hpStrings.ElementAt(fIndex).Value; + + return fIndex switch + { + 0 => string.Format(fStr, __instance.lastDamage, __instance.CurrentDPS, __instance.totalDamage), + _ => finalText, + }; + } +} diff --git a/Source/Patches/GameObjects/NoticePauseMenu_Patch.cs b/Source/Patches/GameObjects/NoticePauseMenu_Patch.cs new file mode 100644 index 0000000..bb09216 --- /dev/null +++ b/Source/Patches/GameObjects/NoticePauseMenu_Patch.cs @@ -0,0 +1,53 @@ +using PvZ_Fusion_Translator.AssetStore; +using UnityEngine.UI; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +public static class NoticePauseMenu_Patch +{ +#pragma warning disable CA2211 + public static string ChangelogText = ""; +#pragma warning restore CA2211 + public static void Pre_Awake(BaseMenu __instance) + { + var contentObject = __instance.transform.FindChild("Scroll View/Viewport/Content").gameObject; + + var contentText = contentObject.GetComponent(); + + File.WriteAllText( + Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "changelog.txt"), + contentText.text + ); + + var stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); + var changelogDir = Path.Combine(stringDir, "changelog.txt"); + + if (!File.Exists(changelogDir)) + File.WriteAllText(changelogDir, contentText.text); + } + + public static void Post_Awake(BaseMenu __instance) + { + _ = FontStore.LoadTMPFont(Utils.Language.ToString()); + FileLoader.LoadChangelogText(); + + var contentObject = __instance.transform.FindChild("Scroll View/Viewport/Content").gameObject; + + var contentText = contentObject.GetComponent(); + contentText.text = ChangelogText; + contentText.margin = new(6, 2, 12, 0); + + contentText.enableWordWrapping = true; + contentText.overflowMode = TextOverflowModes.ScrollRect; + + Canvas.ForceUpdateCanvases(); + contentText.ForceMeshUpdate(); + + //float textHeight = contentText.preferredHeight; + //RectTransform contentRect = contentObject.GetComponent(); + //contentRect.sizeDelta = new Vector2(contentRect.sizeDelta.x, textHeight); + + var sizeFitter = contentObject.AddComponent(); + sizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; + } +} diff --git a/Source/Patches/GameObjects/OtherMenu_Patch.cs b/Source/Patches/GameObjects/OtherMenu_Patch.cs new file mode 100644 index 0000000..7cc2c99 --- /dev/null +++ b/Source/Patches/GameObjects/OtherMenu_Patch.cs @@ -0,0 +1,15 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(OtherMenu))] +public static class OtherMenu_Patch +{ + [HarmonyPatch(nameof(OtherMenu.UpdateText)), HarmonyPostfix] + private static void UpdateText(OtherMenu __instance) + { + __instance.text1 = StringStore.TranslateText(__instance.text1); + __instance.text2 = StringStore.TranslateText(__instance.text2); + } +} diff --git a/Source/Patches/GameObjects/PVPRandomManager_Patch.cs b/Source/Patches/GameObjects/PVPRandomManager_Patch.cs new file mode 100644 index 0000000..db06f86 --- /dev/null +++ b/Source/Patches/GameObjects/PVPRandomManager_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PVPRandomManager))] // ReSharper disable once InconsistentNaming +public static class PVPRandomManager_Patch +{ + [HarmonyPatch(nameof(PVPRandomManager.Start)), HarmonyPostfix] + private static void Start(PVPRandomManager __instance) + { + foreach (var text in __instance.texts) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(PVPRandomManager.Update)), HarmonyPostfix] + private static void ZombieEnterHouse(PVPRandomManager __instance) + { + foreach (var text in __instance.texts) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs b/Source/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs new file mode 100644 index 0000000..7b7d914 --- /dev/null +++ b/Source/Patches/GameObjects/PlantCardPackageBuilder_Patch.cs @@ -0,0 +1,17 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlantCardPackageBuilder))] +public static class PlantCardPackageBuilder_Patch +{ + [HarmonyPatch(nameof(PlantCardPackageBuilder.UpdateText)), HarmonyPostfix] + private static void UpdateText(PlantCardPackageBuilder __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.text.text = StringStore.TranslateText(__instance.text.text); + __instance.text.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/PlantDamageMenu_Patch.cs b/Source/Patches/GameObjects/PlantDamageMenu_Patch.cs new file mode 100644 index 0000000..e0ecb4c --- /dev/null +++ b/Source/Patches/GameObjects/PlantDamageMenu_Patch.cs @@ -0,0 +1,41 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlantDamageMenu))] +public static class PlantDamageMenu_Patch +{ + public static void Awake(BaseMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in __instance.GetComponentsInChildren()) + { + var originalKey = StringStore.TranslationString.FirstOrDefault(x => x.Value == text.text).Key; + + text.text = StringStore.TranslationString.ContainsKey(originalKey + "_RM") + ? StringStore.TranslateText(originalKey + "_RM") + : StringStore.TranslateText(text.text); + + text.font = fontAsset; + } + } + + [HarmonyPatch(nameof(PlantDamageMenu.Awake)), HarmonyPatch(nameof(PlantDamageMenu.InitCards)), HarmonyPostfix] + public static void InitCards(PlantDamageMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in __instance.GetComponentsInChildren()) + { + var originalKey = StringStore.TranslationString.FirstOrDefault(x => x.Value == text.text).Key; + + text.text = StringStore.TranslationString.ContainsKey(originalKey + "_RM") + ? StringStore.TranslateText(originalKey + "_RM") + : StringStore.TranslateText(text.text); + + text.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/PlantDataMenu_Patch.cs b/Source/Patches/GameObjects/PlantDataMenu_Patch.cs new file mode 100644 index 0000000..29b5eec --- /dev/null +++ b/Source/Patches/GameObjects/PlantDataMenu_Patch.cs @@ -0,0 +1,66 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlantDataMenu))] +public static class PlantDataMenu_Patch +{ + [HarmonyPatch(nameof(PlantDataMenu.Start)), HarmonyPostfix] + public static void Post_Start(PlantDataMenu __instance) => TranslatePlantDataMenu(__instance); +#if false + [HarmonyPatch(nameof(PlantDataMenu.Update)), HarmonyPostfix] + public static void Post_Update(PlantDataMenu __instance) => TranslatePlantDataMenu(__instance); +#endif + [HarmonyPatch(nameof(PlantDataMenu.InitDataFromPlant)), HarmonyPostfix] + public static void Post_InitDataFromPlant(PlantDataMenu __instance) => TranslatePlantDataMenu(__instance); + + public static void TranslatePlantDataMenu(PlantDataMenu __instance) + { + if (!__instance) + return; + + var thePlantType = __instance.plant.thePlantType; + var plantName = Utils.GetPlantNameFromAlmanac(thePlantType); + + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in __instance.nameText) + { + text.text = plantName; + text.font = fontAsset; + } + + foreach (var text in __instance.infoText) + { + var toTranslate = text.text; + var startColorTag = ""; + + const string ColorPattern = "(]+>)(.*?)()"; + var match = Regex.Match(toTranslate, ColorPattern); + + if (match.Success) + { + startColorTag = match.Groups[1].Value; + toTranslate = match.Groups[2].Value; + } + + var parts = toTranslate.Split("\n"); + var translatedParts = parts.Select(part => StringStore.TranslateText(part)).ToList(); + + var joinedTranslation = string.Join("\n", translatedParts); + + if (startColorTag != "") + text.text = startColorTag + joinedTranslation + ""; + else + text.text = joinedTranslation; + + text.font = fontAsset; + } + + foreach (var text in __instance.toggles.transform.Find("Viewport/Content/Toggles") + .GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/GameObjects/PlantInfoWindow_Patch.cs b/Source/Patches/GameObjects/PlantInfoWindow_Patch.cs new file mode 100644 index 0000000..ce93672 --- /dev/null +++ b/Source/Patches/GameObjects/PlantInfoWindow_Patch.cs @@ -0,0 +1,43 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlantInfoWindow))] +public static class PlantInfoWindow_Patch +{ + [HarmonyPatch(nameof(PlantInfoWindow.InitText)), HarmonyPostfix] + private static void InitText(PlantInfoWindow __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var thePlant = __instance.plant; + + foreach (var txt in __instance.GetComponentsInChildren()) + { + if (txt.name.Contains("Introduce") && thePlant != null) + { + var thePlantType = thePlant.thePlantType; + txt.text = StringStore.TranslateText(txt.text); + + var text = txt.text; + var lines = text.Split("\n"); + + lines[0] = Utils.GetPlantNameFromAlmanac(thePlantType); + var updatedText = string.Join("\n", lines); + + txt.text = updatedText; + } + else + txt.text = StringStore.TranslateText(txt.text); + + txt.font = fontAsset; + } + + var parentWindowTransform = __instance.transform.parent; + var returnPlantTransform = parentWindowTransform.FindChild("Close"); + + foreach (var txt in returnPlantTransform.GetComponentsInChildren()) + txt.text = StringStore.TranslateText("合上"); + } +} diff --git a/Source/Patches/GameObjects/PlayerSaveMenu_Patch.cs b/Source/Patches/GameObjects/PlayerSaveMenu_Patch.cs new file mode 100644 index 0000000..a16af80 --- /dev/null +++ b/Source/Patches/GameObjects/PlayerSaveMenu_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlayerSaveMenu))] +public static class PlayerSaveMenu_Patch +{ + [HarmonyPatch(nameof(PlayerSaveMenu.CreatePlayerData)), HarmonyPostfix] + public static void CreatePlayerData(PlayerSaveMenu __instance) => TranslateCreatePlayerSaveMenu(); + + [HarmonyPatch(nameof(PlayerSaveMenu.ResetName)), HarmonyPostfix] + public static void ResetName(PlayerSaveMenu __instance) => TranslateCreatePlayerSaveMenu(); + + public static void TranslateCreatePlayerSaveMenu() + { + var reNameMenuTransform = GameAPP.canvasUp.Find("ReNameMenu(Clone)"); + + if (reNameMenuTransform.TryGetComponent(out var reNameMenu)) + reNameMenu.title.text = StringStore.TranslateText(reNameMenu.title.text); + } +} diff --git a/Source/Patches/GameObjects/PlayerShootingMenu_Patch.cs b/Source/Patches/GameObjects/PlayerShootingMenu_Patch.cs new file mode 100644 index 0000000..bf0bb3e --- /dev/null +++ b/Source/Patches/GameObjects/PlayerShootingMenu_Patch.cs @@ -0,0 +1,35 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlayerShootingMenu))] +public static class PlayerShootingMenu_Patch +{ + [HarmonyPatch(nameof(PlayerShootingMenu.Update)), HarmonyPostfix] + private static void Update(PlayerShootingMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(PlayerShootingMenu.Refresh)), HarmonyPostfix] + private static void Refresh(PlayerShootingMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var refreshTransform = __instance.transform.FindChild("Button"); + + foreach (var text in refreshTransform.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + text.autoSizeTextContainer = false; + } + } +} diff --git a/Source/Patches/GameObjects/PlayerShootingWindow_Patch.cs b/Source/Patches/GameObjects/PlayerShootingWindow_Patch.cs new file mode 100644 index 0000000..3b7be3f --- /dev/null +++ b/Source/Patches/GameObjects/PlayerShootingWindow_Patch.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(PlayerShootingWindow))] +public static class PlayerShootingWindow_Patch +{ + [HarmonyPatch(nameof(PlayerShootingWindow.SetType)), HarmonyPostfix] + private static void SetType(PlayerShootingWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(PlayerShootingWindow.OnAnimOver)), HarmonyPostfix] + private static void OnAnimOver(PlayerShootingWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/ReNameMenu_Patch.cs b/Source/Patches/GameObjects/ReNameMenu_Patch.cs new file mode 100644 index 0000000..e7c0f86 --- /dev/null +++ b/Source/Patches/GameObjects/ReNameMenu_Patch.cs @@ -0,0 +1,16 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ReNameMenu))] +public static class ReNameMenu_Patch +{ + [HarmonyPatch(nameof(ReNameMenu.SetTitle)), HarmonyPostfix] + public static void SetTitle(ReNameMenu __instance) => + __instance.title.text = StringStore.TranslateText(__instance.title.text); + + [HarmonyPatch(nameof(ReNameMenu.SetInputText)), HarmonyPostfix] + public static void SetInputText(ReNameMenu __instance) => + __instance.input.text = StringStore.TranslateText(__instance.input.text); +} diff --git a/Source/Patches/GameObjects/RogueCardWindow_Patch.cs b/Source/Patches/GameObjects/RogueCardWindow_Patch.cs new file mode 100644 index 0000000..fe3ed8b --- /dev/null +++ b/Source/Patches/GameObjects/RogueCardWindow_Patch.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(RogueCardWindow))] +public static class RogueCardWindow_Patch +{ + [HarmonyPatch(nameof(RogueCardWindow.InitCard)), HarmonyPostfix] + private static void InitCard(RogueCardWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(RogueCardWindow.OnAnimOver)), HarmonyPostfix] + private static void OnAnimOver(RogueCardWindow __instance) + { + var introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/RogueStartMenu_Patch.cs b/Source/Patches/GameObjects/RogueStartMenu_Patch.cs new file mode 100644 index 0000000..564c177 --- /dev/null +++ b/Source/Patches/GameObjects/RogueStartMenu_Patch.cs @@ -0,0 +1,32 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(RogueStartMenu))] +public static class RogueStartMenu_Patch +{ + [HarmonyPatch(nameof(RogueStartMenu.SetLeader)), HarmonyPostfix] + private static void SetLeader(RogueStartMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(RogueStartMenu.EnterGame)), HarmonyPostfix] + private static void EnterGame(RogueStartMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/GameObjects/SeedLibrary_Patch.cs b/Source/Patches/GameObjects/SeedLibrary_Patch.cs new file mode 100644 index 0000000..8a8ff13 --- /dev/null +++ b/Source/Patches/GameObjects/SeedLibrary_Patch.cs @@ -0,0 +1,48 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(SeedLibrary))] +public static class SeedLibrary_Patch +{ + [HarmonyPatch(nameof(SeedLibrary.ChangeSafeMode)), HarmonyPostfix] + private static void ChangeSafeMode(SeedLibrary __instance) + { + _ = FontStore.LoadTMPFont(Utils.Language.ToString()); + + //foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) + //{ + // txt.text = StringStore.TranslateText(txt.text); + // txt.font = fontAsset; + //} + + var safetyBoxButtonTransform = __instance.transform.FindChild("SafeBox").FindChild("StartSafeMode"); + + if (__instance.safeMode || safetyBoxButtonTransform == null) + return; + + foreach (var txt in safetyBoxButtonTransform.GetComponentsInChildren()) + txt.text = StringStore.TranslateText("合上"); + } + + [HarmonyPatch(nameof(SeedLibrary.Start)), HarmonyPatch(nameof(SeedLibrary.SetAllCards)), HarmonyPostfix] + private static void SetAllCards(SeedLibrary __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + //foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) + //{ + // txt.text = StringStore.TranslateText(txt.text); + // txt.font = fontAsset; + //} + + foreach (var txt in __instance.page.GetComponentsInChildren(true)) + { + txt.font = fontAsset; + + if (!Utils.CheckForUntranslatedText(txt.text)) + txt.text = StringStore.TranslateText(txt.text); + } + } +} diff --git a/Source/Patches/GameObjects/ShootingMenu_Patch.cs b/Source/Patches/GameObjects/ShootingMenu_Patch.cs new file mode 100644 index 0000000..1f85c77 --- /dev/null +++ b/Source/Patches/GameObjects/ShootingMenu_Patch.cs @@ -0,0 +1,22 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ShootingMenu))] +public static class ShootingMenu_Patch +{ + [HarmonyPatch(nameof(ShootingMenu.Update)), HarmonyPostfix] + private static void Update(ShootingMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (TextMeshProUGUI txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} +#endif diff --git a/Source/Patches/GameObjects/ShootingSelectWindow_Patch.cs b/Source/Patches/GameObjects/ShootingSelectWindow_Patch.cs new file mode 100644 index 0000000..04c919a --- /dev/null +++ b/Source/Patches/GameObjects/ShootingSelectWindow_Patch.cs @@ -0,0 +1,65 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(ShootingSelectWindow))] +public static class ShootingSelectWindow_Patch +{ + [HarmonyPatch(nameof(ShootingSelectWindow.InitPlantType)), HarmonyPostfix] + private static void InitCard(ShootingSelectWindow __instance) + { + Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(ShootingSelectWindow.OnAnimOver)), HarmonyPostfix] + private static void OnAnimOver(ShootingSelectWindow __instance) + { + Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(ShootingSelectWindow.SetUpgradePlantTypes)), HarmonyPostfix] + private static void SetUpgradePlantTypes(ShootingSelectWindow __instance) + { + Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(ShootingSelectWindow.GetMaxIndexInRoutes)), HarmonyPostfix] + private static void GetMaxIndexInRoutes(ShootingSelectWindow __instance) + { + Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } + + [HarmonyPatch(nameof(ShootingSelectWindow.Start)), HarmonyPostfix] + private static void Start(ShootingSelectWindow __instance) + { + Transform introduceTransform = __instance.transform.FindChild("Images").FindChild("Introduce"); + var introduceText = introduceTransform.GetComponent(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + introduceText.text = StringStore.TranslateText(introduceText.text); + introduceText.font = fontAsset; + } +} +#endif diff --git a/Source/Patches/GameObjects/SpriteRenderer_Patch.cs b/Source/Patches/GameObjects/SpriteRenderer_Patch.cs new file mode 100644 index 0000000..d2e35d9 --- /dev/null +++ b/Source/Patches/GameObjects/SpriteRenderer_Patch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(SpriteRenderer))] +public static class SpriteRenderer_Patch +{ + [HarmonyPatch(nameof(SpriteRenderer.InvokeSpriteChanged)), HarmonyPostfix] + private static void InvokeSpriteChanged(SpriteRenderer __instance) + { + if (__instance.sprite == null) + return; + + if (TextureStore.SpriteDict.ContainsKey(__instance.sprite.name) && __instance.drawMode != SpriteDrawMode.Sliced) + __instance.drawMode = SpriteDrawMode.Sliced; + } +} diff --git a/Source/Patches/GameObjects/TowerOption_Patch.cs b/Source/Patches/GameObjects/TowerOption_Patch.cs new file mode 100644 index 0000000..6277c0b --- /dev/null +++ b/Source/Patches/GameObjects/TowerOption_Patch.cs @@ -0,0 +1,18 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(TowerOption))] +public static class TowerOption_Patch +{ + [HarmonyPatch(nameof(TowerOption.Start)), HarmonyPostfix] + private static void Postfix_Start(TowerOption __instance) + { + //TextMeshProUGUI[] allTexts = __instance.GetComponentsInChildren(true); + __instance.introduce.text = StringStore.TranslateText(__instance.introduce.text); + __instance.introduce.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } +} +#endif diff --git a/Source/Patches/GameObjects/TowerUpgradeMenu_Patch.cs b/Source/Patches/GameObjects/TowerUpgradeMenu_Patch.cs new file mode 100644 index 0000000..ee77a93 --- /dev/null +++ b/Source/Patches/GameObjects/TowerUpgradeMenu_Patch.cs @@ -0,0 +1,34 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(TowerUpgradeMenu))] +public static class TowerUpgradeMenu_Patch +{ + [HarmonyPatch(nameof(TowerUpgradeMenu.Awake)), HarmonyPostfix] + private static void Awake(TowerUpgradeMenu __instance) + { + __instance.des.text = StringStore.TranslateText(__instance.des.text); + __instance.des2.text = StringStore.TranslateText(__instance.des2.text); + + foreach (var text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } + + [HarmonyPatch(nameof(TowerUpgradeMenu.SetText)), HarmonyPostfix] + private static void SetText(TowerUpgradeMenu __instance) + { + __instance.des.text = StringStore.TranslateText(__instance.des.text); + __instance.des2.text = StringStore.TranslateText(__instance.des2.text); + + foreach (var text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } +} diff --git a/Source/Patches/GameObjects/UIDifficulty_Patch.cs b/Source/Patches/GameObjects/UIDifficulty_Patch.cs new file mode 100644 index 0000000..fafb786 --- /dev/null +++ b/Source/Patches/GameObjects/UIDifficulty_Patch.cs @@ -0,0 +1,17 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(UIDifficulty))] +public static class UIDifficulty_Patch +{ + [HarmonyPatch(nameof(UIDifficulty.Update)), HarmonyPostfix] + private static void Update(UIDifficulty __instance) + { + if (!Utils.CheckForUntranslatedText(__instance.t.text)) + return; + + __instance.t.text = StringStore.TranslateText(__instance.t.text); + } +} diff --git a/Source/Patches/GameObjects/UIZombieNum_Patch.cs b/Source/Patches/GameObjects/UIZombieNum_Patch.cs new file mode 100644 index 0000000..cebf27a --- /dev/null +++ b/Source/Patches/GameObjects/UIZombieNum_Patch.cs @@ -0,0 +1,31 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(UIZombieNum))] +public static class UIZombieNum_Patch +{ + [HarmonyPatch(nameof(UIZombieNum.Update)), HarmonyPostfix] + private static void Update(UIZombieNum __instance) + { + TMP_FontAsset fontAsset; + + if (ModFeatures.IsMultiLanguage) + { + fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + __instance.t.text = StringStore.TranslateText(__instance.t.text); + } + else + { + fontAsset = FontStore.LoadTMPFont(); + + __instance.t.text = string.Format( + StringStore.PatchesStore["Zombies"]["Spanish"] + " {0}", + Board.Instance.enermyCount + ); + } + + __instance.t.font = fontAsset; + } +} diff --git a/Source/Patches/GameObjects/WarningMenu_Patch.cs b/Source/Patches/GameObjects/WarningMenu_Patch.cs new file mode 100644 index 0000000..531158b --- /dev/null +++ b/Source/Patches/GameObjects/WarningMenu_Patch.cs @@ -0,0 +1,77 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.GameObjects; + +[HarmonyPatch(typeof(WarningMenu))] +public static class WarningMenu_Patch +{ + [HarmonyPatch(nameof(WarningMenu.Start)), HarmonyPostfix] + private static void Start(WarningMenu __instance) => TranslateInvestmentWarning(__instance); + + [HarmonyPatch(nameof(WarningMenu.EnableChallengeMode)), HarmonyPostfix] + private static void EnableChallengeMode(WarningMenu __instance) => TranslateInvestmentWarning(__instance); + + [HarmonyPatch(nameof(WarningMenu.Cancel)), HarmonyPostfix] + private static void Cancel(WarningMenu __instance) => TranslateInvestmentWarning(__instance); + + public static void TranslateInvestmentWarning(WarningMenu __instance) + { + var normalModeTransform = __instance.transform.Find("Normal"); + var challengeModeTransform = __instance.transform.Find("Challenge"); + + if (normalModeTransform != null) + { + var text = normalModeTransform.Find("text").GetComponent(); + var textShadow = normalModeTransform.Find("text (1)").GetComponent(); + + text.text = StringStore.TranslationString.ContainsKey("普通模式_IV") + ? StringStore.TranslateText("普通模式_IV") + : Utils.RemoveColorTags(StringStore.TranslateText(text.text)); + + text.alignment = TextAlignmentOptions.Center; + text.autoSizeTextContainer = true; + textShadow.text = Utils.RemoveColorTags(text.text); + textShadow.alignment = TextAlignmentOptions.Center; + textShadow.autoSizeTextContainer = true; + } + + if (challengeModeTransform != null) + { + var text = challengeModeTransform.Find("text").GetComponent(); + var textShadow = challengeModeTransform.Find("text (1)").GetComponent(); + + text.text = StringStore.TranslationString.ContainsKey("诅咒模式_IV") + ? StringStore.TranslateText("诅咒模式_IV") + : Utils.RemoveColorTags(StringStore.TranslateText(text.text)); + + text.alignment = TextAlignmentOptions.Center; + text.autoSizeTextContainer = true; + textShadow.text = Utils.RemoveColorTags(text.text); + textShadow.alignment = TextAlignmentOptions.Center; + textShadow.autoSizeTextContainer = true; + } + + if (__instance.tutor != null) + foreach (var text in __instance.tutor.GetComponentsInChildren() + .Where(text => text.gameObject.name == "text1")) + { + text.text = StringStore.TranslateText(text.text); + + if (text.transform.parent.Find("text").TryGetComponent(out var textShadow)) + textShadow.text = Utils.RemoveColorTags(text.text); + } + + if (__instance.challenge == null) + return; + + foreach (var text in __instance.challenge.GetComponentsInChildren() + .Where(text => text.gameObject.name == "text1")) + { + text.text = StringStore.TranslateText(text.text); + + if (text.transform.parent.Find("text").TryGetComponent(out var textShadow)) + textShadow.text = Utils.RemoveColorTags(text.text); + } + } +} diff --git a/Source/Patches/Managers/AbyssDevelopMenu_Patch.cs b/Source/Patches/Managers/AbyssDevelopMenu_Patch.cs new file mode 100644 index 0000000..59f55d7 --- /dev/null +++ b/Source/Patches/Managers/AbyssDevelopMenu_Patch.cs @@ -0,0 +1,17 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(AbyssDevelopMenu))] +public static class AbyssDevelopMenu_Patch +{ + [HarmonyPatch(nameof(AbyssDevelopMenu.UpdateInfo)), HarmonyPostfix] + private static void UpdateInfo(AbyssDevelopMenu __instance) + { + __instance.currentMoney.text = StringStore.TranslateText(__instance.currentMoney.text); + __instance.upgradeTextInfo.text = StringStore.TranslateText(__instance.upgradeTextInfo.text); + } +} +#endif diff --git a/Source/Patches/Managers/AbyssMenu2_Patch.cs b/Source/Patches/Managers/AbyssMenu2_Patch.cs new file mode 100644 index 0000000..7c9f617 --- /dev/null +++ b/Source/Patches/Managers/AbyssMenu2_Patch.cs @@ -0,0 +1,86 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(AbyssMenu2))] +public static class AbyssMenu2_Patch +{ + [HarmonyPatch(nameof(AbyssMenu2.Start)), HarmonyPostfix] + private static void Start(AbyssMenu2 __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); + __instance.buffCountText.font = fontAsset; + + __instance.money.text = StringStore.TranslateText(__instance.money.text); + __instance.money.font = fontAsset; + + __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); + __instance.refreshText.font = fontAsset; + + __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); + __instance.statistics.font = fontAsset; + + Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; + + if (buffTextTransform != null) + StringStore.TranslateTextTransform(buffTextTransform); + + Transform moneyTransform = __instance.transform.FindChild("Money").transform; + + if (moneyTransform != null) + StringStore.TranslateTextTransform(moneyTransform); + + Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; + + if (buffCountTextTransform != null) + StringStore.TranslateTextTransform(buffCountTextTransform); + + Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; + + if (refreshTextTransform != null) + StringStore.TranslateTextTransform(refreshTextTransform); + } + + [HarmonyPatch(nameof(AbyssMenu2.Awake)), HarmonyPostfix] + private static void Awake(AbyssMenu2 __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); + __instance.buffCountText.font = fontAsset; + + __instance.money.text = StringStore.TranslateText(__instance.money.text); + __instance.money.font = fontAsset; + + __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); + __instance.refreshText.font = fontAsset; + + __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); + __instance.statistics.font = fontAsset; + + Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; + + if (buffTextTransform != null) + StringStore.TranslateTextTransform(buffTextTransform); + + Transform moneyTransform = __instance.transform.FindChild("Money").transform; + + if (moneyTransform != null) + StringStore.TranslateTextTransform(moneyTransform); + + Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; + + if (buffCountTextTransform != null) + StringStore.TranslateTextTransform(buffCountTextTransform); + + Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; + + if (refreshTextTransform != null) + StringStore.TranslateTextTransform(refreshTextTransform); + } +} +#endif diff --git a/Source/Patches/Managers/AbyssMenu_Patch.cs b/Source/Patches/Managers/AbyssMenu_Patch.cs new file mode 100644 index 0000000..9ee9d8c --- /dev/null +++ b/Source/Patches/Managers/AbyssMenu_Patch.cs @@ -0,0 +1,22 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(AbyssMenu))] +public static class AbyssMenu_Patch +{ + [HarmonyPatch(nameof(AbyssMenu.Awake)), HarmonyPostfix] + private static void Awake(AbyssMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.rukous) + { + txt.text = StringStore.TranslateText(txt.text, false); + txt.font = fontAsset; + } + } +} +#endif diff --git a/Source/Patches/Managers/AlmanacMgrZombie_Patch.cs b/Source/Patches/Managers/AlmanacMgrZombie_Patch.cs new file mode 100644 index 0000000..02f472a --- /dev/null +++ b/Source/Patches/Managers/AlmanacMgrZombie_Patch.cs @@ -0,0 +1,95 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using static PvZ_Fusion_Translator.FileLoader; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(AlmanacMgrZombie))] +public static partial class AlmanacMgrZombie_Patch +{ + [HarmonyPatch(nameof(AlmanacMgrZombie.InitNameAndInfoFromJson)), HarmonyPostfix] + private static void InitNameAndInfoFromJson(AlmanacMgrZombie __instance) + { + var (almanacDir, currentLanguage) = ModFeatures.IsMultiLanguage + ? (GetAssetDir(AssetType.Almanac, Utils.Language), Utils.Language.ToString()) + : (GetAssetDir(AssetType.Almanac), "English"); + + var path = Path.Combine(almanacDir, "ZombieStringsTranslate.json"); + var moddedPath = Path.Combine(almanacDir, "ModdedZombiesTranslate.json"); + + if (!File.Exists(path)) + { + Log.LogError($"ZombieStringsTranslate.json file not found at path: {path}"); + return; + } + + var json = File.ReadAllText(path); + var hasAlmanacFont = false; + TMP_FontAsset almanacFontAsset = null; + + if (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || + FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage)) + { + almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); + hasAlmanacFont = true; + } + + FontStore.LoadTMPFont(ModFeatures.IsMultiLanguage ? Utils.Language.ToString() : null); + TextMeshPro component = __instance.info.GetComponent(); + TextMeshPro component2 = __instance.zombieName.GetComponent(); + TextMeshPro component3 = __instance.zombieName.transform.GetChild(0).GetComponent(); + + var zombieData = JsonUtility.FromJson(json); + + foreach (ZombieInfo zombieInfo in zombieData.zombies) + if (zombieInfo.theZombieType == __instance.theZombieType) + { + component.text = zombieInfo.info + "\n\n" + zombieInfo.introduce; + component.overflowMode = TextOverflowModes.Page; + component2.text = zombieInfo.name; + component2.autoSizeTextContainer = true; + component3.text = Utils.RemoveColorTags(zombieInfo.name); + component3.autoSizeTextContainer = true; + component.font = hasAlmanacFont ? almanacFontAsset : fontAsset; + component2.font = fontAsset; + component3.font = fontAsset; + } + + if (!File.Exists(moddedPath)) + return; + + var moddedJson = File.ReadAllText(moddedPath); + + var moddedZombieData = JsonUtility.FromJson(moddedJson); + + foreach (ZombieInfo zombieInfo in moddedZombieData.zombies) + if (zombieInfo.theZombieType == __instance.theZombieType) + { + component.text = zombieInfo.info + "\n\n" + zombieInfo.introduce; + component.overflowMode = TextOverflowModes.Page; + component2.text = zombieInfo.name; + component2.autoSizeTextContainer = true; + component3.text = Utils.RemoveColorTags(zombieInfo.name); + component3.autoSizeTextContainer = true; + component.font = hasAlmanacFont ? almanacFontAsset : fontAsset; + component2.font = fontAsset; + component3.font = fontAsset; + } + } + + [HarmonyPatch(nameof(AlmanacMgrZombie.OnMouseDown)), HarmonyPrefix] + private static bool OnMouseDown(AlmanacMgrZombie __instance) + { + TextMeshPro component = __instance.info.GetComponent(); + + if (component == null) + return true; + + component.pageToDisplay = + component.pageToDisplay > component.m_pageNumber ? 1 : component.pageToDisplay + 1; + + return false; + } +} +#endif diff --git a/Source/Patches/Managers/AlmanacPlantBank_Patch.cs b/Source/Patches/Managers/AlmanacPlantBank_Patch.cs new file mode 100644 index 0000000..023dc57 --- /dev/null +++ b/Source/Patches/Managers/AlmanacPlantBank_Patch.cs @@ -0,0 +1,191 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using static PvZ_Fusion_Translator.FileLoader; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(AlmanacPlantBank))] +public static partial class AlmanacPlantBank_Patch +{ + [HarmonyPatch(nameof(AlmanacPlantBank.InitNameAndInfoFromJson)), HarmonyPostfix] + private static void InitNameAndInfoFromJson(Il2Cpp.AlmanacPlantBank __instance) + { + var (almanacDir, currentLanguage) = ModFeatures.IsMultiLanguage + ? (GetAssetDir(AssetType.Almanac, Utils.Language), Utils.Language.ToString()) + : (GetAssetDir(AssetType.Almanac), "English"); + + var path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); + var moddedPath = Path.Combine(almanacDir, "ModdedPlantsTranslate.json"); + + if (!File.Exists(path)) + { + Log.LogError($"LawnStringsTranslate.json file not found at path: {path}"); + return; + } + + var json = File.ReadAllText(path); + var hasAlmanacFont = false; + TMP_FontAsset almanacFontAsset = null; + + if (FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage + "_Almanac") || + FontStore.fontAssetDictSecondary.ContainsKey(currentLanguage)) + { + almanacFontAsset = FontStore.LoadTMPFontAlmanac(currentLanguage); + hasAlmanacFont = true; + } + + var fontAsset = ModFeatures.IsMultiLanguage + ? FontStore.LoadTMPFont(Utils.Language.ToString()) + : FontStore.LoadTMPFont(); + + TextMeshPro component = __instance.introduce.GetComponent(); + TextMeshPro component2 = __instance.plantName.GetComponent(); + TextMeshPro component3 = __instance.plantName.transform.GetChild(0).GetComponent(); + TextMeshPro component4 = __instance.cost.GetComponent(); + + AlmanacPlantBank.PlantData plantData = JsonUtility.FromJson(json); + + foreach (var plantInfo in plantData.plants) + { + if (plantInfo.seedType != __instance.theSeedType || string.IsNullOrEmpty(plantInfo.name)) + continue; + + component.autoSizeTextContainer = false; + component.text = plantInfo.info + "\n\n" + plantInfo.introduce; + component.overflowMode = TextOverflowModes.Page; + + // fix dimensions for cost text + component.rectTransform.offsetMax = new(component.rectTransform.offsetMax.x, 27.3839f); + component.rectTransform.offsetMin = new(component.rectTransform.offsetMin.x, -29.3079f); + component.rectTransform.sizeDelta = new(component.rectTransform.sizeDelta.x, 50.917f); + + component.transform.localPosition = new( + component.transform.localPosition.x, + component.transform.localPosition.y + 0.15f, + component.transform.localPosition.z + ); + + component2.text = plantInfo.name; + component2.autoSizeTextContainer = true; + + component3.text = Utils.RemoveColorTags(plantInfo.name ?? string.Empty); + component3.autoSizeTextContainer = true; + + component4.text = plantInfo.cost; + + if (hasAlmanacFont) + { + component.font = almanacFontAsset; + component4.font = almanacFontAsset; + } + else + { + component.font = fontAsset; + component4.font = fontAsset; + } + + component2.font = fontAsset; + component3.font = fontAsset; + } + + if (!File.Exists(moddedPath)) + return; + + var moddedJson = File.ReadAllText(moddedPath); + AlmanacPlantBank.PlantData moddedPlantData = JsonUtility.FromJson(moddedJson); + + foreach (AlmanacPlantBank.PlantInfo plantInfo in moddedPlantData.plants) + { + if (plantInfo.seedType != __instance.theSeedType || string.IsNullOrEmpty(plantInfo.name)) + continue; + + component.autoSizeTextContainer = false; + component.text = plantInfo.info + "\n\n" + plantInfo.introduce; + component.overflowMode = TextOverflowModes.Page; + + // fix dimensions for cost text + component.rectTransform.offsetMax = new(component.rectTransform.offsetMax.x, 27.3839f); + component.rectTransform.offsetMin = new(component.rectTransform.offsetMin.x, -29.3079f); + component.rectTransform.sizeDelta = new(component.rectTransform.sizeDelta.x, 50.917f); + + component.transform.localPosition = new( + component.transform.localPosition.x, + component.transform.localPosition.y + 0.15f, + component.transform.localPosition.z + ); + + component2.text = plantInfo.name; + component2.autoSizeTextContainer = true; + + component3.text = Utils.RemoveColorTags(plantInfo.name ?? string.Empty); + component3.autoSizeTextContainer = true; + + component4.text = plantInfo.cost; + + if (hasAlmanacFont) + { + component.font = almanacFontAsset; + component4.font = almanacFontAsset; + } + else + { + component.font = fontAsset; + component4.font = fontAsset; + } + + component2.font = fontAsset; + component3.font = fontAsset; + } + } + + [HarmonyPatch(nameof(AlmanacPlantBank.OnMouseDown)), HarmonyPrefix] + private static bool OnMouseDown(AlmanacPlantBank __instance) + { + TextMeshPro component = __instance.introduce.GetComponent(); + + if (component == null) + return true; + + component.pageToDisplay = + component.pageToDisplay > component.m_pageNumber ? 1 : component.pageToDisplay + 1; + + return false; + } + + [HarmonyPatch(nameof(AlmanacPlantBank.PVPInit)), HarmonyPostfix] // ReSharper disable once InconsistentNaming + private static void PVPInit(Il2Cpp.AlmanacPlantBank __instance) + { + TextMeshPro component = __instance.introduce.GetComponent(); + + if (component != null) + component.autoSizeTextContainer = false; + + Transform banTransform = __instance.transform.FindChild("Ban").GetChild(0); + + if (banTransform != null) + banTransform.GetComponent().text = + StringStore.TranslateText(banTransform.GetComponent().text); + } + + [HarmonyPatch(nameof(AlmanacPlantBank.Start)), HarmonyPostfix] + public static void Post_Start(AlmanacPlantBank __instance) + { + GameObject skinTextObj = __instance.skinButton.transform.GetChild(0).gameObject; + + var skinShadowTextObj = + UnityEngine.Object.Instantiate(skinTextObj, parent: __instance.skinButton.transform); + + var skinShadowText = skinShadowTextObj.GetComponent(); + skinShadowText.text = StringStore.TranslateText("换肤_S"); + skinShadowText.sortingOrder -= 2; + skinShadowTextObj.transform.Translate(new(0.015f, -0.015f, 0)); + skinTextObj.transform.Translate(new(-0.022f, 0)); + skinShadowTextObj.transform.Translate(new(-0.022f, 0)); + __instance.skinButton.transform.localScale /= 1.75f; + __instance.skinButton.transform.Translate(new Vector3(-0.075f, -0.15f, 0)); + __instance.skinButton.transform.GetChild(1).Translate(new Vector3(0.35f, 0)); + __instance.skinButton.transform.GetChild(2).Translate(new Vector3(-0.35f, 0)); + } +} +#endif diff --git a/Source/Patches/Managers/CanvasUpUI_Patch.cs b/Source/Patches/Managers/CanvasUpUI_Patch.cs new file mode 100644 index 0000000..bcb963c --- /dev/null +++ b/Source/Patches/Managers/CanvasUpUI_Patch.cs @@ -0,0 +1,30 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(CanvasUpUI))] +public static class CanvasUpUI_Patch +{ + [HarmonyPatch(nameof(CanvasUpUI.Start)), HarmonyPostfix] + public static void Start(CanvasUpUI __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var text in __instance.GetComponentsInChildren()) + { + var originalKey = StringStore.TranslationString + .FirstOrDefault(x => x.Value == text.text || x.Value.Replace("\n", "") == text.text) + .Key; + + text.text = StringStore.TranslationString.ContainsKey(originalKey + "_MG") + ? StringStore.TranslateText(originalKey + "_MG") + : StringStore.TranslateText(text.text); + + if (text.gameObject.name.Contains("LevelName")) + text.text = text.text.Replace("\n", " "); + + text.font = fontAsset; + } + } +} diff --git a/Source/Patches/Managers/ChessManager_Patch.cs b/Source/Patches/Managers/ChessManager_Patch.cs new file mode 100644 index 0000000..2afda22 --- /dev/null +++ b/Source/Patches/Managers/ChessManager_Patch.cs @@ -0,0 +1,29 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(ChessManager))] +public static class ChessManager_Patch +{ + [HarmonyPatch(nameof(ChessManager.Start)), HarmonyPostfix] + private static void Postfix_Start(ChessManager __instance) + { + __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); + __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + [HarmonyPatch(nameof(ChessManager.Update)), HarmonyPostfix] + private static void Postfix_Update(ChessManager __instance) + { + __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); + __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + [HarmonyPatch(nameof(ChessManager.UpdateText)), HarmonyPostfix] + private static void Postfix_UpdateText(ChessManager __instance) + { + __instance.textMesh.text = StringStore.TranslateText(__instance.textMesh.text); + __instance.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } +} diff --git a/Source/Patches/Managers/CustomLevelShower_Patch.cs b/Source/Patches/Managers/CustomLevelShower_Patch.cs new file mode 100644 index 0000000..f611346 --- /dev/null +++ b/Source/Patches/Managers/CustomLevelShower_Patch.cs @@ -0,0 +1,17 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(CustomLevelShower))] +public static class CustomLevelShower_Patch +{ + [HarmonyPatch(nameof(CustomLevelShower.Show)), HarmonyPostfix] + private static void Show(CustomLevelShower __instance) + { + foreach (var transform in __instance.pages) + StringStore.TranslateTextTransform(transform); + } +} +#endif diff --git a/Source/Patches/Managers/DifficultyMgr_Patch.cs b/Source/Patches/Managers/DifficultyMgr_Patch.cs new file mode 100644 index 0000000..e2f2a15 --- /dev/null +++ b/Source/Patches/Managers/DifficultyMgr_Patch.cs @@ -0,0 +1,15 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(DifficultyMgr))] +public static class DifficultyMgr_Patch +{ + [HarmonyPatch(nameof(DifficultyMgr.Update)), HarmonyPostfix] + private static void DifficultyMgr_Update(DifficultyMgr __instance) + { + __instance.t = StringStore.TranslateText(__instance.t); + __instance.t.autoSizeTextContainer = false; + } +} diff --git a/Source/Patches/Managers/DrawCardManager_Patch.cs b/Source/Patches/Managers/DrawCardManager_Patch.cs new file mode 100644 index 0000000..bb2f5a5 --- /dev/null +++ b/Source/Patches/Managers/DrawCardManager_Patch.cs @@ -0,0 +1,64 @@ +using System.Text.RegularExpressions; +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(DrawCardManager))] +public static class DrawCardManager_Patch +{ +#pragma warning disable CA2211 + public static TMP_FontAsset FontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); +#pragma warning restore CA2211 + [HarmonyPatch(nameof(DrawCardManager.Awake)), HarmonyPostfix] + private static void Awake(DrawCardManager __instance) => + FontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + [HarmonyPatch(nameof(DrawCardManager.UpdateText)), HarmonyPostfix] + private static void Postfix_UpdateText(DrawCardManager __instance) + { + var regexPair = new KeyValuePair( + "抽取次数:\n(\\d+)/(\\d+)\n当前up植物:\n([^\\s]+)\nup刷新倒计时:\n(\\d+)", + "Draw Count:\n{0}/{1}\nCurrent Up:\n{2}\nNext Up in: \n{3}s" + ); + + foreach (var txt in __instance.texts) + if (Regex.IsMatch(txt.text, regexPair.Key)) + { + txt.text = TranslateGashaponText(txt.text, regexPair.Key, regexPair.Value, __instance.up); + txt.font = FontAsset; + } + } + + public static string TranslateGashaponText(string originalText, string pattern, string fallback, PlantType up) + { + var res = ""; + var match = Regex.Match(originalText, pattern); + + if (!match.Success) + return res; + + var groups = match.Groups; + var fStr = StringStore.TranslationStringRegex.GetValueOrDefault(pattern, fallback); + List dynamicParts = []; + + for (var i = 1; i < groups.Count; i++) + { + var group = groups[i].Value; + + var translatedGroup = i == 3 && up != PlantType.Peashooter + ? Utils.GetPlantNameFromAlmanac(up) + : StringStore.TranslateText(group); + + dynamicParts.Add(translatedGroup); + } + + res = string.Format(fStr, [..dynamicParts]); + + return res; + } +#if false + [HarmonyPatch(nameof(DrawCardManager.Update)), HarmonyPostfix] + private static void Postfix_Update(DrawCardManager __instance) => Postfix_UpdateText(__instance); +#endif +} diff --git a/Source/Patches/Managers/EndlessMgr_Patch.cs b/Source/Patches/Managers/EndlessMgr_Patch.cs new file mode 100644 index 0000000..f58d512 --- /dev/null +++ b/Source/Patches/Managers/EndlessMgr_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(EndlessMgr))] +public static class EndlessMgr_Patch +{ + [HarmonyPatch(nameof(EndlessMgr.Awake)), HarmonyPostfix] + private static void Awake(EndlessMgr __instance) + { + var textTransform = __instance.transform.GetChild(2); + + if (textTransform == null || !textTransform.gameObject.activeSelf) + return; + + var textTMP = textTransform.GetComponent(); + + if (textTMP != null) + StringStore.TranslateText(textTMP); + } +} diff --git a/Source/Patches/Managers/Garden_Patch.cs b/Source/Patches/Managers/Garden_Patch.cs new file mode 100644 index 0000000..25caefd --- /dev/null +++ b/Source/Patches/Managers/Garden_Patch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(Garden))] +public static class Garden_Patch +{ + [HarmonyPatch(nameof(Garden.Awake)), HarmonyPostfix] + private static void Awake(Garden __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + } +} diff --git a/Source/Patches/Managers/IZBottomMenu_Patch.cs b/Source/Patches/Managers/IZBottomMenu_Patch.cs new file mode 100644 index 0000000..9a3ba34 --- /dev/null +++ b/Source/Patches/Managers/IZBottomMenu_Patch.cs @@ -0,0 +1,47 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(IZBottomMenu))] +public static class IZBottomMenu_Patch +{ + [HarmonyPatch(nameof(IZBottomMenu.ChangeString)), HarmonyPostfix] + public static void ChangeStringz(IZBottomMenu __instance) + { + foreach (var text in __instance.levelName) + { + var fStr = StringStore.TranslationStringRegex[@"([^\s]+),推荐难度:(\d+)"]; + var parts = text.text.Split(",推荐难度:"); + + if (new Regex(@"([^\s]+),推荐难度:(\d+)").IsMatch(text.text)) + { + var customName = StringStore.TranslationString.ContainsKey(parts[0] + "_IZ") + ? parts[0] + "_IZ" + : parts[0]; + + text.text = string.Format(fStr, StringStore.TranslateText(customName), parts[1]); + } + + text.text = StringStore.TranslateText(text.text); + text.text = text.text.Replace("\n", " "); + } + } + + [HarmonyPatch(nameof(IZBottomMenu.SetLevelName)), HarmonyPostfix] + public static void SetLevelName(IZBottomMenu __instance) + { + foreach (var text in __instance.levelName) + { + var fStr = StringStore.TranslationStringRegex[@"([^\s]+),推荐难度:(\d+)"]; + var parts = text.text.Split(",推荐难度:"); + + if (new Regex(@"([^\s]+),推荐难度:(\d+)").IsMatch(text.text)) + text.text = string.Format(fStr, StringStore.TranslateText(parts[0]), parts[1]); + + text.text = StringStore.TranslateText(text.text); + text.text = text.text.Replace("\n", " "); + } + } +} diff --git a/Source/Patches/Managers/InGameUI_Patch.cs b/Source/Patches/Managers/InGameUI_Patch.cs new file mode 100644 index 0000000..f5c588a --- /dev/null +++ b/Source/Patches/Managers/InGameUI_Patch.cs @@ -0,0 +1,81 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.BaseTextObjects; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(InGameUI))] +public static class InGameUI_Patch +{ + public const string TravelAdventurePattern = "^旅行冒险 ([^\\s:]+)"; + public const string TravelAdventureFallback = "Odyssey Adventure: {0}"; + + [HarmonyPatch(nameof(InGameUI.Start)), HarmonyPostfix] + private static void Start(InGameUI __instance) => SetLevelName(__instance); + + [HarmonyPatch(nameof(InGameUI.SetUniqueText)), HarmonyPostfix] + private static void SetUniqueText(InGameUI __instance) => SetLevelName(__instance); + + [HarmonyPatch(nameof(InGameUI.SetLevelName)), HarmonyPostfix] + private static void SetLevelName(InGameUI __instance) + { + foreach (var text in __instance.levelNameText) + { + if (text.text == null) + continue; + + var originalText = text.text; + text.text = text.text.Replace("\n", " "); + + var checkFusionChallenge = new Regex("^超级([^\\s:]+)(:?挑战1?)"); + var checkTravelAdv = new Regex(TravelAdventurePattern); + + if (checkTravelAdv.IsMatch(originalText)) + text.text = InGameText_Patch.TranslatePlantNameParts( + originalText, + TravelAdventurePattern, + TravelAdventureFallback + ); + else if (text.text.Contains("配方:") && !checkFusionChallenge.IsMatch(text.text)) + { + var lines = text.text.Split(":"); + lines[1] = Utils.GetPlantNameFromAlmanac(lines[1]); + + if (lines[1] == "") + { + Log.LogError("Couldn't find plant! (Fusion Showcase)"); + lines[1] = StringStore.TranslateText(lines[1]); + } + + text.text = StringStore.TranslateText("配方:") + lines[1]; + text.autoSizeTextContainer = true; + } + else + { + text.text = StringStore.TranslationString.ContainsKey(text.text + "_MG") + ? StringStore.TranslateText(text.text + "_MG") + : StringStore.TranslateText(text.text); + + text.text = text.text.Replace("\n", " "); + } + } + } +#if false + [HarmonyPatch(nameof(InGameUI.Update)), HarmonyPostfix] + private static void Update(InGameUI __instance) + { + if (!__instance.board.boardTag.isDrawCards) + return; + + KeyValuePair regexPair = new( + "抽取次数:\n(\\d+)/(\\d+)\n当前up植物:\n([^\\s]+)\nup刷新倒计时:\n(\\d+)", + "Draw Count:\n{0}/{1}\nCurrent Up:\n{2}\nNext Up in: \n{3}s" + ); + + foreach (var txt in __instance.DrawCardsHead.GetComponentsInChildren() + .Where(txt => Regex.IsMatch(txt.text, regexPair.Key))) + txt.text = InGameText_Patch.TranslatePlantNameParts(txt.text, regexPair.Key, regexPair.Value); + } +#endif +} diff --git a/Source/Patches/Managers/PVPScareyPot_Patch.cs b/Source/Patches/Managers/PVPScareyPot_Patch.cs new file mode 100644 index 0000000..ea68740 --- /dev/null +++ b/Source/Patches/Managers/PVPScareyPot_Patch.cs @@ -0,0 +1,27 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(PVPScareyPot))] +public static class PvpScareyPotPatch +{ + [HarmonyPatch(nameof(PVPScareyPot.Awake)), HarmonyPatch(nameof(PVPScareyPot.Start)), + HarmonyPatch(nameof(PVPScareyPot.AutoRuleUpdate)), HarmonyPatch(nameof(PVPScareyPot.RandomCardUpdate)), + HarmonyPatch(nameof(PVPScareyPot.Update)), HarmonyPostfix] + public static void TranslatePlayerDatas(PVPScareyPot __instance) + { + TranslatePlayerData(__instance.player1); + TranslatePlayerData(__instance.player2); + TranslatePlayerData(__instance.currentPlayer); + } + + public static void TranslatePlayerData(PVPScareyPot.PlayerData playerData) + { + if (playerData == null) + return; + + playerData.textMesh.text = StringStore.TranslateText(playerData.textMesh.text); + playerData.textMesh.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } +} diff --git a/Source/Patches/Managers/SaveMenu_Patch.cs b/Source/Patches/Managers/SaveMenu_Patch.cs new file mode 100644 index 0000000..48edc73 --- /dev/null +++ b/Source/Patches/Managers/SaveMenu_Patch.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(SaveMenu))] +public static class SaveMenu_Patch +{ + [HarmonyPatch(nameof(SaveMenu.Start)), HarmonyPatch(nameof(SaveMenu.CreateLevelEnter)), + HarmonyPatch(nameof(SaveMenu.InitLevelSaveEnters)), HarmonyPostfix] + private static void Start(SaveMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.menuTitle.text = StringStore.TranslateText(__instance.menuTitle.text); + __instance.menuTitle.font = fontAsset; + + foreach (var enter in __instance.GetComponentsInChildren()) + LevelSaveEnter_Patch.TranslateEnter(enter); + } + + [HarmonyPatch(nameof(SaveMenu.OnEditSelectedButtonClicked)), HarmonyPostfix] + private static void OnEditSelectedButtonClicked(SaveMenu __instance) { } +} diff --git a/Source/Patches/Managers/Screen_Patch.cs b/Source/Patches/Managers/Screen_Patch.cs new file mode 100644 index 0000000..a96d277 --- /dev/null +++ b/Source/Patches/Managers/Screen_Patch.cs @@ -0,0 +1,13 @@ +using HarmonyLib; +using UnityEngine.EventSystems; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(Screen))] +public static class Screen_Patch +{ + [HarmonyPatch(nameof(Screen.SetResolution), typeof(int), typeof(int), typeof(bool)), HarmonyPrefix] + private static bool SetResolution(Screen __instance) => + EventSystem.current.currentSelectedGameObject == null || + !EventSystem.current.currentSelectedGameObject.TryGetComponent(out _); +} diff --git a/Source/Patches/Managers/TowerManager_Patch.cs b/Source/Patches/Managers/TowerManager_Patch.cs new file mode 100644 index 0000000..40f5fe1 --- /dev/null +++ b/Source/Patches/Managers/TowerManager_Patch.cs @@ -0,0 +1,18 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(TowerManager))] +public static class TowerManager_Patch +{ + public static readonly List UpdatedText = []; + + public static void UpdateText() + { + foreach (var transform in UpdatedText.Where(transform => transform != null) + .Where(transform => transform.gameObject.active)) + transform.GetComponent().text = + StringStore.TranslateText(transform.GetComponent().text); + } +} diff --git a/Source/Patches/Managers/UIMgr_Patch.cs b/Source/Patches/Managers/UIMgr_Patch.cs new file mode 100644 index 0000000..c8308f2 --- /dev/null +++ b/Source/Patches/Managers/UIMgr_Patch.cs @@ -0,0 +1,16 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using Object = UnityEngine.Object; + +namespace PvZ_Fusion_Translator.Patches.Managers; + +[HarmonyPatch(typeof(UIMgr))] +public class UIMgr_Patch +{ + [HarmonyPatch(nameof(UIMgr.EnterLoseMenu)), HarmonyPostfix] + private static void EnterLoseMenu(UIMgr __instance) + { + var loseMenu = Object.FindObjectOfType(); + loseMenu.title.text = StringStore.TranslateText(loseMenu.title.text); + } +} diff --git a/Source/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs new file mode 100644 index 0000000..007d42c --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssBagMenu_Patch.cs @@ -0,0 +1,24 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssBagMenu))] +public static class AbyssBagMenu_Patch +{ + [HarmonyPatch(nameof(AbyssBagMenu.Awake)), HarmonyPostfix] + private static void Awake_Post(AbyssCheckInBag __instance) + { + foreach (TextMeshProUGUI text in __instance.transform.FindChild("Background") + .GetComponentsInChildren()) + { + text.text += "_深渊"; + text.text = StringStore.TranslateText("背包_深渊"); + text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + AbyssMenu2.Instance.UpdateIcons(); + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs b/Source/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs new file mode 100644 index 0000000..f6681a5 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssBuffButton_Patch.cs @@ -0,0 +1,55 @@ +#if false +using System.Text.RegularExpressions; +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssBuffButton))] +public static class AbyssBuffButton_Patch +{ + [HarmonyPatch(nameof(AbyssBuffButton.SetType)), HarmonyPostfix] + private static void SetType(AbyssBuffButton __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var regex = new Regex("([^\\s]+)\n价格:(\\d+)"); + + if (!regex.IsMatch(__instance.description.text)) + return; + + var match = regex.Match(__instance.description.text); + var groupCount = match.Groups.Count; + + List dynamicParts = []; + + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + + var translatedValue = StringStore.translationString.ContainsKey(groupValue) + ? StringStore.translationString[groupValue] + : groupValue; + + dynamicParts.Add(translatedValue); + MelonLogger.Msg(translatedValue); + } + + __instance.description.text = string.Format( + StringStore.translationStringRegex["([^\\s]+)\n价格:(\\d+)"], + [..dynamicParts] + ); + + __instance.description.font = fontAsset; + } + + [HarmonyPatch(nameof(AbyssBuffButton.SetSold)), HarmonyPostfix] + private static void SetSold(AbyssBuffButton __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.description.text = StringStore.TranslateText(__instance.description.text); + __instance.description.font = fontAsset; + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssBuffData_Patch.cs b/Source/Patches/Modes/Abyss/AbyssBuffData_Patch.cs new file mode 100644 index 0000000..deceaa0 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssBuffData_Patch.cs @@ -0,0 +1,127 @@ +#if false +using System.Text.Json; +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssBuffData))] +public static class AbyssBuffData_Patch +{ + [HarmonyPatch(nameof(AbyssBuffData.LoadData)), HarmonyPostfix] + public static void Pre_LoadData(AbyssBuffData __instance) + { + // ReSharper disable once Unity.UnknownResource + var originalAbyssBuffStr = Resources.Load("AbyssBuffData").text; + + Dictionary> originalAbyssBuffData = + JsonSerializer.Deserialize>>(originalAbyssBuffStr); + + List infos = originalAbyssBuffData["infos"]; + + Il2CppSystem.Collections.Generic.Dictionary> result = + new(); + + var abyssBuffDataDir = Path.Combine( + FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), + "abyss_buffs.json" + ); + + if (!File.Exists(abyssBuffDataDir)) + File.WriteAllText(abyssBuffDataDir, originalAbyssBuffStr); + + var abyssBuffData = JsonSerializer.Deserialize>(File.ReadAllText(abyssBuffDataDir)); + + foreach (AbyssBuffInfo originalTuple in infos) + { + Il2CppSystem.ValueTuple translatedTuple = new() + { + Item1 = abyssBuffData.TryGetValue(originalTuple.name, out var item1) + ? item1 + : originalTuple.name, + Item2 = abyssBuffData.TryGetValue(originalTuple.introduce, out var item2) + ? item2 + : originalTuple.introduce, + Item3 = originalTuple.value, + }; + + foreach (var x in AbyssBuffData.buffDatas) + if (x.Value.Item1 == originalTuple.name) + { + AbyssBuffData.buffDatas[x.Key] = translatedTuple; + break; + } + } + } +} + +// ReSharper disable InconsistentNaming +public enum AbyssBuffClone +{ + 生存_聚塑, + 生存_启命, + 生存_坚定, + 生存_弥合, + 生存_警戒, + 生存_霸体, + 生存_共存, + 生存_护盾, + 生存_治疗, + 生存_主宰, + 寒冰_聚塑, + 寒冰_刺骨, + 寒冰_凛风, + 寒冰_冻结, + 寒冰_保护, + 寒冰_折磨, + 寒冰_扩散, + 寒冰_凝神, + 寒冰_破冰, + 寒冰_永冻, + 魅惑_聚塑, + 魅惑_感应, + 魅惑_催眠, + 魅惑_无畏, + 魅惑_脆弱, + 魅惑_黑曜, + 魅惑_转世, + 魅惑_支援, + 魅惑_沉重, + 魅惑_共鸣, + 烈焰_聚塑, + 烈焰_爆破, + 烈焰_怒火, + 烈焰_红唇, + 烈焰_融化, + 烈焰_燃烧, + 烈焰_浴火, + 烈焰_鬼火, + 烈焰_诅咒, + 烈焰_太阳, + 通用_断水, + 通用_千斤, + 通用_急迫, + 通用_折扣, + 通用_密植, + 通用_超级, + 通用_究极, + 通用_极速, + 通用_强力, + 通用_专注, + 通用_迸发, + 通用_投资, + 通用_机遇, + 通用_命运, + 通用_时停, + 通用_升级, + 蒜毒_聚塑, + 蒜毒_腐蚀, + 蒜毒_侵蚀, + 蒜毒_血清, + 蒜毒_混乱, + 蒜毒_虚弱, + 蒜毒_反胃, + 蒜毒_虫噬, + 蒜毒_百毒, + 蒜毒_爆裂, +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs new file mode 100644 index 0000000..8f6f2f0 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssBuffMenu_Patch.cs @@ -0,0 +1,111 @@ +#if false +using System.Text.Json; +using System.Text.RegularExpressions; +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssBuffMenu))] +public static class AbyssBuffMenu_Patch +{ +#pragma warning disable CA2211 + public static Dictionary AbyssBuffData = new(); +#pragma warning restore CA2211 + [HarmonyPatch(nameof(AbyssBuffMenu.Awake)), HarmonyPostfix] + public static void Post_Awake(AbyssBuffMenu __instance) + { + LoadAbyssBuffData(); + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } + + TranslateWindows(__instance, fontAsset); + } + + [HarmonyPatch(nameof(AbyssBuffMenu.SelectWindow)), HarmonyPostfix] + public static void Post_SelectWindow(AbyssBuffMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + TranslateWindows(__instance, fontAsset); + } + + [HarmonyPatch(nameof(AbyssBuffMenu.SetFavorite)), HarmonyPostfix] + public static void Post_SetFavorite(AbyssBuffMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } + } + + public static void TranslateWindows(AbyssBuffMenu __instance, TMP_FontAsset fontAsset) + { + foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + if (AbyssBuffData.TryGetValue(text.text, out var value)) + text.text = value; + else + { + var translatedRegex = TranslateAbyssBuffRegex(text.text); + + if (translatedRegex != null) + text.text = translatedRegex; + } + + text.font = fontAsset; + } + } + + public static void LoadAbyssBuffData() + { + AbyssBuffData.Clear(); + + var abyssBuffText = "{}"; + + if (!Core.Instance.ConfigUseLocal.Value) + { + var abyssBuffsContent = Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/abyss_buffs.json" + ) + .Result; + + if (abyssBuffsContent != null) + abyssBuffText = abyssBuffsContent; + else + { + var abyssBuffsPath = Path.Combine( + GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), + "abyss_buffs.json" + ); + + if (File.Exists(abyssBuffsPath)) + abyssBuffText = File.ReadAllText(abyssBuffsPath); + } + } + else + abyssBuffText = File.ReadAllText( + Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), "abyss_buffs.json") + ); + + AbyssBuffData = JsonSerializer.Deserialize>(abyssBuffText); + } + + public static string TranslateAbyssBuffRegex(string originalText) => + (from x in AbyssBuffData + where x.Key.Contains("{value}") + let pattern = Regex.Escape(x.Key).Replace("\\{value}", "(\\d+)") + where Regex.IsMatch(originalText, pattern) + let regex = new Regex(pattern) + let match = regex.Match(originalText) + select string.Format(x.Value.Replace("value", "0"), match.Groups[1].Value)).FirstOrDefault(); +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs b/Source/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs new file mode 100644 index 0000000..d54c1e3 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssCheckInBag_Patch.cs @@ -0,0 +1,15 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssCheckInBag))] +public static class AbyssCheckInBag_Patch +{ + [HarmonyPatch(nameof(AbyssCheckInBag.MoveFromBag)), HarmonyPostfix] + private static void MoveFromBag(AbyssCheckInBag __instance) => AbyssMenu2.Instance.UpdateIcons(); + + [HarmonyPatch(nameof(AbyssCheckInBag.SellIcon)), HarmonyPostfix] + private static void SellIcon(AbyssCheckInBag __instance) => AbyssMenu2.Instance.UpdateIcons(); +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs new file mode 100644 index 0000000..88a9487 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssCheckSellMenu_Patch.cs @@ -0,0 +1,15 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssCheckSellMenu))] +public static class AbyssCheckSellMenu_Patch +{ + [HarmonyPatch(nameof(AbyssCheckSellMenu.SellIcon)), HarmonyPostfix] + private static void SellIcon(AbyssCheckSellMenu __instance) => AbyssMenu2.Instance.UpdateIcons(); + + [HarmonyPatch(nameof(AbyssCheckSellMenu.MoveInBag)), HarmonyPostfix] + private static void MoveInBag(AbyssCheckSellMenu __instance) => AbyssMenu2.Instance.UpdateIcons(); +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs new file mode 100644 index 0000000..50c8ac9 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssDevelopMenu_Patch.cs @@ -0,0 +1,48 @@ +#if false +using System.Text.RegularExpressions; +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssDevelopMenu))] +public static class AbyssDevelopMenu_Patch +{ + [HarmonyPatch(nameof(AbyssDevelopMenu.UpdateInfo)), HarmonyPostfix] + private static void UpdateInfo(AbyssDevelopMenu __instance) + { + __instance.currentMoney.text = StringStore.TranslateText(__instance.currentMoney.text); + __instance.upgradeTextInfo.text = StringStore.TranslateText(__instance.upgradeTextInfo.text); + + TextMeshProUGUI upgradeCostText = + __instance.transform.FindChild("UpgradeCost").GetComponent(); + + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + const string RegexStr = "([^\\s]+)\n当前等级:([^\\s]+)\n\n升级条件:\n([^\\s]+)\n\n升级消耗:([^\\s]+)"; + var regex = new Regex(RegexStr); + + if (!regex.IsMatch(upgradeCostText.text)) + return; + + var match = regex.Match(upgradeCostText.text); + var groupCount = match.Groups.Count; + + List dynamicParts = []; + + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + + var translatedValue = StringStore.translationString.ContainsKey(groupValue) + ? StringStore.translationString[groupValue] + : groupValue; + + dynamicParts.Add(translatedValue); + } + + upgradeCostText.text = string.Format(StringStore.translationStringRegex[RegexStr], [..dynamicParts]); + upgradeCostText.font = fontAsset; + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssGoods_Patch.cs b/Source/Patches/Modes/Abyss/AbyssGoods_Patch.cs new file mode 100644 index 0000000..eefd9ae --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssGoods_Patch.cs @@ -0,0 +1,18 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssGoods))] +public static class AbyssGoods_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(AbyssGoods.Start))] + private static void Start(AbyssGoods __instance) + { + __instance.costText.text = StringStore.TranslateText(__instance.costText.text, false); + __instance.costText_shadow.text = StringStore.TranslateText(__instance.costText_shadow.text, false); + __instance.hasText.text = StringStore.TranslateText(__instance.hasText.text, false); + __instance.hasText_shadow.text = StringStore.TranslateText(__instance.hasText_shadow.text, false); + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssInfo_Patch.cs b/Source/Patches/Modes/Abyss/AbyssInfo_Patch.cs new file mode 100644 index 0000000..c439084 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssInfo_Patch.cs @@ -0,0 +1,5 @@ +#if false +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +public class AbyssInfo_Patch; +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs b/Source/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs new file mode 100644 index 0000000..ffa83d6 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssLevelEnter_Patch.cs @@ -0,0 +1,14 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssLevelEnter))] +public static class AbyssLevelEnter_Patch +{ + [HarmonyPatch(nameof(AbyssLevelEnter.SetLevel)), HarmonyPostfix] + private static void SetLevel(AbyssLevelEnter __instance) => + __instance.levelName = StringStore.TranslateText(__instance.levelName); +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssMenu2_Patch.cs b/Source/Patches/Modes/Abyss/AbyssMenu2_Patch.cs new file mode 100644 index 0000000..052103e --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssMenu2_Patch.cs @@ -0,0 +1,88 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using UnityEngine.UI; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssMenu2))] +public static class AbyssMenu2_Patch +{ + private static void UpdateAbyss2Text(AbyssMenu2 __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.buffCountText.text = StringStore.TranslateText(__instance.buffCountText.text); + __instance.buffCountText.font = fontAsset; + + __instance.money.text = StringStore.TranslateText(__instance.money.text); + __instance.money.font = fontAsset; + + __instance.refreshText.text = StringStore.TranslateText(__instance.refreshText.text); + __instance.refreshText.font = fontAsset; + + __instance.statistics.text = StringStore.TranslateText(__instance.statistics.text); + __instance.statistics.font = fontAsset; + + Transform buffTextTransform = __instance.transform.FindChild("BuffText").transform; + + if (buffTextTransform != null) + StringStore.TranslateTextTransform(buffTextTransform); + + Transform moneyTransform = __instance.transform.FindChild("Money").transform; + + if (moneyTransform != null) + StringStore.TranslateTextTransform(moneyTransform); + + Transform buffCountTextTransform = __instance.transform.FindChild("BuffCountText").transform; + + if (buffCountTextTransform != null) + StringStore.TranslateTextTransform(buffCountTextTransform); + + Transform refreshTextTransform = __instance.transform.FindChild("RefreshText").transform; + + if (refreshTextTransform != null) + StringStore.TranslateTextTransform(refreshTextTransform); + + Transform optionsTransform = __instance.transform.FindChild("Options").transform; + + foreach (AbyssBuffButton abyssBuffButton in optionsTransform.GetComponentsInChildren()) + { + foreach (TextMeshProUGUI textMesh in abyssBuffButton.GetComponentsInChildren()) + textMesh.text = StringStore.TranslateText(textMesh.text); + } + + foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } + } + + [HarmonyPatch(nameof(AbyssMenu2.Start)), HarmonyPostfix] + private static void Start(AbyssMenu2 __instance) + { + UpdateAbyss2Text(__instance); + + Utils.ConvertButtonText(__instance.transform, "Help"); + + // custom bag text :D + + __instance.transform.FindChild("Bag").FindChild("text").GetComponent().text += "_深渊"; + + Utils.ConvertButtonText(__instance.transform, "Bag"); + } + + [HarmonyPatch(nameof(AbyssMenu2.UpdateIcons)), HarmonyPostfix] + private static void UpdateIcons(AbyssMenu2 __instance) => UpdateAbyss2Text(__instance); + + [HarmonyPatch(nameof(AbyssMenu2.UpdateBuff)), HarmonyPostfix] + private static void UpdateBuff(AbyssMenu2 __instance) => UpdateAbyss2Text(__instance); + + [HarmonyPatch(nameof(AbyssMenu2.BuyBuff)), HarmonyPostfix] + private static void BuyBuff(AbyssMenu2 __instance) => UpdateAbyss2Text(__instance); + + [HarmonyPatch(nameof(AbyssMenu2.ShowBag)), HarmonyPostfix] + private static void ShowBag(AbyssMenu2 __instance) => UpdateAbyss2Text(__instance); +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssMenu_Patch.cs new file mode 100644 index 0000000..46594bf --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssMenu_Patch.cs @@ -0,0 +1,48 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssMenu))] +public static class AbyssMenu_Patch +{ + [HarmonyPatch(nameof(AbyssMenu.Awake)), HarmonyPostfix] + private static void Awake(AbyssMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.levelInfo) + { + txt.text = StringStore.TranslateText( + txt.text, + "第(\\d+)关\n场景:([^\\s]+)\n总波数:(\\d+)波\n特殊环境:([^\\s]+)\n难度:(\\d+)" + ); + + txt.font = fontAsset; + } + + foreach (var text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } + } + + [HarmonyPatch(nameof(AbyssMenu.UpdateLevelInfo)), HarmonyPostfix] + private static void UpdateLevelInfo(AbyssMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (TextMeshProUGUI txt in __instance.levelInfo) + { + txt.text = StringStore.TranslateText( + txt.text, + "第(\\d+)关\n场景:([^\\s]+)\n总波数:(\\d+)波\n特殊环境:([^\\s]+)\n难度:(\\d+)" + ); + + txt.font = fontAsset; + } + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs b/Source/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs new file mode 100644 index 0000000..381b11d --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssSelectBuffWindow_Patch.cs @@ -0,0 +1,45 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssSelectBuffWindow))] +public static class AbyssSelectBuffWindow_Patch +{ + [HarmonyPatch(nameof(AbyssSelectBuffWindow.OnAnimOver)), HarmonyPostfix] + private static void OnAnimOver(AbyssSelectBuffWindow __instance) => TranslateBuffWindow(__instance); + + [HarmonyPatch(nameof(AbyssSelectBuffWindow.SetBuff)), HarmonyPostfix] + private static void SetBuff(AbyssSelectBuffWindow __instance) => TranslateBuffWindow(__instance); + + public static void TranslateBuffWindow(AbyssSelectBuffWindow __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + AbyssBuffMenu_Patch.LoadAbyssBuffData(); + + foreach (TextMeshProUGUI titleText in __instance.titleText) + { + if (AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(titleText.text)) + { + if (titleText.name.Contains("shadow")) + titleText.text = Utils.RemoveColorTags(AbyssBuffMenu_Patch.abyssBuffData[titleText.text]); + else + titleText.text = AbyssBuffMenu_Patch.abyssBuffData[titleText.text]; + } + + titleText.font = fontAsset; + } + + string translatedIntroduceText = AbyssBuffMenu_Patch.abyssBuffData.ContainsKey(__instance.introduce.text) + ? AbyssBuffMenu_Patch.abyssBuffData[__instance.introduce.text] + : AbyssBuffMenu_Patch.TranslateAbyssBuffRegex(__instance.introduce.text); + + if (translatedIntroduceText == null) + return; + + __instance.introduce.text = translatedIntroduceText; + __instance.introduce.font = fontAsset; + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs new file mode 100644 index 0000000..19547c4 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssSettlementMenu_Patch.cs @@ -0,0 +1,58 @@ +#if false +using System.Text.RegularExpressions; +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssSettlementMenu))] +public static class AbyssSettlementMenu_Patch +{ + [HarmonyPatch(nameof(AbyssSettlementMenu.InitSettle)), HarmonyPostfix] + private static void InitSettle(AbyssSettlementMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + string[] regexStrList = + [ + "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", + "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n极限模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", + "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", + "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n首胜产出:(\\d+)\n剩余小推车数量:(\\d+),获得叶绿素:(\\d+)\n产出叶绿素总计:(\\d+)", + "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", + "第(\\d+)关\n通关用时:(\\d+)分(\\d+)秒\n杀敌数量:(\\d+)\n关卡叶绿素产出:(\\d+)\n困难模式产出:(\\d+)\n非首胜无额外产出\n产出叶绿素总计:(\\d+)", + ]; + + foreach (var regexStr in regexStrList) + { + var regex = new Regex(regexStr); + + if (!regex.IsMatch(__instance.settleInfo.text)) + continue; + + var match = regex.Match(__instance.settleInfo.text); + var groupCount = match.Groups.Count; + + List dynamicParts = []; + + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + + var translatedValue = StringStore.translationString.ContainsKey(groupValue) + ? StringStore.translationString[groupValue] + : groupValue; + + dynamicParts.Add(translatedValue); + } + + __instance.settleInfo.text = string.Format( + StringStore.translationStringRegex[regexStr], + [..dynamicParts] + ); + + __instance.settleInfo.font = fontAsset; + } + } +} +#endif diff --git a/Source/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs b/Source/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs new file mode 100644 index 0000000..7ab6c54 --- /dev/null +++ b/Source/Patches/Modes/Abyss/AbyssStoreMenu_Patch.cs @@ -0,0 +1,22 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Abyss; + +[HarmonyPatch(typeof(AbyssStoreMenu))] +public static class AbyssStoreMenu_Patch +{ + [HarmonyPatch(nameof(AbyssStoreMenu.Update)), HarmonyPostfix] + private static void Update(AbyssStoreMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (TextMeshProUGUI text in __instance.GetComponentsInChildren()) + { + text.text = StringStore.TranslateText(text.text); + text.font = fontAsset; + } + } +} +#endif diff --git a/Source/Patches/Modes/Harvest/GardenBagMenu_Patch.cs b/Source/Patches/Modes/Harvest/GardenBagMenu_Patch.cs new file mode 100644 index 0000000..712fb8d --- /dev/null +++ b/Source/Patches/Modes/Harvest/GardenBagMenu_Patch.cs @@ -0,0 +1,19 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(GardenBagMenu))] +public static class GardenBagMenu_Patch +{ + [HarmonyPatch(nameof(GardenBagMenu.Awake)), HarmonyPostfix] + private static void Awake(GardenBagMenu __instance) + { + _ = FontStore.LoadTMPFont(Utils.Language.ToString()); + + var closeButtonTransform = __instance.transform.Find("Close"); + + foreach (var text in closeButtonTransform.GetComponentsInChildren()) + text.text = StringStore.TranslateText("合上"); + } +} diff --git a/Source/Patches/Modes/Harvest/GardenCard_Patch.cs b/Source/Patches/Modes/Harvest/GardenCard_Patch.cs new file mode 100644 index 0000000..fa239ba --- /dev/null +++ b/Source/Patches/Modes/Harvest/GardenCard_Patch.cs @@ -0,0 +1,16 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(GardenCard))] +public static class GardenCard_Patch +{ + [HarmonyPatch(nameof(GardenCard.Start)), HarmonyPostfix] + private static void Start(GardenCard __instance) => + __instance.text.text = StringStore.TranslateText(__instance.text.text).Replace("26", "16"); + + [HarmonyPatch(nameof(GardenCard.ChangeCardSprite)), HarmonyPostfix] + private static void ChangeCardSprite(GardenCard __instance) => + __instance.text.text = StringStore.TranslateText(__instance.text.text).Replace("26", "16"); +} diff --git a/Source/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs new file mode 100644 index 0000000..9527418 --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureConfirmMenu_Patch.cs @@ -0,0 +1,20 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureConfirmMenu))] +public static class TreasureConfirmMenu_Patch +{ + [HarmonyPatch(nameof(TreasureConfirmMenu.SetText)), HarmonyPostfix] + private static void SetText(TreasureConfirmMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs new file mode 100644 index 0000000..29d5dbc --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureEquipmentMenu_Patch.cs @@ -0,0 +1,32 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureEquipmentMenu))] +public static class TreasureEquipmentMenu_Patch +{ + [HarmonyPatch(nameof(TreasureEquipmentMenu.Awake)), HarmonyPostfix] + private static void Awake(TreasureEquipmentMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(TreasureEquipmentMenu.UpdateCards)), HarmonyPostfix] + private static void UpdateCards(TreasureEquipmentMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs new file mode 100644 index 0000000..349ba76 --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureEvacuateMenu_Patch.cs @@ -0,0 +1,23 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureEvacuateMenu))] +public static class TreasureEvacuateMenu_Patch +{ + [HarmonyPatch(nameof(TreasureEvacuateMenu.Start)), HarmonyPostfix] + private static void Start(TreasureEvacuateMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + + if (txt.name.Contains("text (1)")) + txt.name += "_EVACUATE"; + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs new file mode 100644 index 0000000..16a00be --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureMainMenu_Patch.cs @@ -0,0 +1,20 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureMainMenu))] +public static class TreasureMainMenu_Patch +{ + [HarmonyPatch(nameof(TreasureMainMenu.Update)), HarmonyPostfix] + private static void Update(TreasureMainMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureManager_Patch.cs b/Source/Patches/Modes/Harvest/TreasureManager_Patch.cs new file mode 100644 index 0000000..c4e7b39 --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureManager_Patch.cs @@ -0,0 +1,26 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureManager))] +public static class TreasureManager_Patch +{ + [HarmonyPatch(nameof(TreasureManager.Update)), HarmonyPostfix] + private static void Update(TreasureManager __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.evaText) + { + txt.autoSizeTextContainer = false; + + if (txt.text == "Evacuate") + continue; + + txt.text = StringStore.TranslateText(txt.text); + txt.name = txt.text + "_EVACUATE"; + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs new file mode 100644 index 0000000..81bb3f5 --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureStoreMenu_Patch.cs @@ -0,0 +1,20 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureStoreMenu))] +public static class TreasureStoreMenu_Patch +{ + [HarmonyPatch(nameof(TreasureStoreMenu.InitCards)), HarmonyPostfix] + private static void InitCards(TreasureStoreMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs new file mode 100644 index 0000000..9d61ef3 --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureUpgradeMenu_Patch.cs @@ -0,0 +1,54 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using UnityEngine.UI; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureUpgradeMenu))] +public static class TreasureUpgradeMenu_Patch +{ + [HarmonyPatch(nameof(TreasureUpgradeMenu.Start)), HarmonyPostfix] + private static void Start(TreasureUpgradeMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(TreasureUpgradeMenu.UpgradeWareHouse)), HarmonyPostfix] + private static void UpgradeWareHouse(TreasureUpgradeMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(TreasureUpgradeMenu.InitWareHouseUpgrade)), HarmonyPostfix] + private static void InitWareHouseUpgrade(TreasureUpgradeMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + + foreach (var txt in __instance.GetComponentsInChildren()) + { + var newTxtObj = Utils.ConvertToTextMeshProUGUI(txt.gameObject, txt.transform.parent, "text"); + var newTxt = newTxtObj.GetComponent(); + newTxt.text = StringStore.TranslateText("植物商店"); + newTxt.autoSizeTextContainer = true; + newTxt.color = new(0, 0, 0.3922f, 1); + } + } +} diff --git a/Source/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs b/Source/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs new file mode 100644 index 0000000..56d0dac --- /dev/null +++ b/Source/Patches/Modes/Harvest/TreasureWarehouseMenu_Patch.cs @@ -0,0 +1,56 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Harvest; + +[HarmonyPatch(typeof(TreasureWarehouseMenu))] +public static class TreasureWarehouseMenu_Patch +{ + [HarmonyPatch(nameof(TreasureWarehouseMenu.InitCards)), HarmonyPostfix] + private static void InitCards(TreasureWarehouseMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(TreasureWarehouseMenu.QuickSell)), HarmonyPostfix] + private static void QuickSell(TreasureWarehouseMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(TreasureWarehouseMenu.FastSell)), HarmonyPostfix] + private static void FastSell(TreasureWarehouseMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + [HarmonyPatch(nameof(TreasureWarehouseMenu.EnterStore)), HarmonyPostfix] + private static void EnterStore(TreasureWarehouseMenu __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } +} diff --git a/Source/Patches/Modes/Odyssey/MultipleChoiceMenu_Patch.cs b/Source/Patches/Modes/Odyssey/MultipleChoiceMenu_Patch.cs new file mode 100644 index 0000000..8f9dbd0 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/MultipleChoiceMenu_Patch.cs @@ -0,0 +1,46 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(MultipleChoiceMenu))] +public static class MultipleChoiceMenu_Patch +{ + public static TMP_FontAsset FontAsset => FontStore.LoadTMPFont(Utils.Language.ToString()); + + [HarmonyPatch(nameof(MultipleChoiceMenu.Awake)), HarmonyPatch(nameof(MultipleChoiceMenu.Cancel)), + HarmonyPatch(nameof(MultipleChoiceMenu.Refresh)), HarmonyPatch(nameof(MultipleChoiceMenu.TurnPage)), + HarmonyPatch(nameof(MultipleChoiceMenu.UpdateWindow)), HarmonyPostfix] + public static void Awake(MultipleChoiceMenu __instance) + { + foreach (var window in __instance.windows) + { + TranslateWindowText(window.title); + TranslateWindowText(window.introduce); + } + + foreach (var txt in __instance.GetComponentsInChildren() + .SelectMany(button => button.GetComponentsInChildren())) + { + txt.text = StringStore.TranslationString.ContainsKey(txt.text + "_MC") + ? StringStore.TranslateText(txt.text + "_MC") + : StringStore.TranslateText(txt.text); + + txt.font = FontAsset; + } + } + + public static void TranslateWindowText(TextMeshProUGUI txt) + { + txt.font = FontAsset; + + if (StringStore.CustomLevelString.TryGetValue(txt.text, out var value)) + txt.text = value; + else if (Utils.GetPlantNameFromAlmanac(txt.text) != "") + txt.text = Utils.GetPlantNameFromAlmanac(txt.text); + else + txt.text = StringStore.TranslationString.ContainsKey(txt.text + "_MC") + ? StringStore.TranslateText(txt.text + "_MC") + : StringStore.TranslateText(txt.text); + } +} diff --git a/Source/Patches/Modes/Odyssey/OppositeBuffManager_Patch.cs b/Source/Patches/Modes/Odyssey/OppositeBuffManager_Patch.cs new file mode 100644 index 0000000..58f312e --- /dev/null +++ b/Source/Patches/Modes/Odyssey/OppositeBuffManager_Patch.cs @@ -0,0 +1,47 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(OppositeBuffManager))] +public static class OppositeBuffManager_Patch +{ + public static Dictionary buffLinks = TravelMgr_Patch.buffLinks; + + public static Dictionary> translatedTravelBuffs = + TravelMgr_Patch.translatedTravelBuffs; + + public const string BadPattern = @"^但(.*)"; + + public static readonly string BadFormat = StringStore.translationStringRegex.ContainsKey(BadPattern) + ? StringStore.translationStringRegex[BadPattern] + : "But, {0}"; + + public static TMP_FontAsset fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + [HarmonyPatch(nameof(OppositeBuffManager.SetText)), HarmonyPostfix] + private static void SetText(OppositeBuffManager __instance) + { + if (TravelMgr_Patch.travelBuffString.ContainsKey(__result)) + __result = TravelMgr_Patch.travelBuffString[__result]; + else if (TravelMgr_Patch.travelBuffString.ContainsKey(TravelMgr_Patch.RemoveBuffName(__result))) + __result = TravelMgr_Patch.travelBuffString[TravelMgr_Patch.RemoveBuffName(__result)]; + } + + public static void TranslateOppositeText( + Il2CppSystem.Collections.Generic.List textList, + Il2CppSystem.Object buff, + bool isBad = false + ) + { + var buffText = TravelMgr.Instance.GetText(buff); + + foreach (var text in textList) + { + text.text = isBad ? string.Format(BadFormat, buffText) : buffText; + text.font = fontAsset; + } + } +} +#endif diff --git a/Source/Patches/Modes/Odyssey/ShootingManager_Patch.cs b/Source/Patches/Modes/Odyssey/ShootingManager_Patch.cs new file mode 100644 index 0000000..5678e28 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/ShootingManager_Patch.cs @@ -0,0 +1,575 @@ +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(ShootingManager))] +public static class ShootingManager_Patch +{ + [HarmonyPatch(nameof(ShootingManager.RegisterCoreBuff)), HarmonyPatch(nameof(ShootingManager.RegisterExpertBuff)), + HarmonyPatch(nameof(ShootingManager.RegisterGetPlantBuff)), + HarmonyPatch(nameof(ShootingManager.RegisterOtherBuff)), HarmonyPostfix] + public static void UpgradeBuff(ShootingManager __instance, ref MultipleChoiceMenu menu) => + MultipleChoiceMenu_Patch.Awake(menu); + + public static void GetBuffs() + { + /*#region code + + AbyssSwordStar t0 = new(); + Bamboo t1 = new(); + BigChomper t4 = new(); + BigGatling t5 = new(); + CabbageCannon t6 = new(); + Cabbagepult t7 = new(); + Cactus t8 = new(); + Caltrop t9 = new(); + CaltropNut t10 = new(); + CattailLour t11 = new(); + CherryChomper t12 = new(); + CherryGatling t13 = new(); + CherrySquash t14 = new(); + Chomper t15 = new(); + Cornpult t17 = new(); + DoomCactus t20 = new(); + DoomChomper t21 = new(); + DoomSniper t22 = new(); + EmeraleBlover t23 = new(); + FireMelon t24 = new(); + FumeShroom t25 = new(); + GarlicFume t26 = new(); + GloomShroom t28 = new(); + GoldCabbage t29 = new(); + HelmetGatling t30 = new(); + HypnoEmperor t31 = new(); + HypnoNut t32 = new(); + HypnoShroom t33 = new(); + IceFumeShroom t34 = new(); + IcePuff t35 = new(); + IFVIronPuff t36 = new(); + IronPuff t37 = new(); + LanternSplit t38 = new(); + LanternUmbrella t39 = new(); + LaserUmbrella t40 = new(); + LotusBamboo t41 = new(); + Melonpult t42 = new(); + NuclearSquash t43 = new(); + ObsidianSpike t44 = new(); + ObsidianWallNut t45 = new(); + PeaMine t46 = new(); + Peashooter t47 = new(); + PortalCorn t48 = new(); + PotatoMine t49 = new(); + ScaredyDoom t54 = new(); + ScaredyShroom t55 = new(); + SmallPuff t57 = new(); + SniperPea t58 = new(); + SnowGatlingPuff t59 = new(); + SpikeRock t61 = new(); + Squalour t62 = new(); + Squash t63 = new(); + StarFruit t64 = new(); + SuperChomper t66 = new(); + SuperHypno t67 = new(); + SuperMelon t68 = new(); + SuperStar t69 = new(); + SuperThreePeater t70 = new(); + SwordStar t71 = new(); + TallNut t72 = new(); + ThreeMine t73 = new(); + ThreePeater t74 = new(); + ThreeSquash t75 = new(); + UltimateBamboo t76 = new(); + UltimateBigChomper t77 = new(); + UltimateBigGatling t78 = new(); + UltimateBlover t79 = new(); + UltimateCabbage t80 = new(); + UltimateCabbageCannon t81 = new(); + UltimateCactus t82 = new(); + UltimateChomper t83 = new(); + UltimateCorn t84 = new(); + UltimateDoomScared t85 = new(); + UltimateFume t86 = new(); + UltimateGatling t87 = new(); + UltimateGloom t88 = new(); + UltimateHelmetGatling t89 = new(); + UltimateHypno t90 = new(); + UltimateLanternSplit t91 = new(); + UltimateMelon t92 = new(); + UltimateMinigun t93 = new(); + UltimatePoisonFume t94 = new(); + UltimateSniperGatling t95 = new(); + UltimateSpring t96 = new(); + UltimateStar t97 = new(); + UltimateStarTorch t98 = new(); + UltimateTallNut t99 = new(); + UltimateWinterMelon t100 = new(); + Umbrellaleaf t101 = new(); + WallNut t103 = new(); + WinterMelon t104 = new(); + + Dictionary t = new(); + + #region 3 + + if(t0.Buffs != null) + { + Utils.TryAdd(t, t0.Role, t0.Role); + } + + if(t1.Buffs != null) + { + Utils.TryAdd(t, t1.Role, t1.Role); + } + + if(t4.Buffs != null) + { + Utils.TryAdd(t, t4.Role, t4.Role); + } + + if(t5.Buffs != null) + { + Utils.TryAdd(t, t5.Role, t5.Role); + } + + if(t6.Buffs != null) + { + Utils.TryAdd(t, t6.Role, t6.Role); + } + + if(t7.Buffs != null) + { + Utils.TryAdd(t, t7.Role, t7.Role); + } + + if(t8.Buffs != null) + { + Utils.TryAdd(t, t8.Role, t8.Role); + } + + if(t9.Buffs != null) + { + Utils.TryAdd(t, t9.Role, t9.Role); + } + + if(t10.Buffs != null) + { + Utils.TryAdd(t, t10.Role, t10.Role); + } + + if(t11.Buffs != null) + { + Utils.TryAdd(t, t11.Role, t11.Role); + } + + if(t12.Buffs != null) + { + Utils.TryAdd(t, t12.Role, t12.Role); + } + + if(t13.Buffs != null) + { + Utils.TryAdd(t, t13.Role, t13.Role); + } + + if(t14.Buffs != null) + { + Utils.TryAdd(t, t14.Role, t14.Role); + } + + if(t15.Buffs != null) + { + Utils.TryAdd(t, t15.Role, t15.Role); + } + + if(t17.Buffs != null) + { + Utils.TryAdd(t, t17.Role, t17.Role); + } + + if(t20.Buffs != null) + { + Utils.TryAdd(t, t20.Role, t20.Role); + } + + if(t21.Buffs != null) + { + Utils.TryAdd(t, t21.Role, t21.Role); + } + + if(t22.Buffs != null) + { + Utils.TryAdd(t, t22.Role, t22.Role); + } + + if(t23.Buffs != null) + { + Utils.TryAdd(t, t23.Role, t23.Role); + } + + if(t24.Buffs != null) + { + Utils.TryAdd(t, t24.Role, t24.Role); + } + + if(t25.Buffs != null) + { + Utils.TryAdd(t, t25.Role, t25.Role); + } + + if(t26.Buffs != null) + { + Utils.TryAdd(t, t26.Role, t26.Role); + } + + if(t28.Buffs != null) + { + Utils.TryAdd(t, t28.Role, t28.Role); + } + + if(t29.Buffs != null) + { + Utils.TryAdd(t, t29.Role, t29.Role); + } + + if(t30.Buffs != null) + { + Utils.TryAdd(t, t30.Role, t30.Role); + } + + if(t31.Buffs != null) + { + Utils.TryAdd(t, t31.Role, t31.Role); + } + + if(t32.Buffs != null) + { + Utils.TryAdd(t, t32.Role, t32.Role); + } + + if(t33.Buffs != null) + { + Utils.TryAdd(t, t33.Role, t33.Role); + } + + if(t34.Buffs != null) + { + Utils.TryAdd(t, t34.Role, t34.Role); + } + + if(t35.Buffs != null) + { + Utils.TryAdd(t, t35.Role, t35.Role); + } + + if(t36.Buffs != null) + { + Utils.TryAdd(t, t36.Role, t36.Role); + } + + if(t37.Buffs != null) + { + Utils.TryAdd(t, t37.Role, t37.Role); + } + + if(t38.Buffs != null) + { + Utils.TryAdd(t, t38.Role, t38.Role); + } + + if(t39.Buffs != null) + { + Utils.TryAdd(t, t39.Role, t39.Role); + } + + if(t40.Buffs != null) + { + Utils.TryAdd(t, t40.Role, t40.Role); + } + + if(t41.Buffs != null) + { + Utils.TryAdd(t, t41.Role, t41.Role); + } + + if(t42.Buffs != null) + { + Utils.TryAdd(t, t42.Role, t42.Role); + } + + if(t43.Buffs != null) + { + Utils.TryAdd(t, t43.Role, t43.Role); + } + + if(t44.Buffs != null) + { + Utils.TryAdd(t, t44.Role, t44.Role); + } + + if(t45.Buffs != null) + { + Utils.TryAdd(t, t45.Role, t45.Role); + } + + if(t46.Buffs != null) + { + Utils.TryAdd(t, t46.Role, t46.Role); + } + + if(t47.Buffs != null) + { + Utils.TryAdd(t, t47.Role, t47.Role); + } + + if(t48.Buffs != null) + { + Utils.TryAdd(t, t48.Role, t48.Role); + } + + if(t49.Buffs != null) + { + Utils.TryAdd(t, t49.Role, t49.Role); + } + + if(t54.Buffs != null) + { + Utils.TryAdd(t, t54.Role, t54.Role); + } + + if(t55.Buffs != null) + { + Utils.TryAdd(t, t55.Role, t55.Role); + } + + if(t57.Buffs != null) + { + Utils.TryAdd(t, t57.Role, t57.Role); + } + + if(t58.Buffs != null) + { + Utils.TryAdd(t, t58.Role, t58.Role); + } + + if(t59.Buffs != null) + { + Utils.TryAdd(t, t59.Role, t59.Role); + } + + if(t61.Buffs != null) + { + Utils.TryAdd(t, t61.Role, t61.Role); + } + + if(t62.Buffs != null) + { + Utils.TryAdd(t, t62.Role, t62.Role); + } + + if(t63.Buffs != null) + { + Utils.TryAdd(t, t63.Role, t63.Role); + } + + if(t64.Buffs != null) + { + Utils.TryAdd(t, t64.Role, t64.Role); + } + + if(t66.Buffs != null) + { + Utils.TryAdd(t, t66.Role, t66.Role); + } + + if(t67.Buffs != null) + { + Utils.TryAdd(t, t67.Role, t67.Role); + } + + if(t68.Buffs != null) + { + Utils.TryAdd(t, t68.Role, t68.Role); + } + + if(t69.Buffs != null) + { + Utils.TryAdd(t, t69.Role, t69.Role); + } + + if(t70.Buffs != null) + { + Utils.TryAdd(t, t70.Role, t70.Role); + } + + if(t71.Buffs != null) + { + Utils.TryAdd(t, t71.Role, t71.Role); + } + + if(t72.Buffs != null) + { + Utils.TryAdd(t, t72.Role, t72.Role); + } + + if(t73.Buffs != null) + { + Utils.TryAdd(t, t73.Role, t73.Role); + } + + if(t74.Buffs != null) + { + Utils.TryAdd(t, t74.Role, t74.Role); + } + + if(t75.Buffs != null) + { + Utils.TryAdd(t, t75.Role, t75.Role); + } + + if(t76.Buffs != null) + { + Utils.TryAdd(t, t76.Role, t76.Role); + } + + if(t77.Buffs != null) + { + Utils.TryAdd(t, t77.Role, t77.Role); + } + + if(t78.Buffs != null) + { + Utils.TryAdd(t, t78.Role, t78.Role); + } + + if(t79.Buffs != null) + { + Utils.TryAdd(t, t79.Role, t79.Role); + } + + if(t80.Buffs != null) + { + Utils.TryAdd(t, t80.Role, t80.Role); + } + + if(t81.Buffs != null) + { + Utils.TryAdd(t, t81.Role, t81.Role); + } + + if(t82.Buffs != null) + { + Utils.TryAdd(t, t82.Role, t82.Role); + } + + if(t83.Buffs != null) + { + Utils.TryAdd(t, t83.Role, t83.Role); + } + + if(t84.Buffs != null) + { + Utils.TryAdd(t, t84.Role, t84.Role); + } + + if(t85.Buffs != null) + { + Utils.TryAdd(t, t85.Role, t85.Role); + } + + if(t86.Buffs != null) + { + Utils.TryAdd(t, t86.Role, t86.Role); + } + + if(t87.Buffs != null) + { + Utils.TryAdd(t, t87.Role, t87.Role); + } + + if(t88.Buffs != null) + { + Utils.TryAdd(t, t88.Role, t88.Role); + } + + if(t89.Buffs != null) + { + Utils.TryAdd(t, t89.Role, t89.Role); + } + + if(t90.Buffs != null) + { + Utils.TryAdd(t, t90.Role, t90.Role); + } + + if(t91.Buffs != null) + { + Utils.TryAdd(t, t91.Role, t91.Role); + } + + if(t92.Buffs != null) + { + Utils.TryAdd(t, t92.Role, t92.Role); + } + + if(t93.Buffs != null) + { + Utils.TryAdd(t, t93.Role, t93.Role); + } + + if(t94.Buffs != null) + { + Utils.TryAdd(t, t94.Role, t94.Role); + } + + if(t95.Buffs != null) + { + Utils.TryAdd(t, t95.Role, t95.Role); + } + + if(t96.Buffs != null) + { + Utils.TryAdd(t, t96.Role, t96.Role); + } + + if(t97.Buffs != null) + { + Utils.TryAdd(t, t97.Role, t97.Role); + } + + if(t98.Buffs != null) + { + Utils.TryAdd(t, t98.Role, t98.Role); + } + + if(t99.Buffs != null) + { + Utils.TryAdd(t, t99.Role, t99.Role); + } + + if(t100.Buffs != null) + { + Utils.TryAdd(t, t100.Role, t100.Role); + } + + if(t101.Buffs != null) + { + Utils.TryAdd(t, t101.Role, t101.Role); + } + + if(t103.Buffs != null) + { + Utils.TryAdd(t, t103.Role, t103.Role); + } + + if(t104.Buffs != null) + { + Utils.TryAdd(t, t104.Role, t104.Role); + } + + #endregion + + File.WriteAllText("tge_roles.json", FileLoader.SerializeWithIndentation(t)); + + #endregion*/ + } +} diff --git a/Source/Patches/Modes/Odyssey/SynergyDisplay_Patch.cs b/Source/Patches/Modes/Odyssey/SynergyDisplay_Patch.cs new file mode 100644 index 0000000..40e89e2 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/SynergyDisplay_Patch.cs @@ -0,0 +1,19 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(SynergyDisplay))] +public static class SynergyDisplay_Patch +{ + [HarmonyPatch(nameof(SynergyDisplay.Start)), HarmonyPostfix] + public static void Start(SynergyDisplay __instance) => + __instance.text.text = TranslateInvestDisplay(__instance.text.text); + + public static string TranslateInvestDisplay(string originalText) + { + var parts = originalText.Split("\n\n"); + var translatedParts = parts.Select(part => StringStore.TranslateColorText(part)).ToList(); + return string.Join("\n\n", translatedParts); + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelAdvantureMenu_Patch.cs b/Source/Patches/Modes/Odyssey/TravelAdvantureMenu_Patch.cs new file mode 100644 index 0000000..ce26516 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelAdvantureMenu_Patch.cs @@ -0,0 +1,28 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelAdvantureMenu))] +public static class TravelAdvantureMenu_Patch +{ + [HarmonyPatch(nameof(TravelAdvantureMenu.Awake)), HarmonyPostfix] + public static void Awake(TravelAdvantureMenu __instance) + { + foreach (var button in __instance.GetComponentsInChildren()) + { + var plantName = Utils.GetPlantNameFromAlmanac(button.levelName.text); + + if (Utils.Language == Utils.LanguageEnum.Arabic) + button.levelName.text = StringStore.TranslateText(button.levelName.text); + else + button.levelName.text = plantName != "" ? plantName : StringStore.TranslateText(button.levelName.text); + } + } + + [HarmonyPatch(nameof(TravelAdvantureMenu.LookWeak)), HarmonyPostfix] + public static void LookWeak(TravelAdvantureMenu __instance) => Awake(__instance); + + [HarmonyPatch(nameof(TravelAdvantureMenu.LookUlti)), HarmonyPostfix] + public static void LookUlti(TravelAdvantureMenu __instance) => Awake(__instance); +} diff --git a/Source/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs b/Source/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs new file mode 100644 index 0000000..fead17e --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelBuffMenu_Patch.cs @@ -0,0 +1,24 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelBuffMenu))] +public static class TravelBuffMenu_Patch +{ + [HarmonyPatch(nameof(TravelBuffMenu.RefeshOptions)), HarmonyPostfix] + public static void RefeshOptions(TravelBuffMenu __instance) + { + foreach (var button in __instance.options) + TravelBuffOptionButton_Patch.TranslateOptionButton(button); + } + + [HarmonyPatch(nameof(TravelBuffMenu.Awake)), HarmonyPostfix] + public static void Awake(TravelBuffMenu __instance) + { + var refreshTransform = __instance.transform.Find("Refresh"); + + foreach (var text in refreshTransform.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs b/Source/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs new file mode 100644 index 0000000..98f9eca --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelBuffMgr_Patch.cs @@ -0,0 +1,23 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelBuffMgr))] +public static class TravelBuffMgr_Patch +{ + [HarmonyPatch(nameof(TravelBuffMgr.Awake)), HarmonyPostfix] + private static void Awake(TravelBuffMgr __instance) + { + __instance.text = AssetStore.StringStore.TranslateText(__instance.text); + __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); + } + + [HarmonyPatch(nameof(TravelBuffMgr.ShowText), typeof(int), typeof(int)), HarmonyPostfix] + private static void ShowText(TravelBuffMgr __instance) + { + __instance.text = AssetStore.StringStore.TranslateText(__instance.text); + __instance.text2 = AssetStore.StringStore.TranslateText(__instance.text2); + } +} +#endif diff --git a/Source/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs b/Source/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs new file mode 100644 index 0000000..45736d8 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelBuffOptionButton_Patch.cs @@ -0,0 +1,35 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelBuffOptionButton))] +public static class TravelBuffOptionButton_Patch +{ + [HarmonyPatch(nameof(TravelBuffOptionButton.Awake)), HarmonyPostfix] + public static void Awake(TravelBuffOptionButton __instance) => TranslateOptionButton(__instance); + + [HarmonyPatch(nameof(TravelBuffOptionButton.OnAnimOver)), HarmonyPostfix] + public static void OnAnimOver(TravelBuffOptionButton __instance) => TranslateOptionButton(__instance); + + public static void TranslateOptionButton(TravelBuffOptionButton button) + { + if (TravelBuffString.ContainsKey(button.introduce.text)) + { + var translatedBuff = TravelBuffString[button.introduce.text]; + button.introduce.text = AddBuffName(translatedBuff); + } + + if (!Utils.CheckForUntranslatedText(button.introduce.text)) + button.introduce.text = AddBuffName(button.introduce.text); + + if (!TravelBuffString.ContainsKey(button.introduce.text) && + Utils.CheckForUntranslatedText(button.introduce.text)) + button.introduce.text = StringStore.TranslateText(button.introduce.text); + } +} + +//List buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; +//string buff = (__instance.show != null) ? buffSet[__instance.buffIndex] : StringStore.TranslateText("无"); +//__instance.introduce.text = buff; diff --git a/Source/Patches/Modes/Odyssey/TravelBuff_Patch.cs b/Source/Patches/Modes/Odyssey/TravelBuff_Patch.cs new file mode 100644 index 0000000..df2122d --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelBuff_Patch.cs @@ -0,0 +1,19 @@ +#if false +using HarmonyLib; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelBuff))] +public static class TravelBuff_Patch +{ + [HarmonyPatch(nameof(TravelBuff.OnMouseUpAsButton)), HarmonyPostfix] + private static void OnMouseUpAsButton() + { + if (TravelBuffMgr.Instance == null) + return; + + TravelBuffMgr.Instance.text = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text); + TravelBuffMgr.Instance.text2 = AssetStore.StringStore.TranslateText(TravelBuffMgr.Instance.text2); + } +} +#endif diff --git a/Source/Patches/Modes/Odyssey/TravelInvestMenu_Patch.cs b/Source/Patches/Modes/Odyssey/TravelInvestMenu_Patch.cs new file mode 100644 index 0000000..476adb7 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelInvestMenu_Patch.cs @@ -0,0 +1,24 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelInvestMenu))] +public static class TravelInvestMenu_Patch +{ + [HarmonyPatch(nameof(TravelInvestMenu.Start)), HarmonyPostfix] + private static void Start(TravelInvestMenu __instance) + { + var titleText = __instance.transform.Find("Title"); + var shadowText = titleText.GetComponent(); + + var regularText = titleText.transform.Find("Title2").GetComponent(); + regularText.text = StringStore.TranslateText(regularText.text); + + shadowText.text = Utils.RemoveColorTags(regularText.text); + } + + [HarmonyPatch(nameof(TravelInvestMenu.RefreshBuff)), HarmonyPostfix] + private static void RefreshBuff(TravelInvestMenu __instance, ref TravelBuffOptionButton option) => + TravelBuffOptionButton_Patch.TranslateOptionButton(option); +} diff --git a/Source/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs b/Source/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs new file mode 100644 index 0000000..c15256d --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelLookBuff_Patch.cs @@ -0,0 +1,57 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelLookBuff))] +public static class TravelLookBuff_Patch +{ + [HarmonyPatch(nameof(TravelLookBuff.Clear)), HarmonyPostfix] + public static void Post_Clear(TravelLookBuff __instance) + { + __instance.introduce.text = StringStore.TranslateText("无"); + __instance.set = false; + + foreach (var text in __instance.transform.FindChild("Images") + .FindChild("Button") + .GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(TravelLookBuff.OnMouseUpAsButton)), HarmonyPostfix] + public static void Post_OnMouseUpAsButton(TravelLookBuff __instance) + { + foreach (var text in __instance.transform.FindChild("Images") + .FindChild("Button") + .GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(TravelLookBuff.SetBuff)), HarmonyPostfix] + public static void Post_SetBuff(TravelLookBuff __instance) + { + /*SortedDictionary buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; + string buffText = buffSet.ContainsKey(__instance.buffIndex) ? buffSet[__instance.buffIndex] : StringStore.TranslateText(__instance.introduce.text); + __instance.introduce.text = buffText;*/ + + foreach (var text in __instance.transform.FindChild("Images") + .FindChild("Introduce") + .GetComponentsInChildren()) + { + if (TravelBuffString.TryGetValue(text.text, out var translatedBuff)) + text.text = AddBuffName(translatedBuff); + + if (!Utils.CheckForUntranslatedText(text.text)) + text.text = AddBuffName(text.text); + + if (!TravelBuffString.ContainsKey(text.text) && Utils.CheckForUntranslatedText(text.text)) + text.text = StringStore.TranslateText(text.text); + } + + foreach (var text in __instance.transform.FindChild("Images") + .FindChild("Button") + .GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs b/Source/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs new file mode 100644 index 0000000..ad6f659 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelLookMenu_Patch.cs @@ -0,0 +1,42 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelLookMenu))] +public static class TravelLookMenu_Patch +{ +#pragma warning disable CA2211 + public static string SavedAssetString = ""; +#pragma warning restore CA2211 + [HarmonyPatch(nameof(TravelLookMenu.Start)), HarmonyPostfix] + private static void Postfix_Start(TravelLookMenu __instance) + { + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText(txt.text); + txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + var quitButtonTransform = __instance.transform.Find("Quit"); + + foreach (var txt in quitButtonTransform.GetComponentsInChildren()) + { + txt.text = StringStore.TranslateText("合上"); + txt.font = FontStore.LoadTMPFont(Utils.Language.ToString()); + } + + __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); + SavedAssetString = __instance.treasureText.text; + } + + [HarmonyPatch(nameof(TravelLookMenu.Update)), HarmonyPostfix] + private static void Update(TravelLookMenu __instance) + { + if (SavedAssetString == __instance.treasureText.text) + return; + + __instance.treasureText.text = StringStore.TranslateText(__instance.treasureText.text); + SavedAssetString = __instance.treasureText.text; + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelMgr_Patch.cs b/Source/Patches/Modes/Odyssey/TravelMgr_Patch.cs new file mode 100644 index 0000000..40ac83f --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelMgr_Patch.cs @@ -0,0 +1,312 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +public sealed class TravelBuffInfo(string nameA = "", string descA = "") +{ + public readonly string Name = nameA; + public readonly string Desc = descA; +} + +public sealed class TravelBuffSet +{ + public readonly SortedDictionary + AdvancedBuffs, + UltimateBuffs, + Debuffs, + Unlocks, + InvestmentBuffs; + + private readonly Dictionary> _travelBuffSets; + + public TravelBuffSet() + { + AdvancedBuffs = new(); + UltimateBuffs = new(); + Debuffs = new(); + Unlocks = new(); + InvestmentBuffs = new(); + + _travelBuffSets = new() + { + { "advancedBuffs", AdvancedBuffs }, + { "ultimateBuffs", UltimateBuffs }, + { "debuffs", Debuffs }, + { "unlocks", Unlocks }, + { "investmentBuffs", InvestmentBuffs }, + }; + } + + public SortedDictionary TryGet(string name) => + name switch + { + "advancedBuffs" => AdvancedBuffs, + "ultimateBuffs" => UltimateBuffs, + "debuffs" => Debuffs, + "unlocks" => Unlocks, + "investmentBuffs" => InvestmentBuffs, + _ => null, + }; + + public IEnumerator>> GetEnumerator() => + _travelBuffSets.Select(item => (item.Key, item.Value)).GetEnumerator(); +} + +[HarmonyPatch(typeof(TravelMgr))] +public static class TravelMgr_Patch +{ + public static readonly TravelBuffSet TemplateTravelBuffs = new(); + + public static readonly Dictionary TravelBuffString = new(); +#pragma warning disable CA2211 + public static TravelBuffSet DumpedTravelBuffs = new(); + + public static TravelBuffSet TranslatedTravelBuffs = new(); + + public static Dictionary BuffLinks = new() + { + { BuffType.AdvancedBuff, "advancedBuffs" }, + { BuffType.UltimateBuff, "ultimateBuffs" }, + { BuffType.Debuff, "debuffs" }, + { BuffType.UnlockPlant, "unlocks" }, + { BuffType.InvestmentBuff, "investmentBuffs" }, + }; +#pragma warning restore CA2211 + [HarmonyPatch(nameof(TravelMgr.GetText)), HarmonyPostfix] + public static void GetText(TravelMgr __instance, ref string result) + { + if (TravelBuffString.TryGetValue(result, out var value)) + result = value; + else if (TravelBuffString.ContainsKey(RemoveBuffName(result))) + result = TravelBuffString[RemoveBuffName(result)]; + else + result = StringStore.TranslateText(result); + } + + public static void DumpTravelBuffs() + { + TravelMgr.Instance.GetPlantBuffUnlockCount(PlantType.DoomGatling); + + DumpedTravelBuffs = new(); + TravelBuffString.Clear(); + + foreach (var pair in TravelDictionary.advancedBuffsText) + { + Utils.TryAdd(DumpedTravelBuffs.AdvancedBuffs, (int)pair.Key, new("", pair.Value)); + Utils.TryAdd(TravelBuffString, pair.Value, pair.Value); + } + + foreach (var pair in TravelDictionary.ultimateBuffsText) + { + Utils.TryAdd(DumpedTravelBuffs.UltimateBuffs, (int)pair.Key, new("", pair.Value)); + Utils.TryAdd(TravelBuffString, pair.Value, pair.Value); + } + + foreach (var pair in TravelDictionary.debuffData) + { + Utils.TryAdd(DumpedTravelBuffs.Debuffs, (int)pair.Key, new("", pair.Value.Item1)); + Utils.TryAdd(TravelBuffString, pair.Value.Item1, pair.Value.Item1); + } + + foreach (var pair in TravelDictionary.unlocksText) + { + Utils.TryAdd(DumpedTravelBuffs.Unlocks, (int)pair.Key, new("", pair.Value)); + Utils.TryAdd(TravelBuffString, pair.Value, pair.Value); + } + + foreach (var pair in TravelMgr.InvestBuffsData) + { + Utils.TryAdd( + DumpedTravelBuffs.InvestmentBuffs, + (int)pair.Key, + new("", pair.Value.Description) + ); + + Utils.TryAdd(TravelBuffString, pair.Value.Description, pair.Value.Description); + } + + File.WriteAllText( + Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "travel_buffs.json"), + FileLoader.SerializeWithIndentation(DumpedTravelBuffs) + ); + + var translatedTravelBuffsPath = Path.Combine( + FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), + "travel_buffs.json" + ); + + if (File.Exists(translatedTravelBuffsPath)) + return; + + File.WriteAllText(translatedTravelBuffsPath, FileLoader.SerializeWithIndentation(DumpedTravelBuffs)); + TranslatedTravelBuffs = DumpedTravelBuffs; + } + + //System.Text.Json.JsonSerializer.Deserialize>>(travelBuffsContent); + public static void GenerateTranslatedTravelBuffs(string travelBuffsContent) + { + if (!Core.IsInitialized) + return; + + DumpTravelBuffs(); + + var travelBuffs = Newtonsoft.Json.JsonConvert.DeserializeObject(travelBuffsContent); + TranslatedTravelBuffs = travelBuffs; + TravelBuffString.Clear(); + + foreach (var i in travelBuffs) + { + var originalBuffSet = DumpedTravelBuffs.TryGet(i.Item1); + + foreach (var (key, originalBuff) in originalBuffSet) + { + var translatedBuffSet = travelBuffs.TryGet(i.Item1); + + if (originalBuff.Desc != RemoveBuffName(originalBuff.Desc)) + continue; + + if (translatedBuffSet.TryGetValue(key, out var value)) + Utils.TryAdd(TravelBuffString, originalBuff.Desc, value.Desc); +#if false + var translatedBuffSet = travelBuffs[i.Key]; + + if (!translatedBuffSet.ContainsKey(j.Key)) + continue; + + string translatedBuff = travelBuffs[i.Key][j.Key]; + travelBuffString[originalBuff] = translatedBuff; +#endif + } + } + + var travelBuffsToSave = FileLoader.SerializeWithIndentation(TranslatedTravelBuffs); + var stringDir = FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language); + File.WriteAllText(Path.Combine(stringDir, "travel_buffs.json"), travelBuffsToSave); + } + + public static string MatchTravelBuff(string originalText) + { + var res = ""; + + foreach (var i in DumpedTravelBuffs) + { + foreach (var j in DumpedTravelBuffs.TryGet(i.Item1)) + if (j.Value.Desc == originalText || j.Value.Desc == RemoveBuffName(originalText)) + { + var translatedBuffSet = TranslatedTravelBuffs.TryGet(i.Item1); + + if (translatedBuffSet.TryGetValue(j.Key, out var value)) + res = value.Desc; + + break; + } + + if (res != "") + break; + } + + return res; + } + + public static string RemoveBuffName(string buffText) + { + var res = buffText; + var firstColon = res.IndexOf(":", StringComparison.Ordinal); + + if (firstColon > 0) + res = res[(firstColon + 1)..]; + + return res; + } + + public static readonly Dictionary ModifierNameDict = new() + { + { "advancedBuffs", "COMMON_MODIFIER_TAG" }, + { "ultimateBuffs", "EPIC_MODIFIER_TAG" }, + { "debuffs", "ZOMBIE_MODIFIER_TAG" }, + { "unlocks", "UNLOCK_MODIFIER_TAG" }, + { "investmentBuffs", "INVEST_MODIFIER_TAG" }, + }; + + public static readonly Dictionary FallbackNameDict = new() + { + { "COMMON_MODIFIER_TAG", "Common Modifier" }, + { "EPIC_MODIFIER_TAG", "Epic Modifier" }, + { "ZOMBIE_MODIFIER_TAG", "Zombie Modifier" }, + { "UNLOCK_MODIFIER_TAG", "Unlock Modifier" }, + { "INVEST_MODIFIER_TAG", "Investment Modifier" }, + }; + + public static string TranslateNameTag(string originalText) + { + var nameTag = ModifierNameDict[originalText]; + + return StringStore.TranslationString.ContainsKey(nameTag) + ? StringStore.TranslateText(nameTag) + : FallbackNameDict[nameTag]; + } + + public static ValueTuple FindBuffData(string buffText) + { + ValueTuple res = new(); + + foreach (var pair1 in TranslatedTravelBuffs) + { + foreach (var pair2 in pair1.Item2.Where(pair2 => buffText == pair2.Value.Desc)) + { + if (pair2.Value.Name != "") + { + res.Item1 = pair2.Value.Name; + res.Item4 = true; + } + else + { + res.Item1 = TranslateNameTag(pair1.Item1); + res.Item4 = false; + } + + res.Item2 = pair2.Key; + } + } + + foreach (var pair1 in DumpedTravelBuffs) + { + foreach (var pair2 in pair1.Item2.Where(pair2 => buffText == pair2.Value.Desc)) + { + (res.Item1, res.Item4) = pair2.Value.Name != "" + ? (pair2.Value.Name, true) + : (TranslateNameTag(pair1.Item1), false); + + res.Item2 = pair2.Key; + } + } + + var finalBuffText = TravelBuffString.TryGetValue(buffText, out var value) + ? value + : StringStore.TranslateText(buffText); + + res.Item3 = finalBuffText; + + return res; + } + + // public static string FallbackFBuffStr = "{0}: {1}"; + + public static string AddBuffName(string buffText) + { + var translatedBuff = buffText; + + if (Utils.CheckForUntranslatedText(buffText)) + if (TravelBuffString.TryGetValue(buffText, out var value)) + translatedBuff = value; + + var buffData = FindBuffData(translatedBuff); + + if (buffData is not { Item1: not null, Item3: not null }) + return translatedBuff; + + var buffFStr = StringStore.TranslationStringRegex.GetValueOrDefault("BUFF_NAME_FORMAT", "{0}: {1}"); + return string.Format(buffFStr, buffData.Item1, buffData.Item3); + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelRefresh_Patch.cs b/Source/Patches/Modes/Odyssey/TravelRefresh_Patch.cs new file mode 100644 index 0000000..ae4aeca --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelRefresh_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelRefresh))] +public static class TravelRefresh_Patch +{ + [HarmonyPatch(nameof(TravelRefresh.Awake)), HarmonyPostfix] + private static void Awake(TravelRefresh __instance) + { + __instance.text = StringStore.TranslateText(__instance.text); + __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); + } + + [HarmonyPatch(nameof(TravelRefresh.OnMouseUpAsButton)), HarmonyPostfix] + private static void OnMouseUpAsButton(TravelRefresh __instance) + { + __instance.text = StringStore.TranslateText(__instance.text); + __instance.text_shadow = StringStore.TranslateText(__instance.text_shadow); + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelStoreWindow_Patch.cs b/Source/Patches/Modes/Odyssey/TravelStoreWindow_Patch.cs new file mode 100644 index 0000000..dd7b489 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelStoreWindow_Patch.cs @@ -0,0 +1,81 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.RegularExpressions; +using static PvZ_Fusion_Translator.Patches.Modes.Odyssey.TravelMgr_Patch; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelStoreWindow))] +public static class TravelStoreWindow_Patch +{ + [HarmonyPatch(nameof(TravelStoreWindow.SetType)), HarmonyPostfix] + private static void SetType(TravelStoreWindow __instance) + { +#if false + var buffSet = translatedTravelBuffs[buffLinks[__instance.buffType]]; + + var buff = __instance.show != null && __instance.introduce.text != "词条已选完" + ? buffSet[__instance.buffIndex] + : StringStore.TranslateText("词条已选完"); +#endif + var originalText = __instance.introduce.text; + const string AffinityPattern = "([\\s\\S]+)(\\\n)([\\s\\S]+)(<\\/color>)"; + + if (Regex.IsMatch(__instance.introduce.text, AffinityPattern, RegexOptions.Singleline)) + { + var match = Regex.Match(__instance.introduce.text, AffinityPattern, RegexOptions.Singleline); + var startText = match.Groups[1].Value; + var affinityText = match.Groups[3].Value; + var affinities = TranslateAffinities(affinityText); + __instance.introduce.text = AddBuffName(startText) + affinities; + } + else + __instance.introduce.text = AddBuffName(originalText); + + foreach (var text in __instance.buttonText) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(TravelStoreWindow.UpdateButtonText)), HarmonyPostfix] + private static void UpdateButtonText(TravelStoreWindow __instance) + { + foreach (var text in __instance.buttonText) + text.text = StringStore.TranslateText(text.text); + } + + public static string TranslateAffinities(string originalText) + { + List translatedAffinities = []; + var lines = originalText.Split('\n'); + + foreach (var line in lines) + { + if (string.IsNullOrEmpty(line)) + continue; + + var fStr = StringStore.TranslationStringRegex.GetValueOrDefault("【([^\\s]+)】_IV", "[{0}]"); + + // Extract dynamic parts from the original text + var regex = new Regex("【([^\\s]+)】"); + var match = regex.Match(line); + var groupCount = match.Groups.Count; + + // List to hold formatted dynamic parts + List dynamicParts = []; + + // Loop through each group and determine its translation + for (var i = 1; i < groupCount; i++) + { + var groupValue = match.Groups[i].Value; + var translatedValue = StringStore.TranslationString.GetValueOrDefault(groupValue, groupValue); + dynamicParts.Add(translatedValue); + } + + // Format the output string with dynamic parts + var translatedAffinity = string.Format(fStr, [..dynamicParts]); + translatedAffinities.Add(translatedAffinity); + } + + return $"\n{string.Join("\n", translatedAffinities)}"; + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelStore_Patch.cs b/Source/Patches/Modes/Odyssey/TravelStore_Patch.cs new file mode 100644 index 0000000..ecb75d7 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelStore_Patch.cs @@ -0,0 +1,60 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelStore))] +public static class TravelStore_Patch +{ + [HarmonyPatch(nameof(TravelStore.Start)), HarmonyPostfix] + private static void Start(TravelStore __instance) => TranslateStoreText(__instance); + + [HarmonyPatch(nameof(TravelStore.Update)), HarmonyPostfix] + private static void Update(TravelStore __instance) => TranslateStoreText(__instance); + + [HarmonyPatch(nameof(TravelStore.RefreshBuff)), HarmonyPostfix] + private static void RefreshBuff(TravelStore __instance) => TranslateStoreText(__instance); + + [HarmonyPatch(nameof(TravelStore.SelectBuff)), HarmonyPostfix] + private static void SelectBuff(TravelStore __instance, ref TravelStoreWindow window) + { + TranslateStoreText(__instance); + + foreach (var text in window.buttonText) + text.text = StringStore.TranslateText(text.text); + + __instance.investText.text = TranslateInvestText(__instance.investText.text); + __instance.investTextshadow.text = TranslateInvestText(__instance.investTextshadow.text); + } + + public static void TranslateStoreText(TravelStore __instance) + { + __instance.investText.text = TranslateInvestText(__instance.investText.text); + __instance.investTextshadow.text = TranslateInvestText(__instance.investTextshadow.text); + + foreach (var text in __instance.pointText) + text.text = StringStore.TranslateText(text.text); + + foreach (var text in __instance.refreshText) + text.text = StringStore.TranslateText(text.text); + + foreach (var text in __instance.transform.Find("Quit").GetComponentsInChildren()) + text.text = StringStore.TranslateText("合上"); + } + + public static string TranslateInvestText(string investText) + { + if (!Utils.CheckForUntranslatedText(investText)) + return investText; + + var investStats = investText.Split("\n\n"); + + var translatedInvestStats = investStats + .Select(investStat => investStat.Split("\n")) + .Select(lines => lines.Select(line => StringStore.TranslateColorText(line)).ToList()) + .Select(translatedLines => string.Join("\n", translatedLines)) + .ToList(); + + return string.Join("\n\n", translatedInvestStats); + } +} diff --git a/Source/Patches/Modes/Odyssey/TravelSynergyMenu_Patch.cs b/Source/Patches/Modes/Odyssey/TravelSynergyMenu_Patch.cs new file mode 100644 index 0000000..4dc3e29 --- /dev/null +++ b/Source/Patches/Modes/Odyssey/TravelSynergyMenu_Patch.cs @@ -0,0 +1,87 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.RegularExpressions; + +namespace PvZ_Fusion_Translator.Patches.Modes.Odyssey; + +[HarmonyPatch(typeof(TravelSynergyMenu))] +public static class TravelSynergyMenu_Patch +{ + [HarmonyPatch(nameof(TravelSynergyMenu.Awake)), HarmonyPostfix] + public static void Awake(TravelSynergyMenu __instance) + { + var background = __instance.transform.Find("Background"); + var tip = __instance.transform.Find("Text (TMP)"); + + foreach (var text in background.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + + foreach (var text in tip.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} + +[HarmonyPatch(typeof(SynergyNode))] +public static class SynergyNode_Patch +{ + [HarmonyPatch(nameof(SynergyNode.InitNode)), HarmonyPostfix] + public static void InitNode(SynergyNode __instance) + { + var firstNewlineIndex = __instance.synergyTitle.text.IndexOf("\n", StringComparison.Ordinal); + var title = __instance.synergyTitle.text[..firstNewlineIndex]; + var description = __instance.synergyTitle.text[(firstNewlineIndex + 1)..]; + description = description[..8] == "" ? description[8..] : description; + + const string Pattern = @"]+>[\s\S]*?(?:<\/color>|$)|(?:<(?!color=)|[^<])+"; + const string SmallPattern = "(]+>)(.*?)()"; + var matches = Regex.Matches(description, Pattern); + var translatedDescription = ""; + + foreach (Match match in matches) + { + var colorMatch = Regex.Match(match.Value, SmallPattern, RegexOptions.Singleline); + + if (colorMatch.Success) + translatedDescription += colorMatch.Groups[1].Value + + TranslateSegment(colorMatch.Groups[2].Value) + + colorMatch.Groups[3].Value; + else + translatedDescription += TranslateSegment(match.Value) + "\n"; + } + + __instance.synergyTitle.text = + "" + StringStore.TranslateColorText(title) + "\n" + translatedDescription; + } + + public static string TranslateSegment(string text) + { + var res = ""; + + var parts = SplitSecondNewLines(text); + + foreach (var part in parts) + { + var temp = ""; + var lines = part.Split('\n'); + + if (lines.Length > 1) + temp = StringStore.TranslateText(lines[0]) + "\n" + StringStore.TranslateText(lines[1]); + + res += temp + "\n"; + } + + return res[..^1]; + } + + public static List SplitSecondNewLines(string originalText) + { + var results = new List(); + + var lines = originalText.Split('\n'); + + for (var i = 0; i < lines.Length; i += 2) + results.Add(i + 1 < lines.Length ? lines[i] + "\n" + lines[i + 1] : lines[i]); + + return results; + } +} diff --git a/Source/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs b/Source/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs new file mode 100644 index 0000000..fb84b70 --- /dev/null +++ b/Source/Patches/Modes/Starbound/AdvantureEvolutionMenu_Patch.cs @@ -0,0 +1,51 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound; + +[HarmonyPatch(typeof(AdvantureEvolutionMenu))] +public static class AdvantureEvolutionMenu_Patch +{ + [HarmonyPatch(nameof(AdvantureMenu.Awake)), HarmonyPostfix] + public static void Awake(AdvantureEvolutionMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); + + var baseWindow = __instance.transform.Find("BaseWindow"); + var advancedWindow = __instance.transform.Find("AdvancedWindow"); + + if (baseWindow != null) + foreach (var text in baseWindow.GetComponentsInChildren() + .Where(text => text.gameObject.name.Contains("Name"))) + text.text = Utils.GetPlantNameFromAlmanac(__instance.thePlantType); + + if (advancedWindow == null) + return; + + foreach (var text in advancedWindow.GetComponentsInChildren() + .Where(text => text.gameObject.name.Contains("Name"))) + text.text = Utils.GetPlantNameFromAlmanac(__instance.thePlantType); + } + + [HarmonyPatch(nameof(AdvantureEvolutionMenu.UpdateText)), HarmonyPostfix] + public static void UpdateText(AdvantureEvolutionMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); + } + + [HarmonyPatch(nameof(AdvantureEvolutionMenu.RollEvolution)), HarmonyPostfix] + public static void RollEvolution(AdvantureEvolutionMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); + } + + [HarmonyPatch(nameof(AdvantureEvolutionMenu.RollEvolutionGood)), HarmonyPostfix] + public static void RollEvolutionGood(AdvantureEvolutionMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); + } +} diff --git a/Source/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs b/Source/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs new file mode 100644 index 0000000..238f3ca --- /dev/null +++ b/Source/Patches/Modes/Starbound/AdvantureHelpMenu_Patch.cs @@ -0,0 +1,15 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound; + +[HarmonyPatch(typeof(AdvantureHelpMenu))] +public static class AdvantureHelpMenu_Patch +{ + [HarmonyPatch(nameof(AdvantureHelpMenu.InitText)), HarmonyPostfix] + private static void InitText(AdvantureHelpMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs b/Source/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs new file mode 100644 index 0000000..0b337ac --- /dev/null +++ b/Source/Patches/Modes/Starbound/AdvantureMenu2_Patch.cs @@ -0,0 +1,19 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound; + +[HarmonyPatch(typeof(AdvantureMenu2))] +public static class AdvantureMenu2_Patch +{ + [HarmonyPatch(nameof(AdvantureMenu2.Awake)), HarmonyPostfix] + private static void Awake(AdvantureMenu2 __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(AdvantureMenu2.AdjustDifficulty)), HarmonyPostfix] + private static void AdjustDifficulty(AdvantureMenu2 __instance) => + __instance.difficulty.text = StringStore.TranslateText(__instance.difficulty.text); +} diff --git a/Source/Patches/Modes/Starbound/AdvantureMenu_Patch.cs b/Source/Patches/Modes/Starbound/AdvantureMenu_Patch.cs new file mode 100644 index 0000000..5f2c077 --- /dev/null +++ b/Source/Patches/Modes/Starbound/AdvantureMenu_Patch.cs @@ -0,0 +1,43 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound; + +[HarmonyPatch(typeof(AdvantureMenu))] +public static class AdvantureMenu_Patch +{ + [HarmonyPatch(nameof(AdvantureMenu.Start)), HarmonyPostfix] + private static void Start(AdvantureMenu __instance) => TranslateAdvantureMenu(__instance); + + [HarmonyPatch(nameof(AdvantureMenu.ChangeDifficulty)), HarmonyPostfix] + private static void ChangeDifficulty(AdvantureMenu __instance) => TranslateAdvantureMenu(__instance); + + [HarmonyPatch(nameof(AdvantureMenu.GetChapterDifficulty)), HarmonyPostfix] + private static void GetChapterDifficulty(AdvantureMenu __instance) => TranslateAdvantureMenu(__instance); + + [HarmonyPatch(nameof(AdvantureMenu.UpdateChapterDifficulty)), HarmonyPostfix] + private static void UpdateChapterDifficulty(AdvantureMenu __instance) => TranslateAdvantureMenu(__instance); + + [HarmonyPatch(nameof(AdvantureMenu.UpdateStarCount)), HarmonyPostfix] + private static void UpdateStarCount(AdvantureMenu __instance) => TranslateAdvantureMenu(__instance); + + public static void TranslateAdvantureMenu(AdvantureMenu __instance) + { + var hasSbString = StringStore.TranslationString.ContainsKey(__instance.difficulty.text + "_SB"); + + __instance.difficulty.text = Utils.RemoveSizeTags( + hasSbString + ? StringStore.TranslateText(__instance.difficulty.text + "_SB") + : StringStore.TranslateText(__instance.difficulty.text) + ); + + __instance.chapterDifficulty.text = StringStore.TranslateText(__instance.chapterDifficulty.text); + __instance.starCount.text = StringStore.TranslateText(__instance.starCount.text); + + foreach (var text in __instance.title) + text.text = StringStore.TranslateText(text.text); + + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs b/Source/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs new file mode 100644 index 0000000..0c1c55c --- /dev/null +++ b/Source/Patches/Modes/Starbound/AdvantureMissionMenu_Patch.cs @@ -0,0 +1,41 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound; + +[HarmonyPatch(typeof(AdvantureMissionMenu))] +public static class AdvantureMissionMenu_Patch +{ + [HarmonyPatch(nameof(AdvantureMissionMenu.Awake)), HarmonyPostfix] + private static void Awake(AdvantureMissionMenu __instance) + { + foreach (var text in __instance.contant.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); +#if false + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); +#endif + } + + [HarmonyPatch(nameof(AdvantureMissionMenu.InitText)), HarmonyPostfix] + private static void InitText(AdvantureMissionMenu __instance) + { + foreach (var text in __instance.contant.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); +#if false + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); +#endif + } + + [HarmonyPatch(nameof(AdvantureMissionMenu.SwitchAward)), HarmonyPostfix] + private static void SwitchAward(AdvantureMissionMenu __instance) + { + foreach (var text in __instance.contant.GetComponentsInChildren()) + text.text = StringStore.TranslateColorText(text.text); +#if false + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); +#endif + } +} diff --git a/Source/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs b/Source/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs new file mode 100644 index 0000000..6230b24 --- /dev/null +++ b/Source/Patches/Modes/Starbound/AdvantureStarMenu_Patch.cs @@ -0,0 +1,43 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Starbound; + +[HarmonyPatch(typeof(AdvantureStarMenu))] +public static class AdvantureStarMenu_Patch +{ + [HarmonyPatch(nameof(AdvantureStarMenu.Awake)), HarmonyPostfix] + private static void Awake(AdvantureStarMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(AdvantureStarMenu.GetNodes)), HarmonyPostfix] + private static void GetNodes(AdvantureStarMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(AdvantureStarMenu.UpdateStarText)), HarmonyPostfix] + private static void UpdateStarText(AdvantureStarMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(AdvantureStarMenu.InitTalents)), HarmonyPostfix] + private static void InitTalents(AdvantureStarMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } + + [HarmonyPatch(nameof(AdvantureStarMenu.ResetAward)), HarmonyPostfix] + private static void ResetAward(AdvantureStarMenu __instance) + { + foreach (var text in __instance.GetComponentsInChildren()) + text.text = StringStore.TranslateText(text.text); + } +} diff --git a/Source/Patches/Modes/Super Editor/CustomButton_enterGame_Patch.cs b/Source/Patches/Modes/Super Editor/CustomButton_enterGame_Patch.cs new file mode 100644 index 0000000..5ce9a45 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomButton_enterGame_Patch.cs @@ -0,0 +1,108 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.Encodings.Web; +using System.Text.Json; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomButton_enterGame))] +public static class CustomButtonEnterGamePatch +{ + [HarmonyPatch(nameof(CustomButton_enterGame.LoadOnlineLevelAsync)), HarmonyPostfix] + public static void LoadOnlineLevelAsync(CustomButton_enterGame __instance) + { + var dumpPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_data.json"); + var dumpData = new Dictionary(); + + if (!File.Exists(dumpPath)) + File.WriteAllText( + dumpPath, + JsonSerializer.Serialize( + dumpData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + + dumpData = JsonSerializer.Deserialize>(File.ReadAllText(dumpPath)); + + var dumpStringsPath = Path.Combine( + FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), + "custom_level_strings.json" + ); + + var dumpStringsData = new Dictionary(); + + if (!File.Exists(dumpStringsPath)) + File.WriteAllText( + dumpStringsPath, + JsonSerializer.Serialize( + dumpStringsData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + + dumpStringsData = JsonSerializer.Deserialize>(File.ReadAllText(dumpStringsPath)); + + if (__instance.onlineLevelInfo != null) + { + var levelId = __instance.onlineLevelInfo.levelId; + + if (levelId != null) + { + var serializedLevel = __instance.serializedLevel; + + if (CustomLevelMenu_Patch.TranslatedLevelData.TryGetValue(levelId, out var levelData)) + { + __instance.levelName.text = levelData.Name; + serializedLevel.name = levelData.Name; + serializedLevel.boardConfig.startTip = levelData.StartTip; + } + else + { + var dumpedLevelData = new TranslatedLevelData( + __instance.onlineLevelInfo.levelName, + serializedLevel.boardConfig.startTip + ); + + dumpData[levelId] = dumpedLevelData; + } + + // foreach(var _ in level.levelData.SerializedLevelData) + } + } + else + __instance.levelName.text = StringStore.TranslateText(__instance.levelName.text); + + File.WriteAllText( + dumpPath, + JsonSerializer.Serialize( + dumpData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + + File.WriteAllText( + dumpStringsPath, + JsonSerializer.Serialize( + dumpStringsData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + } +} diff --git a/Source/Patches/Modes/Super Editor/CustomLevelMenu_Patch.cs b/Source/Patches/Modes/Super Editor/CustomLevelMenu_Patch.cs new file mode 100644 index 0000000..d8b5e13 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomLevelMenu_Patch.cs @@ -0,0 +1,164 @@ +using HarmonyLib; +using Newtonsoft.Json; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.Encodings.Web; +using System.Text.Json; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomLevelMenu))] +public static class CustomLevelMenu_Patch +{ +#pragma warning disable CA2211 + public static float RequestTimer; + + public static Dictionary TranslatedLevelData = new(); +#pragma warning restore CA2211 + [HarmonyPatch(nameof(CustomLevelMenu.LoadOnlineFiles)), HarmonyPostfix] + public static void LoadOnlineFiles(CustomLevelMenu __instance) + { + if (!Core.Instance.ConfigUseLocal.Value) + LoadOnlineData(); + else + LoadLocalData(); + } + + [HarmonyPatch(nameof(CustomLevelMenu.InitLocalWindows)), HarmonyPostfix] + public static void InitWindows(CustomLevelMenu __instance) => TranslateLevelButtons(__instance); + + [HarmonyPatch(nameof(CustomLevelMenu.InitOnlineWindow)), HarmonyPostfix] + public static void InitOnlineWindow(CustomLevelMenu __instance) => TranslateLevelButtons(__instance); + + [HarmonyPatch(nameof(CustomLevelMenu.ReloadFiles)), HarmonyPostfix] + public static void ReloadFiles(CustomLevelMenu __instance) => TranslateLevelButtons(__instance); + + public static void TranslateLevelButtons(CustomLevelMenu __instance) + { + var dumpPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_data.json"); + var dumpData = new Dictionary(); + + if (!File.Exists(dumpPath)) + File.WriteAllText( + dumpPath, + System.Text.Json.JsonSerializer.Serialize( + dumpData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + + foreach (var level in __instance.levels) + if (level.onlineLevelInfo != null) + { + var levelId = level.onlineLevelInfo.levelId; + + if (levelId == null) + continue; + + if (TranslatedLevelData.TryGetValue(levelId, out var levelData)) + { + level.levelName.text = levelData.Name; + level.serializedLevel.name = levelData.Name; + level.serializedLevel.boardConfig.startTip = levelData.StartTip; + } + else + { + var dumpedLevelData = new TranslatedLevelData( + level.onlineLevelInfo.levelName, + level.serializedLevel.boardConfig.startTip + ); + + dumpData.Add(levelId, dumpedLevelData); + } + } + else + level.levelName.text = StringStore.TranslateText(level.levelName.text); + + File.WriteAllText( + dumpPath, + System.Text.Json.JsonSerializer.Serialize( + dumpData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + } + + public static async Task> GetTranslatedLevelData() + { + var levelDataString = await Utils.GetDataFromWeb( + $"https://raw.githubusercontent.com/Teyliu/PVZF-Translation/refs/heads/main/PvZ_Fusion_Translator/Localization/{Utils.Language.ToString()}/Strings/custom_level_data.json" + ); + + if (levelDataString != null) + { + var levelDataJson = JsonConvert.DeserializeObject>(levelDataString); + return levelDataJson; + } + + new CancellationTokenSource().Cancel(); + return null; + } + + public static void LoadOnlineData() + { + if (RequestTimer > 0) + { + Log.LogInfo( + $"Please wait before requesting levels again! Current cooldown: {Math.Round(RequestTimer, 3)}s" + ); + + return; + } + + // 5 seconds between request attempts to prevent any issues with GitHub + RequestTimer = 5f; + TranslatedLevelData = new(); + + var translatedLevelDataRequest = Task.Run(GetTranslatedLevelData); + + if (translatedLevelDataRequest.Result == null) + { + Log.LogError($"Couldn't find level data for {Utils.Language}!"); + return; + } + + TranslatedLevelData = translatedLevelDataRequest.Result; + Log.LogInfo($"Successfully loaded level data for {Utils.Language}!"); + } + + public static void LoadLocalData() + { + TranslatedLevelData = new(); + + var assetDir = Path.Combine( + FileLoader.GetAssetDir(FileLoader.AssetType.Strings, Utils.Language), + "custom_level_data.json" + ); + + if (!File.Exists(assetDir)) + { + File.CreateText(assetDir); + File.WriteAllText(assetDir, "{}"); + } + + var levelDataString = File.ReadAllText(assetDir); + var levelDataJson = JsonConvert.DeserializeObject>(levelDataString); + TranslatedLevelData = levelDataJson; + } +} + +public sealed class TranslatedLevelData(string name, string startTip) +{ + // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global + public string Name { get; set; } = name; + + // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global + public string StartTip { get; set; } = startTip; +} diff --git a/Source/Patches/Modes/Super Editor/CustomMenuPage_event_Patch_B.cs b/Source/Patches/Modes/Super Editor/CustomMenuPage_event_Patch_B.cs new file mode 100644 index 0000000..6b8bb3d --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomMenuPage_event_Patch_B.cs @@ -0,0 +1,17 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomMenuPage_event))] // ReSharper disable once InconsistentNaming +public static class CustomMenuPage_event_Patch +{ + [HarmonyPatch(nameof(CustomMenuPage_event.InitializeNodeEditor)), HarmonyPostfix] + public static void InitializeNodeEditor(CustomMenuPage_event __instance) + { + RuntimeEventNodeEditor_Patch.Update(__instance.nodeEditor); + NodeInfoPanel_Patch.UpdatePanelContent(__instance.nodeInfoPanel); + } +} +#endif diff --git a/Source/Patches/Modes/Super Editor/CustomMenuPage_initZombies_Patch.cs b/Source/Patches/Modes/Super Editor/CustomMenuPage_initZombies_Patch.cs new file mode 100644 index 0000000..de0e9ae --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomMenuPage_initZombies_Patch.cs @@ -0,0 +1,16 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomMenuPage_initZombies))] +public static class CustomMenuPageInitZombiesPatch +{ + [HarmonyPatch(nameof(CustomMenuPage_initZombies.SubWave)), HarmonyPostfix] + public static void SubWave(CustomMenuPage_initZombies __instance) => + __instance.currentWaveText.text = StringStore.TranslateText(__instance.currentWaveText.text); + + [HarmonyPatch(nameof(CustomMenuPage_initZombies.AddWave)), HarmonyPostfix] + public static void AddWave(CustomMenuPage_initZombies __instance) => + __instance.currentWaveText.text = StringStore.TranslateText(__instance.currentWaveText.text); +} diff --git a/Source/Patches/Modes/Super Editor/CustomMenuPage_page3_Patch.cs b/Source/Patches/Modes/Super Editor/CustomMenuPage_page3_Patch.cs new file mode 100644 index 0000000..669e2e1 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomMenuPage_page3_Patch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomMenu_page3))] +public static class CustomMenuPagePage3Patch +{ + [HarmonyPatch(nameof(CustomMenu_page3.UpdateCardsText)), HarmonyPostfix] + public static void UpdateCardsText(CustomMenu_page3 __instance) + { + var plantName = Utils.GetPlantNameFromAlmanac(__instance.nameText.text); + __instance.nameText.text = plantName != "" ? plantName : StringStore.TranslateText(__instance.nameText.text); + } + + [HarmonyPatch(nameof(CustomMenu_page3.UpdateAdvancedInfo)), HarmonyPostfix] + public static void UpdateAdvancedInfo(CustomMenu_page3 __instance) + { + var plantName = Utils.GetPlantNameFromAlmanac(__instance.nameText.text); + __instance.nameText.text = plantName != "" ? plantName : StringStore.TranslateText(__instance.nameText.text); + } +} diff --git a/Source/Patches/Modes/Super Editor/CustomMenuPage_shooting_Patch.cs b/Source/Patches/Modes/Super Editor/CustomMenuPage_shooting_Patch.cs new file mode 100644 index 0000000..4fcb3d2 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomMenuPage_shooting_Patch.cs @@ -0,0 +1,33 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomMenuPage_shooting))] +public static class CustomMenuPageShootingPatch +{ + [HarmonyPatch(nameof(CustomMenuPage_shooting.CreateRoute)), HarmonyPostfix] + public static void CreateRoute(CustomMenuPage_shooting __instance) => TranslateRoutes(__instance); + + [HarmonyPatch(nameof(CustomMenuPage_shooting.CreateStage)), HarmonyPostfix] + public static void CreateStage(CustomMenuPage_shooting __instance) => TranslateRoutes(__instance); + + [HarmonyPatch(nameof(CustomMenuPage_shooting.Awake)), HarmonyPostfix] + public static void Awake(CustomMenuPage_shooting __instance) => TranslateRoutes(__instance); + + [HarmonyPatch(nameof(CustomMenuPage_shooting.SearchRoute)), HarmonyPostfix] + public static void SearchRoute(CustomMenuPage_shooting __instance) => TranslateRoutes(__instance); + + [HarmonyPatch(nameof(CustomMenuPage_shooting.SearchAllRoute)), HarmonyPostfix] + public static void SearchAllRoute(CustomMenuPage_shooting __instance) => TranslateRoutes(__instance); + + public static void TranslateRoutes(CustomMenuPage_shooting __instance) + { + foreach (var text in __instance.scollContent.GetComponentsInChildren()) + if (text.name == "PlantText") + { + var plantName = Utils.GetPlantNameFromAlmanac(text.text); + text.text = plantName != "" ? plantName : StringStore.TranslateText(text.text); + } + } +} diff --git a/Source/Patches/Modes/Super Editor/CustomOnlineMenu_Patch.cs b/Source/Patches/Modes/Super Editor/CustomOnlineMenu_Patch.cs new file mode 100644 index 0000000..9ed876c --- /dev/null +++ b/Source/Patches/Modes/Super Editor/CustomOnlineMenu_Patch.cs @@ -0,0 +1,70 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.Encodings.Web; +using System.Text.Json; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor; + +[HarmonyPatch(typeof(CustomOnlineMenu))] +public static class CustomOnlineMenu_Patch +{ + [HarmonyPatch(nameof(CustomOnlineMenu.EditLevel)), HarmonyPostfix] + public static void EditLevel(CustomOnlineMenu __instance) => TranslateLevelName(__instance); + + [HarmonyPatch(nameof(CustomOnlineMenu.Start)), HarmonyPostfix] + public static void Start(CustomOnlineMenu __instance) => TranslateLevelName(__instance); + + public static void TranslateLevelName(CustomOnlineMenu __instance) + { + var translatedText = StringStore.TranslateText(__instance.title.text); + __instance.title.text = translatedText; + __instance.title2.text = translatedText; + + TranslateLevelData(__instance.levelData); + } + + public static void TranslateLevelData(CustomLevelData levelData) + { + var dumpData = new Dictionary(); + + if (levelData != null) + { + var levelId = levelData.levelId; + + if (levelId != null) + { + if (CustomLevelMenu_Patch.TranslatedLevelData.TryGetValue(levelId, out var translatedLevelData)) + { + levelData.Name = translatedLevelData.Name; + levelData.SerializedLevelData.name = translatedLevelData.Name; + levelData.SerializedLevelData.boardConfig.startTip = translatedLevelData.StartTip; + } + else + { + var dumpedLevelData = new TranslatedLevelData( + levelData.Name, + levelData.SerializedLevelData.boardConfig.startTip + ); + + dumpData.Add(levelId, dumpedLevelData); + } + } + } + else + levelData.Name = StringStore.TranslateText(levelData.Name); + + var dumpPath = Path.Combine(FileLoader.GetAssetDir(FileLoader.AssetType.Dumps), "custom_level_data.json"); + + File.WriteAllText( + dumpPath, + JsonSerializer.Serialize( + dumpData, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + } +} diff --git a/Source/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs b/Source/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs new file mode 100644 index 0000000..c3537fe --- /dev/null +++ b/Source/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeEventNodeEditor_Patch.cs @@ -0,0 +1,43 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.BaseTextObjects; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes; + +[HarmonyPatch(typeof(RuntimeEventNodeEditor))] +public static class RuntimeEventNodeEditor_Patch +{ + public static TMP_FontAsset FontAsset => FontStore.LoadTMPFont(Utils.Language.ToString()); + + [HarmonyPatch(nameof(RuntimeEventNodeEditor.Update)), HarmonyPostfix] + public static void Update(RuntimeEventNodeEditor __instance) + { + // Translate the new screens. (version 3.7) + TranslateFullTransform(__instance.nodeInfoPanel.transform); + TranslateFullTransform(__instance.attributePanel.transform); + TranslateFullTransform(__instance.canvas.transform); + + if (__instance.TryGetComponent(out var eventNodeContextMenu)) + TranslateFullTransform(eventNodeContextMenu.transform); + } + + public static void TranslateFullTransform(Transform transform) + { + if (transform == null) + return; + + foreach (var txt in transform.GetComponentsInChildren()) + { + txt.text = RuntimeNodeUI_Patch.TranslateCodeText(txt.text); + txt.font = FontAsset; + } + + foreach (var inputField in transform.GetComponentsInChildren()) + { + TMP_InputField_Patch.OnEnable(inputField); + + foreach (var txt in inputField.GetComponentsInChildren(true)) + txt.text = RuntimeNodeUI_Patch.TranslateCodeText(txt.text); + } + } +} diff --git a/Source/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs b/Source/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs new file mode 100644 index 0000000..91985f0 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/GameLevel/EventNodes/RuntimeNodeUI_Patch.cs @@ -0,0 +1,119 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.BaseTextObjects; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel.EventNodes; + +[HarmonyPatch(typeof(RuntimeNodeUI))] +public static class RuntimeNodeUI_Patch +{ + [HarmonyPatch(nameof(RuntimeNodeUI.Awake)), HarmonyPatch(nameof(RuntimeNodeUI.CreatePorts)), + HarmonyPatch(nameof(RuntimeNodeUI.CreateValueEditUI)), HarmonyPatch(nameof(RuntimeNodeUI.GetPortUI)), + HarmonyPatch(nameof(RuntimeNodeUI.UpdateDisplay)), HarmonyPatch(nameof(RuntimeNodeUI.UpdateSelectionVisual)), + HarmonyPatch(nameof(RuntimeNodeUI.UpdateVisable)), HarmonyPostfix] + public static void Post_UpdateDisplay(RuntimeNodeUI __instance) + { + if (!__instance.isActiveAndEnabled) + return; + + if (__instance.Node == null) + return; + + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + __instance.titleText.text = TranslateCodeText(__instance.titleText.text); + __instance.titleText.font = fontAsset; + + foreach (var txt in __instance.inputPortsContainer.GetComponentsInChildren()) + { + txt.text = TranslateCodeText(txt.text); + txt.font = fontAsset; + } + + foreach (var txt in __instance.outputPortsContainer.GetComponentsInChildren()) + { + txt.text = TranslateCodeText(txt.text); + txt.font = fontAsset; + } + + if ( + __instance.GetComponentsInChildren().Count == 0 && + __instance.GetComponentsInChildren().Count == 0 && + __instance.Node.nodeType != "PlantTypeValueNode" && + __instance.Node.nodeType != "SinglePlantTypeListNode" && + __instance.Node.nodeType != "ZombieTypeValueNode" + ) + return; + + if (__instance.Node != null) + { + if (__instance.Node.nodeType == "PlantTypeValueNode") + foreach (var txt in __instance.GetComponentsInChildren()) + if (txt.gameObject.name.Contains("Label")) + if (Utils.CheckForUntranslatedText(txt.text)) + { + var castedNode = __instance.Node.TryCast(); + + if (castedNode == null) + continue; + + _ = castedNode.value_PortName; + var plantName = Utils.GetPlantNameFromAlmanac(castedNode.value, true); + txt.text = plantName != "" ? plantName : StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + + if (__instance.Node.nodeType == "SinglePlantTypeListNode") + foreach (var txt in __instance.GetComponentsInChildren()) + if (txt.gameObject.name.Contains("Label")) + if (Utils.CheckForUntranslatedText(txt.text)) + { + var castedNode = __instance.Node.TryCast(); + + if (castedNode == null) + continue; + + _ = castedNode.plantTypeList_PortName; + var plantName = Utils.GetPlantNameFromAlmanac(castedNode.plantType, true); + txt.text = plantName != "" ? plantName : StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + + if (__instance.Node.nodeType == "ZombieTypeValueNode") + foreach (var txt in __instance.GetComponentsInChildren()) + if (txt.gameObject.name.Contains("Label")) + if (Utils.CheckForUntranslatedText(txt.text)) + { + var castedNode = __instance.Node.TryCast(); + + if (castedNode == null) + continue; + + _ = castedNode.value_PortName; + var zombieName = Utils.GetZombieNameFromAlmanac(castedNode.value, true); + txt.text = zombieName != "" ? zombieName : StringStore.TranslateText(txt.text); + txt.font = fontAsset; + } + } + + if (__instance.GetComponentsInChildren().Count > 0) + foreach (var dropdown in __instance.GetComponentsInChildren()) + TMP_Dropdown_Patch.CreateDropdownList(dropdown); + + if (__instance.GetComponentsInChildren().Count <= 0) + return; + + foreach (var inputField in __instance.GetComponentsInChildren()) + { + TMP_InputField_Patch.OnEnable(inputField); + + foreach (var txt in inputField.GetComponentsInChildren(true)) + txt.text = TranslateCodeText(txt.text); + } + } + + public static string TranslateCodeText(string originalText) => + StringStore.TranslationString.ContainsKey(originalText + "_code") + ? StringStore.TranslateText(originalText + "_code") + : StringStore.TranslateText(originalText); +} diff --git a/Source/Patches/Modes/Super Editor/GameLevel/LevelManager_Patch.cs b/Source/Patches/Modes/Super Editor/GameLevel/LevelManager_Patch.cs new file mode 100644 index 0000000..9564f0f --- /dev/null +++ b/Source/Patches/Modes/Super Editor/GameLevel/LevelManager_Patch.cs @@ -0,0 +1,317 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; +using System.Text.Encodings.Web; +using System.Text.Json; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.GameLevel; + +[HarmonyPatch(typeof(LevelManager))] +public static class LevelManager_Patch +{ + [HarmonyPatch(nameof(LevelManager.SaveLevelData)), HarmonyPrefix] + public static void Pre_SaveLevelData(LevelManager __instance, ref SerializedLevelData serializedLevelData) + { + if (serializedLevelData.name == "未命名关卡") + serializedLevelData.name = StringStore.TranslationString.ContainsKey("LEVEL_UNNAMED") + ? StringStore.TranslateText("LEVEL_UNNAMED") + : "Unnamed"; + } + + public static void ExportLevelStrings(SerializedLevelData serializedLevelData) + { + var levelDataString = JsonUtility.ToJson(serializedLevelData); + var referenceLevelData = Newtonsoft.Json.JsonConvert.DeserializeObject(levelDataString); + var eventNodeGraph = serializedLevelData.eventNodeGraph; + eventNodeGraph.BuildCache(); + + var stringValueNodeIds = new List(); + var stringConcatNodeIds = new List(); + var showTextNodeIds = new List(); + var addOptionNodeIds = new List(); + + foreach (var reference in referenceLevelData.References.RefIds) + { + var nodeType = reference.Data.NodeType; + var nodeId = reference.Data.NodeId; + + switch (nodeType) + { + case "ShowTextNode": + if (!showTextNodeIds.Contains(nodeId)) + showTextNodeIds.Add(nodeId); + + break; + case "AddMultipleChoiceOptionNode": + if (!addOptionNodeIds.Contains(nodeId)) + addOptionNodeIds.Add(nodeId); + + break; + } + } + + foreach (var reference in referenceLevelData.References.RefIds) + { + var nodeType = reference.Data.NodeType; + var nodeId = reference.Data.NodeId; + + switch (nodeType) + { + case "StringValueNode": + case "FloatToStringNode": + case "StringConcatNode": + stringValueNodeIds.Add(nodeId); + + if (nodeType == "StringConcatNode") + stringConcatNodeIds.Add(nodeId); + + break; + } + } + + Dictionary> stringConcatNodePairs = new(); + + foreach (var connection in eventNodeGraph.connections) + { + var sourceNodeId = connection.sourceNodeId; + _ = connection.sourcePortName; + var targetNodeId = connection.targetNodeId; + var targetPortName = connection.targetPortName; + + if (!stringValueNodeIds.Contains(sourceNodeId)) + continue; + + if (!stringConcatNodeIds.Contains(targetNodeId)) + continue; + + if (stringConcatNodePairs.ContainsKey(targetNodeId)) + { + var temp = stringConcatNodePairs[targetNodeId]; + + switch (targetPortName) + { + case "A": + temp.Item1 = sourceNodeId; + stringConcatNodePairs[targetNodeId] = temp; + break; + case "B": + temp.Item2 = sourceNodeId; + stringConcatNodePairs[targetNodeId] = temp; + break; + } + } + else + { + stringConcatNodePairs.Add(targetNodeId, new()); + var temp = stringConcatNodePairs[targetNodeId]; + + switch (targetPortName) + { + case "A": + temp.Item1 = sourceNodeId; + stringConcatNodePairs[targetNodeId] = temp; + break; + case "B": + temp.Item2 = sourceNodeId; + stringConcatNodePairs[targetNodeId] = temp; + break; + } + } + } + + string GetStringNodeValue(EventNodeBase eventNodeBase) + { + var stringValue = ""; + + switch (eventNodeBase.nodeType) + { + case "StringValueNode": + var stringNode = eventNodeBase.Cast(); + stringValue = stringNode.value; + break; + case "FloatToStringNode": + stringValue = "([^\\s]+)"; + break; + case "StringConcatNode": + var stringConcatNode = eventNodeBase.Cast(); + stringConcatNode.InitializeConnections(eventNodeGraph); + + stringValue = GetStringNodeValue(stringConcatNode.aSourceNode) + + GetStringNodeValue(stringConcatNode.bSourceNode); + + break; + } + + return stringValue; + } + + var baseDumpDir = FileLoader.GetAssetDir(FileLoader.AssetType.Dumps); + var levelDumpDir = Path.Combine(baseDumpDir, "CustomLevels.json"); + + if (!File.Exists(levelDumpDir)) + File.WriteAllText(levelDumpDir, "{}"); + + var dump = JsonSerializer.Deserialize>(File.ReadAllText(levelDumpDir)); + + foreach (var showTextNode in showTextNodeIds + .Select(showTextNodeId => eventNodeGraph.GetNodeById(showTextNodeId).Cast())) + { + showTextNode.InitializeConnections(eventNodeGraph); + var value = GetStringNodeValue(showTextNode.textSourceNode); + dump.TryAdd(value, value); + } + + foreach (var addOptionNode in addOptionNodeIds.Select( + addOptionId => eventNodeGraph.GetNodeById(addOptionId).Cast() + )) + { + addOptionNode.InitializeConnections(eventNodeGraph); + var titleValue = GetStringNodeValue(addOptionNode.titleSourceNode); + dump.TryAdd(titleValue, titleValue); + var descriptionValue = GetStringNodeValue(addOptionNode.descriptionSourceNode); + dump.TryAdd(descriptionValue, descriptionValue); + } + + File.WriteAllText( + levelDumpDir, + JsonSerializer.Serialize( + dump, + new JsonSerializerOptions + { + WriteIndented = true, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + } + ) + ); + } + + // Reference level data classes. + public sealed class ReferenceLevelData + { + public References References { get; set; } + } + + // ReSharper disable once ClassNeverInstantiated.Global + public sealed class Data + { + public string NodeId { get; set; } + + public string NodeType { get; set; } + + public Position Position { get; set; } + + public string NodeName { get; set; } + + public string PlantPortName { get; set; } + + public string ColumnPortName { get; set; } + + public string RowPortName { get; set; } + + public string PlantTypePortName { get; set; } + + public object Value { get; set; } + + public string ValuePortName { get; set; } + + public string PlantTypeAPortName { get; set; } + + public string PlantTypeBPortName { get; set; } + + public string EqualPortName { get; set; } + + public string TriggerPortName { get; set; } + + public string CountPortName { get; set; } + + public string OutputPortName { get; set; } + + public string IndexPortName { get; set; } + + public string PlantsPortName { get; set; } + + public string PlantListPortName { get; set; } + + public string LoopBodyPortName { get; set; } + + public string CurrentPlantPortName { get; set; } + + public string CurrentIndexPortName { get; set; } + + public string OnCompletedPortName { get; set; } + + public string ConditionPortName { get; set; } + + public string ThenPortName { get; set; } + + public string ElsePortName { get; set; } + + public string APortName { get; set; } + + public string BPortName { get; set; } + + public string ResultPortName { get; set; } + + public string ShouldResetPortName { get; set; } + + public string OnCountPortName { get; set; } + + public int? StartValue { get; set; } + + public string ValueAPortName { get; set; } + + public string ValueBPortName { get; set; } + + public string GreaterPortName { get; set; } + + public string LessPortName { get; set; } + + public string DisplayText { get; set; } + + public double? Duration { get; set; } + + public string TextPortName { get; set; } + + public string DurationPortName { get; set; } + + public string INTPortName { get; set; } + + public string FloatPortName { get; set; } + } + + // ReSharper disable once ClassNeverInstantiated.Global + public sealed class Position + { + public double X { get; set; } + + public double Y { get; set; } + } + + // ReSharper disable once ClassNeverInstantiated.Global + public sealed class References + { + public int Version { get; set; } + + // ReSharper disable once CollectionNeverUpdated.Global + public List RefIds { get; set; } + } + + // ReSharper disable once ClassNeverInstantiated.Global + public sealed class RefId + { + public int Rid { get; set; } + + public Type Type { get; set; } + + public Data Data { get; set; } + } + + // ReSharper disable once ClassNeverInstantiated.Global + public sealed class Type + { + public string Class { get; set; } + + public string Ns { get; set; } + + public string ASM { get; set; } + } +} diff --git a/Source/Patches/Modes/Super Editor/RhythmGame/RhythmGameChartEditorUI_Patch.cs b/Source/Patches/Modes/Super Editor/RhythmGame/RhythmGameChartEditorUI_Patch.cs new file mode 100644 index 0000000..67c9090 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/RhythmGame/RhythmGameChartEditorUI_Patch.cs @@ -0,0 +1,66 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.RhythmGame; + +[HarmonyPatch(typeof(RhythmGameChartEditorUI))] +public static class RhythmGameChartEditorUI_Patch +{ + [HarmonyPatch(nameof(RhythmGameChartEditorUI.Awake)), HarmonyPostfix] + public static void Awake(RhythmGameChartEditorUI __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.GetComponentsInChildren()) + { + txt.font = fontAsset; + + if (!Utils.CheckForUntranslatedText(txt.text)) + continue; + + txt.text = StringStore.TranslateText(txt.text); + } + + foreach (var txt in __instance.dropdown.GetComponentsInChildren(true)) + txt.text = StringStore.TranslateText(txt.text); + } + + [HarmonyPatch(nameof(RhythmGameChartEditorUI.Start)), HarmonyPostfix] + public static void Start(RhythmGameChartEditorUI __instance) => Awake(__instance); + + [HarmonyPatch(nameof(RhythmGameChartEditorUI.InitializeSubSystems)), HarmonyPostfix] + public static void InitializeSubSystems(RhythmGameChartEditorUI __instance) => Awake(__instance); + + [HarmonyPatch(nameof(RhythmGameChartEditorUI.Update)), HarmonyPostfix] + public static void Update(RhythmGameChartEditorUI __instance) + { + var fontAsset = FontStore.LoadTMPFont(Utils.Language.ToString()); + + foreach (var txt in __instance.transform.Find("TopPanel").GetComponentsInChildren()) + { + txt.font = fontAsset; + txt.text = StringStore.TranslateText(txt.text); + } + + foreach (var txt in __instance.transform.GetComponentsInChildren() + .SelectMany( + b => b.GetComponentsInChildren().Where(t => Utils.CheckForUntranslatedText(t.text)) + )) + txt.text = StringStore.TranslateText(txt.text); + + foreach (var txt in __instance.dropdown.GetComponentsInChildren(true) + .Where(txt => Utils.CheckForUntranslatedText(txt.text))) + txt.text = Utils.RemoveSizeTags(StringStore.TranslateText(txt.text)); + } + + [HarmonyPatch(nameof(RhythmGameChartEditorUI.UpdateUI)), HarmonyPostfix] + public static void UpdateUI(RhythmGameChartEditorUI __instance) + { + foreach (var txt in __instance.dropdown.GetComponentsInChildren(true)) + txt.text = StringStore.TranslateText(txt.text); + } + + [HarmonyPatch(nameof(RhythmGameChartEditorUI.UpdateSelectedNoteInfo)), HarmonyPostfix] + public static void UpdateSelectedNoteInfo(RhythmGameChartEditorUI __instance) => + __instance.selectedNoteInfoText.text = StringStore.TranslateText(__instance.selectedNoteInfoText.text); +} diff --git a/Source/Patches/Modes/Super Editor/RhythmGame/RhythmGameManager_Patch.cs b/Source/Patches/Modes/Super Editor/RhythmGame/RhythmGameManager_Patch.cs new file mode 100644 index 0000000..10df0a3 --- /dev/null +++ b/Source/Patches/Modes/Super Editor/RhythmGame/RhythmGameManager_Patch.cs @@ -0,0 +1,44 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.Modes.Super_Editor.RhythmGame; + +[HarmonyPatch(typeof(RhythmGameManager))] +public static class RhythmGameManager_Patch +{ + [HarmonyPatch(nameof(RhythmGameManager.Awake)), HarmonyPatch(nameof(RhythmGameManager.ComboUpdate)), HarmonyPostfix] + public static void Awake(RhythmGameManager __instance) + { + if (!__instance.comboText) + return; + + __instance.comboText.autoSizeTextContainer = false; + __instance.comboText.ForceMeshUpdate(); + } + + [HarmonyPatch(nameof(RhythmGameManager.OnNoteClicked)), HarmonyPostfix] + public static void OnNoteClicked(RhythmGameManager __instance) + { + if (!__instance.particle) + return; + + var txtParticle = __instance.particle.GetComponent(); + + if (!txtParticle) + return; + + var txt = txtParticle.text.GetComponent(); + + if (!txt) + return; + + var originalKey = StringStore.TranslationString.FirstOrDefault(x => x.Value == txt.text).Key; + + txt.text = StringStore.TranslationString.ContainsKey(originalKey + "_RG") + ? StringStore.TranslateText(originalKey + "_RG") + : StringStore.TranslateText(txt.text); + + txt.autoSizeTextContainer = false; + txt.ForceMeshUpdate(); + } +} diff --git a/Source/Patches/OtherManagers/AchievementClip_Patch.cs b/Source/Patches/OtherManagers/AchievementClip_Patch.cs new file mode 100644 index 0000000..b60aad6 --- /dev/null +++ b/Source/Patches/OtherManagers/AchievementClip_Patch.cs @@ -0,0 +1,63 @@ +#if false +using HarmonyLib; +using Newtonsoft.Json; +using PvZ_Fusion_Translator.AssetStore; +using static PvZ_Fusion_Translator.FileLoader; +using static PvZ_Fusion_Translator.Patches.Managers.AlmanacPlantBank_Patch; + +namespace PvZ_Fusion_Translator.Patches.OtherManagers; + +[HarmonyPatch(typeof(AchievementClip))] +public static class AchievementClip_Patch +{ + [HarmonyPatch(nameof(AchievementClip.Start)), HarmonyPostfix] + private static void Start(AchievementClip __instance) + { + var (achievementDir, fontAsset) = ModFeatures.IsMultiLanguage + ? (GetAssetDir(AssetType.Almanac, Utils.Language), FontStore.LoadTMPFont(Utils.Language.ToString())) + : (GetAssetDir(AssetType.Almanac), FontStore.LoadTMPFont()); + + var path = Path.Combine(achievementDir, "AchievementsTextTranslate.json"); + + if (!File.Exists(path)) + return; + + var json = File.ReadAllText(path); + + Dictionary achievementsTexts = + new Dictionary(); + + achievementsTexts = JsonConvert.DeserializeObject>(json); + + TextMeshProUGUI text1 = __instance.introduce.transform.GetChild(1).GetComponent(); + TextMeshProUGUI text2 = __instance.introduce.transform.GetChild(2).GetComponent(); + TextMeshProUGUI name1 = __instance.image.transform.GetChild(0).GetComponent(); + + text1.text = achievementsTexts[__instance._index].Name; + text1.font = fontAsset; + text2.text = achievementsTexts[__instance._index].Name; + text2.font = fontAsset; + name1.text = achievementsTexts[__instance._index].Text; + name1.font = fontAsset; + } +} + +// ReSharper disable once ClassNeverInstantiated.Global +public sealed class AchievementObject +{ + public Achievement achievement { get; set; } + + // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global + public string Name { get; set; } + + // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global + public string Text { get; set; } + + public AchievementObject(Achievement achievement = Achievement.Welcome, string name = "", string text = "") + { + this.achievement = achievement; + Name = name; + Text = text; + } +} +#endif diff --git a/Source/Patches/OtherManagers/GardenUI_Patch.cs b/Source/Patches/OtherManagers/GardenUI_Patch.cs new file mode 100644 index 0000000..bd4594a --- /dev/null +++ b/Source/Patches/OtherManagers/GardenUI_Patch.cs @@ -0,0 +1,12 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.OtherManagers; + +[HarmonyPatch(typeof(GardenUI))] +public static class GardenUI_Patch +{ + [HarmonyPatch(nameof(GardenUI.Update)), HarmonyPostfix] + public static void Update(GardenUI __instance) => + __instance.currentPageText = StringStore.TranslateText(__instance.currentPageText); +} diff --git a/Source/Patches/OtherManagers/MenuText_Patch.cs b/Source/Patches/OtherManagers/MenuText_Patch.cs new file mode 100644 index 0000000..930b1f8 --- /dev/null +++ b/Source/Patches/OtherManagers/MenuText_Patch.cs @@ -0,0 +1,19 @@ +#if false +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.OtherManagers; + +[HarmonyPatch(typeof(MenuText))] +public static class MenuText_Patch +{ + [HarmonyPatch(nameof(MenuText.UpdateText), typeof(string)), HarmonyPostfix] + private static void UpdateTextPatch(MenuText __instance) + { + var text1 = __instance.transform.GetChild(0).Find("text1").GetComponent(); + text1.text = StringStore.TranslateText(text1.text); + var text = __instance.transform.GetChild(0).Find("text").GetComponent(); + text.text = StringStore.TranslateText(text1.text); + } +} +#endif diff --git a/Source/Patches/OtherManagers/ThanksMenu_Patch.cs b/Source/Patches/OtherManagers/ThanksMenu_Patch.cs new file mode 100644 index 0000000..07510fa --- /dev/null +++ b/Source/Patches/OtherManagers/ThanksMenu_Patch.cs @@ -0,0 +1,20 @@ +using HarmonyLib; +using PvZ_Fusion_Translator.AssetStore; + +namespace PvZ_Fusion_Translator.Patches.OtherManagers; + +[HarmonyPatch(typeof(ThanksMenu))] +public class ThanksMenu_Patch +{ + [HarmonyPostfix, HarmonyPatch(nameof(ThanksMenu.Update))] + private static void Update(ThanksMenu __instance) + { + var textTransform = __instance.transform.GetChild(0).GetComponent(); + + if (textTransform == null) + return; + + textTransform.text = StringStore.TranslateText(textTransform.text); + textTransform.autoSizeTextContainer = true; + } +} diff --git a/Source/PvZ Fusion Translator.csproj b/Source/PvZ Fusion Translator.csproj new file mode 100644 index 0000000..dee6099 --- /dev/null +++ b/Source/PvZ Fusion Translator.csproj @@ -0,0 +1,64 @@ + + + disable + false + latest + 1.0.0.0 + /home/emik/PvZ + enable + en-US + net6.0 + 1.0.0.0 + true + PvZ_Fusion_Translator + PvZ_Fusion_Translator + false + BepInEx + + + $(DefineConstants);BEPINEX + + https://api.nuget.org/v3/index.json; + https://nuget.bepinex.dev/v3/index.json; + https://nuget.samboy.dev/v3/index.json + + + + $(DefineConstants);MELONLOADER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Utils.cs b/Source/Utils.cs new file mode 100644 index 0000000..5a85263 --- /dev/null +++ b/Source/Utils.cs @@ -0,0 +1,708 @@ +using PvZ_Fusion_Translator.AssetStore; +using PvZ_Fusion_Translator.Patches.GameObjects; +using PvZ_Fusion_Translator.Patches.GameObjects.ButtonObjects; +using PvZ_Fusion_Translator.Patches.GameObjects.MinorObjects; +using System.Diagnostics; +using System.Reflection; +using System.Text.RegularExpressions; +using UnityEngine.Experimental.Rendering; +using UnityEngine.UI; + +namespace PvZ_Fusion_Translator; + +public static class Utils +{ + internal static bool TryReplaceTexture2D(Texture2D ogTexture) + { + if (ogTexture == null) + return false; + + if (!TextureStore.TextureDict.TryGetValue(ogTexture.name, out var textureData)) + return false; + + try + { + ImageConversion.LoadImage(ogTexture, textureData); + + Log.LogDebug("OK! Replaced Texture " + ogTexture.name); + + ogTexture.name = "replaced_" + ogTexture.name; + return true; + } + catch (Exception ex) + { + Log.LogError("Failed to replace texture: " + ogTexture.name); + Log.LogError(ex.ToString()); + } + + return false; + } + + internal static Texture2D LoadImage(string path) + { + if (!File.Exists(path)) + throw new FileNotFoundException($"The image file at path '{path}' does not exist."); + + var array = File.ReadAllBytes(path); + + Texture2D texture2D = new( + 2, + 2, + GraphicsFormat.R8G8B8A8_UNorm, + TextureCreationFlags.None, + 1, + IntPtr.Zero, + null + ); + + ImageConversion.LoadImage(texture2D, array); + return texture2D; + } + + internal static Texture2D LoadImage(byte[] bytes) + { + if (bytes == null) + throw new FileNotFoundException("Byte array was null."); + + Texture2D texture2D = new( + 2, + 2, + GraphicsFormat.R8G8B8A8_UNorm, + TextureCreationFlags.None, + 1, + IntPtr.Zero, + null + ); + + ImageConversion.LoadImage(texture2D, bytes); + return texture2D; + } + + public static Color HexToColor(string hex) + { + var r = int.Parse(hex.TrimStart("#")[..2], System.Globalization.NumberStyles.HexNumber) / 255f; + var g = int.Parse(hex.TrimStart("#")[2..4], System.Globalization.NumberStyles.HexNumber) / 255f; + var b = int.Parse(hex.TrimStart("#")[4..6], System.Globalization.NumberStyles.HexNumber) / 255f; + return new(r, g, b); + } + + public static void OpenSaveDirectory() + { + var saveDirectory = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + "AppData", + "LocalLow", + "LanPiaoPiao", + "PlantsVsZombiesRH" + ); + + Process.Start("explorer.exe", saveDirectory); + } + + public static void OpenOnlineAlmanac() + { + const string Website = "https://carroti4ch.itch.io/almanac"; + Process.Start(new ProcessStartInfo(Website) { UseShellExecute = true }); + } + + public static string RemoveColorTags(string text) + { + if (string.IsNullOrEmpty(text)) + return text ?? string.Empty; + + // Remove opening color tags like + var withoutOpenTags = Regex.Replace(text, "]+>", string.Empty, RegexOptions.IgnoreCase); + // Remove closing color tags like + var withoutCloseTags = Regex.Replace(withoutOpenTags, "", string.Empty, RegexOptions.IgnoreCase); + return withoutCloseTags; + } + + public static string RemoveSizeTags(string text) + { + if (string.IsNullOrEmpty(text)) + return text ?? string.Empty; + + // Remove opening size tags like + var withoutOpenTags = Regex.Replace(text, "]+>", string.Empty, RegexOptions.IgnoreCase); + // Remove closing size tags like + var withoutCloseTags = Regex.Replace(withoutOpenTags, "", string.Empty, RegexOptions.IgnoreCase); + return withoutCloseTags; + } + + public static string RemoveFormatTags(string text) + { + if (string.IsNullOrEmpty(text)) + return text ?? string.Empty; + + var withoutUnderlineTags = Regex.Replace(text, "", string.Empty, RegexOptions.IgnoreCase); + + var withoutUnderlineCloseTags = Regex.Replace( + withoutUnderlineTags, + "", + string.Empty, + RegexOptions.IgnoreCase + ); + + var withoutItalicTags = Regex.Replace( + withoutUnderlineCloseTags, + "", + string.Empty, + RegexOptions.IgnoreCase + ); + + var withoutItalicCloseTags = Regex.Replace( + withoutItalicTags, + "", + string.Empty, + RegexOptions.IgnoreCase + ); + + return withoutItalicCloseTags; + } + + public static string RemoveAllTags(string text) + { + if (string.IsNullOrEmpty(text)) + return text ?? string.Empty; + + return RemoveColorTags(RemoveSizeTags(RemoveFormatTags(text))); + } + + public static GameObject ConvertToTextMeshProUGUI(GameObject originalText, Transform parent, string name) + { + GameObject newObj = new(name) + { + transform = + { + position = originalText.transform.position, + }, + }; + + newObj.AddComponent(); + newObj.AddComponent(); + newObj.AddComponent(); + newObj.transform.SetParent(parent); + newObj.transform.localScale = Vector3.one; + + UnityEngine.Object.Destroy(originalText); + return newObj; + } + + public static void ConvertButtonText(Transform original, string name) + { + var fontAsset = FontStore.LoadTMPFont(Language.ToString()); + + var transform = original.FindChild(name); + var textTransform = transform.FindChild("text"); + var text = textTransform.GetComponent().text; + var color = textTransform.GetComponent().color; + + var newGoBackText = ConvertToTextMeshProUGUI(textTransform.gameObject, transform, "text2") + .GetComponent(); + + newGoBackText.autoSizeTextContainer = true; + newGoBackText.text = StringStore.TranslateText(text, false); + newGoBackText.font = fontAsset; + newGoBackText.color = color; + } + + public static string GetPlantNameFromAlmanac(PlantType thePlantType, bool removeTags = false, bool log = false) + { + var foundPlantName = false; + var thePlantName = ""; + + if (PlantIndices.ContainsKey((int)thePlantType)) + { + foundPlantName = true; + thePlantName = PlantIndices[(int)thePlantType].Value; + } + + if (!foundPlantName) + { + if (log) + Log.LogInfo("Couldn't find plant name!"); + + thePlantName = ""; + } + + thePlantName = removeTags ? RemoveAllTags(thePlantName) : thePlantName; + + return thePlantName; + } + + public static string GetPlantNameFromAlmanac( + string theOriginalPlantName, + bool removeTags = false, + bool log = false + ) + { + var foundPlantName = false; + var thePlantName = ""; + + if (PlantIndiceString.TryGetValue(theOriginalPlantName, out var value)) + { + foundPlantName = true; + thePlantName = value; + } + + if (!foundPlantName) + { + if (log) + Log.LogInfo("Couldn't find plant name!"); + + thePlantName = ""; + } + + thePlantName = removeTags ? RemoveAllTags(thePlantName) : thePlantName; + + return thePlantName; + } + + public static string GetZombieNameFromAlmanac(ZombieType theZombieType, bool removeTags = false) + { + var theZombieName = ""; + + var currentLanguage = Language.ToString(); + + var json = AlmanacZombieMenu_Patch.AlmanacJson; + var zombieData = JsonUtility.FromJson(json); + + foreach (var zombieInfo in zombieData.zombies) + if ((int)zombieInfo.theZombieType == (int)theZombieType) + theZombieName = zombieInfo.name; + + theZombieName = removeTags ? RemoveAllTags(theZombieName) : theZombieName; + + return theZombieName; + } + + public static Dictionary> PlantIndices = new(); + + public static Dictionary PlantIndiceString = new(); + + public static void RegisterPlantIndices() + { + PlantIndices = new(); + PlantIndiceString = new(); + string originalJson; + string translatedJson; + + var currentLanguage = Language.ToString(); + var almanacDir = FileLoader.GetAssetDir(FileLoader.AssetType.Almanac, Language); + var dumpDir = FileLoader.GetAssetDir(FileLoader.AssetType.Dumps); + var originalPath = Path.Combine(dumpDir, "LawnStrings.json"); + var path = Path.Combine(almanacDir, "LawnStringsTranslate.json"); + + if (!File.Exists(originalPath)) + Log.LogError($"LawnStrings.json file not found at path: {originalPath}"); + else + try + { + originalJson = File.ReadAllText(originalPath); + translatedJson = AlmanacPlantMenu_Patch.AlmanacJson; + + var originalPlantData = JsonUtility.FromJson(originalJson); + var translatedPlantData = JsonUtility.FromJson(translatedJson); + + foreach (var originalPlantInfo in originalPlantData.plants) + { + if (!PlantIndiceString.ContainsKey(originalPlantInfo.name)) + PlantIndiceString.Add(originalPlantInfo.name, originalPlantInfo.name); + + Il2CppPlantInfo translatedPlantInfo = null; + + foreach (var info in translatedPlantData.plants) + if (info.seedType == originalPlantInfo.seedType) + translatedPlantInfo = info; + + if (translatedPlantInfo != null) + if (translatedPlantInfo.name != null) + { + var temp = new KeyValuePair( + translatedPlantInfo.seedType, + translatedPlantInfo.name + ); + + PlantIndices.Add(originalPlantInfo.seedType, temp); + PlantIndiceString[originalPlantInfo.name] = translatedPlantInfo.name; + } + } + } + catch (Exception e) + { + Log.LogError(e); + } + } + + public static void TryAdd(Dictionary dict, TA key, TB val) + { + if (dict.ContainsKey(key)) + dict[key] = val; + else + dict.Add(key, val); + } + + public static void TryAdd(SortedDictionary dict, TA key, TB val) + { + if (dict.ContainsKey(key)) + dict[key] = val; + else + dict.Add(key, val); + } + + public static AssetBundle GetAssetBundle(Assembly assembly, string assetBundlePath, bool log = false) + { + try + { + if (assembly != null) + { + var manifestResourceStream = + assembly.GetManifestResourceStream($"PvZ_Fusion_Translator.Resources.{assetBundlePath}"); + + using (manifestResourceStream) + { + if (manifestResourceStream == null) + throw new("Stream was null."); + + var array = new byte[manifestResourceStream.Length]; + _ = manifestResourceStream.Read(array, 0, array.Length); + var assetBundle = AssetBundle.LoadFromMemory(array); + ArgumentNullException.ThrowIfNull(assetBundle, "assetBundle"); + + if (log) + Log.LogDebug($"AssetBundle {assetBundlePath} has successfully been loaded."); + + return assetBundle; + } + } + + throw new($"AssetBundle {assetBundlePath} was null."); + } + catch (Exception value) + { + throw new ArgumentException($"Failed to load {assetBundlePath}. \n{value}"); + } + } + + public static AssetBundle GetAssetBundle(string path) + { + var assetBundle = AssetBundle.LoadFromFile(path); + return assetBundle; + } + + /*public static Dictionary> recipeLinks = new Dictionary>(); + + public static void RegisterRecipeLinks() + { + recipeLinks.Clear(); + + Il2CppSystem.Array mixData = MixData.data.Cast(); + int rows = mixData.GetLength(0); + int columns = mixData.GetLength(1); + + foreach (PlantType plantType in Enum.GetValues(typeof(PlantType))) + { + int seedType = (int)plantType; + + recipeLinks.Add(seedType, new()); + + if (seedType > 0) + { + foreach (PlantType checkType in Enum.GetValues(typeof(PlantType))) + { + if (checkType > 0) + { + int[] checks = [mixData.GetValue(seedType, (int)checkType).Unbox(), mixData.GetValue((int)checkType, seedType).Unbox()]; + + if (checks[0] != 0) + { + recipeLinks[seedType].Add(checks[0]); + } + + if (checks[1] != 0) + { + recipeLinks[seedType].Add(checks[1]); + } + } + } + } + if (recipeLinks[seedType].Count > 0) + { + Log.LogDebug($"Found {recipeLinks[seedType].Count} fusions for {seedType}!"); + } + } + }*/ + + public static readonly Regex UntranslatedRegex = new("\\p{IsCJKUnifiedIdeographs}+"); + + public static bool CheckForUntranslatedText(string text) + { + try + { + var match = UntranslatedRegex.Match(text); + return match.Success; + } + catch (Exception e) + { + Log.LogError(e); + } + + return false; + } + + public static void WarnLocalData() + { + var newMenu = GameAPP.UIManager.Push(UIType.ConfirmMenu, GameAPP.canvasUp); + var confirmMenu = newMenu.gameObject.GetComponent(); + + var modeTo = Core.Instance.ConfigUseLocal.Value ? "online mode" : "local mode"; + + confirmMenu.SetTitle( + $"WARNING: This button is meant for translator testing and can overwrite/interfere with the translation files saved in your installation. Proceed with caution. You are switching to {modeTo}.\nOnline Mode: Default, strings will auto-sync with the latest version when opening the game\nLocal Mode: Strings are only loaded from your installaion and do not update (meant for translators)" + ); + + confirmMenu.transform.Find("window/text").GetComponent().text = RemoveColorTags( + confirmMenu.transform.Find("window/text").GetComponent().text + ); + + var confirmButton = confirmMenu.transform.Find("Image").GetComponent(); + _ = confirmMenu.transform.Find("Image2").GetComponent(); + + confirmButton.clickEvent = new(); + confirmButton.clickEvent.AddListener(new Action(SwapLocalData)); + confirmButton.clickEvent.AddListener(new Action(CursorChange.SetDefaultCursor)); + confirmButton.clickEvent.AddListener(new Action(() => GameAPP.UIManager.Pop())); + } + + public static void SwapLocalData() + { + Core.Instance.ConfigUseLocal.Value = !Core.Instance.ConfigUseLocal.Value; + ChangeLanguage(Language.ToString()); + var sourceMsg = $"Translation Source:\n{(Core.Instance.ConfigUseLocal.Value ? "Local" : "Online")}"; + OptLanguageBtn_Patch.FlashMessage(OptLanguageBtn_Patch.ToggleSlots[2], sourceMsg, 0.1f, false); + CursorChange.SetDefaultCursor(); + } + + public static async Task GetDataFromWeb(string url, bool isLog = true) + { + if (isLog) + Log.LogInfo($"Attempting to read {url}"); + + var client = new HttpClient(); + + try + { + var dataRequest = await client.GetAsync(url); + + if (dataRequest.StatusCode == System.Net.HttpStatusCode.OK) + { + if (isLog) + Log.LogInfo($"Successfully loaded data from {url}!"); + + var content = await dataRequest.Content.ReadAsStringAsync(); + return content; + } + + if (isLog) + { + Log.LogError($"Failed to load data from {url}! Falling back..."); + Log.LogError($"Status code: {dataRequest.StatusCode}"); + } + + new CancellationTokenSource().Cancel(); + return null; + } + catch (Exception ex) + { + Log.LogError($"Failed to load data from {url}! Falling back..."); + Log.LogError(ex); + new CancellationTokenSource().Cancel(); + return null; + } + } + + public static async Task GetByteDataFromWeb(string url, bool isLog = true) + { + if (isLog) + Log.LogInfo($"Attempting to read {url}"); + + var client = new HttpClient(); + + try + { + var dataRequest = await client.GetAsync(url); + + if (dataRequest.StatusCode == System.Net.HttpStatusCode.OK) + { + if (isLog) + Log.LogInfo($"Successfully loaded data from {url}!"); + + var content = await dataRequest.Content.ReadAsByteArrayAsync(); + return content; + } + + if (isLog) + { + Log.LogError($"Failed to load data from {url}! Falling back..."); + Log.LogError($"Status code: {dataRequest.StatusCode}"); + } + + new CancellationTokenSource().Cancel(); + return null; + } + catch (Exception ex) + { + Log.LogError($"Failed to load data from {url}! Falling back..."); + Log.LogError(ex); + new CancellationTokenSource().Cancel(); + return null; + } + } + + public static async Task GetDataFromWebWithInput(string url, bool isLog = true) + { + if (isLog) + Log.LogInfo($"Attempting to read {url}"); + + var client = new HttpClient(); + + using var request = new HttpRequestMessage + { + Method = HttpMethod.Get, + RequestUri = new(url), + }; + + request.Headers.Add("Accept", "*/*"); + request.Headers.Add("Accept-Encoding", "gzip, deflate, br"); + request.Headers.Add("User-Agent", "TranslatorMod"); + + var dataRequest = await client.SendAsync(request); + + if (dataRequest.StatusCode == System.Net.HttpStatusCode.OK) + { + if (isLog) + Log.LogInfo($"Successfully loaded data from {url}!"); + + var content = await dataRequest.Content.ReadAsStringAsync(); + return content; + } + + if (isLog) + { + Log.LogError($"Failed to load data from {url}! Falling back..."); + Log.LogError($"Status code: {dataRequest.StatusCode}"); + } + + new CancellationTokenSource().Cancel(); + return null; + } + + public static int CalculateGameVersion(string gameVersion) + { + var res = 0; + var gameVersionParts = gameVersion.Split('.'); + + var startingPower = (int)Math.Max(gameVersionParts.Length, 3); + + for (var i = 0; i < startingPower; i++) + { + var factor = 0; + + if (i < gameVersionParts.Length) + factor = int.Parse(gameVersionParts[i]); + + var power = startingPower - i; + res += factor * (int)Math.Pow(10, power - 1); + } + + return res; + } + + internal static void ChangeLanguage(string language) + { + UnityEngine.Debug.Assert(ModFeatures.IsMultiLanguage, nameof(ModFeatures.IsMultiLanguage)); + OldLanguage = Language; + + if (Enum.TryParse(language, out LanguageEnum lang)) + Language = lang; + else + // Handle invalid language string + Log.LogError($"Invalid language string: {language}"); + + //WarningStore.isWarningMessageLoaded = false; + FontStore.Reload(); + StringStore.Reload(); + TextureStore.Reload(); + FileLoader.SaveLanguage(); + RegisterPlantIndices(); + Zombie_Patch.LoadHpStrings(); + } + + public static LanguageEnum OldLanguage; + public static LanguageEnum Language; + + public enum LanguageEnum + { + // first column + English, + ChineseCn, + French, + + //Italian, + German, + Spanish, + + // second column + //Portuguese, + //Javanese, + //Filipino, + Vietnamese, + Indonesian, + + //Russian, //NOTE: legacy language + Japanese, + + // third column + Korean, + Ukrainian, + + // Slovak, + //Polish, + //Turkish, + Arabic, + Romanian, + + LangEnd, + } + + public static Dictionary LanguageNames = new() + { + { LanguageEnum.English, "English" }, + { LanguageEnum.ChineseCn, "简体中文" }, + { LanguageEnum.French, "Français" }, + { LanguageEnum.German, "Deutsch" }, + { LanguageEnum.Spanish, "Español" }, + { LanguageEnum.Vietnamese, "Tiếng Việt" }, + { LanguageEnum.Indonesian, "Bahasa Indonesia" }, + { LanguageEnum.Japanese, "日本語" }, + { LanguageEnum.Korean, "한국어" }, + { LanguageEnum.Ukrainian, "українська" }, + { LanguageEnum.Arabic, "ﺔﻴﺑﺮﻌﻟا" }, + { LanguageEnum.Romanian, "Română" }, + }; + + public static Dictionary ToggleNames = new() + { + { ToggleEnum.Textures, "Change Texture\nSource" }, + { ToggleEnum.Audio, "Change Audio\nSource" }, + { ToggleEnum.SwapLocal, "Change Translation\nSource" }, + }; + + public enum ToggleEnum + { + Textures, + Audio, + SwapLocal, + ToggleEnd, + } +} diff --git a/Source/bin/BepInEx/net6.0/Assembly-CSharp.dll b/Source/bin/BepInEx/net6.0/Assembly-CSharp.dll new file mode 100644 index 0000000..85ec1c3 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Assembly-CSharp.dll differ diff --git a/BepInEx/Dependencies/AudioImportLib.BepInEx.dll b/Source/bin/BepInEx/net6.0/AudioImportLib.BepInEx.dll similarity index 92% rename from BepInEx/Dependencies/AudioImportLib.BepInEx.dll rename to Source/bin/BepInEx/net6.0/AudioImportLib.BepInEx.dll index 2e87423..c155551 100644 Binary files a/BepInEx/Dependencies/AudioImportLib.BepInEx.dll and b/Source/bin/BepInEx/net6.0/AudioImportLib.BepInEx.dll differ diff --git a/Source/bin/BepInEx/net6.0/BepInEx.Preloader.Core.dll b/Source/bin/BepInEx/net6.0/BepInEx.Preloader.Core.dll new file mode 100644 index 0000000..d33913e Binary files /dev/null and b/Source/bin/BepInEx/net6.0/BepInEx.Preloader.Core.dll differ diff --git a/Source/bin/BepInEx/net6.0/BepInEx.Preloader.Core.xml b/Source/bin/BepInEx/net6.0/BepInEx.Preloader.Core.xml new file mode 100644 index 0000000..c591252 --- /dev/null +++ b/Source/bin/BepInEx/net6.0/BepInEx.Preloader.Core.xml @@ -0,0 +1,313 @@ + + + + BepInEx.Preloader.Core + + + + + + + + Doorstop environment variables, passed into the BepInEx preloader. + https://github.com/NeighTools/UnityDoorstop/wiki#environment-variables + + + + + Path to the assembly that was invoked via Doorstop. Contains the same value as in "targetAssembly" configuration + option in the config file. + + + + + Full path to the game's "Managed" folder that contains all the game's managed assemblies + + + + + Full path to the game executable currently running. + + + + + Array of paths where Mono searches DLLs from before assembly resolvers are invoked. + + + + + Path of the DLL that contains mono imports. + + + + + Log listener that listens to logs during preloading time and buffers messages for output in Unity logs later. + + + + + A list of all objects that this listener has received. + + + + + + + + + + + + + + Worker class which is used for loading and patching entire folders of assemblies, or alternatively patching and + loading assemblies one at a time. + + + + + The context of this assembly patcher instance that is passed to all patcher plugins. + + + + + A cloned version of to ensure that any foreach loops do not break when the collection + gets modified. + + + + + Performs work to dispose collection objects. + + + + + Adds all patchers from all managed assemblies specified in a directory. + + Directory to search patcher DLLs from. + + + + Adds all .dll assemblies in given directories to be patched and loaded by this patcher instance. Non-managed + assemblies + are skipped. + + The directories to search. + + + + Adds all assemblies in given directories to be patched and loaded by this patcher instance. Non-managed assemblies + are + skipped. + + The directory to search. + The file extensions to attempt to load. + + + + Attempts to load a managed assembly as an . Returns true if successful. + + The path of the assembly. + The loaded assembly. Null if not successful in loading. + + + + Applies patchers to all assemblies loaded into this assembly patcher and then loads patched assemblies into memory. + + + + + This attribute denotes that a class is a patcher plugin, and specifies the required metadata. + + + + The unique identifier of the plugin. Should not change between plugin versions. + The user friendly name of the plugin. Is able to be changed between versions. + The specific version of the plugin. + + + + The unique identifier of the plugin. Should not change between plugin versions. + + + + + The user friendly name of the plugin. Is able to be changed between versions. + + + + + The specific version of the plugin. + + + + + Defines an assembly that a patch method will target. + + + + + Marker used to indicate all possible assemblies to be targeted by a patch method. + + + + + The short filename of the assembly. Use to mark all possible + assemblies as targets. + + + + + The short filename of the assembly to target. + + + + + Defines a type that a patch method will target. + + + + The short filename of the assembly of which belongs to. + The full name of the type to target for patching. + + + + The short filename of the assembly to target. + + + + + The full name of the type to target for patching. + + + + + A patcher that can contain multiple methods for patching assemblies. + + + + + A instance created for use by this patcher plugin. + + + + + A configuration file binding created with the of this plugin as the + filename. + + + + + Metadata associated with this patcher plugin. + + + + + The context of the this BasePatcher is associated with. + + + + + Executed before any patches from any plugin are applied. + + + + + Executed after all patches from all plugins have been applied. + + + + + A definition of an individual patch for use by . + + + + + The assembly / assemblies this patch will target, if there any. + + + + + The type / types this patch will target, if there are any. + + + + + The instance of the this originates from. + + + + + The method that will perform the patching logic defined by this instance. + + + + + A friendly name for this patch definition, for use in logging and error tracking. + + + + + Context provided to patcher plugins from the associated patcher engine. + + + + + Contains a list of assemblies that will be patched and loaded into the runtime. + + The dictionary has the name of the file, without any directories. These are used by the dumping + functionality, and as such, these are also required to be unique. They do not have to be exactly the same as + the real filename, however they have to be mapped deterministically. + + Order is not respected, as it will be sorted by dependencies. + + + + + Contains a mapping of available assembly name to their original filenames. + + + + + Contains a dictionary of assemblies that have been loaded as part of executing this assembly patcher. + + The key is the same key as used in , while the value is the actual assembly + itself. + + + + + + A list of plugins that will be initialized and executed, in the order of the list. + + + + + A list of individual patches that will execute, generated by parsing + . + + + + + + A single cached assembly patcher. + + + + + Type name of the patcher. + + + + + + + + + + + Recreation of MonoMod's PlatformHelper.DeterminePlatform method, but with libc calls instead of creating processes. + + + + diff --git a/Source/bin/BepInEx/net6.0/Core.dll b/Source/bin/BepInEx/net6.0/Core.dll new file mode 100644 index 0000000..fd1ae8c Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Core.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppMono.Security.dll b/Source/bin/BepInEx/net6.0/Il2CppMono.Security.dll new file mode 100644 index 0000000..c4625cc Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppMono.Security.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Configuration.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Configuration.dll new file mode 100644 index 0000000..76481cc Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Configuration.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Core.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Core.dll new file mode 100644 index 0000000..e71fbac Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Core.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Data.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Data.dll new file mode 100644 index 0000000..e65e728 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Data.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Drawing.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Drawing.dll new file mode 100644 index 0000000..478d853 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Drawing.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Numerics.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Numerics.dll new file mode 100644 index 0000000..21afd1a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Numerics.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Runtime.Serialization.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Runtime.Serialization.dll new file mode 100644 index 0000000..631f994 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Runtime.Serialization.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Xml.Linq.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Xml.Linq.dll new file mode 100644 index 0000000..eade543 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Xml.Linq.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.Xml.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.Xml.dll new file mode 100644 index 0000000..38cf759 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.Xml.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2CppSystem.dll b/Source/bin/BepInEx/net6.0/Il2CppSystem.dll new file mode 100644 index 0000000..596f481 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2CppSystem.dll differ diff --git a/Source/bin/BepInEx/net6.0/Il2Cppmscorlib.dll b/Source/bin/BepInEx/net6.0/Il2Cppmscorlib.dll new file mode 100644 index 0000000..513e529 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Il2Cppmscorlib.dll differ diff --git a/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.deps.json b/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.deps.json new file mode 100644 index 0000000..a026da2 --- /dev/null +++ b/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.deps.json @@ -0,0 +1,2692 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": { + "PvZ_Fusion_Translator/1.0.0": { + "dependencies": { + "BepInEx.PluginInfoProps": "2.1.0", + "BepInEx.Unity.IL2CPP": "6.0.0-be.790", + "Newtonsoft.Json": "13.0.3", + "Assembly-CSharp": "0.0.0.0", + "AudioImportLib.BepInEx": "1.0.0.0", + "BepInEx.Preloader.Core": "6.0.0.0", + "Core": "0.0.0.0", + "Il2CppMono.Security": "4.0.0.0", + "Il2Cppmscorlib": "4.0.0.0", + "Il2CppSystem.Configuration": "4.0.0.0", + "Il2CppSystem.Core": "4.0.0.0", + "Il2CppSystem.Data": "4.0.0.0", + "Il2CppSystem": "4.0.0.0", + "Il2CppSystem.Drawing": "4.0.0.0", + "Il2CppSystem.Numerics": "4.0.0.0", + "Il2CppSystem.Runtime.Serialization": "4.0.0.0", + "Il2CppSystem.Xml": "4.0.0.0", + "Il2CppSystem.Xml.Linq": "4.0.0.0", + "SimpleFileBrowser.Runtime": "0.0.0.0", + "spine-csharp": "0.0.0.0", + "spine-unity": "0.0.0.0", + "UniTask": "0.0.0.0", + "Unity.2D.Animation.Runtime": "0.0.0.0", + "Unity.2D.Common.Runtime": "0.0.0.0", + "Unity.2D.SpriteShape.Runtime": "0.0.0.0", + "Unity.2D.Tilemap.Extras": "0.0.0.0", + "Unity.Burst": "0.0.0.0", + "Unity.Burst.Unsafe": "4.0.5.0", + "Unity.Collections": "0.0.0.0", + "Unity.Collections.LowLevel.ILSupport": "0.0.0.0", + "Unity.InternalAPIEngineBridge.001": "0.0.0.0", + "Unity.Mathematics": "1.0.0.0", + "Unity.MemoryProfiler": "0.0.0.0", + "Unity.RenderPipeline.Universal.ShaderLibrary": "0.0.0.0", + "Unity.RenderPipelines.Core.Runtime": "0.0.0.0", + "Unity.RenderPipelines.Universal.Runtime": "0.0.0.0", + "Unity.TextMeshPro": "0.0.0.0", + "Unity.VisualScripting.Core": "0.0.0.0", + "UnityEngine.AccessibilityModule": "0.0.0.0", + "UnityEngine.AIModule": "0.0.0.0", + "UnityEngine.AndroidJNIModule": "0.0.0.0", + "UnityEngine.AnimationModule": "0.0.0.0", + "UnityEngine.AssetBundleModule": "0.0.0.0", + "UnityEngine.AudioModule": "0.0.0.0", + "UnityEngine.ClothModule": "0.0.0.0", + "UnityEngine.ClusterInputModule": "0.0.0.0", + "UnityEngine.ClusterRendererModule": "0.0.0.0", + "UnityEngine.ContentLoadModule": "0.0.0.0", + "UnityEngine.CoreModule": "0.0.0.0", + "UnityEngine.CrashReportingModule": "0.0.0.0", + "UnityEngine.DirectorModule": "0.0.0.0", + "UnityEngine": "0.0.0.0", + "UnityEngine.DSPGraphModule": "0.0.0.0", + "UnityEngine.GameCenterModule": "0.0.0.0", + "UnityEngine.GIModule": "0.0.0.0", + "UnityEngine.GridModule": "0.0.0.0", + "UnityEngine.HotReloadModule": "0.0.0.0", + "UnityEngine.ImageConversionModule": "0.0.0.0", + "UnityEngine.IMGUIModule": "0.0.0.0", + "UnityEngine.InputLegacyModule": "0.0.0.0", + "UnityEngine.InputModule": "0.0.0.0", + "UnityEngine.JSONSerializeModule": "0.0.0.0", + "UnityEngine.LocalizationModule": "0.0.0.0", + "UnityEngine.ParticleSystemModule": "0.0.0.0", + "UnityEngine.PerformanceReportingModule": "0.0.0.0", + "UnityEngine.Physics2DModule": "0.0.0.0", + "UnityEngine.PhysicsModule": "0.0.0.0", + "UnityEngine.ProfilerModule": "0.0.0.0", + "UnityEngine.PropertiesModule": "0.0.0.0", + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule": "0.0.0.0", + "UnityEngine.ScreenCaptureModule": "0.0.0.0", + "UnityEngine.SharedInternalsModule": "0.0.0.0", + "UnityEngine.SpriteMaskModule": "0.0.0.0", + "UnityEngine.SpriteShapeModule": "0.0.0.0", + "UnityEngine.StreamingModule": "0.0.0.0", + "UnityEngine.SubstanceModule": "0.0.0.0", + "UnityEngine.SubsystemsModule": "0.0.0.0", + "UnityEngine.TerrainModule": "0.0.0.0", + "UnityEngine.TerrainPhysicsModule": "0.0.0.0", + "UnityEngine.TextCoreFontEngineModule": "0.0.0.0", + "UnityEngine.TextCoreTextEngineModule": "0.0.0.0", + "UnityEngine.TextRenderingModule": "0.0.0.0", + "UnityEngine.TilemapModule": "0.0.0.0", + "UnityEngine.TLSModule": "0.0.0.0", + "UnityEngine.UI": "1.0.0.0", + "UnityEngine.UIElementsModule": "0.0.0.0", + "UnityEngine.UIModule": "0.0.0.0", + "UnityEngine.UmbraModule": "0.0.0.0", + "UnityEngine.UnityAnalyticsCommonModule": "0.0.0.0", + "UnityEngine.UnityAnalyticsModule": "0.0.0.0", + "UnityEngine.UnityConnectModule": "0.0.0.0", + "UnityEngine.UnityCurlModule": "0.0.0.0", + "UnityEngine.UnityTestProtocolModule": "0.0.0.0", + "UnityEngine.UnityWebRequestAssetBundleModule": "0.0.0.0", + "UnityEngine.UnityWebRequestAudioModule": "0.0.0.0", + "UnityEngine.UnityWebRequestModule": "0.0.0.0", + "UnityEngine.UnityWebRequestTextureModule": "0.0.0.0", + "UnityEngine.UnityWebRequestWWWModule": "0.0.0.0", + "UnityEngine.VehiclesModule": "0.0.0.0", + "UnityEngine.VFXModule": "0.0.0.0", + "UnityEngine.VideoModule": "0.0.0.0", + "UnityEngine.VirtualTexturingModule": "0.0.0.0", + "UnityEngine.VRModule": "0.0.0.0", + "UnityEngine.WindModule": "0.0.0.0", + "UnityEngine.XRModule": "0.0.0.0", + "__Generated": "0.0.0.0" + }, + "runtime": { + "PvZ_Fusion_Translator.dll": {} + } + }, + "AsmResolver/6.0.0-beta.5": {}, + "AsmResolver.DotNet/6.0.0-beta.5": { + "dependencies": { + "AsmResolver.PE": "6.0.0-beta.5" + } + }, + "AsmResolver.PE/6.0.0-beta.5": { + "dependencies": { + "AsmResolver.PE.File": "6.0.0-beta.5" + } + }, + "AsmResolver.PE.File/6.0.0-beta.5": { + "dependencies": { + "AsmResolver": "6.0.0-beta.5" + } + }, + "AssetRipper.CIL/1.2.2": { + "dependencies": { + "AsmResolver.DotNet": "6.0.0-beta.5" + } + }, + "AssetRipper.Gee.External.Capstone/2.3.2": {}, + "AssetRipper.Primitives/3.2.0": {}, + "BepInEx.Core/6.0.0-be.790": { + "dependencies": { + "HarmonyX": "2.10.2", + "MonoMod.Utils": "22.7.31.1", + "SemanticVersioning": "2.0.2" + } + }, + "BepInEx.PluginInfoProps/2.1.0": {}, + "BepInEx.Unity.Common/6.0.0-be.790": { + "dependencies": { + "AssetRipper.Primitives": "3.2.0", + "MonoMod.Utils": "22.7.31.1" + } + }, + "BepInEx.Unity.IL2CPP/6.0.0-be.790": { + "dependencies": { + "BepInEx.Core": "6.0.0-be.790", + "BepInEx.Unity.Common": "6.0.0-be.790", + "HarmonyX": "2.10.2", + "Iced": "1.21.0", + "Il2CppInterop.Generator": "1.5.3", + "Il2CppInterop.HarmonySupport": "1.5.3", + "Il2CppInterop.Runtime": "1.5.3", + "MonoMod.RuntimeDetour": "22.7.31.1", + "Samboy063.Cpp2IL.Core": "2022.1.0-development.1452" + } + }, + "Disarm/2022.1.0-master.99": {}, + "HarmonyX/2.10.2": { + "dependencies": { + "MonoMod.RuntimeDetour": "22.7.31.1", + "System.Reflection.Emit": "4.7.0" + } + }, + "Iced/1.21.0": {}, + "Il2CppInterop.Common/1.5.3": { + "dependencies": { + "Iced": "1.21.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.1", + "System.Net.Http": "4.3.4" + } + }, + "Il2CppInterop.Generator/1.5.3": { + "dependencies": { + "AsmResolver.DotNet": "6.0.0-beta.5", + "Il2CppInterop.Common": "1.5.3", + "MonoMod.Backports": "1.1.2" + } + }, + "Il2CppInterop.HarmonySupport/1.5.3": { + "dependencies": { + "HarmonyX": "2.10.2", + "Il2CppInterop.Runtime": "1.5.3" + } + }, + "Il2CppInterop.Runtime/1.5.3": { + "dependencies": { + "Iced": "1.21.0", + "Il2CppInterop.Common": "1.5.3" + } + }, + "Microsoft.Extensions.Logging.Abstractions/6.0.1": {}, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.0": {}, + "Mono.Cecil/0.11.4": {}, + "MonoMod.Backports/1.1.2": { + "dependencies": { + "MonoMod.ILHelpers": "1.1.0" + } + }, + "MonoMod.ILHelpers/1.1.0": {}, + "MonoMod.RuntimeDetour/22.7.31.1": { + "dependencies": { + "Mono.Cecil": "0.11.4", + "MonoMod.Utils": "22.7.31.1", + "System.Collections.NonGeneric": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Reflection.TypeExtensions": "4.7.0" + } + }, + "MonoMod.Utils/22.7.31.1": { + "dependencies": { + "Mono.Cecil": "0.11.4", + "System.Collections.NonGeneric": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Reflection.TypeExtensions": "4.7.0" + } + }, + "Newtonsoft.Json/13.0.3": { + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.3.27908" + } + } + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": {}, + "Samboy063.Cpp2IL.Core/2022.1.0-development.1452": { + "dependencies": { + "AsmResolver.DotNet": "6.0.0-beta.5", + "AssetRipper.CIL": "1.2.2", + "AssetRipper.Gee.External.Capstone": "2.3.2", + "Disarm": "2022.1.0-master.99", + "Iced": "1.21.0", + "Samboy063.LibCpp2IL": "2022.1.0-development.1452", + "StableNameDotNet": "0.1.0-development.1452" + } + }, + "Samboy063.LibCpp2IL/2022.1.0-development.1452": { + "dependencies": { + "AssetRipper.Primitives": "3.2.0", + "Samboy063.WasmDisassembler": "2022.1.0-development.1452" + } + }, + "Samboy063.WasmDisassembler/2022.1.0-development.1452": {}, + "SemanticVersioning/2.0.2": {}, + "StableNameDotNet/0.1.0-development.1452": {}, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Net.Http/4.3.4": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.DiagnosticSource": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.Net.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "System.Net.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.7.0": {}, + "System.Reflection.Emit.ILGeneration/4.7.0": {}, + "System.Reflection.Emit.Lightweight/4.7.0": {}, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.7.0": {}, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.2" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "Assembly-CSharp/0.0.0.0": { + "runtime": { + "Assembly-CSharp.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "AudioImportLib.BepInEx/1.0.0.0": { + "runtime": { + "AudioImportLib.BepInEx.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "BepInEx.Preloader.Core/6.0.0.0": { + "runtime": { + "BepInEx.Preloader.Core.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.0.0" + } + } + }, + "Core/0.0.0.0": { + "runtime": { + "Core.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppMono.Security/4.0.0.0": { + "runtime": { + "Il2CppMono.Security.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2Cppmscorlib/4.0.0.0": { + "runtime": { + "Il2Cppmscorlib.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Configuration/4.0.0.0": { + "runtime": { + "Il2CppSystem.Configuration.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Core/4.0.0.0": { + "runtime": { + "Il2CppSystem.Core.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Data/4.0.0.0": { + "runtime": { + "Il2CppSystem.Data.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem/4.0.0.0": { + "runtime": { + "Il2CppSystem.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Drawing/4.0.0.0": { + "runtime": { + "Il2CppSystem.Drawing.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Numerics/4.0.0.0": { + "runtime": { + "Il2CppSystem.Numerics.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Runtime.Serialization/4.0.0.0": { + "runtime": { + "Il2CppSystem.Runtime.Serialization.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Xml/4.0.0.0": { + "runtime": { + "Il2CppSystem.Xml.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Xml.Linq/4.0.0.0": { + "runtime": { + "Il2CppSystem.Xml.Linq.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "SimpleFileBrowser.Runtime/0.0.0.0": { + "runtime": { + "SimpleFileBrowser.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "spine-csharp/0.0.0.0": { + "runtime": { + "spine-csharp.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "spine-unity/0.0.0.0": { + "runtime": { + "spine-unity.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UniTask/0.0.0.0": { + "runtime": { + "UniTask.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.Animation.Runtime/0.0.0.0": { + "runtime": { + "Unity.2D.Animation.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.Common.Runtime/0.0.0.0": { + "runtime": { + "Unity.2D.Common.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.SpriteShape.Runtime/0.0.0.0": { + "runtime": { + "Unity.2D.SpriteShape.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.Tilemap.Extras/0.0.0.0": { + "runtime": { + "Unity.2D.Tilemap.Extras.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Burst/0.0.0.0": { + "runtime": { + "Unity.Burst.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Burst.Unsafe/4.0.5.0": { + "runtime": { + "Unity.Burst.Unsafe.dll": { + "assemblyVersion": "4.0.5.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Collections/0.0.0.0": { + "runtime": { + "Unity.Collections.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Collections.LowLevel.ILSupport/0.0.0.0": { + "runtime": { + "Unity.Collections.LowLevel.ILSupport.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.InternalAPIEngineBridge.001/0.0.0.0": { + "runtime": { + "Unity.InternalAPIEngineBridge.001.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Mathematics/1.0.0.0": { + "runtime": { + "Unity.Mathematics.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.MemoryProfiler/0.0.0.0": { + "runtime": { + "Unity.MemoryProfiler.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.RenderPipeline.Universal.ShaderLibrary/0.0.0.0": { + "runtime": { + "Unity.RenderPipeline.Universal.ShaderLibrary.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.RenderPipelines.Core.Runtime/0.0.0.0": { + "runtime": { + "Unity.RenderPipelines.Core.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.RenderPipelines.Universal.Runtime/0.0.0.0": { + "runtime": { + "Unity.RenderPipelines.Universal.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.TextMeshPro/0.0.0.0": { + "runtime": { + "Unity.TextMeshPro.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.VisualScripting.Core/0.0.0.0": { + "runtime": { + "Unity.VisualScripting.Core.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AccessibilityModule/0.0.0.0": { + "runtime": { + "UnityEngine.AccessibilityModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AIModule/0.0.0.0": { + "runtime": { + "UnityEngine.AIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AndroidJNIModule/0.0.0.0": { + "runtime": { + "UnityEngine.AndroidJNIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AnimationModule/0.0.0.0": { + "runtime": { + "UnityEngine.AnimationModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AssetBundleModule/0.0.0.0": { + "runtime": { + "UnityEngine.AssetBundleModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AudioModule/0.0.0.0": { + "runtime": { + "UnityEngine.AudioModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ClothModule/0.0.0.0": { + "runtime": { + "UnityEngine.ClothModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ClusterInputModule/0.0.0.0": { + "runtime": { + "UnityEngine.ClusterInputModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ClusterRendererModule/0.0.0.0": { + "runtime": { + "UnityEngine.ClusterRendererModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ContentLoadModule/0.0.0.0": { + "runtime": { + "UnityEngine.ContentLoadModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.CoreModule/0.0.0.0": { + "runtime": { + "UnityEngine.CoreModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.CrashReportingModule/0.0.0.0": { + "runtime": { + "UnityEngine.CrashReportingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.DirectorModule/0.0.0.0": { + "runtime": { + "UnityEngine.DirectorModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine/0.0.0.0": { + "runtime": { + "UnityEngine.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.DSPGraphModule/0.0.0.0": { + "runtime": { + "UnityEngine.DSPGraphModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.GameCenterModule/0.0.0.0": { + "runtime": { + "UnityEngine.GameCenterModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.GIModule/0.0.0.0": { + "runtime": { + "UnityEngine.GIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.GridModule/0.0.0.0": { + "runtime": { + "UnityEngine.GridModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.HotReloadModule/0.0.0.0": { + "runtime": { + "UnityEngine.HotReloadModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ImageConversionModule/0.0.0.0": { + "runtime": { + "UnityEngine.ImageConversionModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.IMGUIModule/0.0.0.0": { + "runtime": { + "UnityEngine.IMGUIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.InputLegacyModule/0.0.0.0": { + "runtime": { + "UnityEngine.InputLegacyModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.InputModule/0.0.0.0": { + "runtime": { + "UnityEngine.InputModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.JSONSerializeModule/0.0.0.0": { + "runtime": { + "UnityEngine.JSONSerializeModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.LocalizationModule/0.0.0.0": { + "runtime": { + "UnityEngine.LocalizationModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ParticleSystemModule/0.0.0.0": { + "runtime": { + "UnityEngine.ParticleSystemModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.PerformanceReportingModule/0.0.0.0": { + "runtime": { + "UnityEngine.PerformanceReportingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.Physics2DModule/0.0.0.0": { + "runtime": { + "UnityEngine.Physics2DModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.PhysicsModule/0.0.0.0": { + "runtime": { + "UnityEngine.PhysicsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ProfilerModule/0.0.0.0": { + "runtime": { + "UnityEngine.ProfilerModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.PropertiesModule/0.0.0.0": { + "runtime": { + "UnityEngine.PropertiesModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule/0.0.0.0": { + "runtime": { + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ScreenCaptureModule/0.0.0.0": { + "runtime": { + "UnityEngine.ScreenCaptureModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SharedInternalsModule/0.0.0.0": { + "runtime": { + "UnityEngine.SharedInternalsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SpriteMaskModule/0.0.0.0": { + "runtime": { + "UnityEngine.SpriteMaskModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SpriteShapeModule/0.0.0.0": { + "runtime": { + "UnityEngine.SpriteShapeModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.StreamingModule/0.0.0.0": { + "runtime": { + "UnityEngine.StreamingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SubstanceModule/0.0.0.0": { + "runtime": { + "UnityEngine.SubstanceModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SubsystemsModule/0.0.0.0": { + "runtime": { + "UnityEngine.SubsystemsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TerrainModule/0.0.0.0": { + "runtime": { + "UnityEngine.TerrainModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TerrainPhysicsModule/0.0.0.0": { + "runtime": { + "UnityEngine.TerrainPhysicsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TextCoreFontEngineModule/0.0.0.0": { + "runtime": { + "UnityEngine.TextCoreFontEngineModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TextCoreTextEngineModule/0.0.0.0": { + "runtime": { + "UnityEngine.TextCoreTextEngineModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TextRenderingModule/0.0.0.0": { + "runtime": { + "UnityEngine.TextRenderingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TilemapModule/0.0.0.0": { + "runtime": { + "UnityEngine.TilemapModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TLSModule/0.0.0.0": { + "runtime": { + "UnityEngine.TLSModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UI/1.0.0.0": { + "runtime": { + "UnityEngine.UI.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UIElementsModule/0.0.0.0": { + "runtime": { + "UnityEngine.UIElementsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UIModule/0.0.0.0": { + "runtime": { + "UnityEngine.UIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UmbraModule/0.0.0.0": { + "runtime": { + "UnityEngine.UmbraModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityAnalyticsCommonModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityAnalyticsCommonModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityAnalyticsModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityAnalyticsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityConnectModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityConnectModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityCurlModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityCurlModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityTestProtocolModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityTestProtocolModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestAssetBundleModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestAssetBundleModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestAudioModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestAudioModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestTextureModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestTextureModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestWWWModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestWWWModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VehiclesModule/0.0.0.0": { + "runtime": { + "UnityEngine.VehiclesModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VFXModule/0.0.0.0": { + "runtime": { + "UnityEngine.VFXModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VideoModule/0.0.0.0": { + "runtime": { + "UnityEngine.VideoModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VirtualTexturingModule/0.0.0.0": { + "runtime": { + "UnityEngine.VirtualTexturingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VRModule/0.0.0.0": { + "runtime": { + "UnityEngine.VRModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.WindModule/0.0.0.0": { + "runtime": { + "UnityEngine.WindModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.XRModule/0.0.0.0": { + "runtime": { + "UnityEngine.XRModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "__Generated/0.0.0.0": { + "runtime": { + "__Generated.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + } + } + }, + "libraries": { + "PvZ_Fusion_Translator/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "AsmResolver/6.0.0-beta.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-G8qFOoSs2DQc4Ddvcu0qoqEWLy1ETuxzzevDMRxg6QTG//hIWaxEaxHMorWVYuPxYU//g8lM8XzdvMWF1wQOrg==", + "path": "asmresolver/6.0.0-beta.5", + "hashPath": "asmresolver.6.0.0-beta.5.nupkg.sha512" + }, + "AsmResolver.DotNet/6.0.0-beta.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-WlbVPV2gTacuJFOPEEsPL+4EHoaTKqjfFCvudrt+Nx1J+Frt781DelvyNMqu8UA/oXF07HgZbaLH//sOXJNI3w==", + "path": "asmresolver.dotnet/6.0.0-beta.5", + "hashPath": "asmresolver.dotnet.6.0.0-beta.5.nupkg.sha512" + }, + "AsmResolver.PE/6.0.0-beta.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-gIv4Dxl/9x3+B1rEJW1Z3+N26B+mpk80+0LisYP+FtER/K4+TpsYijak5AJjj0IF17+elpzWAT/+YFVXAHD4Pw==", + "path": "asmresolver.pe/6.0.0-beta.5", + "hashPath": "asmresolver.pe.6.0.0-beta.5.nupkg.sha512" + }, + "AsmResolver.PE.File/6.0.0-beta.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+j1vOCMVk7Mst59yAd9BTNymTGrTNyuciSyFWumY/6pTL+ysOVMMtbbzKs53HdgxQgjKnKZMqYfob9X6Bk9Ndg==", + "path": "asmresolver.pe.file/6.0.0-beta.5", + "hashPath": "asmresolver.pe.file.6.0.0-beta.5.nupkg.sha512" + }, + "AssetRipper.CIL/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-WL+eRoITdeSkfr5XYxTmELy465aexKKKyj5D15h+lagPaaMdbSiRq0m1tU/j6AiYiXl/VzhaxMjbVZFi0utB/Q==", + "path": "assetripper.cil/1.2.2", + "hashPath": "assetripper.cil.1.2.2.nupkg.sha512" + }, + "AssetRipper.Gee.External.Capstone/2.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wOr5PQPL/2ZfD7+ebt6cpRbUhSzSY5nlHGHjjzuQRiU5zkQlqQNwWDLX0M3smrm5IkaDvONkmDjFMKTlZJmyuQ==", + "path": "assetripper.gee.external.capstone/2.3.2", + "hashPath": "assetripper.gee.external.capstone.2.3.2.nupkg.sha512" + }, + "AssetRipper.Primitives/3.2.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UtDpl72yG5/KUj3BsNP7k2sF13nqqeaJ4sTANZZd/gb+t9YULYYzcyNfxuvdptenlsQIUBmMwTVHUn6TZ61Jqg==", + "path": "assetripper.primitives/3.2.0", + "hashPath": "assetripper.primitives.3.2.0.nupkg.sha512" + }, + "BepInEx.Core/6.0.0-be.790": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pUYQiNSy9qsebQdtui4LtSQsOvbXb/xSG/s12Wi3lIExPwT3oDYKye3Bngbm0RwNDGNvdrs6RY0CLqTn7vJwPA==", + "path": "bepinex.core/6.0.0-be.790", + "hashPath": "bepinex.core.6.0.0-be.790.nupkg.sha512" + }, + "BepInEx.PluginInfoProps/2.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VCG3QRiqNdW9ku2FEcNsbK+HKxrZmW0VxwMNyLNO7h0xGorU+C6vBHN8Qq4eAL5fU11Uks5x2uoYdqEoKD3P8A==", + "path": "bepinex.plugininfoprops/2.1.0", + "hashPath": "bepinex.plugininfoprops.2.1.0.nupkg.sha512" + }, + "BepInEx.Unity.Common/6.0.0-be.790": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pJs7/nJybokWMWjHJ2gCDRGPXVg4T9049NZeIoc3JGxgyE9tFPbFGhZV3AijitqqFAkGPELshLSEok2nrVeEQg==", + "path": "bepinex.unity.common/6.0.0-be.790", + "hashPath": "bepinex.unity.common.6.0.0-be.790.nupkg.sha512" + }, + "BepInEx.Unity.IL2CPP/6.0.0-be.790": { + "type": "package", + "serviceable": true, + "sha512": "sha512-va/LzYiAGsn5lIw7s+zb2cWDOtW1F4dEMJNWTtl37CSl/dsEzXxvIQXh0+7iGJLjEkxZdfJYi8e+Q0dM4wI+iw==", + "path": "bepinex.unity.il2cpp/6.0.0-be.790", + "hashPath": "bepinex.unity.il2cpp.6.0.0-be.790.nupkg.sha512" + }, + "Disarm/2022.1.0-master.99": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lNoK8MyhxxgO7PMp5W3sWIqRMU2neqPbDj+aNZTtnwrty4okYLe2/98t9b4E29LoQlarBfOsElV8wZIdxBk7zQ==", + "path": "disarm/2022.1.0-master.99", + "hashPath": "disarm.2022.1.0-master.99.nupkg.sha512" + }, + "HarmonyX/2.10.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/5WwkxXX8mPsRuigQt957rJGx1f0dDQxk+bvk4yYITKFjXas9Em+O71zEP8X0ym8OFQQ2XH/2SxS4NC7vEC+Xg==", + "path": "harmonyx/2.10.2", + "hashPath": "harmonyx.2.10.2.nupkg.sha512" + }, + "Iced/1.21.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==", + "path": "iced/1.21.0", + "hashPath": "iced.1.21.0.nupkg.sha512" + }, + "Il2CppInterop.Common/1.5.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ziFbpzgXtqTvIwpfva9z3vlhjXrKYHfXDF5barssiFcc0YdFkQyT8FlIVQzDnycVdgPcKjzXD7goFaWddKg/KA==", + "path": "il2cppinterop.common/1.5.3", + "hashPath": "il2cppinterop.common.1.5.3.nupkg.sha512" + }, + "Il2CppInterop.Generator/1.5.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Mb8trdAAoJFV7bSGPKn1EYutVRsvbMu4GaumFoB0JEOcKDTcc6E0H06J/9bklQVc/N4GxoXxKOaoJg+cR3b4Wg==", + "path": "il2cppinterop.generator/1.5.3", + "hashPath": "il2cppinterop.generator.1.5.3.nupkg.sha512" + }, + "Il2CppInterop.HarmonySupport/1.5.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kap8a2rkCpKBenaHQAJqGofLOAOyBnHnlZmTMCEwlwFODXjNv+sQHmlfatl7OYvZXdoIJnZErlOl/8YEk67XaQ==", + "path": "il2cppinterop.harmonysupport/1.5.3", + "hashPath": "il2cppinterop.harmonysupport.1.5.3.nupkg.sha512" + }, + "Il2CppInterop.Runtime/1.5.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kV7UJ9Ra7kHAmFguM2DcD8CBiqM2PYSAUqb/0OajgrAw8yJKxSFmzOjcu653ZMLJ+kVi0XXEO/+uwEspKGCbLQ==", + "path": "il2cppinterop.runtime/1.5.3", + "hashPath": "il2cppinterop.runtime.1.5.3.nupkg.sha512" + }, + "Microsoft.Extensions.Logging.Abstractions/6.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dzB2Cgg+JmrouhjkcQGzSFjjvpwlq353i8oBQO2GWNjCXSzhbtBRUf28HSauWe7eib3wYOdb3tItdjRwAdwCSg==", + "path": "microsoft.extensions.logging.abstractions/6.0.1", + "hashPath": "microsoft.extensions.logging.abstractions.6.0.1.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==", + "path": "microsoft.netcore.targets/1.1.0", + "hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512" + }, + "Mono.Cecil/0.11.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-IC1h5g0NeJGHIUgzM1P82ld57knhP0IcQfrYITDPXlNpMYGUrsG5TxuaWTjaeqDNQMBDNZkB8L0rBnwsY6JHuQ==", + "path": "mono.cecil/0.11.4", + "hashPath": "mono.cecil.0.11.4.nupkg.sha512" + }, + "MonoMod.Backports/1.1.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-baYlNy8n8kmaNhNvqmZ/dIPOeO1r9//dG1i2WbunMWtWZ2EKtIgmXaS+ZzphzTsikkGnoD4Jwr5g0TVdpDjgpw==", + "path": "monomod.backports/1.1.2", + "hashPath": "monomod.backports.1.1.2.nupkg.sha512" + }, + "MonoMod.ILHelpers/1.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-L2FWjhTrv7tcIxshfZ+M3OcaNr4cNw0IwiVZEgwqRnZ5QAN3+RrNJ8ZwCzwXUWyPDqooJxMcjjg8PsSYUiNBjQ==", + "path": "monomod.ilhelpers/1.1.0", + "hashPath": "monomod.ilhelpers.1.1.0.nupkg.sha512" + }, + "MonoMod.RuntimeDetour/22.7.31.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nxVJTvQbWAujaogt5XX3eAy7d22t66Z88aWg9sirPLO9rR/6yNCHAyZpgxXrOsIobZVW0IEZPqNMOBhgke25/w==", + "path": "monomod.runtimedetour/22.7.31.1", + "hashPath": "monomod.runtimedetour.22.7.31.1.nupkg.sha512" + }, + "MonoMod.Utils/22.7.31.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nI0E1oadXS1iMbfwfCzYF08C1jRQR9cnnHv66a4BSPd4sGu2p6g4BmctCWsdAB6oGKkSJUhcfHfxcfTsDyB94Q==", + "path": "monomod.utils/22.7.31.1", + "hashPath": "monomod.utils.22.7.31.1.nupkg.sha512" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7VSGO0URRKoMEAq0Sc9cRz8mb6zbyx/BZDEWhgPdzzpmFhkam3fJ1DAGWFXBI4nGlma+uPKpfuMQP5LXRnOH5g==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0oAaTAm6e2oVH+/Zttt0cuhGaePQYKII1dY8iaqP7CvOpVKgLybKRFvQjXR2LtxXOXTVPNv14j0ot8uV+HrUmw==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-G24ibsCNi5Kbz0oXWynBoRgtGvsw5ZSVEWjv13/KiCAM8C6wz9zzcCniMeQFIkJ2tasjo2kXlvlBZhplL51kGg==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QR1OwtwehHxSeQvZKXe+iSd+d3XZNkEcuWMFYa2i0aG1l+lR739HPicKMlTbJst3spmeekDVBUS7SeS26s4U/g==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I+GNKGg2xCHueRd1m9PzeEW7WLbNNLznmTuEi8/vZX71HudUbx1UTwlGkiwMri7JLl8hGaIAWnA/GONhu+LOyQ==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1Z3TAq1ytS1IBRtPXJvEUZdVsfWfeNEhBkbiOCGEl9wwAfsjP2lz3ZFDx5tq8p60/EqbS0HItG5piHuB71RjoA==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6mU/cVmmHtQiDXhnzUImxIcDL48GbTk+TsptXyJA+MIOG9LRjPoAQC/qBFB7X+UNyK86bmvGwC8t+M66wsYC8w==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vjwG0GGcTW/PPg6KVud8F9GLWYuAV1rrw1BKAqY0oh4jcUqg15oYF1+qkGR2x2ZHM4DQnWKQ7cJgYbfncz/lYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7KMFpTkHC/zoExs+PwP8jDCWcrK9H6L7soowT80CUx3e+nxP/AFnq0AQAW5W76z2WYbLAYCRyPfwYFG6zkvQRw==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xrlmRCnKZJLHxyyLIqkZjNXqgxnKdZxfItrPkjI+6pkRo5lHX8YvSZlWrSI5AVwLMi4HbNWP7064hcAWeZKp5w==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-leXiwfiIkW7Gmn7cgnNcdtNAU70SjmKW3jxGj1iKHOvdn0zRWsgv/l2OJUO5zdGdiv2VRFnAsxxhDgMzofPdWg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg.sha512" + }, + "Samboy063.Cpp2IL.Core/2022.1.0-development.1452": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MRlsRONdPymLoUc63vItrWZAlycDsFaX2XyBpUzWmyS0t9V9SJ7kP4O+DYOg7Hbd9JpKQSTsJPZlB/IKoNABfg==", + "path": "samboy063.cpp2il.core/2022.1.0-development.1452", + "hashPath": "samboy063.cpp2il.core.2022.1.0-development.1452.nupkg.sha512" + }, + "Samboy063.LibCpp2IL/2022.1.0-development.1452": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OoAGHwKdPQIF08mXGoFV81hykA5ntAMt+Ciu8CstA54VAa5J2RY4DZx0qyxY7ktvciHiAuPUN/gQo0uaEXA8dQ==", + "path": "samboy063.libcpp2il/2022.1.0-development.1452", + "hashPath": "samboy063.libcpp2il.2022.1.0-development.1452.nupkg.sha512" + }, + "Samboy063.WasmDisassembler/2022.1.0-development.1452": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6OzjWNUsc4c8LpxY4PbBu2U+H4pw2M7A2hRVN/+swpGq9RaXpoY4CVPvbmIgerv1Ao6bd+RippkN7tkIswDESg==", + "path": "samboy063.wasmdisassembler/2022.1.0-development.1452", + "hashPath": "samboy063.wasmdisassembler.2022.1.0-development.1452.nupkg.sha512" + }, + "SemanticVersioning/2.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA==", + "path": "semanticversioning/2.0.2", + "hashPath": "semanticversioning.2.0.2.nupkg.sha512" + }, + "StableNameDotNet/0.1.0-development.1452": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7QtKG8aVJKjbESvq+qUM5dRc94TLY3zZF9w1ELCsQYOmGlQ9Chg/hstYJCTGvSf5bKcLiU2XWTQ614QRylkF3g==", + "path": "stablenamedotnet/0.1.0-development.1452", + "hashPath": "stablenamedotnet.0.1.0-development.1452.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tD6kosZnTAGdrEa0tZSuFyunMbt/5KYDnHdndJYGqZoNy00XVXyACd5d6KnE1YgYv3ne2CjtAfNXo/fwEhnKUA==", + "path": "system.diagnostics.diagnosticsource/4.3.0", + "hashPath": "system.diagnostics.diagnosticsource.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Net.Http/4.3.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aOa2d51SEbmM+H+Csw7yJOuNZoHkrP2XnAurye5HWYgGVVU54YZDvsLUYRv6h18X3sPnjNCANmN7ZhIPiqMcjA==", + "path": "system.net.http/4.3.4", + "hashPath": "system.net.http.4.3.4.nupkg.sha512" + }, + "System.Net.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==", + "path": "system.net.primitives/4.3.0", + "hashPath": "system.net.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==", + "path": "system.reflection.emit/4.7.0", + "hashPath": "system.reflection.emit.4.7.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-AucBYo3DSI0IDxdUjKksBcQJXPHyoPyrCXYURW1WDsLI4M65Ar/goSHjdnHOAY9MiYDNKqDlIgaYm+zL2hA1KA==", + "path": "system.reflection.emit.ilgeneration/4.7.0", + "hashPath": "system.reflection.emit.ilgeneration.4.7.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==", + "path": "system.reflection.emit.lightweight/4.7.0", + "hashPath": "system.reflection.emit.lightweight.4.7.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==", + "path": "system.reflection.typeextensions/4.7.0", + "hashPath": "system.reflection.typeextensions.4.7.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "Assembly-CSharp/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AudioImportLib.BepInEx/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "BepInEx.Preloader.Core/6.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Core/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppMono.Security/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2Cppmscorlib/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Configuration/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Core/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Data/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Drawing/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Numerics/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Runtime.Serialization/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Xml/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Xml.Linq/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "SimpleFileBrowser.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "spine-csharp/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "spine-unity/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UniTask/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.Animation.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.Common.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.SpriteShape.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.Tilemap.Extras/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Burst/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Burst.Unsafe/4.0.5.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Collections/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Collections.LowLevel.ILSupport/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.InternalAPIEngineBridge.001/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Mathematics/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.MemoryProfiler/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.RenderPipeline.Universal.ShaderLibrary/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.RenderPipelines.Core.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.RenderPipelines.Universal.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.TextMeshPro/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.VisualScripting.Core/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AccessibilityModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AndroidJNIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AnimationModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AssetBundleModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AudioModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ClothModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ClusterInputModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ClusterRendererModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ContentLoadModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.CoreModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.CrashReportingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.DirectorModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.DSPGraphModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.GameCenterModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.GIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.GridModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.HotReloadModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ImageConversionModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.IMGUIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.InputLegacyModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.InputModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.JSONSerializeModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.LocalizationModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ParticleSystemModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.PerformanceReportingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.Physics2DModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.PhysicsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ProfilerModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.PropertiesModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ScreenCaptureModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SharedInternalsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SpriteMaskModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SpriteShapeModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.StreamingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SubstanceModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SubsystemsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TerrainModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TerrainPhysicsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TextCoreFontEngineModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TextCoreTextEngineModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TextRenderingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TilemapModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TLSModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UI/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UIElementsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UmbraModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityAnalyticsCommonModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityAnalyticsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityConnectModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityCurlModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityTestProtocolModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestAssetBundleModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestAudioModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestTextureModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestWWWModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VehiclesModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VFXModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VideoModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VirtualTexturingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VRModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.WindModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.XRModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "__Generated/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.dll b/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..33d075f Binary files /dev/null and b/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.dll differ diff --git a/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.pdb b/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.pdb new file mode 100644 index 0000000..1bf63b3 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.pdb differ diff --git a/Source/bin/BepInEx/net6.0/SimpleFileBrowser.Runtime.dll b/Source/bin/BepInEx/net6.0/SimpleFileBrowser.Runtime.dll new file mode 100644 index 0000000..45835c3 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/SimpleFileBrowser.Runtime.dll differ diff --git a/Source/bin/BepInEx/net6.0/UniTask.dll b/Source/bin/BepInEx/net6.0/UniTask.dll new file mode 100644 index 0000000..eea0025 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UniTask.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.2D.Animation.Runtime.dll b/Source/bin/BepInEx/net6.0/Unity.2D.Animation.Runtime.dll new file mode 100644 index 0000000..a52a029 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.2D.Animation.Runtime.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.2D.Common.Runtime.dll b/Source/bin/BepInEx/net6.0/Unity.2D.Common.Runtime.dll new file mode 100644 index 0000000..e3ac0fb Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.2D.Common.Runtime.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.2D.SpriteShape.Runtime.dll b/Source/bin/BepInEx/net6.0/Unity.2D.SpriteShape.Runtime.dll new file mode 100644 index 0000000..8daf03c Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.2D.SpriteShape.Runtime.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.2D.Tilemap.Extras.dll b/Source/bin/BepInEx/net6.0/Unity.2D.Tilemap.Extras.dll new file mode 100644 index 0000000..6f2cd95 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.2D.Tilemap.Extras.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.Burst.Unsafe.dll b/Source/bin/BepInEx/net6.0/Unity.Burst.Unsafe.dll new file mode 100644 index 0000000..a7adfb2 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.Burst.Unsafe.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.Burst.dll b/Source/bin/BepInEx/net6.0/Unity.Burst.dll new file mode 100644 index 0000000..2feb018 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.Burst.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.Collections.LowLevel.ILSupport.dll b/Source/bin/BepInEx/net6.0/Unity.Collections.LowLevel.ILSupport.dll new file mode 100644 index 0000000..7181393 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.Collections.LowLevel.ILSupport.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.Collections.dll b/Source/bin/BepInEx/net6.0/Unity.Collections.dll new file mode 100644 index 0000000..a025c03 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.Collections.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.InternalAPIEngineBridge.001.dll b/Source/bin/BepInEx/net6.0/Unity.InternalAPIEngineBridge.001.dll new file mode 100644 index 0000000..9656723 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.InternalAPIEngineBridge.001.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.Mathematics.dll b/Source/bin/BepInEx/net6.0/Unity.Mathematics.dll new file mode 100644 index 0000000..dd1d740 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.Mathematics.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.MemoryProfiler.dll b/Source/bin/BepInEx/net6.0/Unity.MemoryProfiler.dll new file mode 100644 index 0000000..9390485 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.MemoryProfiler.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.RenderPipeline.Universal.ShaderLibrary.dll b/Source/bin/BepInEx/net6.0/Unity.RenderPipeline.Universal.ShaderLibrary.dll new file mode 100644 index 0000000..10d2683 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.RenderPipeline.Universal.ShaderLibrary.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.RenderPipelines.Core.Runtime.dll b/Source/bin/BepInEx/net6.0/Unity.RenderPipelines.Core.Runtime.dll new file mode 100644 index 0000000..6439f15 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.RenderPipelines.Core.Runtime.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.RenderPipelines.Universal.Runtime.dll b/Source/bin/BepInEx/net6.0/Unity.RenderPipelines.Universal.Runtime.dll new file mode 100644 index 0000000..4bf693b Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.RenderPipelines.Universal.Runtime.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.TextMeshPro.dll b/Source/bin/BepInEx/net6.0/Unity.TextMeshPro.dll new file mode 100644 index 0000000..78c1011 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.TextMeshPro.dll differ diff --git a/Source/bin/BepInEx/net6.0/Unity.VisualScripting.Core.dll b/Source/bin/BepInEx/net6.0/Unity.VisualScripting.Core.dll new file mode 100644 index 0000000..78a28d2 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/Unity.VisualScripting.Core.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.AIModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.AIModule.dll new file mode 100644 index 0000000..68de143 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.AIModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.AccessibilityModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.AccessibilityModule.dll new file mode 100644 index 0000000..40a3257 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.AccessibilityModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.AndroidJNIModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.AndroidJNIModule.dll new file mode 100644 index 0000000..13a689b Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.AndroidJNIModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.AnimationModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.AnimationModule.dll new file mode 100644 index 0000000..1319041 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.AnimationModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.AssetBundleModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.AssetBundleModule.dll new file mode 100644 index 0000000..59d9834 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.AssetBundleModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.AudioModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.AudioModule.dll new file mode 100644 index 0000000..5927f9e Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.AudioModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ClothModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ClothModule.dll new file mode 100644 index 0000000..261eda5 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ClothModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ClusterInputModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ClusterInputModule.dll new file mode 100644 index 0000000..a3c53b3 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ClusterInputModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ClusterRendererModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ClusterRendererModule.dll new file mode 100644 index 0000000..ae78113 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ClusterRendererModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ContentLoadModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ContentLoadModule.dll new file mode 100644 index 0000000..c66c928 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ContentLoadModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.CoreModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..513a4f3 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.CoreModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.CrashReportingModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.CrashReportingModule.dll new file mode 100644 index 0000000..dd8f2d7 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.CrashReportingModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.DSPGraphModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.DSPGraphModule.dll new file mode 100644 index 0000000..ad3fd33 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.DSPGraphModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.DirectorModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.DirectorModule.dll new file mode 100644 index 0000000..beaa178 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.DirectorModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.GIModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.GIModule.dll new file mode 100644 index 0000000..add7d77 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.GIModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.GameCenterModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.GameCenterModule.dll new file mode 100644 index 0000000..aa038fa Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.GameCenterModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.GridModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.GridModule.dll new file mode 100644 index 0000000..c0dab8a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.GridModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.HotReloadModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.HotReloadModule.dll new file mode 100644 index 0000000..a498f92 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.HotReloadModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.IMGUIModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.IMGUIModule.dll new file mode 100644 index 0000000..6e880d5 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.IMGUIModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ImageConversionModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ImageConversionModule.dll new file mode 100644 index 0000000..e05d713 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ImageConversionModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.InputLegacyModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.InputLegacyModule.dll new file mode 100644 index 0000000..88e2a39 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.InputLegacyModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.InputModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.InputModule.dll new file mode 100644 index 0000000..66e1030 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.InputModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.JSONSerializeModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.JSONSerializeModule.dll new file mode 100644 index 0000000..acd9873 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.JSONSerializeModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.LocalizationModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.LocalizationModule.dll new file mode 100644 index 0000000..6af1b0b Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.LocalizationModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ParticleSystemModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ParticleSystemModule.dll new file mode 100644 index 0000000..5bf4805 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ParticleSystemModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.PerformanceReportingModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.PerformanceReportingModule.dll new file mode 100644 index 0000000..8709b25 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.PerformanceReportingModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.Physics2DModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.Physics2DModule.dll new file mode 100644 index 0000000..bdccb3c Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.Physics2DModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.PhysicsModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.PhysicsModule.dll new file mode 100644 index 0000000..a61a2c8 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.PhysicsModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ProfilerModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ProfilerModule.dll new file mode 100644 index 0000000..4f8fb3c Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ProfilerModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.PropertiesModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.PropertiesModule.dll new file mode 100644 index 0000000..d8ea1a3 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.PropertiesModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll new file mode 100644 index 0000000..d2773d0 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.ScreenCaptureModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.ScreenCaptureModule.dll new file mode 100644 index 0000000..aed1629 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.ScreenCaptureModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.SharedInternalsModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.SharedInternalsModule.dll new file mode 100644 index 0000000..d632af7 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.SharedInternalsModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.SpriteMaskModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.SpriteMaskModule.dll new file mode 100644 index 0000000..81fb976 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.SpriteMaskModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.SpriteShapeModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.SpriteShapeModule.dll new file mode 100644 index 0000000..80592a6 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.SpriteShapeModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.StreamingModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.StreamingModule.dll new file mode 100644 index 0000000..adcd119 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.StreamingModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.SubstanceModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.SubstanceModule.dll new file mode 100644 index 0000000..a8ad21a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.SubstanceModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.SubsystemsModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.SubsystemsModule.dll new file mode 100644 index 0000000..b673172 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.SubsystemsModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TLSModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TLSModule.dll new file mode 100644 index 0000000..16a6771 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TLSModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TerrainModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TerrainModule.dll new file mode 100644 index 0000000..3845ae0 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TerrainModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TerrainPhysicsModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TerrainPhysicsModule.dll new file mode 100644 index 0000000..3ac7882 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TerrainPhysicsModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TextCoreFontEngineModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TextCoreFontEngineModule.dll new file mode 100644 index 0000000..56e39b4 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TextCoreFontEngineModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TextCoreTextEngineModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TextCoreTextEngineModule.dll new file mode 100644 index 0000000..b1ea677 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TextCoreTextEngineModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TextRenderingModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TextRenderingModule.dll new file mode 100644 index 0000000..8ad4763 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TextRenderingModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.TilemapModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.TilemapModule.dll new file mode 100644 index 0000000..e4195ea Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.TilemapModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UI.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UI.dll new file mode 100644 index 0000000..fdeb861 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UI.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UIElementsModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UIElementsModule.dll new file mode 100644 index 0000000..fed1054 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UIElementsModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UIModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UIModule.dll new file mode 100644 index 0000000..cc5111a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UIModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UmbraModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UmbraModule.dll new file mode 100644 index 0000000..5b6fe63 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UmbraModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityAnalyticsCommonModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityAnalyticsCommonModule.dll new file mode 100644 index 0000000..ea2cc1c Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityAnalyticsCommonModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityAnalyticsModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityAnalyticsModule.dll new file mode 100644 index 0000000..045a342 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityAnalyticsModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityConnectModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityConnectModule.dll new file mode 100644 index 0000000..7dd0c4a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityConnectModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityCurlModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityCurlModule.dll new file mode 100644 index 0000000..d980828 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityCurlModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityTestProtocolModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityTestProtocolModule.dll new file mode 100644 index 0000000..bc047e5 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityTestProtocolModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestAssetBundleModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestAssetBundleModule.dll new file mode 100644 index 0000000..2bd6a3a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestAssetBundleModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestAudioModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestAudioModule.dll new file mode 100644 index 0000000..366f478 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestAudioModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestModule.dll new file mode 100644 index 0000000..0e01abf Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestTextureModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestTextureModule.dll new file mode 100644 index 0000000..2792549 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestTextureModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestWWWModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestWWWModule.dll new file mode 100644 index 0000000..9a1f9e6 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.UnityWebRequestWWWModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.VFXModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.VFXModule.dll new file mode 100644 index 0000000..074de47 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.VFXModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.VRModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.VRModule.dll new file mode 100644 index 0000000..25ed46b Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.VRModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.VehiclesModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.VehiclesModule.dll new file mode 100644 index 0000000..bde3297 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.VehiclesModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.VideoModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.VideoModule.dll new file mode 100644 index 0000000..53e72e6 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.VideoModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.VirtualTexturingModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.VirtualTexturingModule.dll new file mode 100644 index 0000000..2ad4564 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.VirtualTexturingModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.WindModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.WindModule.dll new file mode 100644 index 0000000..ea9835c Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.WindModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.XRModule.dll b/Source/bin/BepInEx/net6.0/UnityEngine.XRModule.dll new file mode 100644 index 0000000..6c2cb84 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.XRModule.dll differ diff --git a/Source/bin/BepInEx/net6.0/UnityEngine.dll b/Source/bin/BepInEx/net6.0/UnityEngine.dll new file mode 100644 index 0000000..7e6192e Binary files /dev/null and b/Source/bin/BepInEx/net6.0/UnityEngine.dll differ diff --git a/Source/bin/BepInEx/net6.0/__Generated.dll b/Source/bin/BepInEx/net6.0/__Generated.dll new file mode 100644 index 0000000..54e231a Binary files /dev/null and b/Source/bin/BepInEx/net6.0/__Generated.dll differ diff --git a/Source/bin/BepInEx/net6.0/spine-csharp.dll b/Source/bin/BepInEx/net6.0/spine-csharp.dll new file mode 100644 index 0000000..17bb048 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/spine-csharp.dll differ diff --git a/Source/bin/BepInEx/net6.0/spine-unity.dll b/Source/bin/BepInEx/net6.0/spine-unity.dll new file mode 100644 index 0000000..61ce337 Binary files /dev/null and b/Source/bin/BepInEx/net6.0/spine-unity.dll differ diff --git a/Source/bin/MelonLoader/net6.0/0Harmony.dll b/Source/bin/MelonLoader/net6.0/0Harmony.dll new file mode 100644 index 0000000..c2a2298 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/0Harmony.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AsmResolver.DotNet.dll b/Source/bin/MelonLoader/net6.0/AsmResolver.DotNet.dll new file mode 100644 index 0000000..62e3515 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AsmResolver.DotNet.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AsmResolver.PE.File.dll b/Source/bin/MelonLoader/net6.0/AsmResolver.PE.File.dll new file mode 100644 index 0000000..5480ffc Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AsmResolver.PE.File.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AsmResolver.PE.dll b/Source/bin/MelonLoader/net6.0/AsmResolver.PE.dll new file mode 100644 index 0000000..660e19d Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AsmResolver.PE.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AsmResolver.dll b/Source/bin/MelonLoader/net6.0/AsmResolver.dll new file mode 100644 index 0000000..22dd1ed Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AsmResolver.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Assembly-CSharp.dll b/Source/bin/MelonLoader/net6.0/Assembly-CSharp.dll new file mode 100644 index 0000000..bbe071d Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Assembly-CSharp.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AssetRipper.Primitives.dll b/Source/bin/MelonLoader/net6.0/AssetRipper.Primitives.dll new file mode 100644 index 0000000..be95b71 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AssetRipper.Primitives.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AssetRipper.VersionUtilities.dll b/Source/bin/MelonLoader/net6.0/AssetRipper.VersionUtilities.dll new file mode 100644 index 0000000..aa8a372 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AssetRipper.VersionUtilities.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AssetsTools.NET.dll b/Source/bin/MelonLoader/net6.0/AssetsTools.NET.dll new file mode 100644 index 0000000..32d9f1f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AssetsTools.NET.dll differ diff --git a/Source/bin/MelonLoader/net6.0/AudioImportLib.dll b/Source/bin/MelonLoader/net6.0/AudioImportLib.dll new file mode 100644 index 0000000..1c45e71 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/AudioImportLib.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Iced.dll b/Source/bin/MelonLoader/net6.0/Iced.dll new file mode 100644 index 0000000..2d524f4 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Iced.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppCore.dll b/Source/bin/MelonLoader/net6.0/Il2CppCore.dll new file mode 100644 index 0000000..fff0db0 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppCore.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppInterop.Common.dll b/Source/bin/MelonLoader/net6.0/Il2CppInterop.Common.dll new file mode 100644 index 0000000..e614eb5 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppInterop.Common.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppInterop.Generator.dll b/Source/bin/MelonLoader/net6.0/Il2CppInterop.Generator.dll new file mode 100644 index 0000000..8352864 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppInterop.Generator.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppInterop.HarmonySupport.dll b/Source/bin/MelonLoader/net6.0/Il2CppInterop.HarmonySupport.dll new file mode 100644 index 0000000..90679a3 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppInterop.HarmonySupport.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppInterop.Runtime.dll b/Source/bin/MelonLoader/net6.0/Il2CppInterop.Runtime.dll new file mode 100644 index 0000000..f8ea534 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppInterop.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppMono.Security.dll b/Source/bin/MelonLoader/net6.0/Il2CppMono.Security.dll new file mode 100644 index 0000000..6643580 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppMono.Security.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppNewtonsoft.Json.dll b/Source/bin/MelonLoader/net6.0/Il2CppNewtonsoft.Json.dll new file mode 100644 index 0000000..8dc2b9b Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppNewtonsoft.Json.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSimpleFileBrowser.Runtime.dll b/Source/bin/MelonLoader/net6.0/Il2CppSimpleFileBrowser.Runtime.dll new file mode 100644 index 0000000..8bef629 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSimpleFileBrowser.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Configuration.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Configuration.dll new file mode 100644 index 0000000..53dcfdd Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Configuration.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Core.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Core.dll new file mode 100644 index 0000000..d8b5aac Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Core.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Data.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Data.dll new file mode 100644 index 0000000..8b967c7 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Data.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Drawing.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Drawing.dll new file mode 100644 index 0000000..08dec10 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Drawing.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Numerics.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Numerics.dll new file mode 100644 index 0000000..f97b7c4 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Numerics.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Runtime.Serialization.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Runtime.Serialization.dll new file mode 100644 index 0000000..53547c4 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Runtime.Serialization.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Xml.Linq.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Xml.Linq.dll new file mode 100644 index 0000000..da3c7c3 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Xml.Linq.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.Xml.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Xml.dll new file mode 100644 index 0000000..cbb7e1d Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.Xml.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppSystem.dll b/Source/bin/MelonLoader/net6.0/Il2CppSystem.dll new file mode 100644 index 0000000..f058d4b Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppSystem.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2CppUniTask.dll b/Source/bin/MelonLoader/net6.0/Il2CppUniTask.dll new file mode 100644 index 0000000..b2422fe Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2CppUniTask.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2Cpp__Generated.dll b/Source/bin/MelonLoader/net6.0/Il2Cpp__Generated.dll new file mode 100644 index 0000000..4b3e122 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2Cpp__Generated.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2Cppmscorlib.dll b/Source/bin/MelonLoader/net6.0/Il2Cppmscorlib.dll new file mode 100644 index 0000000..75fd90e Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2Cppmscorlib.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2Cppspine-csharp.dll b/Source/bin/MelonLoader/net6.0/Il2Cppspine-csharp.dll new file mode 100644 index 0000000..e5927d3 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2Cppspine-csharp.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Il2Cppspine-unity.dll b/Source/bin/MelonLoader/net6.0/Il2Cppspine-unity.dll new file mode 100644 index 0000000..4f01847 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Il2Cppspine-unity.dll differ diff --git a/Source/bin/MelonLoader/net6.0/IndexRange.dll b/Source/bin/MelonLoader/net6.0/IndexRange.dll new file mode 100644 index 0000000..79c8e6a Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/IndexRange.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MelonLoader.NativeHost.dll b/Source/bin/MelonLoader/net6.0/MelonLoader.NativeHost.dll new file mode 100644 index 0000000..61148ea Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MelonLoader.NativeHost.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MelonLoader.dll b/Source/bin/MelonLoader/net6.0/MelonLoader.dll new file mode 100644 index 0000000..e7ff1ad Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MelonLoader.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MelonLoader.pdb b/Source/bin/MelonLoader/net6.0/MelonLoader.pdb new file mode 100644 index 0000000..c09b300 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MelonLoader.pdb differ diff --git a/Source/bin/MelonLoader/net6.0/MelonLoader.xml b/Source/bin/MelonLoader/net6.0/MelonLoader.xml new file mode 100644 index 0000000..0a7e96a --- /dev/null +++ b/Source/bin/MelonLoader/net6.0/MelonLoader.xml @@ -0,0 +1,12618 @@ + + + + MelonLoader + + + + + Any additional credits that the mod author might want to include + + + + + AdditionalCredits constructor + + The additional credits of the mod + + + + The (simple) assembly names of Additional Dependencies that aren't directly referenced but should still be regarded as important. + + + + + Color of the Author Log. + + + + + Color of the Author Log. + + + + + Color of the Melon. + + + + + Color of the Author Log. + + + + + Developer of the Game. + + + + + Name of the Game. + + + + + If the Attribute is set as Universal or not. + + + + + Returns true or false if the Game is compatible with this Assembly. + + + + + Returns true or false if the Game is compatible with this Assembly. + + + + + Returns true or false if the Game is compatible with this Assembly specifically because of Universal Compatibility. + + + + + Version of the Game. + + + + + If the Attribute is set as Universal or not. + + + + ID of the Melon. + + + + The (simple) assembly names of the mods that are incompatible. + + + + + System.Type of the Melon. + + + + + Name of the Melon. + + + + + Version of the Melon. + + + + + Semantic Version of the Melon. Will be null if Version is not using the Semantic Versioning format. + + + + + Author of the Melon. + + + + + Download Link of the Melon. + + + + + MelonInfo constructor. + + The main Melon type of the Melon (for example TestMod) + Name of the Melon + Version of the Melon + Author of the Melon + URL to the download link of the mod [optional] + + + + MelonInfo constructor. + + The main Melon type of the Melon (for example TestMod) + Name of the Melon + Version Major of the Melon (Using the Semantic Versioning format) + Version Minor of the Melon (Using the Semantic Versioning format) + Version Revision of the Melon (Using the Semantic Versioning format) + Version Identifier of the Melon (Using the Semantic Versioning format) + Author of the Melon + URL to the download link of the mod [optional] + + + + MelonInfo constructor. + + The main Melon type of the Melon (for example TestMod) + Name of the Melon + Version Major of the Melon (Using the Semantic Versioning format) + Version Minor of the Melon (Using the Semantic Versioning format) + Version Revision of the Melon (Using the Semantic Versioning format) + Author of the Melon + URL to the download link of the mod [optional] + + + + The (simple) assembly names of the dependencies that should be regarded as optional. + + + + + Priority of the Melon. + + + + + Name of the Game's Executable without the '.exe' extension. + + + + + If the Attribute is set as Universal or not. + + + + + Checks if the Attribute is compatible with or not. + + + + + Build HashCode of MelonLoader. + + + + + Specified SemVersion. + + + + + Specified Version Major. + + + + + Specified Version Minor. + + + + + Specified Version Patch. + + + + + Specified Version Prerelease. + + + + + If Version Specified is a Minimum. + + + + + An example class to demonstrate compression and decompression of BZip2 streams. + + + + + Decompress the input writing + uncompressed data to the output stream + + The readable stream containing data to decompress. + The output stream to receive the decompressed data. + Both streams are closed on completion if true. + + + + Compress the input stream sending + result data to output stream + + The readable stream to compress. + The output stream to receive the compressed data. + Both streams are closed on completion if true. + Block size acts as compression level (1 to 9) with 1 giving + the lowest compression and 9 the highest. + + + + Defines internal values for both compression and decompression + + + + + Random numbers used to randomise repetitive blocks + + + + + When multiplied by compression parameter (1-9) gives the block size for compression + 9 gives the best compression but uses the most memory. + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + Backend constant + + + + + BZip2Exception represents exceptions specific to BZip2 classes and code. + + + + + Initialise a new instance of . + + + + + Initialise a new instance of with its message string. + + A that describes the error. + + + + Initialise a new instance of . + + A that describes the error. + The that caused this exception. + + + + Initializes a new instance of the BZip2Exception class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + An input stream that decompresses files in the BZip2 format + + + + + Construct instance for reading from stream + + Data source + + + + Get/set flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + + + + Gets a value indicating if the stream supports reading + + + + + Gets a value indicating whether the current stream supports seeking. + + + + + Gets a value indicating whether the current stream supports writing. + This property always returns false + + + + + Gets the length in bytes of the stream. + + + + + Gets the current position of the stream. + Setting the position is not supported and will throw a NotSupportException. + + Any attempt to set the position. + + + + Flushes the stream. + + + + + Set the streams position. This operation is not supported and will throw a NotSupportedException + + A byte offset relative to the parameter. + A value of type indicating the reference point used to obtain the new position. + The new position of the stream. + Any access + + + + Sets the length of this stream to the given value. + This operation is not supported and will throw a NotSupportedExceptionortedException + + The new length for the stream. + Any access + + + + Writes a block of bytes to this stream using data from a buffer. + This operation is not supported and will throw a NotSupportedException + + The buffer to source data from. + The offset to start obtaining data from. + The number of bytes of data to write. + Any access + + + + Writes a byte to the current position in the file stream. + This operation is not supported and will throw a NotSupportedException + + The value to write. + Any access + + + + Read a sequence of bytes and advances the read position by one byte. + + Array of bytes to store values in + Offset in array to begin storing data + The maximum number of bytes to read + The total number of bytes read into the buffer. This might be less + than the number of bytes requested if that number of bytes are not + currently available or zero if the end of the stream is reached. + + + + + Closes the stream, releasing any associated resources. + + + + + Read a byte from stream advancing position + + byte read or -1 on end of stream + + + + An output stream that compresses into the BZip2 format + including file header chars into another stream. + + + + + Construct a default output stream with maximum block size + + The stream to write BZip data onto. + + + + Initialise a new instance of the + for the specified stream, using the given blocksize. + + The stream to write compressed data to. + The block size to use. + + Valid block sizes are in the range 1..9, with 1 giving + the lowest compression and 9 the highest. + + + + + Ensures that resources are freed and other cleanup operations + are performed when the garbage collector reclaims the BZip2OutputStream. + + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + Gets a value indicating whether the current stream supports reading + + + + + Gets a value indicating whether the current stream supports seeking + + + + + Gets a value indicating whether the current stream supports writing + + + + + Gets the length in bytes of the stream + + + + + Gets or sets the current position of this stream. + + + + + Sets the current position of this stream to the given value. + + The point relative to the offset from which to being seeking. + The reference point from which to begin seeking. + The new position in the stream. + + + + Sets the length of this stream to the given value. + + The new stream length. + + + + Read a byte from the stream advancing the position. + + The byte read cast to an int; -1 if end of stream. + + + + Read a block of bytes + + The buffer to read into. + The offset in the buffer to start storing data at. + The maximum number of bytes to read. + The total number of bytes read. This might be less than the number of bytes + requested if that number of bytes are not currently available, or zero + if the end of the stream is reached. + + + + Write a block of bytes to the stream + + The buffer containing data to write. + The offset of the first byte to write. + The number of bytes to write. + + + + Write a byte to the stream. + + The byte to write to the stream. + + + + Get the number of bytes written to output. + + + + + Get the number of bytes written to the output. + + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Flush output buffers + + + + + Computes Adler32 checksum for a stream of data. An Adler32 + checksum is not as reliable as a CRC32 checksum, but a lot faster to + compute. + + The specification for Adler32 may be found in RFC 1950. + ZLIB Compressed Data Format Specification version 3.3) + + + From that document: + + "ADLER32 (Adler-32 checksum) + This contains a checksum value of the uncompressed data + (excluding any dictionary data) computed according to Adler-32 + algorithm. This algorithm is a 32-bit extension and improvement + of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 + standard. + + Adler-32 is composed of two sums accumulated per byte: s1 is + the sum of all bytes, s2 is the sum of all s1 values. Both sums + are done modulo 65521. s1 is initialized to 1, s2 to zero. The + Adler-32 checksum is stored as s2*65536 + s1 in most- + significant-byte first (network) order." + + "8.2. The Adler-32 algorithm + + The Adler-32 algorithm is much faster than the CRC32 algorithm yet + still provides an extremely low probability of undetected errors. + + The modulo on unsigned long accumulators can be delayed for 5552 + bytes, so the modulo operation time is negligible. If the bytes + are a, b, c, the second sum is 3a + 2b + c + 3, and so is position + and order sensitive, unlike the first sum, which is just a + checksum. That 65521 is prime is important to avoid a possible + large class of two-byte errors that leave the check unchanged. + (The Fletcher checksum uses 255, which is not prime and which also + makes the Fletcher check insensitive to single byte changes 0 - + 255.) + + The sum s1 is initialized to 1 instead of zero to make the length + of the sequence part of s2, so that the length does not have to be + checked separately. (Any sequence of zeroes has a Fletcher + checksum of zero.)" + + + + + + + largest prime smaller than 65536 + + + + + The CRC data checksum so far. + + + + + Initialise a default instance of + + + + + Resets the Adler32 data checksum as if no update was ever called. + + + + + Returns the Adler32 data checksum computed so far. + + + + + Updates the checksum with the byte b. + + + The data value to add. The high byte of the int is ignored. + + + + + Updates the Adler32 data checksum with the bytes taken from + a block of data. + + Contains the data to update the checksum with. + + + + Update Adler32 data checksum based on a portion of a block of data + + + The chunk of data to add + + + + + CRC-32 with unreversed data and reversed output + + + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + This implementation uses sixteen lookup tables stored in one linear array + to implement the slicing-by-16 algorithm, a variant of the slicing-by-8 + algorithm described in this Intel white paper: + + https://web.archive.org/web/20120722193753/http://download.intel.com/technology/comms/perfnet/download/slicing-by-8.pdf + + The first lookup table is simply the CRC of all possible eight bit values. + Each successive lookup table is derived from the original table generated + by Sarwate's algorithm. Slicing a 16-bit input and XORing the outputs + together will produce the same output as a byte-by-byte CRC loop with + fewer arithmetic and bit manipulation operations, at the cost of increased + memory consumed by the lookup tables. (Slicing-by-16 requires a 16KB table, + which is still small enough to fit in most processors' L1 cache.) + + + + + The CRC data checksum so far. + + + + + Initialise a default instance of + + + + + Resets the CRC data checksum as if no update was ever called. + + + + + Returns the CRC data checksum computed so far. + + Reversed Out = true + + + + Updates the checksum with the int bval. + + + the byte is taken as the lower 8 bits of bval + + Reversed Data = false + + + + Updates the CRC data checksum with the bytes taken from + a block of data. + + Contains the data to update the CRC with. + + + + Update CRC data checksum based on a portion of a block of data + + + The chunk of data to add + + + + + Internal helper function for updating a block of data using slicing. + + The array containing the data to add + Range start for (inclusive) + The number of bytes to checksum starting from + + + + A non-inlined function for updating data that doesn't fit in a 16-byte + block. We don't expect to enter this function most of the time, and when + we do we're not here for long, so disabling inlining here improves + performance overall. + + The array containing the data to add + Range start for (inclusive) + Range end for (exclusive) + + + + CRC-32 with reversed data and unreversed output + + + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + This implementation uses sixteen lookup tables stored in one linear array + to implement the slicing-by-16 algorithm, a variant of the slicing-by-8 + algorithm described in this Intel white paper: + + https://web.archive.org/web/20120722193753/http://download.intel.com/technology/comms/perfnet/download/slicing-by-8.pdf + + The first lookup table is simply the CRC of all possible eight bit values. + Each successive lookup table is derived from the original table generated + by Sarwate's algorithm. Slicing a 16-bit input and XORing the outputs + together will produce the same output as a byte-by-byte CRC loop with + fewer arithmetic and bit manipulation operations, at the cost of increased + memory consumed by the lookup tables. (Slicing-by-16 requires a 16KB table, + which is still small enough to fit in most processors' L1 cache.) + + + + + The CRC data checksum so far. + + + + + Initialise a default instance of + + + + + Resets the CRC data checksum as if no update was ever called. + + + + + Returns the CRC data checksum computed so far. + + Reversed Out = false + + + + Updates the checksum with the int bval. + + + the byte is taken as the lower 8 bits of bval + + Reversed Data = true + + + + Updates the CRC data checksum with the bytes taken from + a block of data. + + Contains the data to update the CRC with. + + + + Update CRC data checksum based on a portion of a block of data + + + The chunk of data to add + + + + + Internal helper function for updating a block of data using slicing. + + The array containing the data to add + Range start for (inclusive) + The number of bytes to checksum starting from + + + + A non-inlined function for updating data that doesn't fit in a 16-byte + block. We don't expect to enter this function most of the time, and when + we do we're not here for long, so disabling inlining here improves + performance overall. + + The array containing the data to add + Range start for (inclusive) + Range end for (exclusive) + + + + The number of slicing lookup tables to generate. + + + + + Generates multiple CRC lookup tables for a given polynomial, stored + in a linear array of uints. The first block (i.e. the first 256 + elements) is the same as the byte-by-byte CRC lookup table. + + The generating CRC polynomial + Whether the polynomial is in reversed bit order + A linear array of 256 * elements + + This table could also be generated as a rectangular array, but the + JIT compiler generates slower code than if we use a linear array. + Known issue, see: https://github.com/dotnet/runtime/issues/30275 + + + + + Mixes the first four bytes of input with + using normal ordering before calling . + + Array of data to checksum + Offset to start reading from + The table to use for slicing-by-16 lookup + Checksum state before this update call + A new unfinalized checksum value + + + Assumes input[offset]..input[offset + 15] are valid array indexes. + For performance reasons, this must be checked by the caller. + + + + + Mixes the first four bytes of input with + using reflected ordering before calling . + + Array of data to checksum + Offset to start reading from + The table to use for slicing-by-16 lookup + Checksum state before this update call + A new unfinalized checksum value + + + Assumes input[offset]..input[offset + 15] are valid array indexes. + For performance reasons, this must be checked by the caller. + + + + + A shared method for updating an unfinalized CRC checksum using slicing-by-16. + + Array of data to checksum + Offset to start reading from + The table to use for slicing-by-16 lookup + First byte of input after mixing with the old CRC + Second byte of input after mixing with the old CRC + Third byte of input after mixing with the old CRC + Fourth byte of input after mixing with the old CRC + A new unfinalized checksum value + + + Even though the first four bytes of input are fed in as arguments, + should be the same value passed to this + function's caller (either or + ). This method will get inlined + into both functions, so using the same offset produces faster code. + + + Because most processors running C# have some kind of instruction-level + parallelism, the order of XOR operations can affect performance. This + ordering assumes that the assembly code generated by the just-in-time + compiler will emit a bunch of arithmetic operations for checking array + bounds. Then it opportunistically XORs a1 and a2 to keep the processor + busy while those other parts of the pipeline handle the range check + calculations. + + + + + + Interface to compute a data checksum used by checked input/output streams. + A data checksum can be updated by one byte or with a byte array. After each + update the value of the current checksum can be returned by calling + getValue. The complete checksum object can also be reset + so it can be used again with new data. + + + + + Resets the data checksum as if no update was ever called. + + + + + Returns the data checksum computed so far. + + + + + Adds one byte to the data checksum. + + + the data value to add. The high byte of the int is ignored. + + + + + Updates the data checksum with the bytes taken from the array. + + + buffer an array of bytes + + + + + Adds the byte array to the data checksum. + + + The chunk of data to add + + + + + Event arguments for scanning. + + + + + Initialise a new instance of + + The file or directory name. + + + + The file or directory name for this event. + + + + + Get set a value indicating if scanning should continue or not. + + + + + Event arguments during processing of a single file or directory. + + + + + Initialise a new instance of + + The file or directory name if known. + The number of bytes processed so far + The total number of bytes to process, 0 if not known + + + + The name for this event if known. + + + + + Get set a value indicating whether scanning should continue or not. + + + + + Get a percentage representing how much of the has been processed + + 0.0 to 100.0 percent; 0 if target is not known. + + + + The number of bytes processed so far + + + + + The number of bytes to process. + + Target may be 0 or negative if the value isnt known. + + + + Event arguments for directories. + + + + + Initialize an instance of . + + The name for this directory. + Flag value indicating if any matching files are contained in this directory. + + + + Get a value indicating if the directory contains any matching files or not. + + + + + Arguments passed when scan failures are detected. + + + + + Initialise a new instance of + + The name to apply. + The exception to use. + + + + The applicable name. + + + + + The applicable exception. + + + + + Get / set a value indicating whether scanning should continue. + + + + + Delegate invoked before starting to process a file. + + The source of the event + The event arguments. + + + + Delegate invoked during processing of a file or directory + + The source of the event + The event arguments. + + + + Delegate invoked when a file has been completely processed. + + The source of the event + The event arguments. + + + + Delegate invoked when a directory failure is detected. + + The source of the event + The event arguments. + + + + Delegate invoked when a file failure is detected. + + The source of the event + The event arguments. + + + + FileSystemScanner provides facilities scanning of files and directories. + + + + + Initialise a new instance of + + The file filter to apply when scanning. + + + + Initialise a new instance of + + The file filter to apply. + The directory filter to apply. + + + + Initialise a new instance of + + The file filter to apply. + + + + Initialise a new instance of + + The file filter to apply. + The directory filter to apply. + + + + Delegate to invoke when a directory is processed. + + + + + Delegate to invoke when a file is processed. + + + + + Delegate to invoke when processing for a file has finished. + + + + + Delegate to invoke when a directory failure is detected. + + + + + Delegate to invoke when a file failure is detected. + + + + + Raise the DirectoryFailure event. + + The directory name. + The exception detected. + + + + Raise the FileFailure event. + + The file name. + The exception detected. + + + + Raise the ProcessFile event. + + The file name. + + + + Raise the complete file event + + The file name + + + + Raise the ProcessDirectory event. + + The directory name. + Flag indicating if the directory has matching files. + + + + Scan a directory. + + The base directory to scan. + True to recurse subdirectories, false to scan a single directory. + + + + The file filter currently in use. + + + + + The directory filter currently in use. + + + + + Flag indicating if scanning should continue running. + + + + + INameTransform defines how file system names are transformed for use with archives, or vice versa. + + + + + Given a file name determine the transformed value. + + The name to transform. + The transformed file name. + + + + Given a directory name determine the transformed value. + + The name to transform. + The transformed directory name + + + + InvalidNameException is thrown for invalid names such as directory traversal paths and names with invalid characters + + + + + Initializes a new instance of the InvalidNameException class with a default error message. + + + + + Initializes a new instance of the InvalidNameException class with a specified error message. + + A message describing the exception. + + + + Initializes a new instance of the InvalidNameException class with a specified + error message and a reference to the inner exception that is the cause of this exception. + + A message describing the exception. + The inner exception + + + + Initializes a new instance of the InvalidNameException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Scanning filters support filtering of names. + + + + + Test a name to see if it 'matches' the filter. + + The name to test. + Returns true if the name matches the filter, false if it does not match. + + + + NameFilter is a string matching class which allows for both positive and negative + matching. + A filter is a sequence of independant regular expressions separated by semi-colons ';'. + To include a semi-colon it may be quoted as in \;. Each expression can be prefixed by a plus '+' sign or + a minus '-' sign to denote the expression is intended to include or exclude names. + If neither a plus or minus sign is found include is the default. + A given name is tested for inclusion before checking exclusions. Only names matching an include spec + and not matching an exclude spec are deemed to match the filter. + An empty filter matches any name. + + The following expression includes all name ending in '.dat' with the exception of 'dummy.dat' + "+\.dat$;-^dummy\.dat$" + + + + + Construct an instance based on the filter expression passed + + The filter expression. + + + + Test a string to see if it is a valid regular expression. + + The expression to test. + True if expression is a valid false otherwise. + + + + Test an expression to see if it is valid as a filter. + + The filter expression to test. + True if the expression is valid, false otherwise. + + + + Split a string into its component pieces + + The original string + Returns an array of values containing the individual filter elements. + + + + Convert this filter to its string equivalent. + + The string equivalent for this filter. + + + + Test a value to see if it is included by the filter. + + The value to test. + True if the value is included, false otherwise. + + + + Test a value to see if it is excluded by the filter. + + The value to test. + True if the value is excluded, false otherwise. + + + + Test a value to see if it matches the filter. + + The value to test. + True if the value matches, false otherwise. + + + + Compile this filter. + + + + + PathFilter filters directories and files using a form of regular expressions + by full path name. + See NameFilter for more detail on filtering. + + + + + Initialise a new instance of . + + The filter expression to apply. + + + + Test a name to see if it matches the filter. + + The name to test. + True if the name matches, false otherwise. + is used to get the full path before matching. + + + + ExtendedPathFilter filters based on name, file size, and the last write time of the file. + + Provides an example of how to customise filtering. + + + + Initialise a new instance of ExtendedPathFilter. + + The filter to apply. + The minimum file size to include. + The maximum file size to include. + + + + Initialise a new instance of ExtendedPathFilter. + + The filter to apply. + The minimum to include. + The maximum to include. + + + + Initialise a new instance of ExtendedPathFilter. + + The filter to apply. + The minimum file size to include. + The maximum file size to include. + The minimum to include. + The maximum to include. + + + + Test a filename to see if it matches the filter. + + The filename to test. + True if the filter matches, false otherwise. + The doesnt exist + + + + Get/set the minimum size/length for a file that will match this filter. + + The default value is zero. + value is less than zero; greater than + + + + Get/set the maximum size/length for a file that will match this filter. + + The default value is + value is less than zero or less than + + + + Get/set the minimum value that will match for this filter. + + Files with a LastWrite time less than this value are excluded by the filter. + + + + Get/set the maximum value that will match for this filter. + + Files with a LastWrite time greater than this value are excluded by the filter. + + + + NameAndSizeFilter filters based on name and file size. + + A sample showing how filters might be extended. + + + + Initialise a new instance of NameAndSizeFilter. + + The filter to apply. + The minimum file size to include. + The maximum file size to include. + + + + Test a filename to see if it matches the filter. + + The filename to test. + True if the filter matches, false otherwise. + + + + Get/set the minimum size for a file that will match this filter. + + + + + Get/set the maximum size for a file that will match this filter. + + + + + PathUtils provides simple utilities for handling paths. + + + + + Remove any path root present in the path + + A containing path information. + The path with the root removed if it was present; path otherwise. + + + + Returns a random file name in the users temporary directory, or in directory of if specified + + If specified, used as the base file name for the temporary file + Returns a temporary file name + + + + Provides simple " utilities. + + + + + Read from a ensuring all the required data is read. + + The stream to read. + The buffer to fill. + + + + + Read from a " ensuring all the required data is read. + + The stream to read data from. + The buffer to store data in. + The offset at which to begin storing data. + The number of bytes of data to store. + Required parameter is null + and or are invalid. + End of stream is encountered before all the data has been read. + + + + Read as much data as possible from a ", up to the requested number of bytes + + The stream to read data from. + The buffer to store data in. + The offset at which to begin storing data. + The number of bytes of data to store. + Required parameter is null + and or are invalid. + + + + Copy the contents of one to another. + + The stream to source data from. + The stream to write data to. + The buffer to use during copying. + + + + Copy the contents of one to another. + + The stream to source data from. + The stream to write data to. + The buffer to use during copying. + The progress handler delegate to use. + The minimum between progress updates. + The source for this event. + The name to use with the event. + This form is specialised for use within #Zip to support events during archive operations. + + + + Copy the contents of one to another. + + The stream to source data from. + The stream to write data to. + The buffer to use during copying. + The progress handler delegate to use. + The minimum between progress updates. + The source for this event. + The name to use with the event. + A predetermined fixed target value to use with progress updates. + If the value is negative the target is calculated by looking at the stream. + This form is specialised for use within #Zip to support events during archive operations. + + + + Initialise an instance of + + + + + SharpZipBaseException is the base exception class for SharpZipLib. + All library exceptions are derived from this. + + NOTE: Not all exceptions thrown will be derived from this class. + A variety of other exceptions are possible for example + + + + Initializes a new instance of the SharpZipBaseException class. + + + + + Initializes a new instance of the SharpZipBaseException class with a specified error message. + + A message describing the exception. + + + + Initializes a new instance of the SharpZipBaseException class with a specified + error message and a reference to the inner exception that is the cause of this exception. + + A message describing the exception. + The inner exception + + + + Initializes a new instance of the SharpZipBaseException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Indicates that an error occurred during decoding of a input stream due to corrupt + data or (unintentional) library incompatibility. + + + + + Initializes a new instance of the StreamDecodingException with a generic message + + + + + Initializes a new instance of the StreamDecodingException class with a specified error message. + + A message describing the exception. + + + + Initializes a new instance of the StreamDecodingException class with a specified + error message and a reference to the inner exception that is the cause of this exception. + + A message describing the exception. + The inner exception + + + + Initializes a new instance of the StreamDecodingException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Indicates that the input stream could not decoded due to known library incompability or missing features + + + + + Initializes a new instance of the StreamUnsupportedException with a generic message + + + + + Initializes a new instance of the StreamUnsupportedException class with a specified error message. + + A message describing the exception. + + + + Initializes a new instance of the StreamUnsupportedException class with a specified + error message and a reference to the inner exception that is the cause of this exception. + + A message describing the exception. + The inner exception + + + + Initializes a new instance of the StreamUnsupportedException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Indicates that the input stream could not decoded due to the stream ending before enough data had been provided + + + + + Initializes a new instance of the UnexpectedEndOfStreamException with a generic message + + + + + Initializes a new instance of the UnexpectedEndOfStreamException class with a specified error message. + + A message describing the exception. + + + + Initializes a new instance of the UnexpectedEndOfStreamException class with a specified + error message and a reference to the inner exception that is the cause of this exception. + + A message describing the exception. + The inner exception + + + + Initializes a new instance of the UnexpectedEndOfStreamException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Indicates that a value was outside of the expected range when decoding an input stream + + + + + Initializes a new instance of the ValueOutOfRangeException class naming the causing variable + + Name of the variable, use: nameof() + + + + Initializes a new instance of the ValueOutOfRangeException class naming the causing variable, + it's current value and expected range. + + Name of the variable, use: nameof() + The invalid value + Expected maximum value + Expected minimum value + + + + Initializes a new instance of the ValueOutOfRangeException class naming the causing variable, + it's current value and expected range. + + Name of the variable, use: nameof() + The invalid value + Expected maximum value + Expected minimum value + + + + Initializes a new instance of the ValueOutOfRangeException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + PkzipClassic embodies the classic or original encryption facilities used in Pkzip archives. + While it has been superceded by more recent and more powerful algorithms, its still in use and + is viable for preventing casual snooping + + + + + Generates new encryption keys based on given seed + + The seed value to initialise keys with. + A new key value. + + + + PkzipClassicCryptoBase provides the low level facilities for encryption + and decryption using the PkzipClassic algorithm. + + + + + Transform a single byte + + + The transformed value + + + + + Set the key schedule for encryption/decryption. + + The data use to set the keys from. + + + + Update encryption keys + + + + + Reset the internal state. + + + + + PkzipClassic CryptoTransform for encryption. + + + + + Initialise a new instance of + + The key block to use. + + + + Transforms the specified region of the specified byte array. + + The input for which to compute the transform. + The offset into the byte array from which to begin using data. + The number of bytes in the byte array to use as data. + The computed transform. + + + + Transforms the specified region of the input byte array and copies + the resulting transform to the specified region of the output byte array. + + The input for which to compute the transform. + The offset into the input byte array from which to begin using data. + The number of bytes in the input byte array to use as data. + The output to which to write the transform. + The offset into the output byte array from which to begin writing data. + The number of bytes written. + + + + Gets a value indicating whether the current transform can be reused. + + + + + Gets the size of the input data blocks in bytes. + + + + + Gets the size of the output data blocks in bytes. + + + + + Gets a value indicating whether multiple blocks can be transformed. + + + + + Cleanup internal state. + + + + + PkzipClassic CryptoTransform for decryption. + + + + + Initialise a new instance of . + + The key block to decrypt with. + + + + Transforms the specified region of the specified byte array. + + The input for which to compute the transform. + The offset into the byte array from which to begin using data. + The number of bytes in the byte array to use as data. + The computed transform. + + + + Transforms the specified region of the input byte array and copies + the resulting transform to the specified region of the output byte array. + + The input for which to compute the transform. + The offset into the input byte array from which to begin using data. + The number of bytes in the input byte array to use as data. + The output to which to write the transform. + The offset into the output byte array from which to begin writing data. + The number of bytes written. + + + + Gets a value indicating whether the current transform can be reused. + + + + + Gets the size of the input data blocks in bytes. + + + + + Gets the size of the output data blocks in bytes. + + + + + Gets a value indicating whether multiple blocks can be transformed. + + + + + Cleanup internal state. + + + + + Defines a wrapper object to access the Pkzip algorithm. + This class cannot be inherited. + + + + + Get / set the applicable block size in bits. + + The only valid block size is 8. + + + + Get an array of legal key sizes. + + + + + Generate an initial vector. + + + + + Get an array of legal block sizes. + + + + + Get / set the key value applicable. + + + + + Generate a new random key. + + + + + Create an encryptor. + + The key to use for this encryptor. + Initialisation vector for the new encryptor. + Returns a new PkzipClassic encryptor + + + + Create a decryptor. + + Keys to use for this new decryptor. + Initialisation vector for the new decryptor. + Returns a new decryptor. + + + + Encrypts and decrypts AES ZIP + + + Based on information from http://www.winzip.com/aes_info.htm + and http://www.gladman.me.uk/cryptography_technology/fileencrypt/ + + + + + Constructor + + The stream on which to perform the cryptographic transformation. + Instance of ZipAESTransform + Read or Write + + + + Reads a sequence of bytes from the current CryptoStream into buffer, + and advances the position within the stream by the number of bytes read. + + + + + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + + An array of bytes. This method copies count bytes from buffer to the current stream. + The byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + + + + Transforms stream using AES in CTR mode + + + + + Constructor. + + Password string + Random bytes, length depends on encryption strength. + 128 bits = 8 bytes, 192 bits = 12 bytes, 256 bits = 16 bytes. + The encryption strength, in bytes eg 16 for 128 bits. + True when creating a zip, false when reading. For the AuthCode. + + + + + Implement the ICryptoTransform method. + + + + + Returns the 2 byte password verifier + + + + + Returns the 10 byte AUTH CODE to be checked or appended immediately following the AES data stream. + + + + + Not implemented. + + + + + Gets the size of the input data blocks in bytes. + + + + + Gets the size of the output data blocks in bytes. + + + + + Gets a value indicating whether multiple blocks can be transformed. + + + + + Gets a value indicating whether the current transform can be reused. + + + + + Cleanup internal state. + + + + + An example class to demonstrate compression and decompression of GZip streams. + + + + + Decompress the input writing + uncompressed data to the output stream + + The readable stream containing data to decompress. + The output stream to receive the decompressed data. + Both streams are closed on completion if true. + Input or output stream is null + + + + Compress the input stream sending + result data to output stream + + The readable stream to compress. + The output stream to receive the compressed data. + Both streams are closed on completion if true. + Deflate buffer size, minimum 512 + Deflate compression level, 0-9 + Input or output stream is null + Buffer Size is smaller than 512 + Compression level outside 0-9 + + + + This class contains constants used for gzip. + + + + + First GZip identification byte + + + + + Second GZip identification byte + + + + + Deflate compression method + + + + + Get the GZip specified encoding (CP-1252 if supported, otherwise ASCII) + + + + + GZip header flags + + + + + Text flag hinting that the file is in ASCII + + + + + CRC flag indicating that a CRC16 preceeds the data + + + + + Extra flag indicating that extra fields are present + + + + + Filename flag indicating that the original filename is present + + + + + Flag bit mask indicating that a comment is present + + + + + GZipException represents exceptions specific to GZip classes and code. + + + + + Initialise a new instance of . + + + + + Initialise a new instance of with its message string. + + A that describes the error. + + + + Initialise a new instance of . + + A that describes the error. + The that caused this exception. + + + + Initializes a new instance of the GZipException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + This filter stream is used to decompress a "GZIP" format stream. + The "GZIP" format is described baseInputStream RFC 1952. + + author of the original java version : John Leuner + + This sample shows how to unzip a gzipped file + + using System; + using System.IO; + + using MelonLoader.ICSharpCode.SharpZipLib.Core; + using MelonLoader.ICSharpCode.SharpZipLib.GZip; + + class MainClass + { + public static void Main(string[] args) + { + using (Stream inStream = new GZipInputStream(File.OpenRead(args[0]))) + using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) { + byte[] buffer = new byte[4096]; + StreamUtils.Copy(inStream, outStream, buffer); + } + } + } + + + + + + CRC-32 value for uncompressed data + + + + + Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data). + This is tracked per-block as the file is parsed. + + + + + Flag to indicate if at least one block in a stream with concatenated blocks was read successfully. + This allows us to exit gracefully if downstream data is not in gzip format. + + + + + Creates a GZipInputStream with the default buffer size + + + The stream to read compressed data from (baseInputStream GZIP format) + + + + + Creates a GZIPInputStream with the specified buffer size + + + The stream to read compressed data from (baseInputStream GZIP format) + + + Size of the buffer to use + + + + + Reads uncompressed data into an array of bytes + + + The buffer to read uncompressed data into + + + The offset indicating where the data should be placed + + + The number of uncompressed bytes to be read + + Returns the number of bytes actually read. + + + + Retrieves the filename header field for the block last read + + + + + + This filter stream is used to compress a stream into a "GZIP" stream. + The "GZIP" format is described in RFC 1952. + + author of the original java version : John Leuner + + This sample shows how to gzip a file + + using System; + using System.IO; + + using MelonLoader.ICSharpCode.SharpZipLib.GZip; + using MelonLoader.ICSharpCode.SharpZipLib.Core; + + class MainClass + { + public static void Main(string[] args) + { + using (Stream s = new GZipOutputStream(File.Create(args[0] + ".gz"))) + using (FileStream fs = File.OpenRead(args[0])) { + byte[] writeData = new byte[4096]; + Streamutils.Copy(s, fs, writeData); + } + } + } + } + + + + + + CRC-32 value for uncompressed data + + + + + Creates a GzipOutputStream with the default buffer size + + + The stream to read data (to be compressed) from + + + + + Creates a GZipOutputStream with the specified buffer size + + + The stream to read data (to be compressed) from + + + Size of the buffer to use + + + + + Sets the active compression level (0-9). The new level will be activated + immediately. + + The compression level to set. + + Level specified is not supported. + + + + + + Get the current compression level. + + The current compression level. + + + + Original filename + + + + + Write given buffer to output updating crc + + Buffer to write + Offset of first byte in buf to write + Number of bytes to write + + + + Writes remaining compressed output data to the output stream + and closes it. + + + + + Flushes the stream by ensuring the header is written, and then calling Flush + on the deflater. + + + + + Finish compression and write any footer information required to stream + + + + + This class contains constants used for LZW + + + + + Magic number found at start of LZW header: 0x1f 0x9d + + + + + Maximum number of bits per code + + + + + Mask for 'number of compression bits' + + + + + Indicates the presence of a fourth header byte + + + + + Reserved bits + + + + + Block compression: if table is full and compression rate is dropping, + clear the dictionary. + + + + + LZW file header size (in bytes) + + + + + Initial number of bits per code + + + + + LzwException represents exceptions specific to LZW classes and code. + + + + + Initialise a new instance of . + + + + + Initialise a new instance of with its message string. + + A that describes the error. + + + + Initialise a new instance of . + + A that describes the error. + The that caused this exception. + + + + Initializes a new instance of the LzwException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + This filter stream is used to decompress a LZW format stream. + Specifically, a stream that uses the LZC compression method. + This file format is usually associated with the .Z file extension. + + See http://en.wikipedia.org/wiki/Compress + See http://wiki.wxwidgets.org/Development:_Z_File_Format + + The file header consists of 3 (or optionally 4) bytes. The first two bytes + contain the magic marker "0x1f 0x9d", followed by a byte of flags. + + Based on Java code by Ronald Tschalar, which in turn was based on the unlzw.c + code in the gzip package. + + This sample shows how to unzip a compressed file + + using System; + using System.IO; + + using MelonLoader.ICSharpCode.SharpZipLib.Core; + using MelonLoader.ICSharpCode.SharpZipLib.LZW; + + class MainClass + { + public static void Main(string[] args) + { + using (Stream inStream = new LzwInputStream(File.OpenRead(args[0]))) + using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) { + byte[] buffer = new byte[4096]; + StreamUtils.Copy(inStream, outStream, buffer); + // OR + inStream.Read(buffer, 0, buffer.Length); + // now do something with the buffer + } + } + } + + + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + Creates a LzwInputStream + + + The stream to read compressed data from (baseInputStream LZW format) + + + + + See + + + + + + Reads decompressed data into the provided buffer byte array + + + The array to read and decompress data into + + + The offset indicating where the data should be placed + + + The number of bytes to decompress + + The number of bytes read. Zero signals the end of stream + + + + Moves the unread data in the buffer to the beginning and resets + the pointers. + + + + + + + Gets a value indicating whether the current stream supports reading + + + + + Gets a value of false indicating seeking is not supported for this stream. + + + + + Gets a value of false indicating that this stream is not writeable. + + + + + A value representing the length of the stream in bytes. + + + + + The current position within the stream. + Throws a NotSupportedException when attempting to set the position + + Attempting to set the position + + + + Flushes the baseInputStream + + + + + Sets the position within the current stream + Always throws a NotSupportedException + + The relative offset to seek to. + The defining where to seek from. + The new position in the stream. + Any access + + + + Set the length of the current stream + Always throws a NotSupportedException + + The new length value for the stream. + Any access + + + + Writes a sequence of bytes to stream and advances the current position + This method always throws a NotSupportedException + + The buffer containing data to write. + The offset of the first byte to write. + The number of bytes to write. + Any access + + + + Writes one byte to the current stream and advances the current position + Always throws a NotSupportedException + + The byte to write. + Any access + + + + Closes the input stream. When + is true the underlying stream is also closed. + + + + + Flag indicating wether this instance has been closed or not. + + + + + This exception is used to indicate that there is a problem + with a TAR archive header. + + + + + Initialise a new instance of the InvalidHeaderException class. + + + + + Initialises a new instance of the InvalidHeaderException class with a specified message. + + Message describing the exception cause. + + + + Initialise a new instance of InvalidHeaderException + + Message describing the problem. + The exception that is the cause of the current exception. + + + + Initializes a new instance of the InvalidHeaderException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Used to advise clients of 'events' while processing archives + + + + + The TarArchive class implements the concept of a + 'Tape Archive'. A tar archive is a series of entries, each of + which represents a file system object. Each entry in + the archive consists of a header block followed by 0 or more data blocks. + Directory entries consist only of the header block, and are followed by entries + for the directory's contents. File entries consist of a + header followed by the number of blocks needed to + contain the file's contents. All entries are written on + block boundaries. Blocks are 512 bytes long. + + TarArchives are instantiated in either read or write mode, + based upon whether they are instantiated with an InputStream + or an OutputStream. Once instantiated TarArchives read/write + mode can not be changed. + + There is currently no support for random access to tar archives. + However, it seems that subclassing TarArchive, and using the + TarBuffer.CurrentRecord and TarBuffer.CurrentBlock + properties, this would be rather trivial. + + + + + Client hook allowing detailed information to be reported during processing + + + + + Raises the ProgressMessage event + + The TarEntry for this event + message for this event. Null is no message + + + + Constructor for a default . + + + + + Initialise a TarArchive for input. + + The to use for input. + + + + Initialise a TarArchive for output. + + The to use for output. + + + + The InputStream based constructors create a TarArchive for the + purposes of extracting or listing a tar archive. Thus, use + these constructors when you wish to extract files from or list + the contents of an existing tar archive. + + The stream to retrieve archive data from. + Returns a new suitable for reading from. + + + + The InputStream based constructors create a TarArchive for the + purposes of extracting or listing a tar archive. Thus, use + these constructors when you wish to extract files from or list + the contents of an existing tar archive. + + The stream to retrieve archive data from. + The used for the Name fields, or null for ASCII only + Returns a new suitable for reading from. + + + + Create TarArchive for reading setting block factor + + A stream containing the tar archive contents + The blocking factor to apply + Returns a suitable for reading. + + + + Create TarArchive for reading setting block factor + + A stream containing the tar archive contents + The blocking factor to apply + The used for the Name fields, or null for ASCII only + Returns a suitable for reading. + + + + Create a TarArchive for writing to, using the default blocking factor + + The to write to + The used for the Name fields, or null for ASCII only + Returns a suitable for writing. + + + + Create a TarArchive for writing to, using the default blocking factor + + The to write to + Returns a suitable for writing. + + + + Create a tar archive for writing. + + The stream to write to + The blocking factor to use for buffering. + Returns a suitable for writing. + + + + Create a tar archive for writing. + + The stream to write to + The blocking factor to use for buffering. + The used for the Name fields, or null for ASCII only + Returns a suitable for writing. + + + + Set the flag that determines whether existing files are + kept, or overwritten during extraction. + + + If true, do not overwrite existing files. + + + + + Get/set the ascii file translation flag. If ascii file translation + is true, then the file is checked to see if it a binary file or not. + If the flag is true and the test indicates it is ascii text + file, it will be translated. The translation converts the local + operating system's concept of line ends into the UNIX line end, + '\n', which is the defacto standard for a TAR archive. This makes + text files compatible with UNIX. + + + + + Set the ascii file translation flag. + + + If true, translate ascii text files. + + + + + PathPrefix is added to entry names as they are written if the value is not null. + A slash character is appended after PathPrefix + + + + + RootPath is removed from entry names if it is found at the + beginning of the name. + + + + + Set user and group information that will be used to fill in the + tar archive's entry headers. This information is based on that available + for the linux operating system, which is not always available on other + operating systems. TarArchive allows the programmer to specify values + to be used in their place. + is set to true by this call. + + + The user id to use in the headers. + + + The user name to use in the headers. + + + The group id to use in the headers. + + + The group name to use in the headers. + + + + + Get or set a value indicating if overrides defined by SetUserInfo should be applied. + + If overrides are not applied then the values as set in each header will be used. + + + + Get the archive user id. + See ApplyUserInfoOverrides for detail + on how to allow setting values on a per entry basis. + + + The current user id. + + + + + Get the archive user name. + See ApplyUserInfoOverrides for detail + on how to allow setting values on a per entry basis. + + + The current user name. + + + + + Get the archive group id. + See ApplyUserInfoOverrides for detail + on how to allow setting values on a per entry basis. + + + The current group id. + + + + + Get the archive group name. + See ApplyUserInfoOverrides for detail + on how to allow setting values on a per entry basis. + + + The current group name. + + + + + Get the archive's record size. Tar archives are composed of + a series of RECORDS each containing a number of BLOCKS. + This allowed tar archives to match the IO characteristics of + the physical device being used. Archives are expected + to be properly "blocked". + + + The record size this archive is using. + + + + + Sets the IsStreamOwner property on the underlying stream. + Set this to false to prevent the Close of the TarArchive from closing the stream. + + + + + Close the archive. + + + + + Perform the "list" command for the archive contents. + + NOTE That this method uses the progress event to actually list + the contents. If the progress display event is not set, nothing will be listed! + + + + + Perform the "extract" command and extract the contents of the archive. + + + The destination directory into which to extract. + + + + + Perform the "extract" command and extract the contents of the archive. + + + The destination directory into which to extract. + + Allow parent directory traversal in file paths (e.g. ../file) + + + + Extract an entry from the archive. This method assumes that the + tarIn stream has been properly set with a call to GetNextEntry(). + + + The destination directory into which to extract. + + + The TarEntry returned by tarIn.GetNextEntry(). + + Allow parent directory traversal in file paths (e.g. ../file) + + + + Write an entry to the archive. This method will call the putNextEntry + and then write the contents of the entry, and finally call closeEntry() + for entries that are files. For directories, it will call putNextEntry(), + and then, if the recurse flag is true, process each entry that is a + child of the directory. + + + The TarEntry representing the entry to write to the archive. + + + If true, process the children of directory entries. + + + + + Write an entry to the archive. This method will call the putNextEntry + and then write the contents of the entry, and finally call closeEntry() + for entries that are files. For directories, it will call putNextEntry(), + and then, if the recurse flag is true, process each entry that is a + child of the directory. + + + The TarEntry representing the entry to write to the archive. + + + If true, process the children of directory entries. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases the unmanaged resources used by the FileStream and optionally releases the managed resources. + + true to release both managed and unmanaged resources; + false to release only unmanaged resources. + + + + Closes the archive and releases any associated resources. + + + + + Ensures that resources are freed and other cleanup operations are performed + when the garbage collector reclaims the . + + + + + The TarBuffer class implements the tar archive concept + of a buffered input stream. This concept goes back to the + days of blocked tape drives and special io devices. In the + C# universe, the only real function that this class + performs is to ensure that files have the correct "record" + size, or other tars will complain. +

+ You should never have a need to access this class directly. + TarBuffers are created by Tar IO Streams. +

+
+
+ + + The size of a block in a tar archive in bytes. + + This is 512 bytes. + + + + The number of blocks in a default record. + + + The default value is 20 blocks per record. + + + + + The size in bytes of a default record. + + + The default size is 10KB. + + + + + Get the record size for this buffer + + The record size in bytes. + This is equal to the multiplied by the + + + + Get the TAR Buffer's record size. + + The record size in bytes. + This is equal to the multiplied by the + + + + Get the Blocking factor for the buffer + + This is the number of blocks in each record. + + + + Get the TAR Buffer's block factor + + The block factor; the number of blocks per record. + + + + Construct a default TarBuffer + + + + + Create TarBuffer for reading with default BlockFactor + + Stream to buffer + A new suitable for input. + + + + Construct TarBuffer for reading inputStream setting BlockFactor + + Stream to buffer + Blocking factor to apply + A new suitable for input. + + + + Construct TarBuffer for writing with default BlockFactor + + output stream for buffer + A new suitable for output. + + + + Construct TarBuffer for writing Tar output to streams. + + Output stream to write to. + Blocking factor to apply + A new suitable for output. + + + + Initialization common to all constructors. + + + + + Determine if an archive block indicates End of Archive. End of + archive is indicated by a block that consists entirely of null bytes. + All remaining blocks for the record should also be null's + However some older tars only do a couple of null blocks (Old GNU tar for one) + and also partial records + + The data block to check. + Returns true if the block is an EOF block; false otherwise. + + + + Determine if an archive block indicates the End of an Archive has been reached. + End of archive is indicated by a block that consists entirely of null bytes. + All remaining blocks for the record should also be null's + However some older tars only do a couple of null blocks (Old GNU tar for one) + and also partial records + + The data block to check. + Returns true if the block is an EOF block; false otherwise. + + + + Skip over a block on the input stream. + + + + + Read a block from the input stream. + + + The block of data read. + + + + + Read a record from data stream. + + + false if End-Of-File, else true. + + + + + Get the current block number, within the current record, zero based. + + Block numbers are zero based values + + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + Get the current block number, within the current record, zero based. + + + The current zero based block number. + + + The absolute block number = (record number * block factor) + block number. + + + + + Get the current record number. + + + The current zero based record number. + + + + + Get the current record number. + + + The current zero based record number. + + + + + Write a block of data to the archive. + + + The data to write to the archive. + + + + + Write an archive record to the archive, where the record may be + inside of a larger array buffer. The buffer must be "offset plus + record size" long. + + + The buffer containing the record data to write. + + + The offset of the record data within buffer. + + + + + Write a TarBuffer record to the archive. + + + + + WriteFinalRecord writes the current record buffer to output any unwritten data is present. + + Any trailing bytes are set to zero which is by definition correct behaviour + for the end of a tar stream. + + + + Close the TarBuffer. If this is an output buffer, also flush the + current block before closing. + + + + + This class represents an entry in a Tar archive. It consists + of the entry's header, as well as the entry's File. Entries + can be instantiated in one of three ways, depending on how + they are to be used. +

+ TarEntries that are created from the header bytes read from + an archive are instantiated with the TarEntry( byte[] ) + constructor. These entries will be used when extracting from + or listing the contents of an archive. These entries have their + header filled in using the header bytes. They also set the File + to null, since they reference an archive entry not a file.

+

+ TarEntries that are created from files that are to be written + into an archive are instantiated with the CreateEntryFromFile(string) + pseudo constructor. These entries have their header filled in using + the File's information. They also keep a reference to the File + for convenience when writing entries.

+

+ Finally, TarEntries can be constructed from nothing but a name. + This allows the programmer to construct the entry by hand, for + instance when only an InputStream is available for writing to + the archive, and the header information is constructed from + other information. In this case the header fields are set to + defaults and the File is set to null.

+ +
+
+ + + Initialise a default instance of . + + + + + Construct an entry from an archive's header bytes. File is set + to null. + + + The header bytes from a tar archive entry. + + + + + Construct an entry from an archive's header bytes. File is set + to null. + + + The header bytes from a tar archive entry. + + + The used for the Name fields, or null for ASCII only + + + + + Construct a TarEntry using the header provided + + Header details for entry + + + + Clone this tar entry. + + Returns a clone of this entry. + + + + Construct an entry with only a name. + This allows the programmer to construct the entry's header "by hand". + + The name to use for the entry + Returns the newly created + + + + Construct an entry for a file. File is set to file, and the + header is constructed from information from the file. + + The file name that the entry represents. + Returns the newly created + + + + Determine if the two entries are equal. Equality is determined + by the header names being equal. + + The to compare with the current Object. + + True if the entries are equal; false if not. + + + + + Derive a Hash value for the current + + A Hash code for the current + + + + Determine if the given entry is a descendant of this entry. + Descendancy is determined by the name of the descendant + starting with this entry's name. + + + Entry to be checked as a descendent of this. + + + True if entry is a descendant of this. + + + + + Get this entry's header. + + + This entry's TarHeader. + + + + + Get/Set this entry's name. + + + + + Get/set this entry's user id. + + + + + Get/set this entry's group id. + + + + + Get/set this entry's user name. + + + + + Get/set this entry's group name. + + + + + Convenience method to set this entry's group and user ids. + + + This entry's new user id. + + + This entry's new group id. + + + + + Convenience method to set this entry's group and user names. + + + This entry's new user name. + + + This entry's new group name. + + + + + Get/Set the modification time for this entry + + + + + Get this entry's file. + + + This entry's file. + + + + + Get/set this entry's recorded file size. + + + + + Return true if this entry represents a directory, false otherwise + + + True if this entry is a directory. + + + + + Fill in a TarHeader with information from a File. + + + The TarHeader to fill in. + + + The file from which to get the header information. + + + + + Get entries for all files present in this entries directory. + If this entry doesnt represent a directory zero entries are returned. + + + An array of TarEntry's for this entry's children. + + + + + Write an entry's header information to a header buffer. + + + The tar entry header buffer to fill in. + + + + + Write an entry's header information to a header buffer. + + + The tar entry header buffer to fill in. + + + The used for the Name fields, or null for ASCII only + + + + + Convenience method that will modify an entry's name directly + in place in an entry header buffer byte array. + + + The buffer containing the entry header to modify. + + + The new name to place into the header buffer. + + + + + Convenience method that will modify an entry's name directly + in place in an entry header buffer byte array. + + + The buffer containing the entry header to modify. + + + The new name to place into the header buffer. + + + The used for the Name fields, or null for ASCII only + + + + + Fill in a TarHeader given only the entry's name. + + + The TarHeader to fill in. + + + The tar entry name. + + + + + The name of the file this entry represents or null if the entry is not based on a file. + + + + + The entry's header information. + + + + + TarException represents exceptions specific to Tar classes and code. + + + + + Initialise a new instance of . + + + + + Initialise a new instance of with its message string. + + A that describes the error. + + + + Initialise a new instance of . + + A that describes the error. + The that caused this exception. + + + + Initializes a new instance of the TarException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + Reads the extended header of a Tar stream + + + + + Creates a new . + + + + + Read bytes from + + + + + + + Returns the parsed headers as key-value strings + + + + + This class encapsulates the Tar Entry Header used in Tar Archives. + The class also holds a number of tar constants, used mostly in headers. + + + The tar format and its POSIX successor PAX have a long history which makes for compatability + issues when creating and reading files. + + This is further complicated by a large number of programs with variations on formats + One common issue is the handling of names longer than 100 characters. + GNU style long names are currently supported. + + This is the ustar (Posix 1003.1) header. + + struct header + { + char t_name[100]; // 0 Filename + char t_mode[8]; // 100 Permissions + char t_uid[8]; // 108 Numerical User ID + char t_gid[8]; // 116 Numerical Group ID + char t_size[12]; // 124 Filesize + char t_mtime[12]; // 136 st_mtime + char t_chksum[8]; // 148 Checksum + char t_typeflag; // 156 Type of File + char t_linkname[100]; // 157 Target of Links + char t_magic[6]; // 257 "ustar" or other... + char t_version[2]; // 263 Version fixed to 00 + char t_uname[32]; // 265 User Name + char t_gname[32]; // 297 Group Name + char t_devmajor[8]; // 329 Major for devices + char t_devminor[8]; // 337 Minor for devices + char t_prefix[155]; // 345 Prefix for t_name + char t_mfill[12]; // 500 Filler up to 512 + }; + + + + + The length of the name field in a header buffer. + + + + + The length of the mode field in a header buffer. + + + + + The length of the user id field in a header buffer. + + + + + The length of the group id field in a header buffer. + + + + + The length of the checksum field in a header buffer. + + + + + Offset of checksum in a header buffer. + + + + + The length of the size field in a header buffer. + + + + + The length of the magic field in a header buffer. + + + + + The length of the version field in a header buffer. + + + + + The length of the modification time field in a header buffer. + + + + + The length of the user name field in a header buffer. + + + + + The length of the group name field in a header buffer. + + + + + The length of the devices field in a header buffer. + + + + + The length of the name prefix field in a header buffer. + + + + + The "old way" of indicating a normal file. + + + + + Normal file type. + + + + + Link file type. + + + + + Symbolic link file type. + + + + + Character device file type. + + + + + Block device file type. + + + + + Directory file type. + + + + + FIFO (pipe) file type. + + + + + Contiguous file type. + + + + + Posix.1 2001 global extended header + + + + + Posix.1 2001 extended header + + + + + Solaris access control list file type + + + + + GNU dir dump file type + This is a dir entry that contains the names of files that were in the + dir at the time the dump was made + + + + + Solaris Extended Attribute File + + + + + Inode (metadata only) no file content + + + + + Identifies the next file on the tape as having a long link name + + + + + Identifies the next file on the tape as having a long name + + + + + Continuation of a file that began on another volume + + + + + For storing filenames that dont fit in the main header (old GNU) + + + + + GNU Sparse file + + + + + GNU Tape/volume header ignore on extraction + + + + + The magic tag representing a POSIX tar archive. (would be written with a trailing NULL) + + + + + The magic tag representing an old GNU tar archive where version is included in magic and overwrites it + + + + + Initialise a default TarHeader instance + + + + + Get/set the name for this tar entry. + + Thrown when attempting to set the property to null. + + + + Get the name of this entry. + + The entry's name. + + + + Get/set the entry's Unix style permission mode. + + + + + The entry's user id. + + + This is only directly relevant to unix systems. + The default is zero. + + + + + Get/set the entry's group id. + + + This is only directly relevant to linux/unix systems. + The default value is zero. + + + + + Get/set the entry's size. + + Thrown when setting the size to less than zero. + + + + Get/set the entry's modification time. + + + The modification time is only accurate to within a second. + + Thrown when setting the date time to less than 1/1/1970. + + + + Get the entry's checksum. This is only valid/updated after writing or reading an entry. + + + + + Get value of true if the header checksum is valid, false otherwise. + + + + + Get/set the entry's type flag. + + + + + The entry's link name. + + Thrown when attempting to set LinkName to null. + + + + Get/set the entry's magic tag. + + Thrown when attempting to set Magic to null. + + + + The entry's version. + + Thrown when attempting to set Version to null. + + + + The entry's user name. + + + + + Get/set the entry's group name. + + + This is only directly relevant to unix systems. + + + + + Get/set the entry's major device number. + + + + + Get/set the entry's minor device number. + + + + + Create a new that is a copy of the current instance. + + A new that is a copy of the current instance. + + + + Parse TarHeader information from a header buffer. + + + The tar entry header buffer to get information from. + + + The used for the Name field, or null for ASCII only + + + + + Parse TarHeader information from a header buffer. + + + The tar entry header buffer to get information from. + + + + + 'Write' header information to buffer provided, updating the check sum. + + output buffer for header information + + + + 'Write' header information to buffer provided, updating the check sum. + + output buffer for header information + The used for the Name field, or null for ASCII only + + + + Get a hash code for the current object. + + A hash code for the current object. + + + + Determines if this instance is equal to the specified object. + + The object to compare with. + true if the objects are equal, false otherwise. + + + + Set defaults for values used when constructing a TarHeader instance. + + Value to apply as a default for userId. + Value to apply as a default for userName. + Value to apply as a default for groupId. + Value to apply as a default for groupName. + + + + Parse an octal string from a header buffer. + + The header buffer from which to parse. + The offset into the buffer from which to parse. + The number of header bytes to parse. + The long equivalent of the octal string. + + + + Parse a name from a header buffer. + + + The header buffer from which to parse. + + + The offset into the buffer from which to parse. + + + The number of header bytes to parse. + + + The name parsed. + + + + + Parse a name from a header buffer. + + + The header buffer from which to parse. + + + The offset into the buffer from which to parse. + + + The number of header bytes to parse. + + + name encoding, or null for ASCII only + + + The name parsed. + + + + + Add name to the buffer as a collection of bytes + + The name to add + The offset of the first character + The buffer to add to + The index of the first byte to add + The number of characters/bytes to add + The next free index in the + + + + Add name to the buffer as a collection of bytes + + The name to add + The offset of the first character + The buffer to add to + The index of the first byte to add + The number of characters/bytes to add + The next free index in the + + + + Add name to the buffer as a collection of bytes + + The name to add + The offset of the first character + The buffer to add to + The index of the first byte to add + The number of characters/bytes to add + name encoding, or null for ASCII only + The next free index in the + + + + Add an entry name to the buffer + + + The name to add + + + The buffer to add to + + + The offset into the buffer from which to start adding + + + The number of header bytes to add + + + The index of the next free byte in the buffer + + TODO: what should be default behavior?(omit upper byte or UTF8?) + + + + Add an entry name to the buffer + + + The name to add + + + The buffer to add to + + + The offset into the buffer from which to start adding + + + The number of header bytes to add + + + + + The index of the next free byte in the buffer + + + + + Add an entry name to the buffer + + The name to add + The buffer to add to + The offset into the buffer from which to start adding + The number of header bytes to add + The index of the next free byte in the buffer + TODO: what should be default behavior?(omit upper byte or UTF8?) + + + + Add an entry name to the buffer + + The name to add + The buffer to add to + The offset into the buffer from which to start adding + The number of header bytes to add + + The index of the next free byte in the buffer + + + + Add a string to a buffer as a collection of ascii bytes. + + The string to add + The offset of the first character to add. + The buffer to add to. + The offset to start adding at. + The number of ascii characters to add. + The next free index in the buffer. + + + + Add a string to a buffer as a collection of ascii bytes. + + The string to add + The offset of the first character to add. + The buffer to add to. + The offset to start adding at. + The number of ascii characters to add. + String encoding, or null for ASCII only + The next free index in the buffer. + + + + Put an octal representation of a value into a buffer + + + the value to be converted to octal + + + buffer to store the octal string + + + The offset into the buffer where the value starts + + + The length of the octal string to create + + + The offset of the character next byte after the octal string + + + + + Put an octal or binary representation of a value into a buffer + + Value to be convert to octal + The buffer to update + The offset into the buffer to store the value + The length of the octal string. Must be 12. + Index of next byte + + + + Add the checksum integer to header buffer. + + + The header buffer to set the checksum for + The offset into the buffer for the checksum + The number of header bytes to update. + It's formatted differently from the other fields: it has 6 digits, a + null, then a space -- rather than digits, a space, then a null. + The final space is already there, from checksumming + + The modified buffer offset + + + + Compute the checksum for a tar entry header. + The checksum field must be all spaces prior to this happening + + The tar entry's header buffer. + The computed checksum. + + + + Make a checksum for a tar entry ignoring the checksum contents. + + The tar entry's header buffer. + The checksum for the buffer + + + + The TarInputStream reads a UNIX tar archive as an InputStream. + methods are provided to position at each successive entry in + the archive, and the read each entry as a normal input stream + using read(). + + + + + Construct a TarInputStream with default block factor + + stream to source data from + + + + Construct a TarInputStream with default block factor + + stream to source data from + The used for the Name fields, or null for ASCII only + + + + Construct a TarInputStream with user specified block factor + + stream to source data from + block factor to apply to archive + + + + Construct a TarInputStream with user specified block factor + + stream to source data from + block factor to apply to archive + The used for the Name fields, or null for ASCII only + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + Gets a value indicating whether the current stream supports reading + + + + + Gets a value indicating whether the current stream supports seeking + This property always returns false. + + + + + Gets a value indicating if the stream supports writing. + This property always returns false. + + + + + The length in bytes of the stream + + + + + Gets or sets the position within the stream. + Setting the Position is not supported and throws a NotSupportedExceptionNotSupportedException + + Any attempt to set position + + + + Flushes the baseInputStream + + + + + Set the streams position. This operation is not supported and will throw a NotSupportedException + + The offset relative to the origin to seek to. + The to start seeking from. + The new position in the stream. + Any access + + + + Sets the length of the stream + This operation is not supported and will throw a NotSupportedException + + The new stream length. + Any access + + + + Writes a block of bytes to this stream using data from a buffer. + This operation is not supported and will throw a NotSupportedException + + The buffer containing bytes to write. + The offset in the buffer of the frist byte to write. + The number of bytes to write. + Any access + + + + Writes a byte to the current position in the file stream. + This operation is not supported and will throw a NotSupportedException + + The byte value to write. + Any access + + + + Reads a byte from the current tar archive entry. + + A byte cast to an int; -1 if the at the end of the stream. + + + + Reads bytes from the current tar archive entry. + + This method is aware of the boundaries of the current + entry in the archive and will deal with them appropriately + + + The buffer into which to place bytes read. + + + The offset at which to place bytes read. + + + The number of bytes to read. + + + The number of bytes read, or 0 at end of stream/EOF. + + + + + Closes this stream. Calls the TarBuffer's close() method. + The underlying stream is closed by the TarBuffer. + + + + + Set the entry factory for this instance. + + The factory for creating new entries + + + + Get the record size being used by this stream's TarBuffer. + + + + + Get the record size being used by this stream's TarBuffer. + + + TarBuffer record size. + + + + + Get the available data that can be read from the current + entry in the archive. This does not indicate how much data + is left in the entire archive, only in the current entry. + This value is determined from the entry's size header field + and the amount of data already read from the current entry. + + + The number of available bytes for the current entry. + + + + + Skip bytes in the input buffer. This skips bytes in the + current entry's data, not the entire archive, and will + stop at the end of the current entry's data if the number + to skip extends beyond that point. + + + The number of bytes to skip. + + + + + Return a value of true if marking is supported; false otherwise. + + Currently marking is not supported, the return value is always false. + + + + Since we do not support marking just yet, we do nothing. + + + The limit to mark. + + + + + Since we do not support marking just yet, we do nothing. + + + + + Get the next entry in this tar archive. This will skip + over any remaining data in the current entry, if there + is one, and place the input stream at the header of the + next entry, and read the header and instantiate a new + TarEntry from the header bytes and return that entry. + If there are no more entries in the archive, null will + be returned to indicate that the end of the archive has + been reached. + + + The next TarEntry in the archive, or null. + + + + + Copies the contents of the current tar archive entry directly into + an output stream. + + + The OutputStream into which to write the entry's data. + + + + + This interface is provided, along with the method , to allow + the programmer to have their own subclass instantiated for the + entries return from . + + + + + Create an entry based on name alone + + + Name of the new EntryPointNotFoundException to create + + created TarEntry or descendant class + + + + Create an instance based on an actual file + + + Name of file to represent in the entry + + + Created TarEntry or descendant class + + + + + Create a tar entry based on the header information passed + + + Buffer containing header information to create an entry from. + + + Created TarEntry or descendant class + + + + + Standard entry factory class creating instances of the class TarEntry + + + + + Construct standard entry factory class with ASCII name encoding + + + + + Construct standard entry factory with name encoding + + The used for the Name fields, or null for ASCII only + + + + Create a based on named + + The name to use for the entry + A new + + + + Create a tar entry with details obtained from file + + The name of the file to retrieve details from. + A new + + + + Create an entry based on details in header + + The buffer containing entry details. + A new + + + + Flag set when last block has been read + + + + + Size of this entry as recorded in header + + + + + Number of bytes read for this entry so far + + + + + Buffer used with calls to Read() + + + + + Working buffer + + + + + Current entry being read + + + + + Factory used to create TarEntry or descendant class instance + + + + + Stream used as the source of input data. + + + + + The TarOutputStream writes a UNIX tar archive as an OutputStream. + Methods are provided to put entries, and then write their contents + by writing to this stream using write(). + + public + + + + Construct TarOutputStream using default block factor + + stream to write to + + + + Construct TarOutputStream using default block factor + + stream to write to + The used for the Name fields, or null for ASCII only + + + + Construct TarOutputStream with user specified block factor + + stream to write to + blocking factor + + + + Construct TarOutputStream with user specified block factor + + stream to write to + blocking factor + The used for the Name fields, or null for ASCII only + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + true if the stream supports reading; otherwise, false. + + + + + true if the stream supports seeking; otherwise, false. + + + + + true if stream supports writing; otherwise, false. + + + + + length of stream in bytes + + + + + gets or sets the position within the current stream. + + + + + set the position within the current stream + + The offset relative to the to seek to + The to seek from. + The new position in the stream. + + + + Set the length of the current stream + + The new stream length. + + + + Read a byte from the stream and advance the position within the stream + by one byte or returns -1 if at the end of the stream. + + The byte value or -1 if at end of stream + + + + read bytes from the current stream and advance the position within the + stream by the number of bytes read. + + The buffer to store read bytes in. + The index into the buffer to being storing bytes at. + The desired number of bytes to read. + The total number of bytes read, or zero if at the end of the stream. + The number of bytes may be less than the count + requested if data is not available. + + + + All buffered data is written to destination + + + + + Ends the TAR archive without closing the underlying OutputStream. + The result is that the EOF block of nulls is written. + + + + + Ends the TAR archive and closes the underlying OutputStream. + + This means that Finish() is called followed by calling the + TarBuffer's Close(). + + + + Get the record size being used by this stream's TarBuffer. + + + + + Get the record size being used by this stream's TarBuffer. + + + The TarBuffer record size. + + + + + Get a value indicating whether an entry is open, requiring more data to be written. + + + + + Put an entry on the output stream. This writes the entry's + header and positions the output stream for writing + the contents of the entry. Once this method is called, the + stream is ready for calls to write() to write the entry's + contents. Once the contents are written, closeEntry() + MUST be called to ensure that all buffered data + is completely written to the output stream. + + + The TarEntry to be written to the archive. + + + + + Close an entry. This method MUST be called for all file + entries that contain data. The reason is that we must + buffer data written to the stream in order to satisfy + the buffer's block based writes. Thus, there may be + data fragments still being assembled that must be written + to the output stream before this entry is closed and the + next entry written. + + + + + Writes a byte to the current tar archive entry. + This method simply calls Write(byte[], int, int). + + + The byte to be written. + + + + + Writes bytes to the current tar archive entry. This method + is aware of the current entry and will throw an exception if + you attempt to write bytes past the length specified for the + current entry. The method is also (painfully) aware of the + record buffering required by TarBuffer, and manages buffers + that are not a multiple of recordsize in length, including + assembling records from small buffers. + + + The buffer to write to the archive. + + + The offset in the buffer from which to get bytes. + + + The number of bytes to write. + + + + + Write an EOF (end of archive) block to the tar archive. + The end of the archive is indicated by two blocks consisting entirely of zero bytes. + + + + + bytes written for this entry so far + + + + + current 'Assembly' buffer length + + + + + Flag indicating whether this instance has been closed or not. + + + + + Size for the current entry + + + + + single block working buffer + + + + + 'Assembly' buffer used to assemble data before writing + + + + + TarBuffer used to provide correct blocking factor + + + + + the destination stream for the archive contents + + + + + name encoding + + + + + This is the Deflater class. The deflater class compresses input + with the deflate algorithm described in RFC 1951. It has several + compression levels and three different strategies described below. + + This class is not thread safe. This is inherent in the API, due + to the split of deflate and setInput. + + author of the original java version : Jochen Hoenicke + + + + + The best and slowest compression level. This tries to find very + long and distant string repetitions. + + + + + The worst but fastest compression level. + + + + + The default compression level. + + + + + This level won't compress at all but output uncompressed blocks. + + + + + The compression method. This is the only method supported so far. + There is no need to use this constant at all. + + + + + Compression Level as an enum for safer use + + + + + The best and slowest compression level. This tries to find very + long and distant string repetitions. + + + + + The worst but fastest compression level. + + + + + The default compression level. + + + + + This level won't compress at all but output uncompressed blocks. + + + + + The compression method. This is the only method supported so far. + There is no need to use this constant at all. + + + + + Creates a new deflater with default compression level. + + + + + Creates a new deflater with given compression level. + + + the compression level, a value between NO_COMPRESSION + and BEST_COMPRESSION, or DEFAULT_COMPRESSION. + + if lvl is out of range. + + + + Creates a new deflater with given compression level. + + + the compression level, a value between NO_COMPRESSION + and BEST_COMPRESSION. + + + true, if we should suppress the Zlib/RFC1950 header at the + beginning and the adler checksum at the end of the output. This is + useful for the GZIP/PKZIP formats. + + if lvl is out of range. + + + + Resets the deflater. The deflater acts afterwards as if it was + just created with the same compression level and strategy as it + had before. + + + + + Gets the current adler checksum of the data that was processed so far. + + + + + Gets the number of input bytes processed so far. + + + + + Gets the number of output bytes so far. + + + + + Flushes the current input block. Further calls to deflate() will + produce enough output to inflate everything in the current input + block. This is not part of Sun's JDK so I have made it package + private. It is used by DeflaterOutputStream to implement + flush(). + + + + + Finishes the deflater with the current input block. It is an error + to give more input after this method was called. This method must + be called to force all bytes to be flushed. + + + + + Returns true if the stream was finished and no more output bytes + are available. + + + + + Returns true, if the input buffer is empty. + You should then call setInput(). + NOTE: This method can also return true when the stream + was finished. + + + + + Sets the data which should be compressed next. This should be only + called when needsInput indicates that more input is needed. + If you call setInput when needsInput() returns false, the + previous input that is still pending will be thrown away. + The given byte array should not be changed, before needsInput() returns + true again. + This call is equivalent to setInput(input, 0, input.length). + + + the buffer containing the input data. + + + if the buffer was finished() or ended(). + + + + + Sets the data which should be compressed next. This should be + only called when needsInput indicates that more input is needed. + The given byte array should not be changed, before needsInput() returns + true again. + + + the buffer containing the input data. + + + the start of the data. + + + the number of data bytes of input. + + + if the buffer was Finish()ed or if previous input is still pending. + + + + + Sets the compression level. There is no guarantee of the exact + position of the change, but if you call this when needsInput is + true the change of compression level will occur somewhere near + before the end of the so far given input. + + + the new compression level. + + + + + Get current compression level + + Returns the current compression level + + + + Sets the compression strategy. Strategy is one of + DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact + position where the strategy is changed, the same as for + SetLevel() applies. + + + The new compression strategy. + + + + + Deflates the current input block with to the given array. + + + The buffer where compressed data is stored + + + The number of compressed bytes added to the output, or 0 if either + IsNeedingInput() or IsFinished returns true or length is zero. + + + + + Deflates the current input block to the given array. + + + Buffer to store the compressed data. + + + Offset into the output array. + + + The maximum number of bytes that may be stored. + + + The number of compressed bytes added to the output, or 0 if either + needsInput() or finished() returns true or length is zero. + + + If Finish() was previously called. + + + If offset or length don't match the array length. + + + + + Sets the dictionary which should be used in the deflate process. + This call is equivalent to setDictionary(dict, 0, dict.Length). + + + the dictionary. + + + if SetInput () or Deflate () were already called or another dictionary was already set. + + + + + Sets the dictionary which should be used in the deflate process. + The dictionary is a byte array containing strings that are + likely to occur in the data which should be compressed. The + dictionary is not stored in the compressed output, only a + checksum. To decompress the output you need to supply the same + dictionary again. + + + The dictionary data + + + The index where dictionary information commences. + + + The number of bytes in the dictionary. + + + If SetInput () or Deflate() were already called or another dictionary was already set. + + + + + Compression level. + + + + + If true no Zlib/RFC1950 headers or footers are generated + + + + + The current state. + + + + + The total bytes of output written. + + + + + The pending output. + + + + + The deflater engine. + + + + + This class contains constants used for deflation. + + + + + Set to true to enable debugging + + + + + Written to Zip file to identify a stored block + + + + + Identifies static tree in Zip file + + + + + Identifies dynamic tree in Zip file + + + + + Header flag indicating a preset dictionary for deflation + + + + + Sets internal buffer sizes for Huffman encoding + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Internal compression engine constant + + + + + Strategies for deflater + + + + + The default strategy + + + + + This strategy will only allow longer string repetitions. It is + useful for random data with a small character set. + + + + + This strategy will not look for string repetitions at all. It + only encodes with Huffman trees (which means, that more common + characters get a smaller encoding. + + + + + Low level compression engine for deflate algorithm which uses a 32K sliding window + with secondary compression from Huffman/Shannon-Fano codes. + + + + + Construct instance with pending buffer + Adler calculation will be performed + + + Pending buffer to use + + + + + Construct instance with pending buffer + + + Pending buffer to use + + + If no adler calculation should be performed + + + + + Deflate drives actual compression of data + + True to flush input buffers + Finish deflation with the current input. + Returns true if progress has been made. + + + + Sets input data to be deflated. Should only be called when NeedsInput() + returns true + + The buffer containing input data. + The offset of the first byte of data. + The number of bytes of data to use as input. + + + + Determines if more input is needed. + + Return true if input is needed via SetInput + + + + Set compression dictionary + + The buffer containing the dictionary data + The offset in the buffer for the first byte of data + The length of the dictionary data. + + + + Reset internal state + + + + + Reset Adler checksum + + + + + Get current value of Adler checksum + + + + + Total data processed + + + + + Get/set the deflate strategy + + + + + Set the deflate level (0-9) + + The value to set the level to. + + + + Fill the window + + + + + Inserts the current string in the head hash and returns the previous + value for this hash. + + The previous hash value + + + + Find the best (longest) string in the window matching the + string starting at strstart. + + Preconditions: + + strstart + DeflaterConstants.MAX_MATCH <= window.length. + + + True if a match greater than the minimum length is found + + + + Hashtable, hashing three characters to an index for window, so + that window[index]..window[index+2] have this hash code. + Note that the array should really be unsigned short, so you need + to and the values with 0xffff. + + + + + prev[index & WMASK] points to the previous index that has the + same hash code as the string starting at index. This way + entries with the same hash code are in a linked list. + Note that the array should really be unsigned short, so you need + to and the values with 0xffff. + + + + + Points to the current character in the window. + + + + + lookahead is the number of characters starting at strstart in + window that are valid. + So window[strstart] until window[strstart+lookahead-1] are valid + characters. + + + + + This array contains the part of the uncompressed stream that + is of relevance. The current character is indexed by strstart. + + + + + The current compression function. + + + + + The input data for compression. + + + + + The total bytes of input read. + + + + + The offset into inputBuf, where input data starts. + + + + + The end offset of the input data. + + + + + The adler checksum + + + + + This is the DeflaterHuffman class. + + This class is not thread safe. This is inherent in the API, due + to the split of Deflate and SetInput. + + author of the original java version : Jochen Hoenicke + + + + + Resets the internal state of the tree + + + + + Check that all frequencies are zero + + + At least one frequency is non-zero + + + + + Set static codes and length + + new codes + length for new codes + + + + Build dynamic codes and lengths + + + + + Get encoded length + + Encoded length, the sum of frequencies * lengths + + + + Scan a literal or distance tree to determine the frequencies of the codes + in the bit length tree. + + + + + Write tree values + + Tree to write + + + + Pending buffer to use + + + + + Construct instance with pending buffer + + Pending buffer to use + + + + Reset internal state + + + + + Write all trees to pending buffer + + The number/rank of treecodes to send. + + + + Compress current buffer writing data to pending buffer + + + + + Flush block to output with no compression + + Data to write + Index of first byte to write + Count of bytes to write + True if this is the last block + + + + Flush block to output with compression + + Data to flush + Index of first byte to flush + Count of bytes to flush + True if this is the last block + + + + Get value indicating if internal buffer is full + + true if buffer is full + + + + Add literal to buffer + + Literal value to add to buffer. + Value indicating internal buffer is full + + + + Add distance code and length to literal and distance trees + + Distance code + Length + Value indicating if internal buffer is full + + + + Reverse the bits of a 16 bit value. + + Value to reverse bits + Value with bits reversed + + + + This class stores the pending output of the Deflater. + + author of the original java version : Jochen Hoenicke + + + + + Construct instance with default buffer size + + + + + Inflater is used to decompress data that has been compressed according + to the "deflate" standard described in rfc1951. + + By default Zlib (rfc1950) headers and footers are expected in the input. + You can use constructor public Inflater(bool noHeader) passing true + if there is no Zlib header information + + The usage is as following. First you have to set some input with + SetInput(), then Inflate() it. If inflate doesn't + inflate any bytes there may be three reasons: +
    +
  • IsNeedingInput() returns true because the input buffer is empty. + You have to provide more input with SetInput(). + NOTE: IsNeedingInput() also returns true when, the stream is finished. +
  • +
  • IsNeedingDictionary() returns true, you have to provide a preset + dictionary with SetDictionary().
  • +
  • IsFinished returns true, the inflater has finished.
  • +
+ Once the first output byte is produced, a dictionary will not be + needed at a later stage. + + author of the original java version : John Leuner, Jochen Hoenicke +
+
+ + + Copy lengths for literal codes 257..285 + + + + + Extra bits for literal codes 257..285 + + + + + Copy offsets for distance codes 0..29 + + + + + Extra bits for distance codes + + + + + These are the possible states for an inflater + + + + + This variable contains the current state. + + + + + The adler checksum of the dictionary or of the decompressed + stream, as it is written in the header resp. footer of the + compressed stream. + Only valid if mode is DECODE_DICT or DECODE_CHKSUM. + + + + + The number of bits needed to complete the current state. This + is valid, if mode is DECODE_DICT, DECODE_CHKSUM, + DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS. + + + + + True, if the last block flag was set in the last block of the + inflated stream. This means that the stream ends after the + current block. + + + + + The total number of inflated bytes. + + + + + The total number of bytes set with setInput(). This is not the + value returned by the TotalIn property, since this also includes the + unprocessed input. + + + + + This variable stores the noHeader flag that was given to the constructor. + True means, that the inflated stream doesn't contain a Zlib header or + footer. + + + + + Creates a new inflater or RFC1951 decompressor + RFC1950/Zlib headers and footers will be expected in the input data + + + + + Creates a new inflater. + + + True if no RFC1950/Zlib header and footer fields are expected in the input data + + This is used for GZIPed/Zipped input. + + For compatibility with + Sun JDK you should provide one byte of input more than needed in + this case. + + + + + Resets the inflater so that a new stream can be decompressed. All + pending input and output will be discarded. + + + + + Decodes a zlib/RFC1950 header. + + + False if more input is needed. + + + The header is invalid. + + + + + Decodes the dictionary checksum after the deflate header. + + + False if more input is needed. + + + + + Decodes the huffman encoded symbols in the input stream. + + + false if more input is needed, true if output window is + full or the current block ends. + + + if deflated stream is invalid. + + + + + Decodes the adler checksum after the deflate stream. + + + false if more input is needed. + + + If checksum doesn't match. + + + + + Decodes the deflated stream. + + + false if more input is needed, or if finished. + + + if deflated stream is invalid. + + + + + Sets the preset dictionary. This should only be called, if + needsDictionary() returns true and it should set the same + dictionary, that was used for deflating. The getAdler() + function returns the checksum of the dictionary needed. + + + The dictionary. + + + + + Sets the preset dictionary. This should only be called, if + needsDictionary() returns true and it should set the same + dictionary, that was used for deflating. The getAdler() + function returns the checksum of the dictionary needed. + + + The dictionary. + + + The index into buffer where the dictionary starts. + + + The number of bytes in the dictionary. + + + No dictionary is needed. + + + The adler checksum for the buffer is invalid + + + + + Sets the input. This should only be called, if needsInput() + returns true. + + + the input. + + + + + Sets the input. This should only be called, if needsInput() + returns true. + + + The source of input data + + + The index into buffer where the input starts. + + + The number of bytes of input to use. + + + No input is needed. + + + The index and/or count are wrong. + + + + + Inflates the compressed stream to the output buffer. If this + returns 0, you should check, whether IsNeedingDictionary(), + IsNeedingInput() or IsFinished() returns true, to determine why no + further output is produced. + + + the output buffer. + + + The number of bytes written to the buffer, 0 if no further + output can be produced. + + + if buffer has length 0. + + + if deflated stream is invalid. + + + + + Inflates the compressed stream to the output buffer. If this + returns 0, you should check, whether needsDictionary(), + needsInput() or finished() returns true, to determine why no + further output is produced. + + + the output buffer. + + + the offset in buffer where storing starts. + + + the maximum number of bytes to output. + + + the number of bytes written to the buffer, 0 if no further output can be produced. + + + if count is less than 0. + + + if the index and / or count are wrong. + + + if deflated stream is invalid. + + + + + Returns true, if the input buffer is empty. + You should then call setInput(). + NOTE: This method also returns true when the stream is finished. + + + + + Returns true, if a preset dictionary is needed to inflate the input. + + + + + Returns true, if the inflater has finished. This means, that no + input is needed and no output can be produced. + + + + + Gets the adler checksum. This is either the checksum of all + uncompressed bytes returned by inflate(), or if needsDictionary() + returns true (and thus no output was yet produced) this is the + adler checksum of the expected dictionary. + + + the adler checksum. + + + + + Gets the total number of output bytes returned by Inflate(). + + + the total number of output bytes. + + + + + Gets the total number of processed compressed input bytes. + + + The total number of bytes of processed input bytes. + + + + + Gets the number of unprocessed input bytes. Useful, if the end of the + stream is reached and you want to further process the bytes after + the deflate stream. + + + The number of bytes of the input which have not been processed. + + + + + Continue decoding header from until more bits are needed or decoding has been completed + + Returns whether decoding could be completed + + + + Get literal/length huffman tree, must not be used before has returned true + + If hader has not been successfully read by the state machine + + + + Get distance huffman tree, must not be used before has returned true + + If hader has not been successfully read by the state machine + + + + Huffman tree used for inflation + + + + + Literal length tree + + + + + Distance tree + + + + + Constructs a Huffman tree from the array of code lengths. + + + the array of code lengths + + + + + Reads the next symbol from input. The symbol is encoded using the + huffman tree. + + + input the input source. + + + the next symbol, or -1 if not enough input is available. + + + + + This class is general purpose class for writing data to a buffer. + + It allows you to write bits as well as bytes + Based on DeflaterPending.java + + author of the original java version : Jochen Hoenicke + + + + + Internal work buffer + + + + + construct instance using default buffer size of 4096 + + + + + construct instance using specified buffer size + + + size to use for internal buffer + + + + + Clear internal state/buffers + + + + + Write a byte to buffer + + + The value to write + + + + + Write a short value to buffer LSB first + + + The value to write. + + + + + write an integer LSB first + + The value to write. + + + + Write a block of data to buffer + + data to write + offset of first byte to write + number of bytes to write + + + + The number of bits written to the buffer + + + + + Align internal buffer on a byte boundary + + + + + Write bits to internal buffer + + source of bits + number of bits to write + + + + Write a short value to internal buffer most significant byte first + + value to write + + + + Indicates if buffer has been flushed + + + + + Flushes the pending buffer into the given output array. If the + output array is to small, only a partial flush is done. + + The output array. + The offset into output array. + The maximum number of bytes to store. + The number of bytes flushed. + + + + Convert internal buffer to byte array. + Buffer is empty on completion + + + The internal buffer contents converted to a byte array. + + + + + A special stream deflating or compressing the bytes that are + written to it. It uses a Deflater to perform actual deflating.
+ Authors of the original java version : Tom Tromey, Jochen Hoenicke +
+
+ + + Creates a new DeflaterOutputStream with a default Deflater and default buffer size. + + + the output stream where deflated output should be written. + + + + + Creates a new DeflaterOutputStream with the given Deflater and + default buffer size. + + + the output stream where deflated output should be written. + + + the underlying deflater. + + + + + Creates a new DeflaterOutputStream with the given Deflater and + buffer size. + + + The output stream where deflated output is written. + + + The underlying deflater to use + + + The buffer size in bytes to use when deflating (minimum value 512) + + + bufsize is less than or equal to zero. + + + baseOutputStream does not support writing + + + deflater instance is null + + + + + Finishes the stream by calling finish() on the deflater. + + + Not all input is deflated + + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + Allows client to determine if an entry can be patched after its added + + + + + The CryptoTransform currently being used to encrypt the compressed data. + + + + + Returns the 10 byte AUTH CODE to be appended immediately following the AES data stream. + + + + + Encrypt a block of data + + + Data to encrypt. NOTE the original contents of the buffer are lost + + + Offset of first byte in buffer to encrypt + + + Number of bytes in buffer to encrypt + + + + + Deflates everything in the input buffers. This will call + def.deflate() until all bytes from the input buffers + are processed. + + + + + Gets value indicating stream can be read from + + + + + Gets a value indicating if seeking is supported for this stream + This property always returns false + + + + + Get value indicating if this stream supports writing + + + + + Get current length of stream + + + + + Gets the current position within the stream. + + Any attempt to set position + + + + Sets the current position of this stream to the given value. Not supported by this class! + + The offset relative to the to seek. + The to seek from. + The new position in the stream. + Any access + + + + Sets the length of this stream to the given value. Not supported by this class! + + The new stream length. + Any access + + + + Read a byte from stream advancing position by one + + The byte read cast to an int. THe value is -1 if at the end of the stream. + Any access + + + + Read a block of bytes from stream + + The buffer to store read data in. + The offset to start storing at. + The maximum number of bytes to read. + The actual number of bytes read. Zero if end of stream is detected. + Any access + + + + Flushes the stream by calling Flush on the deflater and then + on the underlying stream. This ensures that all bytes are flushed. + + + + + Calls and closes the underlying + stream when is true. + + + + + Get the Auth code for AES encrypted entries + + + + + Writes a single byte to the compressed output stream. + + + The byte value. + + + + + Writes bytes from an array to the compressed stream. + + + The byte array + + + The offset into the byte array where to start. + + + The number of bytes to write. + + + + + This buffer is used temporarily to retrieve the bytes from the + deflater and write them to the underlying output stream. + + + + + The deflater which is used to deflate the stream. + + + + + Base stream the deflater depends on. + + + + + An input buffer customised for use by + + + The buffer supports decryption of incoming data. + + + + + Initialise a new instance of with a default buffer size + + The stream to buffer. + + + + Initialise a new instance of + + The stream to buffer. + The size to use for the buffer + A minimum buffer size of 1KB is permitted. Lower sizes are treated as 1KB. + + + + Get the length of bytes in the + + + + + Get the contents of the raw data buffer. + + This may contain encrypted data. + + + + Get the number of useable bytes in + + + + + Get the contents of the clear text buffer. + + + + + Get/set the number of bytes available + + + + + Call passing the current clear text buffer contents. + + The inflater to set input for. + + + + Fill the buffer from the underlying input stream. + + + + + Read a buffer directly from the input stream + + The buffer to fill + Returns the number of bytes read. + + + + Read a buffer directly from the input stream + + The buffer to read into + The offset to start reading data into. + The number of bytes to read. + Returns the number of bytes read. + + + + Read clear text data from the input stream. + + The buffer to add data to. + The offset to start adding data at. + The number of bytes to read. + Returns the number of bytes actually read. + + + + Read a from the input stream. + + Returns the byte read. + + + + Read an in little endian byte order. + + The short value read case to an int. + + + + Read an in little endian byte order. + + The int value read. + + + + Read a in little endian byte order. + + The long value read. + + + + Get/set the to apply to any data. + + Set this value to null to have no transform applied. + + + + This filter stream is used to decompress data compressed using the "deflate" + format. The "deflate" format is described in RFC 1951. + + This stream may form the basis for other decompression filters, such + as the GZipInputStream. + + Author of the original java version : John Leuner. + + + + + Create an InflaterInputStream with the default decompressor + and a default buffer size of 4KB. + + + The InputStream to read bytes from + + + + + Create an InflaterInputStream with the specified decompressor + and a default buffer size of 4KB. + + + The source of input data + + + The decompressor used to decompress data read from baseInputStream + + + + + Create an InflaterInputStream with the specified decompressor + and the specified buffer size. + + + The InputStream to read bytes from + + + The decompressor to use + + + Size of the buffer to use + + + + + Gets or sets a flag indicating ownership of underlying stream. + When the flag is true will close the underlying stream also. + + The default value is true. + + + + Skip specified number of bytes of uncompressed data + + + Number of bytes to skip + + + The number of bytes skipped, zero if the end of + stream has been reached + + + The number of bytes to skip is less than or equal to zero. + + + + + Clear any cryptographic state. + + + + + Returns 0 once the end of the stream (EOF) has been reached. + Otherwise returns 1. + + + + + Fills the buffer with more data to decompress. + + + Stream ends early + + + + + Gets a value indicating whether the current stream supports reading + + + + + Gets a value of false indicating seeking is not supported for this stream. + + + + + Gets a value of false indicating that this stream is not writeable. + + + + + A value representing the length of the stream in bytes. + + + + + The current position within the stream. + Throws a NotSupportedException when attempting to set the position + + Attempting to set the position + + + + Flushes the baseInputStream + + + + + Sets the position within the current stream + Always throws a NotSupportedException + + The relative offset to seek to. + The defining where to seek from. + The new position in the stream. + Any access + + + + Set the length of the current stream + Always throws a NotSupportedException + + The new length value for the stream. + Any access + + + + Writes a sequence of bytes to stream and advances the current position + This method always throws a NotSupportedException + + The buffer containing data to write. + The offset of the first byte to write. + The number of bytes to write. + Any access + + + + Writes one byte to the current stream and advances the current position + Always throws a NotSupportedException + + The byte to write. + Any access + + + + Closes the input stream. When + is true the underlying stream is also closed. + + + + + Reads decompressed data into the provided buffer byte array + + + The array to read and decompress data into + + + The offset indicating where the data should be placed + + + The number of bytes to decompress + + The number of bytes read. Zero signals the end of stream + + Inflater needs a dictionary + + + + + Decompressor for this stream + + + + + Input buffer for this stream. + + + + + Base stream the inflater reads from. + + + + + The compressed size + + + + + Flag indicating whether this instance has been closed or not. + + + + + Contains the output from the Inflation process. + We need to have a window so that we can refer backwards into the output stream + to repeat stuff.
+ Author of the original java version : John Leuner +
+
+ + + Write a byte to this output window + + value to write + + if window is full + + + + + Append a byte pattern already in the window itself + + length of pattern to copy + distance from end of window pattern occurs + + If the repeated data overflows the window + + + + + Copy from input manipulator to internal window + + source of data + length of data to copy + the number of bytes copied + + + + Copy dictionary to window + + source dictionary + offset of start in source dictionary + length of dictionary + + If window isnt empty + + + + + Get remaining unfilled space in window + + Number of bytes left in window + + + + Get bytes available for output in window + + Number of bytes filled + + + + Copy contents of window to output + + buffer to copy to + offset to start at + number of bytes to count + The number of bytes copied + + If a window underflow occurs + + + + + Reset by clearing window so GetAvailable returns 0 + + + + + This class allows us to retrieve a specified number of bits from + the input buffer, as well as copy big byte blocks. + + It uses an int buffer to store up to 31 bits for direct + manipulation. This guarantees that we can get at least 16 bits, + but we only need at most 15, so this is all safe. + + There are some optimizations in this class, for example, you must + never peek more than 8 bits more than needed, and you must first + peek bits before you may drop them. This is not a general purpose + class but optimized for the behaviour of the Inflater. + + authors of the original java version : John Leuner, Jochen Hoenicke + + + + + Get the next sequence of bits but don't increase input pointer. bitCount must be + less or equal 16 and if this call succeeds, you must drop + at least n - 8 bits in the next call. + + The number of bits to peek. + + the value of the bits, or -1 if not enough bits available. */ + + + + + Tries to grab the next bits from the input and + sets to the value, adding . + + true if enough bits could be read, otherwise false + + + + Tries to grab the next bits from the input and + sets of to the value. + + true if enough bits could be read, otherwise false + + + + Drops the next n bits from the input. You should have called PeekBits + with a bigger or equal n before, to make sure that enough bits are in + the bit buffer. + + The number of bits to drop. + + + + Gets the next n bits and increases input pointer. This is equivalent + to followed by , except for correct error handling. + + The number of bits to retrieve. + + the value of the bits, or -1 if not enough bits available. + + + + + Gets the number of bits available in the bit buffer. This must be + only called when a previous PeekBits() returned -1. + + + the number of bits available. + + + + + Gets the number of bytes available. + + + The number of bytes available. + + + + + Skips to the next byte boundary. + + + + + Returns true when SetInput can be called + + + + + Copies bytes from input buffer to output buffer starting + at output[offset]. You have to make sure, that the buffer is + byte aligned. If not enough bytes are available, copies fewer + bytes. + + + The buffer to copy bytes to. + + + The offset in the buffer at which copying starts + + + The length to copy, 0 is allowed. + + + The number of bytes copied, 0 if no bytes were available. + + + Length is less than zero + + + Bit buffer isnt byte aligned + + + + + Resets state and empties internal buffers + + + + + Add more input for consumption. + Only call when IsNeedingInput returns true + + data to be input + offset of first byte of input + number of bytes of input to add. + + + + FastZipEvents supports all events applicable to FastZip operations. + + + + + Delegate to invoke when processing directories. + + + + + Delegate to invoke when processing files. + + + + + Delegate to invoke during processing of files. + + + + + Delegate to invoke when processing for a file has been completed. + + + + + Delegate to invoke when processing directory failures. + + + + + Delegate to invoke when processing file failures. + + + + + Raise the directory failure event. + + The directory causing the failure. + The exception for this event. + A boolean indicating if execution should continue or not. + + + + Fires the file failure handler delegate. + + The file causing the failure. + The exception for this failure. + A boolean indicating if execution should continue or not. + + + + Fires the ProcessFile delegate. + + The file being processed. + A boolean indicating if execution should continue or not. + + + + Fires the delegate + + The file whose processing has been completed. + A boolean indicating if execution should continue or not. + + + + Fires the process directory delegate. + + The directory being processed. + Flag indicating if the directory has matching files as determined by the current filter. + A of true if the operation should continue; false otherwise. + + + + The minimum timespan between events. + + The minimum period of time between events. + + The default interval is three seconds. + + + + FastZip provides facilities for creating and extracting zip files. + + + + + Defines the desired handling when overwriting files during extraction. + + + + + Prompt the user to confirm overwriting + + + + + Never overwrite files. + + + + + Always overwrite files. + + + + + Initialise a default instance of . + + + + + Initialise a new instance of using the specified + + The time setting to use when creating or extracting Zip entries. + Using TimeSetting.LastAccessTime[Utc] when + creating an archive will set the file time to the moment of reading. + + + + + Initialise a new instance of using the specified + + The time to set all values for created or extracted Zip Entries. + + + + Initialise a new instance of + + The events to use during operations. + + + + Get/set a value indicating whether empty directories should be created. + + + + + Get / set the password value. + + + + + Get / set the method of encrypting entries. + + + Only applies when is set. + Defaults to ZipCrypto for backwards compatibility purposes. + + + + + Get or set the active when creating Zip files. + + + + + + Get or set the active when creating Zip files. + + + + + Gets or sets the setting for Zip64 handling when writing. + + + The default value is dynamic which is not backwards compatible with old + programs and can cause problems with XP's built in compression which cant + read Zip64 archives. However it does avoid the situation were a large file + is added and cannot be completed correctly. + NOTE: Setting the size for entries before they are added is the best solution! + By default the EntryFactory used by FastZip will set the file size. + + + + + Get/set a value indicating whether file dates and times should + be restored when extracting files from an archive. + + The default value is false. + + + + Get/set a value indicating whether file attributes should + be restored during extract operations + + + + + Get/set the Compression Level that will be used + when creating the zip + + + + + Delegate called when confirming overwriting of files. + + + + + Create a zip file. + + The name of the zip file to create. + The directory to source files from. + True to recurse directories, false for no recursion. + The file filter to apply. + The directory filter to apply. + + + + Create a zip file/archive. + + The name of the zip file to create. + The directory to obtain files and directories from. + True to recurse directories, false for no recursion. + The file filter to apply. + + + + Create a zip archive sending output to the passed. + + The stream to write archive data to. + The directory to source files from. + True to recurse directories, false for no recursion. + The file filter to apply. + The directory filter to apply. + The is closed after creation. + + + + Create a zip archive sending output to the passed. + + The stream to write archive data to. + The directory to source files from. + True to recurse directories, false for no recursion. + The file filter to apply. + The directory filter to apply. + true to leave open after the zip has been created, false to dispose it. + + + + Create a zip file. + + The name of the zip file to create. + The directory to source files from. + True to recurse directories, false for no recursion. + The file filter to apply. + The directory filter to apply. + + + + Create a zip archive sending output to the passed. + + The stream to write archive data to. + The directory to source files from. + True to recurse directories, false for no recursion. + The file filter to apply. + The directory filter to apply. + true to leave open after the zip has been created, false to dispose it. + + + + Create a zip archive sending output to the passed. + + The stream to write archive data to. + The directory to source files from. + True to recurse directories, false for no recursion. + For performing the actual file system scan + true to leave open after the zip has been created, false to dispose it. + The is closed after creation. + + + + Extract the contents of a zip file. + + The zip file to extract from. + The directory to save extracted information in. + A filter to apply to files. + + + + Extract the contents of a zip file. + + The zip file to extract from. + The directory to save extracted information in. + The style of overwriting to apply. + A delegate to invoke when confirming overwriting. + A filter to apply to files. + A filter to apply to directories. + Flag indicating whether to restore the date and time for extracted files. + Allow parent directory traversal in file paths (e.g. ../file) + + + + Extract the contents of a zip file held in a stream. + + The seekable input stream containing the zip to extract from. + The directory to save extracted information in. + The style of overwriting to apply. + A delegate to invoke when confirming overwriting. + A filter to apply to files. + A filter to apply to directories. + Flag indicating whether to restore the date and time for extracted files. + Flag indicating whether the inputStream will be closed by this method. + Allow parent directory traversal in file paths (e.g. ../file) + + + + Defines factory methods for creating new values. + + + + + Create a for a file given its name + + The name of the file to create an entry for. + Returns a file entry based on the passed. + + + + Create a for a file given its name + + The name of the file to create an entry for. + If true get details from the file system if the file exists. + Returns a file entry based on the passed. + + + + Create a for a file given its actual name and optional override name + + The name of the file to create an entry for. + An alternative name to be used for the new entry. Null if not applicable. + If true get details from the file system if the file exists. + Returns a file entry based on the passed. + + + + Create a for a directory given its name + + The name of the directory to create an entry for. + Returns a directory entry based on the passed. + + + + Create a for a directory given its name + + The name of the directory to create an entry for. + If true get details from the file system for this directory if it exists. + Returns a directory entry based on the passed. + + + + Get/set the applicable. + + + + + Get the in use. + + + + + Get the value to use when is set to , + or if not specified, the value of when the class was the initialized + + + + + WindowsNameTransform transforms names to windows compatible ones. + + + + + The maximum windows path name permitted. + + This may not valid for all windows systems - CE?, etc but I cant find the equivalent in the CLR. + + + + In this case we need Windows' invalid path characters. + Path.GetInvalidPathChars() only returns a subset invalid on all platforms. + + + + + Initialises a new instance of + + + Allow parent directory traversal in file paths (e.g. ../file) + + + + Initialise a default instance of + + + + + Gets or sets a value containing the target directory to prefix values with. + + + + + Allow parent directory traversal in file paths (e.g. ../file) + + + + + Gets or sets a value indicating whether paths on incoming values should be removed. + + + + + Transform a Zip directory name to a windows directory name. + + The directory name to transform. + The transformed name. + + + + Transform a Zip format file name to a windows style one. + + The file name to transform. + The transformed name. + + + + Test a name to see if it is a valid name for a windows filename as extracted from a Zip archive. + + The name to test. + Returns true if the name is a valid zip name; false otherwise. + The filename isnt a true windows path in some fundamental ways like no absolute paths, no rooted paths etc. + + + + Force a name to be valid by replacing invalid characters with a fixed value + + The name to make valid + The replacement character to use for any invalid characters. + Returns a valid name + + + + Gets or set the character to replace invalid characters during transformations. + + + + + Determines how entries are tested to see if they should use Zip64 extensions or not. + + + + + Zip64 will not be forced on entries during processing. + + An entry can have this overridden if required + + + + Zip64 should always be used. + + + + + #ZipLib will determine use based on entry values when added to archive. + + + + + The kind of compression used for an entry in an archive + + + + + A direct copy of the file contents is held in the archive + + + + + Common Zip compression method using a sliding dictionary + of up to 32KB and secondary compression from Huffman/Shannon-Fano trees + + + + + An extension to deflate with a 64KB window. Not supported by #Zip currently + + + + + BZip2 compression. Not supported by #Zip. + + + + + LZMA compression. Not supported by #Zip. + + + + + PPMd compression. Not supported by #Zip. + + + + + WinZip special for AES encryption, Now supported by #Zip. + + + + + Identifies the encryption algorithm used for an entry + + + + + No encryption has been used. + + + + + Encrypted using PKZIP 2.0 or 'classic' encryption. + + + + + DES encryption has been used. + + + + + RC2 encryption has been used for encryption. + + + + + Triple DES encryption with 168 bit keys has been used for this entry. + + + + + Triple DES with 112 bit keys has been used for this entry. + + + + + AES 128 has been used for encryption. + + + + + AES 192 has been used for encryption. + + + + + AES 256 has been used for encryption. + + + + + RC2 corrected has been used for encryption. + + + + + Blowfish has been used for encryption. + + + + + Twofish has been used for encryption. + + + + + RC4 has been used for encryption. + + + + + An unknown algorithm has been used for encryption. + + + + + Defines the contents of the general bit flags field for an archive entry. + + + + + Bit 0 if set indicates that the file is encrypted + + + + + Bits 1 and 2 - Two bits defining the compression method (only for Method 6 Imploding and 8,9 Deflating) + + + + + Bit 3 if set indicates a trailing data descriptor is appended to the entry data + + + + + Bit 4 is reserved for use with method 8 for enhanced deflation + + + + + Bit 5 if set indicates the file contains Pkzip compressed patched data. + Requires version 2.7 or greater. + + + + + Bit 6 if set indicates strong encryption has been used for this entry. + + + + + Bit 7 is currently unused + + + + + Bit 8 is currently unused + + + + + Bit 9 is currently unused + + + + + Bit 10 is currently unused + + + + + Bit 11 if set indicates the filename and + comment fields for this file must be encoded using UTF-8. + + + + + Bit 12 is documented as being reserved by PKware for enhanced compression. + + + + + Bit 13 if set indicates that values in the local header are masked to hide + their actual values, and the central directory is encrypted. + + + Used when encrypting the central directory contents. + + + + + Bit 14 is documented as being reserved for use by PKware + + + + + Bit 15 is documented as being reserved for use by PKware + + + + + This class contains constants used for Zip format files + + + + + The version made by field for entries in the central header when created by this library + + + This is also the Zip version for the library when comparing against the version required to extract + for an entry. See . + + + + + The version made by field for entries in the central header when created by this library + + + This is also the Zip version for the library when comparing against the version required to extract + for an entry. See ZipInputStream.CanDecompressEntry. + + + + + The minimum version required to support strong encryption + + + + + The minimum version required to support strong encryption + + + + + Version indicating AES encryption + + + + + The version required for Zip64 extensions (4.5 or higher) + + + + + The version required for BZip2 compression (4.6 or higher) + + + + + Size of local entry header (excluding variable length fields at end) + + + + + Size of local entry header (excluding variable length fields at end) + + + + + Size of Zip64 data descriptor + + + + + Size of data descriptor + + + + + Size of data descriptor + + + + + Size of central header entry (excluding variable fields) + + + + + Size of central header entry + + + + + Size of end of central record (excluding variable fields) + + + + + Size of end of central record (excluding variable fields) + + + + + Size of 'classic' cryptographic header stored before any entry data + + + + + Size of cryptographic header stored before entry data + + + + + The size of the Zip64 central directory locator. + + + + + Signature for local entry header + + + + + Signature for local entry header + + + + + Signature for spanning entry + + + + + Signature for spanning entry + + + + + Signature for temporary spanning entry + + + + + Signature for temporary spanning entry + + + + + Signature for data descriptor + + + This is only used where the length, Crc, or compressed size isnt known when the + entry is created and the output stream doesnt support seeking. + The local entry cannot be 'patched' with the correct values in this case + so the values are recorded after the data prefixed by this header, as well as in the central directory. + + + + + Signature for data descriptor + + + This is only used where the length, Crc, or compressed size isnt known when the + entry is created and the output stream doesnt support seeking. + The local entry cannot be 'patched' with the correct values in this case + so the values are recorded after the data prefixed by this header, as well as in the central directory. + + + + + Signature for central header + + + + + Signature for central header + + + + + Signature for Zip64 central file header + + + + + Signature for Zip64 central file header + + + + + Signature for Zip64 central directory locator + + + + + Signature for archive extra data signature (were headers are encrypted). + + + + + Central header digital signature + + + + + Central header digital signature + + + + + End of central directory record signature + + + + + End of central directory record signature + + + + + Default encoding used for string conversion. 0 gives the default system OEM code page. + Using the default code page isnt the full solution necessarily + there are many variable factors, codepage 850 is often a good choice for + European users, however be careful about compatability. + + + + Deprecated wrapper for + + + Deprecated wrapper for + + + Deprecated wrapper for + + + Deprecated wrapper for + + + Deprecated wrapper for + + + Deprecated wrapper for + + + + The method of encrypting entries when creating zip archives. + + + + + No encryption will be used. + + + + + Encrypt entries with ZipCrypto. + + + + + Encrypt entries with AES 128. + + + + + Encrypt entries with AES 256. + + + + + Defines known values for the property. + + + + + Host system = MSDOS + + + + + Host system = Amiga + + + + + Host system = Open VMS + + + + + Host system = Unix + + + + + Host system = VMCms + + + + + Host system = Atari ST + + + + + Host system = OS2 + + + + + Host system = Macintosh + + + + + Host system = ZSystem + + + + + Host system = Cpm + + + + + Host system = Windows NT + + + + + Host system = MVS + + + + + Host system = VSE + + + + + Host system = Acorn RISC + + + + + Host system = VFAT + + + + + Host system = Alternate MVS + + + + + Host system = BEOS + + + + + Host system = Tandem + + + + + Host system = OS400 + + + + + Host system = OSX + + + + + Host system = WinZIP AES + + + + + This class represents an entry in a zip archive. This can be a file + or a directory + ZipFile and ZipInputStream will give you instances of this class as + information about the members in an archive. ZipOutputStream + uses an instance of this class when creating an entry in a Zip file. +
+
Author of the original java version : Jochen Hoenicke +
+
+ + + Creates a zip entry with the given name. + + + The name for this entry. Can include directory components. + The convention for names is 'unix' style paths with relative names only. + There are with no device names and path elements are separated by '/' characters. + + + The name passed is null + + + + + Creates a zip entry with the given name and version required to extract + + + The name for this entry. Can include directory components. + The convention for names is 'unix' style paths with no device names and + path elements separated by '/' characters. This is not enforced see CleanName + on how to ensure names are valid if this is desired. + + + The minimum 'feature version' required this entry + + + The name passed is null + + + + + Initializes an entry with the given name and made by information + + Name for this entry + Version and HostSystem Information + Minimum required zip feature version required to extract this entry + Compression method for this entry. + + The name passed is null + + + versionRequiredToExtract should be 0 (auto-calculate) or > 10 + + + This constructor is used by the ZipFile class when reading from the central header + It is not generally useful, use the constructor specifying the name only. + + + + + Creates a deep copy of the given zip entry. + + + The entry to copy. + + + + + Get a value indicating whether the entry has a CRC value available. + + + + + Get/Set flag indicating if entry is encrypted. + A simple helper routine to aid interpretation of flags + + This is an assistant that interprets the flags property. + + + + Get / set a flag indicating whether entry name and comment text are + encoded in unicode UTF8. + + This is an assistant that interprets the flags property. + + + + Value used during password checking for PKZIP 2.0 / 'classic' encryption. + + + + + Get/Set general purpose bit flag for entry + + + General purpose bit flag
+
+ Bit 0: If set, indicates the file is encrypted
+ Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating
+ Imploding:
+ Bit 1 if set indicates an 8K sliding dictionary was used. If clear a 4k dictionary was used
+ Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise
+
+ Deflating:
+ Bit 2 Bit 1
+ 0 0 Normal compression was used
+ 0 1 Maximum compression was used
+ 1 0 Fast compression was used
+ 1 1 Super fast compression was used
+
+ Bit 3: If set, the fields crc-32, compressed size + and uncompressed size are were not able to be written during zip file creation + The correct values are held in a data descriptor immediately following the compressed data.
+ Bit 4: Reserved for use by PKZIP for enhanced deflating
+ Bit 5: If set indicates the file contains compressed patch data
+ Bit 6: If set indicates strong encryption was used.
+ Bit 7-10: Unused or reserved
+ Bit 11: If set the name and comments for this entry are in unicode.
+ Bit 12-15: Unused or reserved
+
+ + +
+ + + Get/Set index of this entry in Zip file + + This is only valid when the entry is part of a + + + + Get/set offset for use in central header + + + + + Get/Set external file attributes as an integer. + The values of this are operating system dependent see + HostSystem for details + + + + + Get the version made by for this entry or zero if unknown. + The value / 10 indicates the major version number, and + the value mod 10 is the minor version number + + + + + Get a value indicating this entry is for a DOS/Windows system. + + + + + Test the external attributes for this to + see if the external attributes are Dos based (including WINNT and variants) + and match the values + + The attributes to test. + Returns true if the external attributes are known to be DOS/Windows + based and have the same attributes set as the value passed. + + + + Gets the compatibility information for the external file attribute + If the external file attributes are compatible with MS-DOS and can be read + by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value + will be non-zero and identify the host system on which the attributes are compatible. + + + + The values for this as defined in the Zip File format and by others are shown below. The values are somewhat + misleading in some cases as they are not all used as shown. You should consult the relevant documentation + to obtain up to date and correct information. The modified appnote by the infozip group is + particularly helpful as it documents a lot of peculiarities. The document is however a little dated. + + 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) + 1 - Amiga + 2 - OpenVMS + 3 - Unix + 4 - VM/CMS + 5 - Atari ST + 6 - OS/2 HPFS + 7 - Macintosh + 8 - Z-System + 9 - CP/M + 10 - Windows NTFS + 11 - MVS (OS/390 - Z/OS) + 12 - VSE + 13 - Acorn Risc + 14 - VFAT + 15 - Alternate MVS + 16 - BeOS + 17 - Tandem + 18 - OS/400 + 19 - OS/X (Darwin) + 99 - WinZip AES + remainder - unused + + + + + + Get minimum Zip feature version required to extract this entry + + + Minimum features are defined as:
+ 1.0 - Default value
+ 1.1 - File is a volume label
+ 2.0 - File is a folder/directory
+ 2.0 - File is compressed using Deflate compression
+ 2.0 - File is encrypted using traditional encryption
+ 2.1 - File is compressed using Deflate64
+ 2.5 - File is compressed using PKWARE DCL Implode
+ 2.7 - File is a patch data set
+ 4.5 - File uses Zip64 format extensions
+ 4.6 - File is compressed using BZIP2 compression
+ 5.0 - File is encrypted using DES
+ 5.0 - File is encrypted using 3DES
+ 5.0 - File is encrypted using original RC2 encryption
+ 5.0 - File is encrypted using RC4 encryption
+ 5.1 - File is encrypted using AES encryption
+ 5.1 - File is encrypted using corrected RC2 encryption
+ 5.1 - File is encrypted using corrected RC2-64 encryption
+ 6.1 - File is encrypted using non-OAEP key wrapping
+ 6.2 - Central directory encryption (not confirmed yet)
+ 6.3 - File is compressed using LZMA
+ 6.3 - File is compressed using PPMD+
+ 6.3 - File is encrypted using Blowfish
+ 6.3 - File is encrypted using Twofish
+
+ +
+ + + Get a value indicating whether this entry can be decompressed by the library. + + This is based on the and + whether the compression method is supported. + + + + Force this entry to be recorded using Zip64 extensions. + + + + + Get a value indicating whether Zip64 extensions were forced. + + A value of true if Zip64 extensions have been forced on; false if not. + + + + Gets a value indicating if the entry requires Zip64 extensions + to store the full entry values. + + A value of true if a local header requires Zip64 extensions; false if not. + + + + Get a value indicating whether the central directory entry requires Zip64 extensions to be stored. + + + + + Get/Set DosTime value. + + + The MS-DOS date format can only represent dates between 1/1/1980 and 12/31/2107. + + + + + Gets/Sets the time of last modification of the entry. + + + The property is updated to match this as far as possible. + + + + + Returns the entry name. + + + The unix naming convention is followed. + Path components in the entry should always separated by forward slashes ('/'). + Dos device names like C: should also be removed. + See the class, or + + + + + Gets/Sets the size of the uncompressed data. + + + The size or -1 if unknown. + + Setting the size before adding an entry to an archive can help + avoid compatibility problems with some archivers which don't understand Zip64 extensions. + + + + Gets/Sets the size of the compressed data. + + + The compressed entry size or -1 if unknown. + + + + + Gets/Sets the crc of the uncompressed data. + + + Crc is not in the range 0..0xffffffffL + + + The crc value or -1 if unknown. + + + + + Gets/Sets the compression method. + + + The compression method for this entry + + + + + Gets the compression method for outputting to the local or central header. + Returns same value as CompressionMethod except when AES encrypting, which + places 99 in the method and places the real method in the extra data. + + + + + Gets/Sets the extra data. + + + Extra data is longer than 64KB (0xffff) bytes. + + + Extra data or null if not set. + + + + + For AES encrypted files returns or sets the number of bits of encryption (128, 192 or 256). + When setting, only 0 (off), 128 or 256 is supported. + + + + + AES Encryption strength for storage in extra data in entry header. + 1 is 128 bit, 2 is 192 bit, 3 is 256 bit. + + + + + Returns the length of the salt, in bytes + + Key size -> Salt length: 128 bits = 8 bytes, 192 bits = 12 bytes, 256 bits = 16 bytes. + + + + Number of extra bytes required to hold the AES Header fields (Salt, Pwd verify, AuthCode) + + File format: + Bytes | Content + ---------+--------------------------- + Variable | Salt value + 2 | Password verification value + Variable | Encrypted file data + 10 | Authentication code + + + + Number of extra bytes required to hold the encryption header fields. + + + + + Process extra data fields updating the entry based on the contents. + + True if the extra data fields should be handled + for a local header, rather than for a central header. + + + + + Gets/Sets the entry comment. + + + If comment is longer than 0xffff. + + + The comment or null if not set. + + + A comment is only available for entries when read via the class. + The class doesn't have the comment data available. + + + + + Gets a value indicating if the entry is a directory. + however. + + + A directory is determined by an entry name with a trailing slash '/'. + The external file attributes can also indicate an entry is for a directory. + Currently only dos/windows attributes are tested in this manner. + The trailing slash convention should always be followed. + + + + + Get a value of true if the entry appears to be a file; false otherwise + + + This only takes account of DOS/Windows attributes. Other operating systems are ignored. + For linux and others the result may be incorrect. + + + + + Test entry to see if data can be extracted. + + Returns true if data can be extracted for this entry; false otherwise. + + + + Creates a copy of this zip entry. + + An that is a copy of the current instance. + + + + Gets a string representation of this ZipEntry. + + A readable textual representation of this + + + + Test a compression method to see if this library + supports extracting data compressed with that method + + The compression method to test. + Returns true if the compression method is supported; false otherwise + + + + Cleans a name making it conform to Zip file conventions. + Devices names ('c:\') and UNC share names ('\\server\share') are removed + and forward slashes ('\') are converted to back slashes ('/'). + Names are made relative by trimming leading slashes which is compatible + with the ZIP naming convention. + + The name to clean + The 'cleaned' name. + + The Zip name transform class is more flexible. + + + + + General ZipEntry helper extensions + + + + + Efficiently check if a flag is set without enum un-/boxing + + + + Returns whether the flag was set + + + + Efficiently set a flag without enum un-/boxing + + + + Whether the passed flag should be set (1) or cleared (0) + + + + Basic implementation of + + + + + Defines the possible values to be used for the . + + + + + Use the recorded LastWriteTime value for the file. + + + + + Use the recorded LastWriteTimeUtc value for the file + + + + + Use the recorded CreateTime value for the file. + + + + + Use the recorded CreateTimeUtc value for the file. + + + + + Use the recorded LastAccessTime value for the file. + + + + + Use the recorded LastAccessTimeUtc value for the file. + + + + + Use a fixed value. + + The actual value used can be + specified via the constructor or + using the with the setting set + to which will use the when this class was constructed. + The property can also be used to set this value. + + + + Initialise a new instance of the class. + + A default , and the LastWriteTime for files is used. + + + + Initialise a new instance of using the specified + + The time setting to use when creating Zip entries. + + + + Initialise a new instance of using the specified + + The time to set all values to. + + + + Get / set the to be used when creating new values. + + + Setting this property to null will cause a default name transform to be used. + + + + + Get / set the in use. + + + + + Get / set the value to use when is set to + + + + + A bitmask defining the attributes to be retrieved from the actual file. + + The default is to get all possible attributes from the actual file. + + + + A bitmask defining which attributes are to be set on. + + By default no attributes are set on. + + + + Get set a value indicating whether unidoce text should be set on. + + + + + Make a new for a file. + + The name of the file to create a new entry for. + Returns a new based on the . + + + + Make a new for a file. + + The name of the file to create a new entry for. + If true entry detail is retrieved from the file system if the file exists. + Returns a new based on the . + + + + Make a new from a name. + + The name of the file to create a new entry for. + An alternative name to be used for the new entry. Null if not applicable. + If true entry detail is retrieved from the file system if the file exists. + Returns a new based on the . + + + + Make a new for a directory. + + The raw untransformed name for the new directory + Returns a new representing a directory. + + + + Make a new for a directory. + + The raw untransformed name for the new directory + If true entry detail is retrieved from the file system if the file exists. + Returns a new representing a directory. + + + + ZipException represents exceptions specific to Zip classes and code. + + + + + Initialise a new instance of . + + + + + Initialise a new instance of with its message string. + + A that describes the error. + + + + Initialise a new instance of . + + A that describes the error. + The that caused this exception. + + + + Initializes a new instance of the ZipException class with serialized data. + + + The System.Runtime.Serialization.SerializationInfo that holds the serialized + object data about the exception being thrown. + + + The System.Runtime.Serialization.StreamingContext that contains contextual information + about the source or destination. + + + + + ExtraData tagged value interface. + + + + + Get the ID for this tagged data value. + + + + + Set the contents of this instance from the data passed. + + The data to extract contents from. + The offset to begin extracting data from. + The number of bytes to extract. + + + + Get the data representing this instance. + + Returns the data for this instance. + + + + A raw binary tagged value + + + + + Initialise a new instance. + + The tag ID. + + + + Get the ID for this tagged data value. + + + + + Set the data from the raw values provided. + + The raw data to extract values from. + The index to start extracting values from. + The number of bytes available. + + + + Get the binary data representing this instance. + + The raw binary data representing this instance. + + + + Get /set the binary data representing this instance. + + The raw binary data representing this instance. + + + + The tag ID for this instance. + + + + + Class representing extended unix date time values. + + + + + Flags indicate which values are included in this instance. + + + + + The modification time is included + + + + + The access time is included + + + + + The create time is included. + + + + + Get the ID + + + + + Set the data from the raw values provided. + + The raw data to extract values from. + The index to start extracting values from. + The number of bytes available. + + + + Get the binary data representing this instance. + + The raw binary data representing this instance. + + + + Test a value to see if is valid and can be represented here. + + The value to test. + Returns true if the value is valid and can be represented; false if not. + The standard Unix time is a signed integer data type, directly encoding the Unix time number, + which is the number of seconds since 1970-01-01. + Being 32 bits means the values here cover a range of about 136 years. + The minimum representable time is 1901-12-13 20:45:52, + and the maximum representable time is 2038-01-19 03:14:07. + + + + + Get /set the Modification Time + + + + + + + Get / set the Access Time + + + + + + + Get / Set the Create Time + + + + + + + Get/set the values to include. + + + + + Class handling NT date time values. + + + + + Get the ID for this tagged data value. + + + + + Set the data from the raw values provided. + + The raw data to extract values from. + The index to start extracting values from. + The number of bytes available. + + + + Get the binary data representing this instance. + + The raw binary data representing this instance. + + + + Test a valuie to see if is valid and can be represented here. + + The value to test. + Returns true if the value is valid and can be represented; false if not. + + NTFS filetimes are 64-bit unsigned integers, stored in Intel + (least significant byte first) byte order. They determine the + number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", + which is "01-Jan-1601 00:00:00 UTC". 28 May 60056 is the upper limit + + + + + Get/set the last modification time. + + + + + Get /set the create time + + + + + Get /set the last access time. + + + + + A factory that creates tagged data instances. + + + + + Get data for a specific tag value. + + The tag ID to find. + The data to search. + The offset to begin extracting data from. + The number of bytes to extract. + The located value found, or null if not found. + + + + + A class to handle the extra data field for Zip entries + + + Extra data contains 0 or more values each prefixed by a header tag and length. + They contain zero or more bytes of actual data. + The data is held internally using a copy on write strategy. This is more efficient but + means that for extra data created by passing in data can have the values modified by the caller + in some circumstances. + + + + + Initialise a default instance. + + + + + Initialise with known extra data. + + The extra data. + + + + Get the raw extra data value + + Returns the raw byte[] extra data this instance represents. + + + + Clear the stored data. + + + + + Gets the current extra data length. + + + + + Get a read-only for the associated tag. + + The tag to locate data for. + Returns a containing tag data or null if no tag was found. + + + + Get the tagged data for a tag. + + The tag to search for. + Returns a tagged value or null if none found. + + + + Get the length of the last value found by + + This is only valid if has previously returned true. + + + + Get the index for the current read value. + + This is only valid if has previously returned true. + Initially the result will be the index of the first byte of actual data. The value is updated after calls to + , and . + + + + Get the number of bytes remaining to be read for the current value; + + + + + Find an extra data value + + The identifier for the value to find. + Returns true if the value was found; false otherwise. + + + + Add a new entry to extra data. + + The value to add. + + + + Add a new entry to extra data + + The ID for this entry. + The data to add. + If the ID already exists its contents are replaced. + + + + Start adding a new entry. + + Add data using , , , or . + The new entry is completed and actually added by calling + + + + + Add entry data added since using the ID passed. + + The identifier to use for this entry. + + + + Add a byte of data to the pending new entry. + + The byte to add. + + + + + Add data to a pending new entry. + + The data to add. + + + + + Add a short value in little endian order to the pending new entry. + + The data to add. + + + + + Add an integer value in little endian order to the pending new entry. + + The data to add. + + + + + Add a long value in little endian order to the pending new entry. + + The data to add. + + + + + Delete an extra data field. + + The identifier of the field to delete. + Returns true if the field was found and deleted. + + + + Read a long in little endian form from the last found data value + + Returns the long value read. + + + + Read an integer in little endian form from the last found data value. + + Returns the integer read. + + + + Read a short value in little endian form from the last found data value. + + Returns the short value read. + + + + Read a byte from an extra data + + The byte value read or -1 if the end of data has been reached. + + + + Skip data during reading. + + The number of bytes to skip. + + + + Internal form of that reads data at any location. + + Returns the short value read. + + + + Dispose of this instance. + + + + + Arguments used with KeysRequiredEvent + + + + + Initialise a new instance of + + The name of the file for which keys are required. + + + + Initialise a new instance of + + The name of the file for which keys are required. + The current key value. + + + + Gets the name of the file for which keys are required. + + + + + Gets or sets the key value + + + + + The strategy to apply to testing. + + + + + Find the first error only. + + + + + Find all possible errors. + + + + + The operation in progress reported by a during testing. + + TestArchive + + + + Setting up testing. + + + + + Testing an individual entries header + + + + + Testing an individual entries data + + + + + Testing an individual entry has completed. + + + + + Running miscellaneous tests + + + + + Testing is complete + + + + + Status returned by during testing. + + TestArchive + + + + Initialise a new instance of + + The this status applies to. + + + + Get the current in progress. + + + + + Get the this status is applicable to. + + + + + Get the current/last entry tested. + + + + + Get the number of errors detected so far. + + + + + Get the number of bytes tested so far for the current entry. + + + + + Get a value indicating whether the last entry test was valid. + + + + + Delegate invoked during testing if supplied indicating current progress and status. + + If the message is non-null an error has occured. If the message is null + the operation as found in status has started. + + + + The possible ways of applying updates to an archive. + + + + + Perform all updates on temporary files ensuring that the original file is saved. + + + + + Update the archive directly, which is faster but less safe. + + + + + This class represents a Zip archive. You can ask for the contained + entries, or get an input stream for a file entry. The entry is + automatically decompressed. + + You can also update the archive adding or deleting entries. + + This class is thread safe for input: You can open input streams for arbitrary + entries in different threads. +
+
Author of the original java version : Jochen Hoenicke +
+ + + using System; + using System.Text; + using System.Collections; + using System.IO; + + using MelonLoader.ICSharpCode.SharpZipLib.Zip; + + class MainClass + { + static public void Main(string[] args) + { + using (ZipFile zFile = new ZipFile(args[0])) { + Console.WriteLine("Listing of : " + zFile.Name); + Console.WriteLine(""); + Console.WriteLine("Raw Size Size Date Time Name"); + Console.WriteLine("-------- -------- -------- ------ ---------"); + foreach (ZipEntry e in zFile) { + if ( e.IsFile ) { + DateTime d = e.DateTime; + Console.WriteLine("{0, -10}{1, -10}{2} {3} {4}", e.Size, e.CompressedSize, + d.ToString("dd-MM-yy"), d.ToString("HH:mm"), + e.Name); + } + } + } + } + } + + +
+ + + Delegate for handling keys/password setting during compression/decompression. + + + + + Event handler for handling encryption keys. + + + + + Handles getting of encryption keys when required. + + The file for which encryption keys are required. + + + + Get/set the encryption key value. + + + + + Password to be used for encrypting/decrypting files. + + Set to null if no password is required. + + + + Get a value indicating whether encryption keys are currently available. + + + + + Opens a Zip file with the given name for reading. + + The name of the file to open. + The argument supplied is null. + + An i/o error occurs + + + The file doesn't contain a valid zip archive. + + + + + Opens a Zip file reading the given . + + The to read archive data from. + The supplied argument is null. + + An i/o error occurs. + + + The file doesn't contain a valid zip archive. + + + + + Opens a Zip file reading the given . + + The to read archive data from. + true to leave the file open when the ZipFile is disposed, false to dispose of it + The supplied argument is null. + + An i/o error occurs. + + + The file doesn't contain a valid zip archive. + + + + + Opens a Zip file reading the given . + + The to read archive data from. + + An i/o error occurs + + + The stream doesn't contain a valid zip archive.
+
+ + The stream doesnt support seeking. + + + The stream argument is null. + +
+ + + Opens a Zip file reading the given . + + The to read archive data from. + true to leave the stream open when the ZipFile is disposed, false to dispose of it + + An i/o error occurs + + + The stream doesn't contain a valid zip archive.
+
+ + The stream doesnt support seeking. + + + The stream argument is null. + +
+ + + Initialises a default instance with no entries and no file storage. + + + + + Finalize this instance. + + + + + Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. + Once closed, no further instance methods should be called. + + + An i/o error occurs. + + + + + Create a new whose data will be stored in a file. + + The name of the archive to create. + Returns the newly created + is null + + + + Create a new whose data will be stored on a stream. + + The stream providing data storage. + Returns the newly created + is null + doesnt support writing. + + + + Get/set a flag indicating if the underlying stream is owned by the ZipFile instance. + If the flag is true then the stream will be closed when Close is called. + + + The default value is true in all cases. + + + + + Get a value indicating whether + this archive is embedded in another file or not. + + + + + Get a value indicating that this archive is a new one. + + + + + Gets the comment for the zip file. + + + + + Gets the name of this zip file. + + + + + Gets the number of entries in this zip file. + + + The Zip file has been closed. + + + + + Get the number of entries contained in this . + + + + + Indexer property for ZipEntries + + + + + Gets an enumerator for the Zip entries in this Zip file. + + Returns an for this archive. + + The Zip file has been closed. + + + + + Return the index of the entry with a matching name + + Entry name to find + If true the comparison is case insensitive + The index position of the matching entry or -1 if not found + + The Zip file has been closed. + + + + + Searches for a zip entry in this archive with the given name. + String comparisons are case insensitive + + + The name to find. May contain directory components separated by slashes ('/'). + + + A clone of the zip entry, or null if no entry with that name exists. + + + The Zip file has been closed. + + + + + Gets an input stream for reading the given zip entry data in an uncompressed form. + Normally the should be an entry returned by GetEntry(). + + The to obtain a data for + An input containing data for this + + The ZipFile has already been closed + + + The compression method for the entry is unknown + + + The entry is not found in the ZipFile + + + + + Creates an input stream reading a zip entry + + The index of the entry to obtain an input stream for. + + An input containing data for this + + + The ZipFile has already been closed + + + The compression method for the entry is unknown + + + The entry is not found in the ZipFile + + + + + Test an archive for integrity/validity + + Perform low level data Crc check + true if all tests pass, false otherwise + Testing will terminate on the first error found. + + + + Test an archive for integrity/validity + + Perform low level data Crc check + The to apply. + The handler to call during testing. + true if all tests pass, false otherwise + The object has already been closed. + + + + Test a local header against that provided from the central directory + + + The entry to test against + + The type of tests to carry out. + The offset of the entries data in the file + + + + The kind of update to apply. + + + + + Get / set the to apply to names when updating. + + + + + Get/set the used to generate values + during updates. + + + + + Get /set the buffer size to be used when updating this zip file. + + + + + Get a value indicating an update has been started. + + + + + Get / set a value indicating how Zip64 Extension usage is determined when adding entries. + + + + + Begin updating this archive. + + The archive storage for use during the update. + The data source to utilise during updating. + ZipFile has been closed. + One of the arguments provided is null + ZipFile has been closed. + + + + Begin updating to this archive. + + The storage to use during the update. + + + + Begin updating this archive. + + + + + + + + Commit current updates, updating this archive. + + + + ZipFile has been closed. + + + + Abort updating leaving the archive unchanged. + + + + + + + Set the file comment to be recorded when the current update is commited. + + The comment to record. + ZipFile has been closed. + + + + Add a new entry to the archive. + + The name of the file to add. + The compression method to use. + Ensure Unicode text is used for name and comment for this entry. + Argument supplied is null. + ZipFile has been closed. + Compression method is not supported for creating entries. + + + + Add a new entry to the archive. + + The name of the file to add. + The compression method to use. + ZipFile has been closed. + Compression method is not supported for creating entries. + + + + Add a file to the archive. + + The name of the file to add. + Argument supplied is null. + + + + Add a file to the archive. + + The name of the file to add. + The name to use for the on the Zip file created. + Argument supplied is null. + + + + Add a file entry with data. + + The source of the data for this entry. + The name to give to the entry. + + + + Add a file entry with data. + + The source of the data for this entry. + The name to give to the entry. + The compression method to use. + Compression method is not supported for creating entries. + + + + Add a file entry with data. + + The source of the data for this entry. + The name to give to the entry. + The compression method to use. + Ensure Unicode text is used for name and comments for this entry. + Compression method is not supported for creating entries. + + + + Add a that contains no data. + + The entry to add. + This can be used to add directories, volume labels, or empty file entries. + + + + Add a with data. + + The source of the data for this entry. + The entry to add. + This can be used to add file entries with a custom data source. + + The encryption method specified in is unsupported. + + Compression method is not supported for creating entries. + + + + Add a directory entry to the archive. + + The directory to add. + + + + Check if the specified compression method is supported for adding a new entry. + + The compression method for the new entry. + + + + Delete an entry by name + + The filename to delete + True if the entry was found and deleted; false otherwise. + + + + Delete a from the archive. + + The entry to delete. + + + + Write an unsigned short in little endian byte order. + + + + + Write an int in little endian byte order. + + + + + Write an unsigned int in little endian byte order. + + + + + Write a long in little endian byte order. + + + + + Get a raw memory buffer. + + Returns a raw memory buffer. + + + + Get the size of the source descriptor for a . + + The update to get the size for. + Whether to include the signature size + The descriptor size, zero if there isn't one. + + + + Get an output stream for the specified + + The entry to get an output stream for. + The output stream obtained for the entry. + + + + Class used to sort updates. + + + + + Compares two objects and returns a value indicating whether one is + less than, equal to or greater than the other. + + First object to compare + Second object to compare. + Compare result. + + + + Represents a pending update to a Zip file. + + + + + Copy an existing entry. + + The existing entry to copy. + + + + Get the for this update. + + This is the source or original entry. + + + + Get the that will be written to the updated/new file. + + + + + Get the command for this update. + + + + + Get the filename if any for this update. Null if none exists. + + + + + Get/set the location of the size patch for this update. + + + + + Get /set the location of the crc patch for this update. + + + + + Get/set the size calculated by offset. + Specifically, the difference between this and next entry's starting offset. + + + + + Releases the unmanaged resources used by the this instance and optionally releases the managed resources. + + true to release both managed and unmanaged resources; + false to release only unmanaged resources. + + + + Read an unsigned short in little endian byte order. + + Returns the value read. + + The stream ends prematurely + + + + + Read a uint in little endian byte order. + + Returns the value read. + + An i/o error occurs. + + + The file ends prematurely + + + + + Search for and read the central directory of a zip file filling the entries array. + + + An i/o error occurs. + + + The central directory is malformed or cannot be found + + + + + Locate the data for a given entry. + + + The start offset of the data. + + + The stream ends prematurely + + + The local header signature is invalid, the entry and central header file name lengths are different + or the local and entry compression methods dont match + + + + + Represents a string from a which is stored as an array of bytes. + + + + + Initialise a with a string. + + The textual string form. + + + + Initialise a using a string in its binary 'raw' form. + + + + + + Get a value indicating the original source of data for this instance. + True if the source was a string; false if the source was binary data. + + + + + Get the length of the comment when represented as raw bytes. + + + + + Get the comment in its 'raw' form as plain bytes. + + + + + Reset the comment to its initial state. + + + + + Implicit conversion of comment to a string. + + The to convert to a string. + The textual equivalent for the input value. + + + + An enumerator for Zip entries + + + + + An is a stream that you can write uncompressed data + to and flush, but cannot read, seek or do anything else to. + + + + + Gets a value indicating whether the current stream supports reading. + + + + + Write any buffered data to underlying storage. + + + + + Gets a value indicating whether the current stream supports writing. + + + + + Gets a value indicating whether the current stream supports seeking. + + + + + Get the length in bytes of the stream. + + + + + Gets or sets the position within the current stream. + + + + + Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + + The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + The sum of offset and count is larger than the buffer length. + Methods were called after the stream was closed. + The stream does not support reading. + buffer is null. + An I/O error occurs. + offset or count is negative. + + + + Sets the position within the current stream. + + A byte offset relative to the origin parameter. + A value of type indicating the reference point used to obtain the new position. + + The new position within the current stream. + + An I/O error occurs. + The stream does not support seeking, such as if the stream is constructed from a pipe or console output. + Methods were called after the stream was closed. + + + + Sets the length of the current stream. + + The desired length of the current stream in bytes. + The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. + An I/O error occurs. + Methods were called after the stream was closed. + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + + An array of bytes. This method copies count bytes from buffer to the current stream. + The zero-based byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + An I/O error occurs. + The stream does not support writing. + Methods were called after the stream was closed. + buffer is null. + The sum of offset and count is greater than the buffer length. + offset or count is negative. + + + + A is an + whose data is only a part or subsection of a file. + + + + + Initialise a new instance of the class. + + The containing the underlying stream to use for IO. + The start of the partial data. + The length of the partial data. + + + + Read a byte from this stream. + + Returns the byte read or -1 on end of stream. + + + + Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + + The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + The sum of offset and count is larger than the buffer length. + Methods were called after the stream was closed. + The stream does not support reading. + buffer is null. + An I/O error occurs. + offset or count is negative. + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + + An array of bytes. This method copies count bytes from buffer to the current stream. + The zero-based byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + An I/O error occurs. + The stream does not support writing. + Methods were called after the stream was closed. + buffer is null. + The sum of offset and count is greater than the buffer length. + offset or count is negative. + + + + When overridden in a derived class, sets the length of the current stream. + + The desired length of the current stream in bytes. + The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. + An I/O error occurs. + Methods were called after the stream was closed. + + + + When overridden in a derived class, sets the position within the current stream. + + A byte offset relative to the origin parameter. + A value of type indicating the reference point used to obtain the new position. + + The new position within the current stream. + + An I/O error occurs. + The stream does not support seeking, such as if the stream is constructed from a pipe or console output. + Methods were called after the stream was closed. + + + + Clears all buffers for this stream and causes any buffered data to be written to the underlying device. + + An I/O error occurs. + + + + Gets or sets the position within the current stream. + + + The current position within the stream. + An I/O error occurs. + The stream does not support seeking. + Methods were called after the stream was closed. + + + + Gets the length in bytes of the stream. + + + A long value representing the length of the stream in bytes. + A class derived from Stream does not support seeking. + Methods were called after the stream was closed. + + + + Gets a value indicating whether the current stream supports writing. + + false + true if the stream supports writing; otherwise, false. + + + + Gets a value indicating whether the current stream supports seeking. + + true + true if the stream supports seeking; otherwise, false. + + + + Gets a value indicating whether the current stream supports reading. + + true. + true if the stream supports reading; otherwise, false. + + + + Gets a value that determines whether the current stream can time out. + + + A value that determines whether the current stream can time out. + + + + Provides a static way to obtain a source of data for an entry. + + + + + Get a source of data by creating a new stream. + + Returns a to use for compression input. + Ideally a new stream is created and opened to achieve this, to avoid locking problems. + + + + Represents a source of data that can dynamically provide + multiple data sources based on the parameters passed. + + + + + Get a data source. + + The to get a source for. + The name for data if known. + Returns a to use for compression input. + Ideally a new stream is created and opened to achieve this, to avoid locking problems. + + + + Default implementation of a for use with files stored on disk. + + + + + Initialise a new instance of + + The name of the file to obtain data from. + + + + Get a providing data. + + Returns a providing data. + + + + Default implementation of for files stored on disk. + + + + + Get a providing data for an entry. + + The entry to provide data for. + The file name for data if known. + Returns a stream providing data; or null if not available + + + + Defines facilities for data storage when updating Zip Archives. + + + + + Get the to apply during updates. + + + + + Get an empty that can be used for temporary output. + + Returns a temporary output + + + + + Convert a temporary output stream to a final stream. + + The resulting final + + + + + Make a temporary copy of the original stream. + + The to copy. + Returns a temporary output that is a copy of the input. + + + + Return a stream suitable for performing direct updates on the original source. + + The current stream. + Returns a stream suitable for direct updating. + This may be the current stream passed. + + + + Dispose of this instance. + + + + + An abstract suitable for extension by inheritance. + + + + + Initializes a new instance of the class. + + The update mode. + + + + Gets a temporary output + + Returns the temporary output stream. + + + + + Converts the temporary to its final form. + + Returns a that can be used to read + the final storage for the archive. + + + + + Make a temporary copy of a . + + The to make a copy of. + Returns a temporary output that is a copy of the input. + + + + Return a stream suitable for performing direct updates on the original source. + + The to open for direct update. + Returns a stream suitable for direct updating. + + + + Disposes this instance. + + + + + Gets the update mode applicable. + + The update mode. + + + + An implementation suitable for hard disks. + + + + + Initializes a new instance of the class. + + The file. + The update mode. + + + + Initializes a new instance of the class. + + The file. + + + + Gets a temporary output for performing updates on. + + Returns the temporary output stream. + + + + Converts a temporary to its final form. + + Returns a that can be used to read + the final storage for the archive. + + + + Make a temporary copy of a stream. + + The to copy. + Returns a temporary output that is a copy of the input. + + + + Return a stream suitable for performing direct updates on the original source. + + The current stream. + Returns a stream suitable for direct updating. + If the is not null this is used as is. + + + + Disposes this instance. + + + + + An implementation suitable for in memory streams. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The to use + This constructor is for testing as memory streams dont really require safe mode. + + + + Get the stream returned by if this was in fact called. + + + + + Gets the temporary output + + Returns the temporary output stream. + + + + Converts the temporary to its final form. + + Returns a that can be used to read + the final storage for the archive. + + + + Make a temporary copy of the original stream. + + The to copy. + Returns a temporary output that is a copy of the input. + + + + Return a stream suitable for performing direct updates on the original source. + + The original source stream + Returns a stream suitable for direct updating. + If the passed is not null this is used; + otherwise a new is returned. + + + + Disposes this instance. + + + + + Holds data pertinent to a data descriptor. + + + + + Get /set the compressed size of data. + + + + + Get / set the uncompressed size of data + + + + + Get /set the crc value. + + + + + This class assists with writing/reading from Zip files. + + + + + Initialise an instance of this class. + + The name of the file to open. + + + + Initialise a new instance of . + + The stream to use. + + + + Get / set a value indicating whether the underlying stream is owned or not. + + If the stream is owned it is closed when this instance is closed. + + + + Close the stream. + + + The underlying stream is closed only if is true. + + + + + Locates a block with the desired . + + The signature to find. + Location, marking the end of block. + Minimum size of the block. + The maximum variable data. + Returns the offset of the first byte after the signature; -1 if not found + + + + Write Zip64 end of central directory records (File header and locator). + + The number of entries in the central directory. + The size of entries in the central directory. + The offset of the central directory. + + + + Write the required records to end the central directory. + + The number of entries in the directory. + The size of the entries in the directory. + The start of the central directory. + The archive comment. (This can be null). + + + + Read an unsigned short in little endian byte order. + + Returns the value read. + + An i/o error occurs. + + + The file ends prematurely + + + + + Read an int in little endian byte order. + + Returns the value read. + + An i/o error occurs. + + + The file ends prematurely + + + + + Read a long in little endian byte order. + + The value read. + + + + Write an unsigned short in little endian byte order. + + The value to write. + + + + Write a ushort in little endian byte order. + + The value to write. + + + + Write an int in little endian byte order. + + The value to write. + + + + Write a uint in little endian byte order. + + The value to write. + + + + Write a long in little endian byte order. + + The value to write. + + + + Write a ulong in little endian byte order. + + The value to write. + + + + Write a data descriptor. + + The entry to write a descriptor for. + Returns the number of descriptor bytes written. + + + + Read data descriptor at the end of compressed data. + + if set to true [zip64]. + The data to fill in. + Returns the number of bytes read in the descriptor. + + + + This is an InflaterInputStream that reads the files baseInputStream an zip archive + one after another. It has a special method to get the zip entry of + the next file. The zip entry contains information about the file name + size, compressed size, Crc, etc. + It includes support for Stored and Deflated entries. +
+
Author of the original java version : Jochen Hoenicke +
+ + This sample shows how to read a zip file + + using System; + using System.Text; + using System.IO; + + using MelonLoader.ICSharpCode.SharpZipLib.Zip; + + class MainClass + { + public static void Main(string[] args) + { + using ( ZipInputStream s = new ZipInputStream(File.OpenRead(args[0]))) { + + ZipEntry theEntry; + const int size = 2048; + byte[] data = new byte[2048]; + + while ((theEntry = s.GetNextEntry()) != null) { + if ( entry.IsFile ) { + Console.Write("Show contents (y/n) ?"); + if (Console.ReadLine() == "y") { + while (true) { + size = s.Read(data, 0, data.Length); + if (size > 0) { + Console.Write(new ASCIIEncoding().GetString(data, 0, size)); + } else { + break; + } + } + } + } + } + } + } + } + + +
+ + + Delegate for reading bytes from a stream. + + + + + The current reader this instance. + + + + + Creates a new Zip input stream, for reading a zip archive. + + The underlying providing data. + + + + Creates a new Zip input stream, for reading a zip archive. + + The underlying providing data. + Size of the buffer. + + + + Optional password used for encryption when non-null + + A password for all encrypted entries in this + + + + Gets a value indicating if there is a current entry and it can be decompressed + + + The entry can only be decompressed if the library supports the zip features required to extract it. + See the ZipEntry Version property for more details. + + Since uses the local headers for extraction, entries with no compression combined with the + flag set, cannot be extracted as the end of the entry data cannot be deduced. + + + + + Is the compression method for the specified entry supported? + + + Uses entry.CompressionMethodForHeader so that entries of type WinZipAES will be rejected. + + the entry to check. + true if the compression method is supported, false if not. + + + + Advances to the next entry in the archive + + + The next entry in the archive or null if there are no more entries. + + + If the previous entry is still open CloseEntry is called. + + + Input stream is closed + + + Password is not set, password is invalid, compression method is invalid, + version required to extract is not supported + + + + + Read data descriptor at the end of compressed data. + + + + + Complete cleanup as the final part of closing. + + True if the crc value should be tested + + + + Closes the current zip entry and moves to the next one. + + + The stream is closed + + + The Zip stream ends early + + + + + Returns 1 if there is an entry available + Otherwise returns 0. + + + + + Returns the current size that can be read from the current entry if available + + Thrown if the entry size is not known. + Thrown if no entry is currently available. + + + + Reads a byte from the current zip entry. + + + The byte or -1 if end of stream is reached. + + + + + Handle attempts to read by throwing an . + + The destination array to store data in. + The offset at which data read should be stored. + The maximum number of bytes to read. + Returns the number of bytes actually read. + + + + Handle attempts to read from this entry by throwing an exception + + + + + Handle attempts to read from this entry by throwing an exception + + + + + Perform the initial read on an entry which may include + reading encryption headers and setting up inflation. + + The destination to fill with data read. + The offset to start reading at. + The maximum number of bytes to read. + The actual number of bytes read. + + + + Read a block of bytes from the stream. + + The destination for the bytes. + The index to start storing data. + The number of bytes to attempt to read. + Returns the number of bytes read. + Zero bytes read means end of stream. + + + + Reads a block of bytes from the current zip entry. + + + The number of bytes read (this may be less than the length requested, even before the end of stream), or 0 on end of stream. + + + An i/o error occurred. + + + The deflated stream is corrupted. + + + The stream is not open. + + + + + Closes the zip input stream + + + + + ZipNameTransform transforms names as per the Zip file naming convention. + + The use of absolute names is supported although its use is not valid + according to Zip naming conventions, and should not be used if maximum compatability is desired. + + + + Initialize a new instance of + + + + + Initialize a new instance of + + The string to trim from the front of paths if found. + + + + Static constructor. + + + + + Transform a windows directory name according to the Zip file naming conventions. + + The directory name to transform. + The transformed name. + + + + Transform a windows file name according to the Zip file naming conventions. + + The file name to transform. + The transformed name. + + + + Get/set the path prefix to be trimmed from paths if present. + + The prefix is trimmed before any conversion from + a windows path is done. + + + + Force a name to be valid by replacing invalid characters with a fixed value + + The name to force valid + The replacement character to use. + Returns a valid name + + + + Test a name to see if it is a valid name for a zip entry. + + The name to test. + If true checking is relaxed about windows file names and absolute paths. + Returns true if the name is a valid zip name; false otherwise. + Zip path names are actually in Unix format, and should only contain relative paths. + This means that any path stored should not contain a drive or + device letter, or a leading slash. All slashes should forward slashes '/'. + An empty name is valid for a file where the input comes from standard input. + A null name is not considered valid. + + + + + Test a name to see if it is a valid name for a zip entry. + + The name to test. + Returns true if the name is a valid zip name; false otherwise. + Zip path names are actually in unix format, + and should only contain relative paths if a path is present. + This means that the path stored should not contain a drive or + device letter, or a leading slash. All slashes should forward slashes '/'. + An empty name is valid where the input comes from standard input. + A null name is not considered valid. + + + + + An implementation of INameTransform that transforms entry paths as per the Zip file naming convention. + Strips path roots and puts directory separators in the correct format ('/') + + + + + Initialize a new instance of + + + + + Transform a windows directory name according to the Zip file naming conventions. + + The directory name to transform. + The transformed name. + + + + Transform a windows file name according to the Zip file naming conventions. + + The file name to transform. + The transformed name. + + + + This is a DeflaterOutputStream that writes the files into a zip + archive one after another. It has a special method to start a new + zip entry. The zip entries contains information about the file name + size, compressed size, CRC, etc. + + It includes support for Stored and Deflated entries. + This class is not thread safe. +
+
Author of the original java version : Jochen Hoenicke +
+ This sample shows how to create a zip file + + using System; + using System.IO; + + using MelonLoader.ICSharpCode.SharpZipLib.Core; + using MelonLoader.ICSharpCode.SharpZipLib.Zip; + + class MainClass + { + public static void Main(string[] args) + { + string[] filenames = Directory.GetFiles(args[0]); + byte[] buffer = new byte[4096]; + + using ( ZipOutputStream s = new ZipOutputStream(File.Create(args[1])) ) { + + s.SetLevel(9); // 0 - store only to 9 - means best compression + + foreach (string file in filenames) { + ZipEntry entry = new ZipEntry(file); + s.PutNextEntry(entry); + + using (FileStream fs = File.OpenRead(file)) { + StreamUtils.Copy(fs, s, buffer); + } + } + } + } + } + + +
+ + + Creates a new Zip output stream, writing a zip archive. + + + The output stream to which the archive contents are written. + + + + + Creates a new Zip output stream, writing a zip archive. + + The output stream to which the archive contents are written. + Size of the buffer to use. + + + + Gets a flag value of true if the central header has been added for this archive; false if it has not been added. + + No further entries can be added once this has been done. + + + + Set the zip file comment. + + + The comment text for the entire archive. + + + The converted comment is longer than 0xffff bytes. + + + + + Sets the compression level. The new level will be activated + immediately. + + The new compression level (1 to 9). + + Level specified is not supported. + + + + + + Get the current deflater compression level + + The current compression level + + + + Get / set a value indicating how Zip64 Extension usage is determined when adding entries. + + Older archivers may not understand Zip64 extensions. + If backwards compatability is an issue be careful when adding entries to an archive. + Setting this property to off is workable but less desirable as in those circumstances adding a file + larger then 4GB will fail. + + + + Used for transforming the names of entries added by . + Defaults to , set to null to disable transforms and use names as supplied. + + + + + Get/set the password used for encryption. + + When set to null or if the password is empty no encryption is performed + + + + Write an unsigned short in little endian byte order. + + + + + Write an int in little endian byte order. + + + + + Write an int in little endian byte order. + + + + + Starts a new Zip entry. It automatically closes the previous + entry if present. + All entry elements bar name are optional, but must be correct if present. + If the compression method is stored and the output is not patchable + the compression for that entry is automatically changed to deflate level 0 + + + the entry. + + + if entry passed is null. + + + if an I/O error occured. + + + if stream was finished + + + Too many entries in the Zip file
+ Entry name is too long
+ Finish has already been called
+
+ + The Compression method specified for the entry is unsupported. + +
+ + + Closes the current entry, updating header and footer information as required + + + Invalid entry field values. + + + An I/O error occurs. + + + No entry is active. + + + + + Initializes encryption keys based on given . + + The password. + + + + Initializes encryption keys based on given password. + + + + + Writes the given buffer to the current entry. + + The buffer containing data to write. + The offset of the first byte to write. + The number of bytes to write. + Archive size is invalid + No entry is active. + + + + Finishes the stream. This will write the central directory at the + end of the zip file and flush the stream. + + + This is automatically called when the stream is closed. + + + An I/O error occurs. + + + Comment exceeds the maximum length
+ Entry name exceeds the maximum length +
+
+ + + Flushes the stream by calling Flush on the deflater stream unless + the current compression method is . Then it flushes the underlying output stream. + + + + + The entries for the archive. + + + + + Used to track the crc of data added to entries. + + + + + The current entry being added. + + + + + Used to track the size of data for an entry during writing. + + + + + Offset to be recorded for each entry in the central header. + + + + + Comment for the entire archive recorded in central header. + + + + + Flag indicating that header patching is required for the current entry. + + + + + Position to patch crc + + + + + Position to patch size. + + + + + The password to use when encrypting archive entries. + + + + + This static class contains functions for encoding and decoding zip file strings + + + + Code page backing field + + The original Zip specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) states + that file names should only be encoded with IBM Code Page 437 or UTF-8. + In practice, most zip apps use OEM or system encoding (typically cp437 on Windows). + Let's be good citizens and default to UTF-8 http://utf8everywhere.org/ + + + + Automatically select codepage while opening archive + see https://github.com/icsharpcode/SharpZipLib/pull/280#issuecomment-433608324 + + + + + Encoding used for string conversion. Setting this to 65001 (UTF-8) will + also set the Language encoding flag to indicate UTF-8 encoded file names. + + + + + Attempt to get the operating system default codepage, or failing that, to + the fallback code page IBM 437. + + + + + Get whether the default codepage is set to UTF-8. Setting this property to false will + set the to + + + Get OEM codepage from NetFX, which parses the NLP file with culture info table etc etc. + But sometimes it yields the special value of 1 which is nicknamed CodePageNoOEM in sources (might also mean CP_OEMCP, but Encoding puts it so). + This was observed on Ukranian and Hindu systems. + Given this value, throws an . + So replace it with , (IBM 437 which is the default code page in a default Windows installation console. + + + + + Convert a portion of a byte array to a string using + + + Data to convert to string + + + Number of bytes to convert starting from index 0 + + + data[0]..data[count - 1] converted to a string + + + + + Convert a byte array to a string using + + + Byte array to convert + + + dataconverted to a string + + + + + Convert a byte array to a string using + + The applicable general purpose bits flags + + Byte array to convert + + The number of bytes to convert. + + dataconverted to a string + + + + + Convert a byte array to a string using + + + Byte array to convert + + The applicable general purpose bits flags + + dataconverted to a string + + + + + Convert a string to a byte array using + + + String to convert to an array + + Converted array + + + + Convert a string to a byte array using + + The applicable general purpose bits flags + + String to convert to an array + + Converted array + + + + Mark members that should be included. + Public fields are included by default. + + + + + Mark members that should be excluded. + Private fields and all properties are excluded by default. + + + + + Mark methods to be called after an object is decoded. + + + + + Mark methods to be called before an object is encoded. + + + + + Mark members to force type hinting even when EncodeOptions.NoTypeHints is set. + + + + + Provide field and property aliases when an object is decoded. + If a field or property is not found while decoding, this list will be searched for a matching alias. + + + + Gets the original array containing the range of elements that the array segment delimits. + The original array that was passed to the constructor, and that contains the range delimited by the . + + + Gets the position of the first element in the range delimited by the array segment, relative to the start of the original array. + The position of the first element in the range delimited by the , relative to the start of the original array. + + + Gets the number of elements in the range delimited by the array segment. + The number of elements in the range delimited by the . + + + Initializes a new instance of the structure that delimits all the elements in the specified array. + The array to wrap. + + is . + + + Initializes a new instance of the structure that delimits the specified range of the elements in the specified array. + The array containing the range of elements to delimit. + The zero-based index of the first element in the range. + The number of elements in the range. + + is . + + or is less than 0. + + and do not specify a valid range in . + + + Returns the hash code for the current instance. + A 32-bit signed integer hash code. + + + Determines whether the specified object is equal to the current instance. + The object to be compared with the current instance. + + if the specified object is a structure and is equal to the current instance; otherwise, . + + + Determines whether the specified structure is equal to the current instance. + The structure to compare with the current instance. + + if the specified structure is equal to the current instance; otherwise, . + + + Indicates whether two structures are equal. + The structure on the left side of the equality operator. + The structure on the right side of the equality operator. + + if is equal to ; otherwise, . + + + Indicates whether two structures are unequal. + The structure on the left side of the inequality operator. + The structure on the right side of the inequality operator. + + if is not equal to ; otherwise, . + + + Returns an enumerator that iterates through an array segment. + An enumerator that can be used to iterate through the array segment. + + + + Creates a new instance of with a new copy of ''. + + + + + Creates a new instance of with a new copy of ''. + + + + + Called after all MelonPlugins are initialized. + + + + + Called after Game Initialization, before OnApplicationStart and before Assembly Generation on Il2Cpp games. + + + + + Called after all MelonMods are initialized and before the right Support Module is loaded. + + + + + Called after all MelonLoader components are fully initialized (including all MelonMods). + Don't use this event to initialize your Melons anymore! Instead, override . + + + + + Called when the first 'Start' Unity Messages are invoked. + + + + + Called before the Application is closed. It is not possible to prevent the game from closing at this point. + + + + + Called on a quit request. It is possible to abort the request in this callback. + + + + + Called once per frame. + + + + + Called every 0.02 seconds, unless Time.fixedDeltaTime has a different Value. It is recommended to do all important Physics calculations inside this Callback. + + + + + Called once per frame, after . + + + + + Called at every IMGUI event. Only use this for drawing IMGUI Elements. + + + + + Called when a new Scene is loaded. + + Arguments: +
: Build Index of the Scene.
+
: Name of the Scene.
+
+
+
+ + + Called once a Scene is initialized. + + Arguments: +
: Build Index of the Scene.
+
: Name of the Scene.
+
+
+
+ + + Called once a Scene unloads. + + Arguments: +
: Build Index of the Scene.
+
: Name of the Scene.
+
+
+
+ + + Called before MelonMods are loaded from the Mods folder. + + + + + Dictionary of all Arguments with value (if found) that were not used by MelonLoader + + Key is the argument, Value is the value for the argument, null if not found + + + + + + Array of All Command Line Arguments + + + + + Called before a process of resolving Melons from a MelonAssembly has started. + + + + + List of all loaded MelonAssemblies. + + + + + Tries to find the instance of Melon with type T, whether it's registered or not + + + + + Gets the MelonAssembly of the given member. If the given member is not in any MelonAssembly, returns null. + + + + + Loads or finds a MelonAssembly from path. + + Path of the MelonAssembly + Sets whether Melons should be auto-loaded or not + + + + Loads or finds a MelonAssembly from raw Assembly Data. + + + + + Loads or finds a MelonAssembly. + + + + + A SHA256 Hash of the Assembly. + + + + + A list of all loaded Melons in the Assembly. + + + + + A list of all broken Melons in the Assembly. + + + + + Unregisters all Melons in this Assembly. + + + + + Called once a Melon is fully registered. + + + + + Called when a Melon unregisters. + + + + + Called before a Melon starts initializing. + + + + + Creates a new Melon instance for a Wrapper. + + + + + Registers a List of Melons in the right order. + + + + + MelonAssembly of the Melon. + + + + + Priority of the Melon. + + + + + Console Color of the Melon. + + + + + Console Color of the Author that made this melon. + + + + + Info Attribute of the Melon. + + + + + AdditionalCredits Attribute of the Melon + + + + + Process Attributes of the Melon. + + + + + Game Attributes of the Melon. + + + + + Game Version Attributes of the Melon. + + + + + Optional Dependencies Attribute of the Melon. + + + + + Platform Attribute of the Melon. + + + + + Platform Attribute of the Melon. + + + + + Verify Loader Version Attribute of the Melon. + + + + + Verify Build Version Attribute of the Melon. + + + + + Auto-Created Harmony Instance of the Melon. + + + + + Auto-Created MelonLogger Instance of the Melon. + + + + + Optional ID of the Melon. + + + + + if the Melon is registered. + + + + + Name of the current Melon Type. + + + + + Runs before Support Module Initialization and after Assembly Generation for Il2Cpp Games. + + + + + Runs once per frame. + + + + + Can run multiple times per frame. Mostly used for Physics. + + + + + Runs once per frame, after . + + + + + Can run multiple times per frame. Mostly used for Unity's IMGUI. + + + + + Runs on a quit request. It is possible to abort the request in this callback. + + + + + Runs when Melon Preferences get saved. + + + + + Runs when Melon Preferences get saved. Gets passed the Preferences's File Path. + + + + + Runs when Melon Preferences get loaded. + + + + + Runs when Melon Preferences get loaded. Gets passed the Preferences's File Path. + + + + + Runs when the Melon is registered. Executed before the Melon's info is printed to the console. This callback should only be used a constructor for the Melon. + + + Please note that this callback may run before the Support Module is loaded. +
As a result, using unhollowed assemblies may not be possible yet and you would have to override instead.
+
+
+ + + Runs after the Melon has registered. This callback waits until MelonLoader has fully initialized (). + + + + + Runs after . This callback waits until Unity has invoked the first 'Start' messages (). + + + + + Runs when the Melon is unregistered. Also runs before the Application is closed (). + + + + + Registers the Melon. + + + + + Tries to find a registered Melon that matches the given Info. + + + + + Unregisters the Melon and all other Melons located in the same Assembly. + This only unsubscribes the Melons from all Callbacks/s and unpatches all Methods that were patched by Harmony, but doesn't actually unload the whole Assembly. + + + + + Directory of Plugins. + + + + + Directory of Mods. + + + + + List of Plugins. + + + + + List of Mods. + + + + + Runs when a new Scene is loaded. + + + + + Runs once a Scene is initialized. + + + + + Runs once a Scene unloads. + + + + + Runs before Game Initialization. + + + + + Runs after Game Initialization, before OnApplicationStart and before Assembly Generation on Il2Cpp games + + + + + Runs before MelonMods from the Mods folder are loaded. + + + + + Runs after all MelonLoader components are fully initialized (including all MelonMods). + + + + + List of registered s. + + + + + A Human-Readable Name for . + + + + + An info class for broken Melons. + + + + + A base for external MelonLoader modules. + + + + + Controls colored console output by . + + + + + Enables any future console color output produced by Pastel. + + + + + Disables any future console color output produced by Pastel. + + + + + Returns a string wrapped in an ANSI foreground color code using the specified color. + + The string to color. + The color to use on the specified string. + + + + Returns a string wrapped in an ANSI foreground color code using the specified color. + + The string to color. + The color to use on the specified string.Supported format: [#]RRGGBB. + + + + Returns a string wrapped in an ANSI background color code using the specified color. + + The string to color. + The color to use on the specified string. + + + + Returns a string wrapped in an ANSI background color code using the specified color. + + The string to color. + The color to use on the specified string.Supported format: [#]RRGGBB. + + + + Occurs when a Preferences File has been loaded. + + : Path of the Preferences File. + + + + + + Occurs when a Preferences File has been saved. + + : Path of the Preferences File. + + + + + + Extentions for enums. + + + + + From: http://www.sambeauvois.be/blog/2011/08/enum-hasflag-method-extension-for-4-0-framework/ + A FX 3.5 way to mimic the FX4 "HasFlag" method. + + The tested enum. + The value to test. + True if the flag is set. Otherwise false. + + + + Start a new coroutine.
+ Coroutines are called at the end of the game Update loops. +
+ The target routine + An object that can be passed to Stop to stop this coroutine +
+ + + Stop a currently running coroutine + + The coroutine to stop + + + Gets the red component value of this structure. + The red component value of this . + + + Gets the green component value of this structure. + The green component value of this . + + + Gets the blue component value of this structure. + The blue component value of this . + + + Gets the alpha component value of this structure. + The alpha component value of this . + + + Creates a structure from a 32-bit ARGB value. + A value specifying the 32-bit ARGB value. + The structure that this method creates. + + + Creates a structure from the four ARGB component (alpha, red, green, and blue) values. + The alpha component. + The red component. + The green component. + The blue component. + The that this method creates. + + + Creates a structure from the specified structure, but with the new specified alpha value. + The alpha value for the new . + The from which to create the new . + The that this method creates. + + + Creates a structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). + The red component value for the new . + The green component value for the new . + The blue component value for the new . + The that this method creates. + + + Tests whether two specified structures are equivalent. + The that is to the left of the equality operator. + The that is to the right of the equality operator. + + if the two structures are equal; otherwise, . + + + + Tests whether two specified structures are different. + The that is to the left of the inequality operator. + The that is to the right of the inequality operator. + + if the two structures are different; otherwise, . + + + + Tests whether the specified object is a structure and is equivalent to this structure. + The object to test. + + if is a structure equivalent to this structure; otherwise, . + + + + Tests whether the specified structure is equivalent to this structure. + The structure to test. + + if is equivalent to this structure; otherwise, . + + + + Returns a hash code for this structure. + An integer value that specifies the hash code for this . + + + Gets a ColorARGB that has an ARGB value of #00FFFFFF. + + + Gets a ColorARGB that has an ARGB value of #FFF0F8FF. + + + Gets a ColorARGB that has an ARGB value of #FFFAEBD7. + + + Gets a ColorARGB that has an ARGB value of #FF00FFFF. + + + Gets a ColorARGB that has an ARGB value of #FF7FFFD4. + + + Gets a ColorARGB that has an ARGB value of #FFF0FFFF. + + + Gets a ColorARGB that has an ARGB value of #FFF5F5DC. + + + Gets a ColorARGB that has an ARGB value of #FFFFE4C4. + + + Gets a ColorARGB that has an ARGB value of #FF000000. + + + Gets a ColorARGB that has an ARGB value of #FFFFEBCD. + + + Gets a ColorARGB that has an ARGB value of #FF0000FF. + + + Gets a ColorARGB that has an ARGB value of #FF8A2BE2. + + + Gets a ColorARGB that has an ARGB value of #FFA52A2A. + + + Gets a ColorARGB that has an ARGB value of #FFDEB887. + + + Gets a ColorARGB that has an ARGB value of #FF5F9EA0. + + + Gets a ColorARGB that has an ARGB value of #FF7FFF00. + + + Gets a ColorARGB that has an ARGB value of #FFD2691E. + + + Gets a ColorARGB that has an ARGB value of #FFFF7F50. + + + Gets a ColorARGB that has an ARGB value of #FF6495ED. + + + Gets a ColorARGB that has an ARGB value of #FFFFF8DC. + + + Gets a ColorARGB that has an ARGB value of #FFDC143C. + + + Gets a ColorARGB that has an ARGB value of #FF00FFFF. + + + Gets a ColorARGB that has an ARGB value of #FF00008B. + + + Gets a ColorARGB that has an ARGB value of #FF008B8B. + + + Gets a ColorARGB that has an ARGB value of #FFB8860B. + + + Gets a ColorARGB that has an ARGB value of #FFA9A9A9. + + + Gets a ColorARGB that has an ARGB value of #FF006400. + + + Gets a ColorARGB that has an ARGB value of #FFBDB76B. + + + Gets a ColorARGB that has an ARGB value of #FF8B008B. + + + Gets a ColorARGB that has an ARGB value of #FF556B2F. + + + Gets a ColorARGB that has an ARGB value of #FFFF8C00. + + + Gets a ColorARGB that has an ARGB value of #FF9932CC. + + + Gets a ColorARGB that has an ARGB value of #FF8B0000. + + + Gets a ColorARGB that has an ARGB value of #FFE9967A. + + + Gets a ColorARGB that has an ARGB value of #FF8FBC8B. + + + Gets a ColorARGB that has an ARGB value of #FF483D8B. + + + Gets a ColorARGB that has an ARGB value of #FF2F4F4F. + + + Gets a ColorARGB that has an ARGB value of #FF00CED1. + + + Gets a ColorARGB that has an ARGB value of #FF9400D3. + + + Gets a ColorARGB that has an ARGB value of #FFFF1493. + + + Gets a ColorARGB that has an ARGB value of #FF00BFFF. + + + Gets a ColorARGB that has an ARGB value of #FF696969. + + + Gets a ColorARGB that has an ARGB value of #FF1E90FF. + + + Gets a ColorARGB that has an ARGB value of #FFB22222. + + + Gets a ColorARGB that has an ARGB value of #FFFFFAF0. + + + Gets a ColorARGB that has an ARGB value of #FF228B22. + + + Gets a ColorARGB that has an ARGB value of #FFFF00FF. + + + Gets a ColorARGB that has an ARGB value of #FFDCDCDC. + + + Gets a ColorARGB that has an ARGB value of #FFF8F8FF. + + + Gets a ColorARGB that has an ARGB value of #FFFFD700. + + + Gets a ColorARGB that has an ARGB value of #FFDAA520. + + + Gets a ColorARGB that has an ARGB value of #FF808080. + + + Gets a ColorARGB that has an ARGB value of #FF008000. + + + Gets a ColorARGB that has an ARGB value of #FFADFF2F. + + + Gets a ColorARGB that has an ARGB value of #FFF0FFF0. + + + Gets a ColorARGB that has an ARGB value of #FFFF69B4. + + + Gets a ColorARGB that has an ARGB value of #FFCD5C5C. + + + Gets a ColorARGB that has an ARGB value of #FF4B0082. + + + Gets a ColorARGB that has an ARGB value of #FFFFFFF0. + + + Gets a ColorARGB that has an ARGB value of #FFF0E68C. + + + Gets a ColorARGB that has an ARGB value of #FFE6E6FA. + + + Gets a ColorARGB that has an ARGB value of #FFFFF0F5. + + + Gets a ColorARGB that has an ARGB value of #FF7CFC00. + + + Gets a ColorARGB that has an ARGB value of #FFFFFACD. + + + Gets a ColorARGB that has an ARGB value of #FFADD8E6. + + + Gets a ColorARGB that has an ARGB value of #FFF08080. + + + Gets a ColorARGB that has an ARGB value of #FFE0FFFF. + + + Gets a ColorARGB that has an ARGB value of #FFFAFAD2. + + + Gets a ColorARGB that has an ARGB value of #FF90EE90. + + + Gets a ColorARGB that has an ARGB value of #FFD3D3D3. + + + Gets a ColorARGB that has an ARGB value of #FFFFB6C1. + + + Gets a ColorARGB that has an ARGB value of #FFFFA07A. + + + Gets a ColorARGB that has an ARGB value of #FF20B2AA. + + + Gets a ColorARGB that has an ARGB value of #FF87CEFA. + + + Gets a ColorARGB that has an ARGB value of #FF778899. + + + Gets a ColorARGB that has an ARGB value of #FFB0C4DE. + + + Gets a ColorARGB that has an ARGB value of #FFFFFFE0. + + + Gets a ColorARGB that has an ARGB value of #FF00FF00. + + + Gets a ColorARGB that has an ARGB value of #FF32CD32. + + + Gets a ColorARGB that has an ARGB value of #FFFAF0E6. + + + Gets a ColorARGB that has an ARGB value of #FFFF00FF. + + + Gets a ColorARGB that has an ARGB value of #FF800000. + + + Gets a ColorARGB that has an ARGB value of #FF66CDAA. + + + Gets a ColorARGB that has an ARGB value of #FF0000CD. + + + Gets a ColorARGB that has an ARGB value of #FFBA55D3. + + + Gets a ColorARGB that has an ARGB value of #FF9370DB. + + + Gets a ColorARGB that has an ARGB value of #FF3CB371. + + + Gets a ColorARGB that has an ARGB value of #FF7B68EE. + + + Gets a ColorARGB that has an ARGB value of #FF00FA9A. + + + Gets a ColorARGB that has an ARGB value of #FF48D1CC. + + + Gets a ColorARGB that has an ARGB value of #FFC71585. + + + Gets a ColorARGB that has an ARGB value of #FF191970. + + + Gets a ColorARGB that has an ARGB value of #FFF5FFFA. + + + Gets a ColorARGB that has an ARGB value of #FFFFE4E1. + + + Gets a ColorARGB that has an ARGB value of #FFFFE4B5. + + + Gets a ColorARGB that has an ARGB value of #FFFFDEAD. + + + Gets a ColorARGB that has an ARGB value of #FF000080. + + + Gets a ColorARGB that has an ARGB value of #FFFDF5E6. + + + Gets a ColorARGB that has an ARGB value of #FF808000. + + + Gets a ColorARGB that has an ARGB value of #FF6B8E23. + + + Gets a ColorARGB that has an ARGB value of #FFFFA500. + + + Gets a ColorARGB that has an ARGB value of #FFFF4500. + + + Gets a ColorARGB that has an ARGB value of #FFDA70D6. + + + Gets a ColorARGB that has an ARGB value of #FFEEE8AA. + + + Gets a ColorARGB that has an ARGB value of #FF98FB98. + + + Gets a ColorARGB that has an ARGB value of #FFAFEEEE. + + + Gets a ColorARGB that has an ARGB value of #FFDB7093. + + + Gets a ColorARGB that has an ARGB value of #FFFFEFD5. + + + Gets a ColorARGB that has an ARGB value of #FFFFDAB9. + + + Gets a ColorARGB that has an ARGB value of #FFCD853F. + + + Gets a ColorARGB that has an ARGB value of #FFFFC0CB. + + + Gets a ColorARGB that has an ARGB value of #FFDDA0DD. + + + Gets a ColorARGB that has an ARGB value of #FFB0E0E6. + + + Gets a ColorARGB that has an ARGB value of #FF800080. + + + Gets a ColorARGB that has an ARGB value of #FFFF0000. + + + Gets a ColorARGB that has an ARGB value of #FFBC8F8F. + + + Gets a ColorARGB that has an ARGB value of #FF4169E1. + + + Gets a ColorARGB that has an ARGB value of #FF8B4513. + + + Gets a ColorARGB that has an ARGB value of #FFFA8072. + + + Gets a ColorARGB that has an ARGB value of #FFF4A460. + + + Gets a ColorARGB that has an ARGB value of #FF2E8B57. + + + Gets a ColorARGB that has an ARGB value of #FFFFF5EE. + + + Gets a ColorARGB that has an ARGB value of #FFA0522D. + + + Gets a ColorARGB that has an ARGB value of #FFC0C0C0. + + + Gets a ColorARGB that has an ARGB value of #FF87CEEB. + + + Gets a ColorARGB that has an ARGB value of #FF6A5ACD. + + + Gets a ColorARGB that has an ARGB value of #FF708090. + + + Gets a ColorARGB that has an ARGB value of #FFFFFAFA. + + + Gets a ColorARGB that has an ARGB value of #FF00FF7F. + + + Gets a ColorARGB that has an ARGB value of #FF4682B4. + + + Gets a ColorARGB that has an ARGB value of #FFD2B48C. + + + Gets a ColorARGB that has an ARGB value of #FF008080. + + + Gets a ColorARGB that has an ARGB value of #FFD8BFD8. + + + Gets a ColorARGB that has an ARGB value of #FFFF6347. + + + Gets a ColorARGB that has an ARGB value of #FF40E0D0. + + + Gets a ColorARGB that has an ARGB value of #FFEE82EE. + + + Gets a ColorARGB that has an ARGB value of #FFF5DEB3. + + + Gets a ColorARGB that has an ARGB value of #FFFFFFFF. + + + Gets a ColorARGB that has an ARGB value of #FFF5F5F5. + + + Gets a ColorARGB that has an ARGB value of #FFFFFF00. + + + Gets a ColorARGB that has an ARGB value of #FF9ACD32. + + + + The number of digits in a non-negative number. Returns 1 for all + negative numbers. That is ok because we are using it to calculate + string length for a for numbers that + aren't supposed to be negative, but when they are it is just a little + slower. + + + This approach is based on https://stackoverflow.com/a/51099524/268898 + where the poster offers performance benchmarks showing this is the + fastest way to get a number of digits. + + + + + A semantic version implementation. + Conforms with v2.0.0 of http://semver.org + + + + + Deserialize a . + + The parameter is null. + + + + Constructs a new instance of the class. + + The major version. + The minor version. + The patch version. + The prerelease version (e.g. "alpha"). + The build metadata (e.g. "nightly.232"). + + + + Constructs a new instance of the class from + a . + + The that is used to initialize + the Major, Minor, Patch and Build. + A with the same Major and Minor version. + The Patch version will be the fourth part of the version number. The + build meta data will contain the third part of the version number if + it is greater than zero. + + + + Converts the string representation of a semantic version to its equivalent. + + The version string. + If set to minor and patch version are required, + otherwise they are optional. + The object. + The is . + The has an invalid format. + The is missing Minor or Patch versions and is . + The Major, Minor, or Patch versions are larger than int.MaxValue. + + + + Converts the string representation of a semantic version to its + equivalent and returns a value that indicates whether the conversion succeeded. + + The version string. + When the method returns, contains a instance equivalent + to the version string passed in, if the version string was valid, or if the + version string was not valid. + If set to minor and patch version are required, + otherwise they are optional. + when a invalid version string is passed, otherwise . + + + + Checks whether two semantic versions are equal. + + The first version to compare. + The second version to compare. + if the two values are equal, otherwise . + + + + Compares the specified versions. + + The first version to compare. + The second version to compare. + A signed number indicating the relative values of and . + + + + Make a copy of the current instance with changed properties. + + The value to replace the major version or to leave it unchanged. + The value to replace the minor version or to leave it unchanged. + The value to replace the patch version or to leave it unchanged. + The value to replace the prerelease version or to leave it unchanged. + The value to replace the build metadata or to leave it unchanged. + The new version object. + + The change method is intended to be called using named argument syntax, passing only + those fields to be changed. + + + To change only the patch version: + version.Change(patch: 4) + + + + + Gets the major version. + + + The major version. + + + + + Gets the minor version. + + + The minor version. + + + + + Gets the patch version. + + + The patch version. + + + + + Gets the prerelease version. + + + The prerelease version. Empty string if this is a release version. + + + + + Gets the build metadata. + + + The build metadata. Empty string if there is no build metadata. + + + + + Returns the equivalent of this version. + + + The equivalent of this version. + + + + + Compares the current instance with another object of the same type and returns an integer that indicates + whether the current instance precedes, follows, or occurs in the same position in the sort order as the + other object. + + An object to compare with this instance. + + A value that indicates the relative order of the objects being compared. + The return value has these meanings: + Less than zero: This instance precedes in the sort order. + Zero: This instance occurs in the same position in the sort order as . + Greater than zero: This instance follows in the sort order. + + The is not a . + + + + Compares the current instance with another object of the same type and returns an integer that indicates + whether the current instance precedes, follows, or occurs in the same position in the sort order as the + other object. + + An object to compare with this instance. + + A value that indicates the relative order of the objects being compared. + The return value has these meanings: + Less than zero: This instance precedes in the sort order. + Zero: This instance occurs in the same position in the sort order as . + Greater than zero: This instance follows in the sort order. + + + + + Returns whether two semantic versions have the same precedence. Versions + that differ only by build metadata have the same precedence. + + The semantic version to compare to. + if the version precedences are equal. + + + + Compares two semantic versions by precedence as defined in the SemVer spec. Versions + that differ only by build metadata have the same precedence. + + The semantic version. + + A value that indicates the relative order of the objects being compared. + The return value has these meanings: + Less than zero: This instance precedes in the sort order. + Zero: This instance occurs in the same position in the sort order as . + Greater than zero: This instance follows in the sort order. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + if the specified is equal to this instance, otherwise . + + The is not a . + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Populates a with the data needed to serialize the target object. + + The to populate with data. + The destination (see ) for this serialization. + + + + Implicit conversion from to . + + The semantic version. + The object. + The is . + The version number has an invalid format. + The Major, Minor, or Patch versions are larger than int.MaxValue. + + + + Compares two semantic versions for equality. + + The left value. + The right value. + If left is equal to right , otherwise . + + + + Compares two semantic versions for inequality. + + The left value. + The right value. + If left is not equal to right , otherwise . + + + + Compares two semantic versions. + + The left value. + The right value. + If left is greater than right , otherwise . + + + + Compares two semantic versions. + + The left value. + The right value. + If left is greater than or equal to right , otherwise . + + + + Compares two semantic versions. + + The left value. + The right value. + If left is less than right , otherwise . + + + + Compares two semantic versions. + + The left value. + The right value. + If left is less than or equal to right , otherwise . + +
+
diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Bcl.AsyncInterfaces.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 0000000..ec91b0e Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Bcl.Memory.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Bcl.Memory.dll new file mode 100644 index 0000000..c28754d Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Bcl.Memory.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Diagnostics.NETCore.Client.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Diagnostics.NETCore.Client.dll new file mode 100644 index 0000000..6b4e2b7 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Diagnostics.NETCore.Client.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Diagnostics.Runtime.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Diagnostics.Runtime.dll new file mode 100644 index 0000000..f5c26cb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Diagnostics.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll new file mode 100644 index 0000000..3a5ec19 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.Binder.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.Binder.dll new file mode 100644 index 0000000..2415b67 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.Binder.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.dll new file mode 100644 index 0000000..58f5d93 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Configuration.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll new file mode 100644 index 0000000..7abcf40 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.DependencyInjection.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.DependencyInjection.dll new file mode 100644 index 0000000..078d596 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.DependencyInjection.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Logging.Abstractions.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Logging.Abstractions.dll new file mode 100644 index 0000000..9c5333a Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Logging.Abstractions.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Logging.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Logging.dll new file mode 100644 index 0000000..f996242 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Logging.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Options.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Options.dll new file mode 100644 index 0000000..ead3f93 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Options.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Primitives.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Primitives.dll new file mode 100644 index 0000000..7fa3191 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Extensions.Primitives.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Microsoft.Win32.SystemEvents.dll b/Source/bin/MelonLoader/net6.0/Microsoft.Win32.SystemEvents.dll new file mode 100644 index 0000000..2af012d Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Microsoft.Win32.SystemEvents.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Mono.Cecil.Mdb.dll b/Source/bin/MelonLoader/net6.0/Mono.Cecil.Mdb.dll new file mode 100644 index 0000000..55f9ee2 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Mono.Cecil.Mdb.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Mono.Cecil.Pdb.dll b/Source/bin/MelonLoader/net6.0/Mono.Cecil.Pdb.dll new file mode 100644 index 0000000..0462a8f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Mono.Cecil.Pdb.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Mono.Cecil.Rocks.dll b/Source/bin/MelonLoader/net6.0/Mono.Cecil.Rocks.dll new file mode 100644 index 0000000..561b0d7 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Mono.Cecil.Rocks.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Mono.Cecil.dll b/Source/bin/MelonLoader/net6.0/Mono.Cecil.dll new file mode 100644 index 0000000..488bd5c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Mono.Cecil.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MonoMod.Backports.dll b/Source/bin/MelonLoader/net6.0/MonoMod.Backports.dll new file mode 100644 index 0000000..bf86322 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MonoMod.Backports.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MonoMod.ILHelpers.dll b/Source/bin/MelonLoader/net6.0/MonoMod.ILHelpers.dll new file mode 100644 index 0000000..628ab09 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MonoMod.ILHelpers.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MonoMod.RuntimeDetour.dll b/Source/bin/MelonLoader/net6.0/MonoMod.RuntimeDetour.dll new file mode 100644 index 0000000..dd52100 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MonoMod.RuntimeDetour.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MonoMod.Utils.dll b/Source/bin/MelonLoader/net6.0/MonoMod.Utils.dll new file mode 100644 index 0000000..19b0459 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MonoMod.Utils.dll differ diff --git a/Source/bin/MelonLoader/net6.0/MonoMod.dll b/Source/bin/MelonLoader/net6.0/MonoMod.dll new file mode 100644 index 0000000..f28d313 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/MonoMod.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Newtonsoft.Json.dll b/Source/bin/MelonLoader/net6.0/Newtonsoft.Json.dll new file mode 100644 index 0000000..5813d8c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Newtonsoft.Json.dll differ diff --git a/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.deps.json b/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.deps.json new file mode 100644 index 0000000..5c51e78 --- /dev/null +++ b/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.deps.json @@ -0,0 +1,2232 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": { + "PvZ_Fusion_Translator/1.0.0": { + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "0Harmony": "2.10.2.0", + "AsmResolver": "6.0.0.0", + "AsmResolver.DotNet": "6.0.0.0", + "AsmResolver.PE": "6.0.0.0", + "AsmResolver.PE.File": "6.0.0.0", + "Assembly-CSharp": "0.0.0.0", + "AssetRipper.Primitives": "3.2.0.0", + "AssetRipper.VersionUtilities": "1.5.0.0", + "AssetsTools.NET": "3.0.0.0", + "AudioImportLib": "1.0.0.0", + "bHapticsLib": "1.0.6.0", + "Iced": "1.21.0.0", + "Il2CppCore": "0.0.0.0", + "Il2CppInterop.Common": "1.5.1.0", + "Il2CppInterop.Generator": "1.5.1.0", + "Il2CppInterop.HarmonySupport": "1.5.1.0", + "Il2CppInterop.Runtime": "1.5.1.0", + "Il2CppMono.Security": "4.0.0.0", + "Il2Cppmscorlib": "4.0.0.0", + "Il2CppNewtonsoft.Json": "13.0.0.0", + "Il2CppSimpleFileBrowser.Runtime": "0.0.0.0", + "Il2Cppspine-csharp": "0.0.0.0", + "Il2Cppspine-unity": "0.0.0.0", + "Il2CppSystem.Configuration": "4.0.0.0", + "Il2CppSystem.Core": "4.0.0.0", + "Il2CppSystem.Data": "4.0.0.0", + "Il2CppSystem": "4.0.0.0", + "Il2CppSystem.Drawing": "4.0.0.0", + "Il2CppSystem.Numerics": "4.0.0.0", + "Il2CppSystem.Runtime.Serialization": "4.0.0.0", + "Il2CppSystem.Xml": "4.0.0.0", + "Il2CppSystem.Xml.Linq": "4.0.0.0", + "Il2CppUniTask": "0.0.0.0", + "Il2Cpp__Generated": "0.0.0.0", + "IndexRange": "1.1.1.0", + "MelonLoader": "0.7.3.0", + "MelonLoader.NativeHost": "0.7.3.0", + "Microsoft.Bcl.AsyncInterfaces": "9.0.0.8", + "Microsoft.Bcl.Memory": "9.0.0.14", + "Microsoft.Diagnostics.NETCore.Client": "0.2.13.11903", + "Microsoft.Diagnostics.Runtime": "3.1.10.12801", + "Microsoft.Extensions.Configuration.Abstractions": "10.0.0.0", + "Microsoft.Extensions.Configuration.Binder": "2.1.1.0", + "Microsoft.Extensions.Configuration": "10.0.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.0.0", + "Microsoft.Extensions.DependencyInjection": "10.0.0.0", + "Microsoft.Extensions.Logging.Abstractions": "10.0.0.0", + "Microsoft.Extensions.Logging": "10.0.0.0", + "Microsoft.Extensions.Options": "10.0.0.0", + "Microsoft.Extensions.Primitives": "10.0.0.0", + "Microsoft.Win32.SystemEvents": "8.0.0.0", + "Mono.Cecil": "0.11.6.0", + "Mono.Cecil.Mdb": "0.11.6.0", + "Mono.Cecil.Pdb": "0.11.6.0", + "Mono.Cecil.Rocks": "0.11.6.0", + "MonoMod.Backports": "1.1.2.0", + "MonoMod": "22.7.31.1", + "MonoMod.ILHelpers": "1.1.0.0", + "MonoMod.RuntimeDetour": "22.7.31.1", + "MonoMod.Utils": "22.7.31.1", + "Newtonsoft.Json.Reference": "13.0.0.0", + "System.Configuration.ConfigurationManager": "10.0.0.0", + "System.Diagnostics.DiagnosticSource": "10.0.0.0", + "System.Drawing.Common": "8.0.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0.0", + "System.Security.Cryptography.ProtectedData": "10.0.0.0", + "System.Security.Permissions": "10.0.0.0", + "System.Windows.Extensions": "8.0.0.0", + "Tomlet": "6.2.0.0", + "Unity.2D.Animation.Runtime": "0.0.0.0", + "Unity.2D.Common.Runtime": "0.0.0.0", + "Unity.2D.SpriteShape.Runtime": "0.0.0.0", + "Unity.2D.Tilemap.Extras": "0.0.0.0", + "Unity.Burst": "0.0.0.0", + "Unity.Burst.Unsafe": "4.0.5.0", + "Unity.Collections": "0.0.0.0", + "Unity.Collections.LowLevel.ILSupport": "0.0.0.0", + "Unity.InternalAPIEngineBridge.001": "0.0.0.0", + "Unity.Mathematics": "1.0.0.0", + "Unity.MemoryProfiler": "0.0.0.0", + "Unity.RenderPipeline.Universal.ShaderLibrary": "0.0.0.0", + "Unity.RenderPipelines.Core.Runtime": "0.0.0.0", + "Unity.RenderPipelines.Universal.Runtime": "0.0.0.0", + "Unity.TextMeshPro": "0.0.0.0", + "Unity.VisualScripting.Core": "0.0.0.0", + "UnityEngine.AccessibilityModule": "0.0.0.0", + "UnityEngine.AIModule": "0.0.0.0", + "UnityEngine.AndroidJNIModule": "0.0.0.0", + "UnityEngine.AnimationModule": "0.0.0.0", + "UnityEngine.ARModule": "0.0.0.0", + "UnityEngine.AssetBundleModule": "0.0.0.0", + "UnityEngine.AudioModule": "0.0.0.0", + "UnityEngine.ClothModule": "0.0.0.0", + "UnityEngine.ClusterInputModule": "0.0.0.0", + "UnityEngine.ClusterRendererModule": "0.0.0.0", + "UnityEngine.ContentLoadModule": "0.0.0.0", + "UnityEngine.CoreModule": "0.0.0.0", + "UnityEngine.CrashReportingModule": "0.0.0.0", + "UnityEngine.DirectorModule": "0.0.0.0", + "UnityEngine": "0.0.0.0", + "UnityEngine.DSPGraphModule": "0.0.0.0", + "UnityEngine.GameCenterModule": "0.0.0.0", + "UnityEngine.GIModule": "0.0.0.0", + "UnityEngine.GridModule": "0.0.0.0", + "UnityEngine.HotReloadModule": "0.0.0.0", + "UnityEngine.Il2CppAssetBundleManager": "0.7.3.0", + "UnityEngine.Il2CppImageConversionManager": "0.7.3.0", + "UnityEngine.ImageConversionModule": "0.0.0.0", + "UnityEngine.IMGUIModule": "0.0.0.0", + "UnityEngine.InputLegacyModule": "0.0.0.0", + "UnityEngine.InputModule": "0.0.0.0", + "UnityEngine.JSONSerializeModule": "0.0.0.0", + "UnityEngine.LocalizationModule": "0.0.0.0", + "UnityEngine.NVIDIAModule": "0.0.0.0", + "UnityEngine.ParticleSystemModule": "0.0.0.0", + "UnityEngine.PerformanceReportingModule": "0.0.0.0", + "UnityEngine.Physics2DModule": "0.0.0.0", + "UnityEngine.PhysicsModule": "0.0.0.0", + "UnityEngine.ProfilerModule": "0.0.0.0", + "UnityEngine.PropertiesModule": "0.0.0.0", + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule": "0.0.0.0", + "UnityEngine.ScreenCaptureModule": "0.0.0.0", + "UnityEngine.SharedInternalsModule": "0.0.0.0", + "UnityEngine.SpriteMaskModule": "0.0.0.0", + "UnityEngine.SpriteShapeModule": "0.0.0.0", + "UnityEngine.StreamingModule": "0.0.0.0", + "UnityEngine.SubstanceModule": "0.0.0.0", + "UnityEngine.SubsystemsModule": "0.0.0.0", + "UnityEngine.TerrainModule": "0.0.0.0", + "UnityEngine.TerrainPhysicsModule": "0.0.0.0", + "UnityEngine.TextCoreFontEngineModule": "0.0.0.0", + "UnityEngine.TextCoreTextEngineModule": "0.0.0.0", + "UnityEngine.TextRenderingModule": "0.0.0.0", + "UnityEngine.TilemapModule": "0.0.0.0", + "UnityEngine.TLSModule": "0.0.0.0", + "UnityEngine.UI": "1.0.0.0", + "UnityEngine.UIElementsModule": "0.0.0.0", + "UnityEngine.UIModule": "0.0.0.0", + "UnityEngine.UmbraModule": "0.0.0.0", + "UnityEngine.UnityAnalyticsCommonModule": "0.0.0.0", + "UnityEngine.UnityAnalyticsModule": "0.0.0.0", + "UnityEngine.UnityConnectModule": "0.0.0.0", + "UnityEngine.UnityCurlModule": "0.0.0.0", + "UnityEngine.UnityTestProtocolModule": "0.0.0.0", + "UnityEngine.UnityWebRequestAssetBundleModule": "0.0.0.0", + "UnityEngine.UnityWebRequestAudioModule": "0.0.0.0", + "UnityEngine.UnityWebRequestModule": "0.0.0.0", + "UnityEngine.UnityWebRequestTextureModule": "0.0.0.0", + "UnityEngine.UnityWebRequestWWWModule": "0.0.0.0", + "UnityEngine.VehiclesModule": "0.0.0.0", + "UnityEngine.VFXModule": "0.0.0.0", + "UnityEngine.VideoModule": "0.0.0.0", + "UnityEngine.VirtualTexturingModule": "0.0.0.0", + "UnityEngine.VRModule": "0.0.0.0", + "UnityEngine.WindModule": "0.0.0.0", + "UnityEngine.XRModule": "0.0.0.0", + "WebSocketDotNet": "1.0.0.0" + }, + "runtime": { + "PvZ_Fusion_Translator.dll": {} + } + }, + "Newtonsoft.Json/13.0.3": {}, + "0Harmony/2.10.2.0": { + "runtime": { + "0Harmony.dll": { + "assemblyVersion": "2.10.2.0", + "fileVersion": "2.10.2.0" + } + } + }, + "AsmResolver/6.0.0.0": { + "runtime": { + "AsmResolver.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.0.0" + } + } + }, + "AsmResolver.DotNet/6.0.0.0": { + "runtime": { + "AsmResolver.DotNet.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.0.0" + } + } + }, + "AsmResolver.PE/6.0.0.0": { + "runtime": { + "AsmResolver.PE.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.0.0" + } + } + }, + "AsmResolver.PE.File/6.0.0.0": { + "runtime": { + "AsmResolver.PE.File.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.0.0" + } + } + }, + "Assembly-CSharp/0.0.0.0": { + "runtime": { + "Assembly-CSharp.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "AssetRipper.Primitives/3.2.0.0": { + "runtime": { + "AssetRipper.Primitives.dll": { + "assemblyVersion": "3.2.0.0", + "fileVersion": "3.2.0.0" + } + } + }, + "AssetRipper.VersionUtilities/1.5.0.0": { + "runtime": { + "AssetRipper.VersionUtilities.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.5.0.0" + } + } + }, + "AssetsTools.NET/3.0.0.0": { + "runtime": { + "AssetsTools.NET.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.0.0.0" + } + } + }, + "AudioImportLib/1.0.0.0": { + "runtime": { + "AudioImportLib.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + }, + "bHapticsLib/1.0.6.0": { + "runtime": { + "bHapticsLib.dll": { + "assemblyVersion": "1.0.6.0", + "fileVersion": "1.0.6.0" + } + } + }, + "Iced/1.21.0.0": { + "runtime": { + "Iced.dll": { + "assemblyVersion": "1.21.0.0", + "fileVersion": "1.21.0.0" + } + } + }, + "Il2CppCore/0.0.0.0": { + "runtime": { + "Il2CppCore.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppInterop.Common/1.5.1.0": { + "runtime": { + "Il2CppInterop.Common.dll": { + "assemblyVersion": "1.5.1.0", + "fileVersion": "1.5.1.0" + } + } + }, + "Il2CppInterop.Generator/1.5.1.0": { + "runtime": { + "Il2CppInterop.Generator.dll": { + "assemblyVersion": "1.5.1.0", + "fileVersion": "1.5.1.0" + } + } + }, + "Il2CppInterop.HarmonySupport/1.5.1.0": { + "runtime": { + "Il2CppInterop.HarmonySupport.dll": { + "assemblyVersion": "1.5.1.0", + "fileVersion": "1.5.1.0" + } + } + }, + "Il2CppInterop.Runtime/1.5.1.0": { + "runtime": { + "Il2CppInterop.Runtime.dll": { + "assemblyVersion": "1.5.1.0", + "fileVersion": "1.5.1.0" + } + } + }, + "Il2CppMono.Security/4.0.0.0": { + "runtime": { + "Il2CppMono.Security.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2Cppmscorlib/4.0.0.0": { + "runtime": { + "Il2Cppmscorlib.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppNewtonsoft.Json/13.0.0.0": { + "runtime": { + "Il2CppNewtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSimpleFileBrowser.Runtime/0.0.0.0": { + "runtime": { + "Il2CppSimpleFileBrowser.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2Cppspine-csharp/0.0.0.0": { + "runtime": { + "Il2Cppspine-csharp.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2Cppspine-unity/0.0.0.0": { + "runtime": { + "Il2Cppspine-unity.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Configuration/4.0.0.0": { + "runtime": { + "Il2CppSystem.Configuration.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Core/4.0.0.0": { + "runtime": { + "Il2CppSystem.Core.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Data/4.0.0.0": { + "runtime": { + "Il2CppSystem.Data.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem/4.0.0.0": { + "runtime": { + "Il2CppSystem.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Drawing/4.0.0.0": { + "runtime": { + "Il2CppSystem.Drawing.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Numerics/4.0.0.0": { + "runtime": { + "Il2CppSystem.Numerics.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Runtime.Serialization/4.0.0.0": { + "runtime": { + "Il2CppSystem.Runtime.Serialization.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Xml/4.0.0.0": { + "runtime": { + "Il2CppSystem.Xml.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppSystem.Xml.Linq/4.0.0.0": { + "runtime": { + "Il2CppSystem.Xml.Linq.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2CppUniTask/0.0.0.0": { + "runtime": { + "Il2CppUniTask.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Il2Cpp__Generated/0.0.0.0": { + "runtime": { + "Il2Cpp__Generated.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "IndexRange/1.1.1.0": { + "runtime": { + "IndexRange.dll": { + "assemblyVersion": "1.1.1.0", + "fileVersion": "1.1.1.0" + } + } + }, + "MelonLoader/0.7.3.0": { + "runtime": { + "MelonLoader.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "MelonLoader.NativeHost/0.7.3.0": { + "runtime": { + "MelonLoader.NativeHost.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/9.0.0.8": { + "runtime": { + "Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "9.0.0.8", + "fileVersion": "9.0.825.36511" + } + } + }, + "Microsoft.Bcl.Memory/9.0.0.14": { + "runtime": { + "Microsoft.Bcl.Memory.dll": { + "assemblyVersion": "9.0.0.14", + "fileVersion": "9.0.1426.11910" + } + } + }, + "Microsoft.Diagnostics.NETCore.Client/0.2.13.11903": { + "runtime": { + "Microsoft.Diagnostics.NETCore.Client.dll": { + "assemblyVersion": "0.2.13.11903", + "fileVersion": "0.2.13.11903" + } + } + }, + "Microsoft.Diagnostics.Runtime/3.1.10.12801": { + "runtime": { + "Microsoft.Diagnostics.Runtime.dll": { + "assemblyVersion": "3.1.10.12801", + "fileVersion": "3.1.10.12801" + } + } + }, + "Microsoft.Extensions.Configuration.Abstractions/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.Configuration.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.Configuration.Binder/2.1.1.0": { + "runtime": { + "Microsoft.Extensions.Configuration.Binder.dll": { + "assemblyVersion": "2.1.1.0", + "fileVersion": "2.1.1.18157" + } + } + }, + "Microsoft.Extensions.Configuration/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.Configuration.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.DependencyInjection.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.DependencyInjection/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.DependencyInjection.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.Logging.Abstractions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.Logging/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.Logging.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.Options/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.Options.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Extensions.Primitives/10.0.0.0": { + "runtime": { + "Microsoft.Extensions.Primitives.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "Microsoft.Win32.SystemEvents/8.0.0.0": { + "runtime": { + "Microsoft.Win32.SystemEvents.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Mono.Cecil/0.11.6.0": { + "runtime": { + "Mono.Cecil.dll": { + "assemblyVersion": "0.11.6.0", + "fileVersion": "0.11.6.0" + } + } + }, + "Mono.Cecil.Mdb/0.11.6.0": { + "runtime": { + "Mono.Cecil.Mdb.dll": { + "assemblyVersion": "0.11.6.0", + "fileVersion": "0.11.6.0" + } + } + }, + "Mono.Cecil.Pdb/0.11.6.0": { + "runtime": { + "Mono.Cecil.Pdb.dll": { + "assemblyVersion": "0.11.6.0", + "fileVersion": "0.11.6.0" + } + } + }, + "Mono.Cecil.Rocks/0.11.6.0": { + "runtime": { + "Mono.Cecil.Rocks.dll": { + "assemblyVersion": "0.11.6.0", + "fileVersion": "0.11.6.0" + } + } + }, + "MonoMod.Backports/1.1.2.0": { + "runtime": { + "MonoMod.Backports.dll": { + "assemblyVersion": "1.1.2.0", + "fileVersion": "1.1.2.0" + } + } + }, + "MonoMod/22.7.31.1": { + "runtime": { + "MonoMod.dll": { + "assemblyVersion": "22.7.31.1", + "fileVersion": "22.7.31.1" + } + } + }, + "MonoMod.ILHelpers/1.1.0.0": { + "runtime": { + "MonoMod.ILHelpers.dll": { + "assemblyVersion": "1.1.0.0", + "fileVersion": "1.1.0.0" + } + } + }, + "MonoMod.RuntimeDetour/22.7.31.1": { + "runtime": { + "MonoMod.RuntimeDetour.dll": { + "assemblyVersion": "22.7.31.1", + "fileVersion": "22.7.31.1" + } + } + }, + "MonoMod.Utils/22.7.31.1": { + "runtime": { + "MonoMod.Utils.dll": { + "assemblyVersion": "22.7.31.1", + "fileVersion": "22.7.31.1" + } + } + }, + "Newtonsoft.Json.Reference/13.0.0.0": { + "runtime": { + "Newtonsoft.Json.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.0.4.30916" + } + } + }, + "System.Configuration.ConfigurationManager/10.0.0.0": { + "runtime": { + "System.Configuration.ConfigurationManager.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "System.Diagnostics.DiagnosticSource/10.0.0.0": { + "runtime": { + "System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "System.Drawing.Common/8.0.0.0": { + "runtime": { + "System.Drawing.Common.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.1024.46803" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0.0": { + "runtime": { + "System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.100.225.20307" + } + } + }, + "System.Security.Cryptography.ProtectedData/10.0.0.0": { + "runtime": { + "System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "System.Security.Permissions/10.0.0.0": { + "runtime": { + "System.Security.Permissions.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.326.7603" + } + } + }, + "System.Windows.Extensions/8.0.0.0": { + "runtime": { + "System.Windows.Extensions.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.23.53103" + } + } + }, + "Tomlet/6.2.0.0": { + "runtime": { + "Tomlet.dll": { + "assemblyVersion": "6.2.0.0", + "fileVersion": "6.2.0.0" + } + } + }, + "Unity.2D.Animation.Runtime/0.0.0.0": { + "runtime": { + "Unity.2D.Animation.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.Common.Runtime/0.0.0.0": { + "runtime": { + "Unity.2D.Common.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.SpriteShape.Runtime/0.0.0.0": { + "runtime": { + "Unity.2D.SpriteShape.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.2D.Tilemap.Extras/0.0.0.0": { + "runtime": { + "Unity.2D.Tilemap.Extras.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Burst/0.0.0.0": { + "runtime": { + "Unity.Burst.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Burst.Unsafe/4.0.5.0": { + "runtime": { + "Unity.Burst.Unsafe.dll": { + "assemblyVersion": "4.0.5.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Collections/0.0.0.0": { + "runtime": { + "Unity.Collections.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Collections.LowLevel.ILSupport/0.0.0.0": { + "runtime": { + "Unity.Collections.LowLevel.ILSupport.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.InternalAPIEngineBridge.001/0.0.0.0": { + "runtime": { + "Unity.InternalAPIEngineBridge.001.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.Mathematics/1.0.0.0": { + "runtime": { + "Unity.Mathematics.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.MemoryProfiler/0.0.0.0": { + "runtime": { + "Unity.MemoryProfiler.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.RenderPipeline.Universal.ShaderLibrary/0.0.0.0": { + "runtime": { + "Unity.RenderPipeline.Universal.ShaderLibrary.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.RenderPipelines.Core.Runtime/0.0.0.0": { + "runtime": { + "Unity.RenderPipelines.Core.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.RenderPipelines.Universal.Runtime/0.0.0.0": { + "runtime": { + "Unity.RenderPipelines.Universal.Runtime.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.TextMeshPro/0.0.0.0": { + "runtime": { + "Unity.TextMeshPro.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "Unity.VisualScripting.Core/0.0.0.0": { + "runtime": { + "Unity.VisualScripting.Core.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AccessibilityModule/0.0.0.0": { + "runtime": { + "UnityEngine.AccessibilityModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AIModule/0.0.0.0": { + "runtime": { + "UnityEngine.AIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AndroidJNIModule/0.0.0.0": { + "runtime": { + "UnityEngine.AndroidJNIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AnimationModule/0.0.0.0": { + "runtime": { + "UnityEngine.AnimationModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ARModule/0.0.0.0": { + "runtime": { + "UnityEngine.ARModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AssetBundleModule/0.0.0.0": { + "runtime": { + "UnityEngine.AssetBundleModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.AudioModule/0.0.0.0": { + "runtime": { + "UnityEngine.AudioModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ClothModule/0.0.0.0": { + "runtime": { + "UnityEngine.ClothModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ClusterInputModule/0.0.0.0": { + "runtime": { + "UnityEngine.ClusterInputModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ClusterRendererModule/0.0.0.0": { + "runtime": { + "UnityEngine.ClusterRendererModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ContentLoadModule/0.0.0.0": { + "runtime": { + "UnityEngine.ContentLoadModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.CoreModule/0.0.0.0": { + "runtime": { + "UnityEngine.CoreModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.CrashReportingModule/0.0.0.0": { + "runtime": { + "UnityEngine.CrashReportingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.DirectorModule/0.0.0.0": { + "runtime": { + "UnityEngine.DirectorModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine/0.0.0.0": { + "runtime": { + "UnityEngine.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.DSPGraphModule/0.0.0.0": { + "runtime": { + "UnityEngine.DSPGraphModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.GameCenterModule/0.0.0.0": { + "runtime": { + "UnityEngine.GameCenterModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.GIModule/0.0.0.0": { + "runtime": { + "UnityEngine.GIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.GridModule/0.0.0.0": { + "runtime": { + "UnityEngine.GridModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.HotReloadModule/0.0.0.0": { + "runtime": { + "UnityEngine.HotReloadModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.Il2CppAssetBundleManager/0.7.3.0": { + "runtime": { + "UnityEngine.Il2CppAssetBundleManager.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "UnityEngine.Il2CppImageConversionManager/0.7.3.0": { + "runtime": { + "UnityEngine.Il2CppImageConversionManager.dll": { + "assemblyVersion": "0.7.3.0", + "fileVersion": "0.7.3.0" + } + } + }, + "UnityEngine.ImageConversionModule/0.0.0.0": { + "runtime": { + "UnityEngine.ImageConversionModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.IMGUIModule/0.0.0.0": { + "runtime": { + "UnityEngine.IMGUIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.InputLegacyModule/0.0.0.0": { + "runtime": { + "UnityEngine.InputLegacyModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.InputModule/0.0.0.0": { + "runtime": { + "UnityEngine.InputModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.JSONSerializeModule/0.0.0.0": { + "runtime": { + "UnityEngine.JSONSerializeModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.LocalizationModule/0.0.0.0": { + "runtime": { + "UnityEngine.LocalizationModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.NVIDIAModule/0.0.0.0": { + "runtime": { + "UnityEngine.NVIDIAModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ParticleSystemModule/0.0.0.0": { + "runtime": { + "UnityEngine.ParticleSystemModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.PerformanceReportingModule/0.0.0.0": { + "runtime": { + "UnityEngine.PerformanceReportingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.Physics2DModule/0.0.0.0": { + "runtime": { + "UnityEngine.Physics2DModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.PhysicsModule/0.0.0.0": { + "runtime": { + "UnityEngine.PhysicsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ProfilerModule/0.0.0.0": { + "runtime": { + "UnityEngine.ProfilerModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.PropertiesModule/0.0.0.0": { + "runtime": { + "UnityEngine.PropertiesModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule/0.0.0.0": { + "runtime": { + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.ScreenCaptureModule/0.0.0.0": { + "runtime": { + "UnityEngine.ScreenCaptureModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SharedInternalsModule/0.0.0.0": { + "runtime": { + "UnityEngine.SharedInternalsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SpriteMaskModule/0.0.0.0": { + "runtime": { + "UnityEngine.SpriteMaskModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SpriteShapeModule/0.0.0.0": { + "runtime": { + "UnityEngine.SpriteShapeModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.StreamingModule/0.0.0.0": { + "runtime": { + "UnityEngine.StreamingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SubstanceModule/0.0.0.0": { + "runtime": { + "UnityEngine.SubstanceModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.SubsystemsModule/0.0.0.0": { + "runtime": { + "UnityEngine.SubsystemsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TerrainModule/0.0.0.0": { + "runtime": { + "UnityEngine.TerrainModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TerrainPhysicsModule/0.0.0.0": { + "runtime": { + "UnityEngine.TerrainPhysicsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TextCoreFontEngineModule/0.0.0.0": { + "runtime": { + "UnityEngine.TextCoreFontEngineModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TextCoreTextEngineModule/0.0.0.0": { + "runtime": { + "UnityEngine.TextCoreTextEngineModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TextRenderingModule/0.0.0.0": { + "runtime": { + "UnityEngine.TextRenderingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TilemapModule/0.0.0.0": { + "runtime": { + "UnityEngine.TilemapModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.TLSModule/0.0.0.0": { + "runtime": { + "UnityEngine.TLSModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UI/1.0.0.0": { + "runtime": { + "UnityEngine.UI.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UIElementsModule/0.0.0.0": { + "runtime": { + "UnityEngine.UIElementsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UIModule/0.0.0.0": { + "runtime": { + "UnityEngine.UIModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UmbraModule/0.0.0.0": { + "runtime": { + "UnityEngine.UmbraModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityAnalyticsCommonModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityAnalyticsCommonModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityAnalyticsModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityAnalyticsModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityConnectModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityConnectModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityCurlModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityCurlModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityTestProtocolModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityTestProtocolModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestAssetBundleModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestAssetBundleModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestAudioModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestAudioModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestTextureModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestTextureModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.UnityWebRequestWWWModule/0.0.0.0": { + "runtime": { + "UnityEngine.UnityWebRequestWWWModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VehiclesModule/0.0.0.0": { + "runtime": { + "UnityEngine.VehiclesModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VFXModule/0.0.0.0": { + "runtime": { + "UnityEngine.VFXModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VideoModule/0.0.0.0": { + "runtime": { + "UnityEngine.VideoModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VirtualTexturingModule/0.0.0.0": { + "runtime": { + "UnityEngine.VirtualTexturingModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.VRModule/0.0.0.0": { + "runtime": { + "UnityEngine.VRModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.WindModule/0.0.0.0": { + "runtime": { + "UnityEngine.WindModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "UnityEngine.XRModule/0.0.0.0": { + "runtime": { + "UnityEngine.XRModule.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.0.0.0" + } + } + }, + "WebSocketDotNet/1.0.0.0": { + "runtime": { + "WebSocketDotNet.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.0.0.0" + } + } + } + } + }, + "libraries": { + "PvZ_Fusion_Translator/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "path": "newtonsoft.json/13.0.3", + "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + }, + "0Harmony/2.10.2.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AsmResolver/6.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AsmResolver.DotNet/6.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AsmResolver.PE/6.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AsmResolver.PE.File/6.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Assembly-CSharp/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AssetRipper.Primitives/3.2.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AssetRipper.VersionUtilities/1.5.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AssetsTools.NET/3.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "AudioImportLib/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "bHapticsLib/1.0.6.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Iced/1.21.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppCore/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppInterop.Common/1.5.1.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppInterop.Generator/1.5.1.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppInterop.HarmonySupport/1.5.1.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppInterop.Runtime/1.5.1.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppMono.Security/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2Cppmscorlib/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppNewtonsoft.Json/13.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSimpleFileBrowser.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2Cppspine-csharp/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2Cppspine-unity/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Configuration/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Core/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Data/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Drawing/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Numerics/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Runtime.Serialization/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Xml/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppSystem.Xml.Linq/4.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2CppUniTask/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Il2Cpp__Generated/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "IndexRange/1.1.1.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MelonLoader/0.7.3.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MelonLoader.NativeHost/0.7.3.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Bcl.AsyncInterfaces/9.0.0.8": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Bcl.Memory/9.0.0.14": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Diagnostics.NETCore.Client/0.2.13.11903": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Diagnostics.Runtime/3.1.10.12801": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Configuration.Abstractions/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Configuration.Binder/2.1.1.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Configuration/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.DependencyInjection.Abstractions/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.DependencyInjection/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Logging.Abstractions/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Logging/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Options/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Extensions.Primitives/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Win32.SystemEvents/8.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Mono.Cecil/0.11.6.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Mono.Cecil.Mdb/0.11.6.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Mono.Cecil.Pdb/0.11.6.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Mono.Cecil.Rocks/0.11.6.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MonoMod.Backports/1.1.2.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MonoMod/22.7.31.1": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MonoMod.ILHelpers/1.1.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MonoMod.RuntimeDetour/22.7.31.1": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "MonoMod.Utils/22.7.31.1": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Newtonsoft.Json.Reference/13.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Configuration.ConfigurationManager/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Diagnostics.DiagnosticSource/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Drawing.Common/8.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Security.Cryptography.ProtectedData/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Security.Permissions/10.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "System.Windows.Extensions/8.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Tomlet/6.2.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.Animation.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.Common.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.SpriteShape.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.2D.Tilemap.Extras/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Burst/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Burst.Unsafe/4.0.5.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Collections/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Collections.LowLevel.ILSupport/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.InternalAPIEngineBridge.001/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.Mathematics/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.MemoryProfiler/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.RenderPipeline.Universal.ShaderLibrary/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.RenderPipelines.Core.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.RenderPipelines.Universal.Runtime/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.TextMeshPro/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "Unity.VisualScripting.Core/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AccessibilityModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AndroidJNIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AnimationModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ARModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AssetBundleModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.AudioModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ClothModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ClusterInputModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ClusterRendererModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ContentLoadModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.CoreModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.CrashReportingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.DirectorModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.DSPGraphModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.GameCenterModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.GIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.GridModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.HotReloadModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.Il2CppAssetBundleManager/0.7.3.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.Il2CppImageConversionManager/0.7.3.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ImageConversionModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.IMGUIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.InputLegacyModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.InputModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.JSONSerializeModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.LocalizationModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.NVIDIAModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ParticleSystemModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.PerformanceReportingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.Physics2DModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.PhysicsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ProfilerModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.PropertiesModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.ScreenCaptureModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SharedInternalsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SpriteMaskModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SpriteShapeModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.StreamingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SubstanceModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.SubsystemsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TerrainModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TerrainPhysicsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TextCoreFontEngineModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TextCoreTextEngineModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TextRenderingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TilemapModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.TLSModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UI/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UIElementsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UIModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UmbraModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityAnalyticsCommonModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityAnalyticsModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityConnectModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityCurlModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityTestProtocolModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestAssetBundleModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestAudioModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestTextureModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.UnityWebRequestWWWModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VehiclesModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VFXModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VideoModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VirtualTexturingModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.VRModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.WindModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "UnityEngine.XRModule/0.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + }, + "WebSocketDotNet/1.0.0.0": { + "type": "reference", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.dll b/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..21dfc24 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.dll differ diff --git a/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb b/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb new file mode 100644 index 0000000..d932a10 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb differ diff --git a/Source/bin/MelonLoader/net6.0/System.Configuration.ConfigurationManager.dll b/Source/bin/MelonLoader/net6.0/System.Configuration.ConfigurationManager.dll new file mode 100644 index 0000000..5d547a6 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Configuration.ConfigurationManager.dll differ diff --git a/Source/bin/MelonLoader/net6.0/System.Diagnostics.DiagnosticSource.dll b/Source/bin/MelonLoader/net6.0/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 0000000..b4f8912 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Diagnostics.DiagnosticSource.dll differ diff --git a/Source/bin/MelonLoader/net6.0/System.Drawing.Common.dll b/Source/bin/MelonLoader/net6.0/System.Drawing.Common.dll new file mode 100644 index 0000000..e7d6e5f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Drawing.Common.dll differ diff --git a/Source/bin/MelonLoader/net6.0/System.Runtime.CompilerServices.Unsafe.dll b/Source/bin/MelonLoader/net6.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000..53524fb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/Source/bin/MelonLoader/net6.0/System.Security.Cryptography.ProtectedData.dll b/Source/bin/MelonLoader/net6.0/System.Security.Cryptography.ProtectedData.dll new file mode 100644 index 0000000..04300d2 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Security.Cryptography.ProtectedData.dll differ diff --git a/Source/bin/MelonLoader/net6.0/System.Security.Permissions.dll b/Source/bin/MelonLoader/net6.0/System.Security.Permissions.dll new file mode 100644 index 0000000..b329ada Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Security.Permissions.dll differ diff --git a/Source/bin/MelonLoader/net6.0/System.Windows.Extensions.dll b/Source/bin/MelonLoader/net6.0/System.Windows.Extensions.dll new file mode 100644 index 0000000..ea06d3d Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/System.Windows.Extensions.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Tomlet.dll b/Source/bin/MelonLoader/net6.0/Tomlet.dll new file mode 100644 index 0000000..c988419 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Tomlet.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.2D.Animation.Runtime.dll b/Source/bin/MelonLoader/net6.0/Unity.2D.Animation.Runtime.dll new file mode 100644 index 0000000..2547c5e Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.2D.Animation.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.2D.Common.Runtime.dll b/Source/bin/MelonLoader/net6.0/Unity.2D.Common.Runtime.dll new file mode 100644 index 0000000..a663fde Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.2D.Common.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.2D.SpriteShape.Runtime.dll b/Source/bin/MelonLoader/net6.0/Unity.2D.SpriteShape.Runtime.dll new file mode 100644 index 0000000..a66618f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.2D.SpriteShape.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.2D.Tilemap.Extras.dll b/Source/bin/MelonLoader/net6.0/Unity.2D.Tilemap.Extras.dll new file mode 100644 index 0000000..a8ac00f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.2D.Tilemap.Extras.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.Burst.Unsafe.dll b/Source/bin/MelonLoader/net6.0/Unity.Burst.Unsafe.dll new file mode 100644 index 0000000..3aaf2fb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.Burst.Unsafe.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.Burst.dll b/Source/bin/MelonLoader/net6.0/Unity.Burst.dll new file mode 100644 index 0000000..f95a1b6 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.Burst.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.Collections.LowLevel.ILSupport.dll b/Source/bin/MelonLoader/net6.0/Unity.Collections.LowLevel.ILSupport.dll new file mode 100644 index 0000000..c347306 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.Collections.LowLevel.ILSupport.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.Collections.dll b/Source/bin/MelonLoader/net6.0/Unity.Collections.dll new file mode 100644 index 0000000..36b4d3c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.Collections.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.InternalAPIEngineBridge.001.dll b/Source/bin/MelonLoader/net6.0/Unity.InternalAPIEngineBridge.001.dll new file mode 100644 index 0000000..266b616 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.InternalAPIEngineBridge.001.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.Mathematics.dll b/Source/bin/MelonLoader/net6.0/Unity.Mathematics.dll new file mode 100644 index 0000000..6f42a04 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.Mathematics.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.MemoryProfiler.dll b/Source/bin/MelonLoader/net6.0/Unity.MemoryProfiler.dll new file mode 100644 index 0000000..8359045 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.MemoryProfiler.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.RenderPipeline.Universal.ShaderLibrary.dll b/Source/bin/MelonLoader/net6.0/Unity.RenderPipeline.Universal.ShaderLibrary.dll new file mode 100644 index 0000000..8d84e5f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.RenderPipeline.Universal.ShaderLibrary.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.RenderPipelines.Core.Runtime.dll b/Source/bin/MelonLoader/net6.0/Unity.RenderPipelines.Core.Runtime.dll new file mode 100644 index 0000000..14e6327 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.RenderPipelines.Core.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.RenderPipelines.Universal.Runtime.dll b/Source/bin/MelonLoader/net6.0/Unity.RenderPipelines.Universal.Runtime.dll new file mode 100644 index 0000000..7b254bf Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.RenderPipelines.Universal.Runtime.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.TextMeshPro.dll b/Source/bin/MelonLoader/net6.0/Unity.TextMeshPro.dll new file mode 100644 index 0000000..9a0c3d9 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.TextMeshPro.dll differ diff --git a/Source/bin/MelonLoader/net6.0/Unity.VisualScripting.Core.dll b/Source/bin/MelonLoader/net6.0/Unity.VisualScripting.Core.dll new file mode 100644 index 0000000..1c833b7 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/Unity.VisualScripting.Core.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.AIModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.AIModule.dll new file mode 100644 index 0000000..0885435 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.AIModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ARModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ARModule.dll new file mode 100644 index 0000000..bfcfadd Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ARModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.AccessibilityModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.AccessibilityModule.dll new file mode 100644 index 0000000..d0f56f8 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.AccessibilityModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.AndroidJNIModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.AndroidJNIModule.dll new file mode 100644 index 0000000..a191db6 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.AndroidJNIModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.AnimationModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.AnimationModule.dll new file mode 100644 index 0000000..9128728 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.AnimationModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.AssetBundleModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.AssetBundleModule.dll new file mode 100644 index 0000000..15a75f8 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.AssetBundleModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.AudioModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.AudioModule.dll new file mode 100644 index 0000000..31aa81b Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.AudioModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ClothModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ClothModule.dll new file mode 100644 index 0000000..d60481c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ClothModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ClusterInputModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ClusterInputModule.dll new file mode 100644 index 0000000..1b540eb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ClusterInputModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ClusterRendererModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ClusterRendererModule.dll new file mode 100644 index 0000000..c80b081 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ClusterRendererModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ContentLoadModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ContentLoadModule.dll new file mode 100644 index 0000000..b3f2732 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ContentLoadModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.CoreModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..1abf687 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.CoreModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.CrashReportingModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.CrashReportingModule.dll new file mode 100644 index 0000000..46c31ca Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.CrashReportingModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.DSPGraphModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.DSPGraphModule.dll new file mode 100644 index 0000000..6824424 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.DSPGraphModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.DirectorModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.DirectorModule.dll new file mode 100644 index 0000000..f865132 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.DirectorModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.GIModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.GIModule.dll new file mode 100644 index 0000000..c7a5e5c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.GIModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.GameCenterModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.GameCenterModule.dll new file mode 100644 index 0000000..37ca3fb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.GameCenterModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.GridModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.GridModule.dll new file mode 100644 index 0000000..69760b6 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.GridModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.HotReloadModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.HotReloadModule.dll new file mode 100644 index 0000000..5b8e57c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.HotReloadModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.IMGUIModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.IMGUIModule.dll new file mode 100644 index 0000000..8ea25ed Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.IMGUIModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppAssetBundleManager.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppAssetBundleManager.dll new file mode 100644 index 0000000..e7bbda8 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppAssetBundleManager.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppAssetBundleManager.pdb b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppAssetBundleManager.pdb new file mode 100644 index 0000000..d8c0668 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppAssetBundleManager.pdb differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppImageConversionManager.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppImageConversionManager.dll new file mode 100644 index 0000000..d766a1e Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppImageConversionManager.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppImageConversionManager.pdb b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppImageConversionManager.pdb new file mode 100644 index 0000000..94be28f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.Il2CppImageConversionManager.pdb differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ImageConversionModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ImageConversionModule.dll new file mode 100644 index 0000000..9f880e6 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ImageConversionModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.InputLegacyModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.InputLegacyModule.dll new file mode 100644 index 0000000..8c7688e Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.InputLegacyModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.InputModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.InputModule.dll new file mode 100644 index 0000000..c5e2dc1 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.InputModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.JSONSerializeModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.JSONSerializeModule.dll new file mode 100644 index 0000000..2d041b2 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.JSONSerializeModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.LocalizationModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.LocalizationModule.dll new file mode 100644 index 0000000..9fd04a4 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.LocalizationModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.NVIDIAModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.NVIDIAModule.dll new file mode 100644 index 0000000..9345af3 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.NVIDIAModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ParticleSystemModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ParticleSystemModule.dll new file mode 100644 index 0000000..ef33518 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ParticleSystemModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.PerformanceReportingModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.PerformanceReportingModule.dll new file mode 100644 index 0000000..64f8300 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.PerformanceReportingModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.Physics2DModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.Physics2DModule.dll new file mode 100644 index 0000000..6be79b1 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.Physics2DModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.PhysicsModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.PhysicsModule.dll new file mode 100644 index 0000000..2716228 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.PhysicsModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ProfilerModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ProfilerModule.dll new file mode 100644 index 0000000..835071c Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ProfilerModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.PropertiesModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.PropertiesModule.dll new file mode 100644 index 0000000..5d677df Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.PropertiesModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll new file mode 100644 index 0000000..34e7613 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.ScreenCaptureModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.ScreenCaptureModule.dll new file mode 100644 index 0000000..65adb5f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.ScreenCaptureModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.SharedInternalsModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.SharedInternalsModule.dll new file mode 100644 index 0000000..a54ed10 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.SharedInternalsModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.SpriteMaskModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.SpriteMaskModule.dll new file mode 100644 index 0000000..b13e519 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.SpriteMaskModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.SpriteShapeModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.SpriteShapeModule.dll new file mode 100644 index 0000000..33f53f1 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.SpriteShapeModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.StreamingModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.StreamingModule.dll new file mode 100644 index 0000000..9bc5ba5 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.StreamingModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.SubstanceModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.SubstanceModule.dll new file mode 100644 index 0000000..d9f2293 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.SubstanceModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.SubsystemsModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.SubsystemsModule.dll new file mode 100644 index 0000000..5cfac55 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.SubsystemsModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TLSModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TLSModule.dll new file mode 100644 index 0000000..8720f28 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TLSModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TerrainModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TerrainModule.dll new file mode 100644 index 0000000..a85ebc0 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TerrainModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TerrainPhysicsModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TerrainPhysicsModule.dll new file mode 100644 index 0000000..514f8cf Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TerrainPhysicsModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TextCoreFontEngineModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TextCoreFontEngineModule.dll new file mode 100644 index 0000000..0c3a58f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TextCoreFontEngineModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TextCoreTextEngineModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TextCoreTextEngineModule.dll new file mode 100644 index 0000000..15fccbc Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TextCoreTextEngineModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TextRenderingModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TextRenderingModule.dll new file mode 100644 index 0000000..b26ddbc Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TextRenderingModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.TilemapModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.TilemapModule.dll new file mode 100644 index 0000000..6a5fbb4 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.TilemapModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UI.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UI.dll new file mode 100644 index 0000000..684e307 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UI.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UIElementsModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UIElementsModule.dll new file mode 100644 index 0000000..26528f1 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UIElementsModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UIModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UIModule.dll new file mode 100644 index 0000000..1c85aed Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UIModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UmbraModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UmbraModule.dll new file mode 100644 index 0000000..ddc54dc Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UmbraModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityAnalyticsCommonModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityAnalyticsCommonModule.dll new file mode 100644 index 0000000..cfca9da Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityAnalyticsCommonModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityAnalyticsModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityAnalyticsModule.dll new file mode 100644 index 0000000..675a8da Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityAnalyticsModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityConnectModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityConnectModule.dll new file mode 100644 index 0000000..b55feb9 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityConnectModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityCurlModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityCurlModule.dll new file mode 100644 index 0000000..00a5183 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityCurlModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityTestProtocolModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityTestProtocolModule.dll new file mode 100644 index 0000000..4477766 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityTestProtocolModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestAssetBundleModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestAssetBundleModule.dll new file mode 100644 index 0000000..b0e4660 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestAssetBundleModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestAudioModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestAudioModule.dll new file mode 100644 index 0000000..18b3678 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestAudioModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestModule.dll new file mode 100644 index 0000000..ec0dfeb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestTextureModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestTextureModule.dll new file mode 100644 index 0000000..9913097 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestTextureModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestWWWModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestWWWModule.dll new file mode 100644 index 0000000..ee76803 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.UnityWebRequestWWWModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.VFXModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.VFXModule.dll new file mode 100644 index 0000000..9983bc9 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.VFXModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.VRModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.VRModule.dll new file mode 100644 index 0000000..a66a4eb Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.VRModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.VehiclesModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.VehiclesModule.dll new file mode 100644 index 0000000..5dc4578 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.VehiclesModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.VideoModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.VideoModule.dll new file mode 100644 index 0000000..bfdba68 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.VideoModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.VirtualTexturingModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.VirtualTexturingModule.dll new file mode 100644 index 0000000..771699f Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.VirtualTexturingModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.WindModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.WindModule.dll new file mode 100644 index 0000000..13b89ad Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.WindModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.XRModule.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.XRModule.dll new file mode 100644 index 0000000..7274a43 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.XRModule.dll differ diff --git a/Source/bin/MelonLoader/net6.0/UnityEngine.dll b/Source/bin/MelonLoader/net6.0/UnityEngine.dll new file mode 100644 index 0000000..52d33d2 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/UnityEngine.dll differ diff --git a/Source/bin/MelonLoader/net6.0/WebSocketDotNet.dll b/Source/bin/MelonLoader/net6.0/WebSocketDotNet.dll new file mode 100644 index 0000000..12d1def Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/WebSocketDotNet.dll differ diff --git a/Source/bin/MelonLoader/net6.0/bHapticsLib.dll b/Source/bin/MelonLoader/net6.0/bHapticsLib.dll new file mode 100644 index 0000000..caa6db9 Binary files /dev/null and b/Source/bin/MelonLoader/net6.0/bHapticsLib.dll differ diff --git a/Source/obj/BepInEx/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs b/Source/obj/BepInEx/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs new file mode 100644 index 0000000..ed92695 --- /dev/null +++ b/Source/obj/BepInEx/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] diff --git a/Source/obj/BepInEx/net6.0/MyPluginInfo.cs b/Source/obj/BepInEx/net6.0/MyPluginInfo.cs new file mode 100644 index 0000000..a6ea2e4 --- /dev/null +++ b/Source/obj/BepInEx/net6.0/MyPluginInfo.cs @@ -0,0 +1,9 @@ +namespace PvZ_Fusion_Translator +{ + public static class MyPluginInfo + { + public const string PLUGIN_GUID = "PvZ_Fusion_Translator"; + public const string PLUGIN_NAME = "PvZ_Fusion_Translator"; + public const string PLUGIN_VERSION = "1.0.0"; + } +} diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusi.9A76C7D4.Up2Date b/Source/obj/BepInEx/net6.0/PvZ Fusi.9A76C7D4.Up2Date new file mode 100644 index 0000000..e69de29 diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfo.cs b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfo.cs new file mode 100644 index 0000000..15a666c --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("PvZ_Fusion_Translator")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("BepInEx")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36dfab123f6b8ce2310317b1d5e81cd0b2a898f1")] +[assembly: System.Reflection.AssemblyProductAttribute("PvZ_Fusion_Translator")] +[assembly: System.Reflection.AssemblyTitleAttribute("PvZ_Fusion_Translator")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] +[assembly: System.Resources.NeutralResourcesLanguageAttribute("en-US")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache new file mode 100644 index 0000000..ab32860 --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +58c5a6670f1bc194d1428c065f5cbbbf656aa9211bb1dc2c6c0c4a3c4a6fdee3 diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..f7ee5cb --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,13 @@ +is_global = true +build_property.TargetFramework = net6.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = PvZ_Fusion_Translator +build_property.ProjectDir = /home/emik/RiderProjects/Quarantine/PVZFusionTranslation/Source/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GlobalUsings.g.cs b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.assets.cache b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.assets.cache new file mode 100644 index 0000000..9079e76 Binary files /dev/null and b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.assets.cache differ diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache new file mode 100644 index 0000000..176ad55 Binary files /dev/null and b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache differ diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..85f79c1 --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +53da643917c6314a0cba384e9991e4bfe7fc74b6ce05aafb410509e5fa6b0195 diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.FileListAbsolute.txt b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..13fc5c8 --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.FileListAbsolute.txt @@ -0,0 +1,12 @@ +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.dll +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/bin/BepInEx/net6.0/PvZ_Fusion_Translator.pdb +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/MyPluginInfo.cs +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.AssemblyInfo.cs +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.sourcelink.json +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.dll +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/refint/PvZ_Fusion_Translator.dll +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.pdb diff --git a/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.sourcelink.json b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.sourcelink.json new file mode 100644 index 0000000..7308583 --- /dev/null +++ b/Source/obj/BepInEx/net6.0/PvZ Fusion Translator.sourcelink.json @@ -0,0 +1 @@ +{"documents":{"/home/emik/RiderProjects/Quarantine/PVZFusionTranslation/*":"https://raw.githubusercontent.com/Teyliu/PVZFusionTranslation/36dfab123f6b8ce2310317b1d5e81cd0b2a898f1/*"}} \ No newline at end of file diff --git a/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.dll b/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..33d075f Binary files /dev/null and b/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.dll differ diff --git a/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.pdb b/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.pdb new file mode 100644 index 0000000..1bf63b3 Binary files /dev/null and b/Source/obj/BepInEx/net6.0/PvZ_Fusion_Translator.pdb differ diff --git a/Source/obj/BepInEx/net6.0/ref/PvZ_Fusion_Translator.dll b/Source/obj/BepInEx/net6.0/ref/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..1370057 Binary files /dev/null and b/Source/obj/BepInEx/net6.0/ref/PvZ_Fusion_Translator.dll differ diff --git a/Source/obj/BepInEx/net6.0/refint/PvZ_Fusion_Translator.dll b/Source/obj/BepInEx/net6.0/refint/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..1370057 Binary files /dev/null and b/Source/obj/BepInEx/net6.0/refint/PvZ_Fusion_Translator.dll differ diff --git a/Source/obj/MelonLoader/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs b/Source/obj/MelonLoader/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs new file mode 100644 index 0000000..ed92695 --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] diff --git a/Source/obj/MelonLoader/net6.0/MyPluginInfo.cs b/Source/obj/MelonLoader/net6.0/MyPluginInfo.cs new file mode 100644 index 0000000..a6ea2e4 --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/MyPluginInfo.cs @@ -0,0 +1,9 @@ +namespace PvZ_Fusion_Translator +{ + public static class MyPluginInfo + { + public const string PLUGIN_GUID = "PvZ_Fusion_Translator"; + public const string PLUGIN_NAME = "PvZ_Fusion_Translator"; + public const string PLUGIN_VERSION = "1.0.0"; + } +} diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusi.9A76C7D4.Up2Date b/Source/obj/MelonLoader/net6.0/PvZ Fusi.9A76C7D4.Up2Date new file mode 100644 index 0000000..e69de29 diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfo.cs b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfo.cs new file mode 100644 index 0000000..26fa263 --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("PvZ_Fusion_Translator")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("MelonLoader")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+36dfab123f6b8ce2310317b1d5e81cd0b2a898f1")] +[assembly: System.Reflection.AssemblyProductAttribute("PvZ_Fusion_Translator")] +[assembly: System.Reflection.AssemblyTitleAttribute("PvZ_Fusion_Translator")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] +[assembly: System.Resources.NeutralResourcesLanguageAttribute("en-US")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache new file mode 100644 index 0000000..0cc2431 --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +d201901882a4605474dbf29dce4ef1ede570c402e9facc0cec9d79a3a04a4bfa diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..f7ee5cb --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,13 @@ +is_global = true +build_property.TargetFramework = net6.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = PvZ_Fusion_Translator +build_property.ProjectDir = /home/emik/RiderProjects/Quarantine/PVZFusionTranslation/Source/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GlobalUsings.g.cs b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.assets.cache b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.assets.cache new file mode 100644 index 0000000..674bfe3 Binary files /dev/null and b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.assets.cache differ diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache new file mode 100644 index 0000000..e7edfd9 Binary files /dev/null and b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache differ diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..57fa60c --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +b0d64e686661c371ecca09f3f2d9f5872e6c60c409b02b99adbec48e13673a8f diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.FileListAbsolute.txt b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..e3b6f72 --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.FileListAbsolute.txt @@ -0,0 +1,11 @@ +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.AssemblyReference.cache +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.GeneratedMSBuildEditorConfig.editorconfig +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfoInputs.cache +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.AssemblyInfo.cs +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.csproj.CoreCompileInputs.cache +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.sourcelink.json +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.dll +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/bin/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.dll +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/refint/PvZ_Fusion_Translator.dll +/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb diff --git a/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.sourcelink.json b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.sourcelink.json new file mode 100644 index 0000000..7308583 --- /dev/null +++ b/Source/obj/MelonLoader/net6.0/PvZ Fusion Translator.sourcelink.json @@ -0,0 +1 @@ +{"documents":{"/home/emik/RiderProjects/Quarantine/PVZFusionTranslation/*":"https://raw.githubusercontent.com/Teyliu/PVZFusionTranslation/36dfab123f6b8ce2310317b1d5e81cd0b2a898f1/*"}} \ No newline at end of file diff --git a/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.dll b/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..21dfc24 Binary files /dev/null and b/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.dll differ diff --git a/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb b/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb new file mode 100644 index 0000000..d932a10 Binary files /dev/null and b/Source/obj/MelonLoader/net6.0/PvZ_Fusion_Translator.pdb differ diff --git a/Source/obj/MelonLoader/net6.0/ref/PvZ_Fusion_Translator.dll b/Source/obj/MelonLoader/net6.0/ref/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..ca6fe78 Binary files /dev/null and b/Source/obj/MelonLoader/net6.0/ref/PvZ_Fusion_Translator.dll differ diff --git a/Source/obj/MelonLoader/net6.0/refint/PvZ_Fusion_Translator.dll b/Source/obj/MelonLoader/net6.0/refint/PvZ_Fusion_Translator.dll new file mode 100644 index 0000000..ca6fe78 Binary files /dev/null and b/Source/obj/MelonLoader/net6.0/refint/PvZ_Fusion_Translator.dll differ diff --git a/Source/obj/PvZ Fusion Translator.csproj.nuget.dgspec.json b/Source/obj/PvZ Fusion Translator.csproj.nuget.dgspec.json new file mode 100644 index 0000000..1f2a9f1 --- /dev/null +++ b/Source/obj/PvZ Fusion Translator.csproj.nuget.dgspec.json @@ -0,0 +1,74 @@ +{ + "format": 1, + "restore": { + "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj": {} + }, + "projects": { + "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj", + "projectName": "PvZ_Fusion_Translator", + "projectPath": "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj", + "packagesPath": "/home/emik/.nuget/packages/", + "outputPath": "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/emik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net6.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net6.0": { + "framework": "net6.0", + "targetAlias": "net6.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net6.0": { + "framework": "net6.0", + "targetAlias": "net6.0", + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[13.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/home/emik/.dotnet/sdk/8.0.426/RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Source/obj/PvZ Fusion Translator.csproj.nuget.g.props b/Source/obj/PvZ Fusion Translator.csproj.nuget.g.props new file mode 100644 index 0000000..48a9c68 --- /dev/null +++ b/Source/obj/PvZ Fusion Translator.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/emik/.nuget/packages/ + /home/emik/.nuget/packages/ + PackageReference + 7.0.0 + + + + + \ No newline at end of file diff --git a/Source/obj/PvZ Fusion Translator.csproj.nuget.g.targets b/Source/obj/PvZ Fusion Translator.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/Source/obj/PvZ Fusion Translator.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Source/obj/project.assets.json b/Source/obj/project.assets.json new file mode 100644 index 0000000..adbcf01 --- /dev/null +++ b/Source/obj/project.assets.json @@ -0,0 +1,126 @@ +{ + "version": 3, + "targets": { + "net6.0": { + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net6.0/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + } + } + }, + "libraries": { + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + } + }, + "projectFileDependencyGroups": { + "net6.0": [ + "Newtonsoft.Json >= 13.0.3" + ] + }, + "packageFolders": { + "/home/emik/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj", + "projectName": "PvZ_Fusion_Translator", + "projectPath": "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj", + "packagesPath": "/home/emik/.nuget/packages/", + "outputPath": "/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/emik/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net6.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net6.0": { + "framework": "net6.0", + "targetAlias": "net6.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net6.0": { + "framework": "net6.0", + "targetAlias": "net6.0", + "dependencies": { + "Newtonsoft.Json": { + "target": "Package", + "version": "[13.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/home/emik/.dotnet/sdk/8.0.426/RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Source/obj/project.nuget.cache b/Source/obj/project.nuget.cache new file mode 100644 index 0000000..3f0b5c3 --- /dev/null +++ b/Source/obj/project.nuget.cache @@ -0,0 +1,10 @@ +{ + "version": 2, + "dgSpecHash": "ZEhwvPT/wpk=", + "success": true, + "projectFilePath": "/home/emik/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj", + "expectedPackageFiles": [ + "/home/emik/.nuget/packages/newtonsoft.json/13.0.3/newtonsoft.json.13.0.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Source/obj/project.packagespec.json b/Source/obj/project.packagespec.json new file mode 100644 index 0000000..798cda2 --- /dev/null +++ b/Source/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj","projectName":"PvZ_Fusion_Translator","projectPath":"/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/PvZ Fusion Translator.csproj","packagesPath":"","outputPath":"/media/f/RiderProjects/Quarantine/PVZFusionTranslation/Source/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net6.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net6.0":{"framework":"net6.0","targetAlias":"net6.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"}}"frameworks":{"net6.0":{"framework":"net6.0","targetAlias":"net6.0","dependencies":{"Newtonsoft.Json":{"target":"Package","version":"[13.0.3, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/home/emik/.dotnet/sdk/8.0.426/RuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/Source/obj/rider.project.model.nuget.info b/Source/obj/rider.project.model.nuget.info new file mode 100644 index 0000000..e12dd72 --- /dev/null +++ b/Source/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17924911768500000 \ No newline at end of file diff --git a/Source/obj/rider.project.restore.info b/Source/obj/rider.project.restore.info new file mode 100644 index 0000000..f5497ab --- /dev/null +++ b/Source/obj/rider.project.restore.info @@ -0,0 +1 @@ +17925404023400000 \ No newline at end of file