Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ProperKorean v1.5.0
ProperKorean.dll
Decompiled 3 weeks agousing System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using On.RoR2.UI; using ProperKorean.Properties; using R2API.Utils; using RoR2; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.TextCore; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ProperKorean")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a8985f2423a2b2e9f8c1562ae9918514f085b745")] [assembly: AssemblyProduct("ProperKorean")] [assembly: AssemblyTitle("ProperKorean")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ProperKorean { internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogDebug(object data) { _logSource.LogDebug(data); } internal static void LogError(object data) { _logSource.LogError(data); } internal static void LogFatal(object data) { _logSource.LogFatal(data); } internal static void LogInfo(object data) { _logSource.LogInfo(data); } internal static void LogMessage(object data) { _logSource.LogMessage(data); } internal static void LogWarning(object data) { _logSource.LogWarning(data); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("DVRP.ProperKorean", "ProperKorean", "1.5.0")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class ProperKorean : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_OnCurrentLanguageChanged <0>__HGTextMeshProUGUI_OnCurrentLanguageChanged; } public const string PluginGUID = "DVRP.ProperKorean"; public const string PluginAuthor = "DVRP"; public const string PluginName = "ProperKorean"; public const string PluginVersion = "1.5.0"; private static AssetBundle properBundle = AssetBundle.LoadFromMemory(Resources.properkorean); private static TMP_FontAsset properFont; private void Awake() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); properFont = properBundle.LoadAsset<TMP_FontAsset>("Assets/properkorean/NotoSansCJKsc-Regular SDF (Korean).asset"); object obj = <>O.<0>__HGTextMeshProUGUI_OnCurrentLanguageChanged; if (obj == null) { hook_OnCurrentLanguageChanged val = HGTextMeshProUGUI_OnCurrentLanguageChanged; <>O.<0>__HGTextMeshProUGUI_OnCurrentLanguageChanged = val; obj = (object)val; } HGTextMeshProUGUI.OnCurrentLanguageChanged += (hook_OnCurrentLanguageChanged)obj; } private static void FixLocalization() { foreach (KeyValuePair<string, string> item in JsonConvert.DeserializeObject<Dictionary<string, string>>(((object)JObject.Parse(Encoding.UTF8.GetString(Resources.output_korean))["strings"]).ToString())) { if (Language.currentLanguage.GetLocalizedStringByToken(item.Key) != item.Value) { Language.currentLanguage.SetStringByToken(item.Key, item.Value); } } Log.LogInfo("ProperKorean :: Fixed localization"); } private static void FixFont() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) TMP_FontAsset val = LegacyResourcesAPI.LoadAsync<TMP_FontAsset>("TmpFonts/Bombardier/tmpBombDropshadow").WaitForCompletion(); Glyph? obj = val.glyphTable.Find((Glyph x) => x.index == 95); GlyphMetrics metrics = obj.metrics; ((GlyphMetrics)(ref metrics)).horizontalBearingY = 40f; obj.metrics = metrics; properFont.fallbackFontAssets.Add(val); if (((Object)TMP_Settings.fallbackFontAssets[0]).name != "tmpBombDropshadow") { TMP_Settings.fallbackFontAssets.Insert(0, val); } HGTextMeshProUGUI.defaultLanguageFont = properFont; Log.LogInfo("ProperKorean :: Fixed font"); } private static void HGTextMeshProUGUI_OnCurrentLanguageChanged(orig_OnCurrentLanguageChanged orig) { orig.Invoke(); if (Language.currentLanguageName == "ko") { FixFont(); FixLocalization(); } } } } namespace ProperKorean.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { resourceMan = new ResourceManager("ProperKorean.Properties.Resources", typeof(Resources).Assembly); } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] output_korean => (byte[])ResourceManager.GetObject("output_korean", resourceCulture); internal static byte[] properkorean => (byte[])ResourceManager.GetObject("properkorean", resourceCulture); internal Resources() { } } }