using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LCKR.Patches; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RadiationIsCool")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RadiationIsCool")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8ee335db-0cbe-470c-8fbc-69263f01b35a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: IgnoresAccessChecksTo("0Harmony")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("BepInEx")] [assembly: IgnoresAccessChecksTo("BepInEx.Harmony")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.UnityWebRequestModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.VideoModule")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [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; } } } public static class Const { public const int ImageDiv = 16; public const int ImageCompareSize = 64; } namespace LCKR { [BepInPlugin("asta.light.LCKR", "LCKR", "2.1.1")] public class Plugin : BaseUnityPlugin { private const string modGUID = "asta.light.LCKR"; private const string modName = "LCKR"; public const string modVersion = "2.1.1"; public static string modVerType = "b"; private readonly Harmony harmony = new Harmony("asta.light.LCKR"); private static Plugin Instance; public static ManualLogSource mls; public static AssetBundle Bundle; public static TMP_FontAsset font3270_HUDIngame; public static TMP_FontAsset font3270_HUDIngame_Variant; public static TMP_FontAsset font3270_HUDIngameB; public static TMP_FontAsset font3270_Regular_SDF; public static TMP_FontAsset font3270_b; public static TMP_FontAsset font3270_DialogueText; public static TMP_FontAsset fontEdunline; public static TMP_FontAsset fontAds; public static VideoClip snareKorean; public static bool fullyKoreanMoons; public static GameObject resetPanel; public static bool patchFont; public static bool toKG; public static bool toCelsius; public static bool showVersion; public static bool versionChanged; public static string deathText; public static string quotaReached; public static string firedText; public static string sellText; public static string injuryText; public static string systemOnlineText; public static string allDead1; public static string allDead2; public static string autoTakeoff1; public static string autoTakeoff2; public static string midnightWarning; public static string PluginDirectory; public static string TranslationFilePath; public static string DefTranslationFilePath; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } PluginDirectory = ((BaseUnityPlugin)this).Info.Location; string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Config.ConfigFilePath); TranslationFilePath = Path.Combine(directoryName, "LCKR_Translation"); DefTranslationFilePath = Path.Combine(TranslationFilePath, "Default"); mls = Logger.CreateLogSource("asta.light.LCKR"); LoadAssets(); TextureReplacer.Setup(); TranslationManager.Setup(); patchFont = ((BaseUnityPlugin)this).Config.Bind("폰트", "폰트 변경", true, "기본값은 true입니다.\nFontPatcher 등 외부 폰트 모드를 사용하려면 이 값을 false로 설정하세요. false로 설정하면 본 모드에서 폰트를 변경하지 않습니다.").Value; showVersion = ((BaseUnityPlugin)this).Config.Bind("일반", "버전 표시", true, "기본값은 true입니다.\ntrue로 설정하면 메인 화면에 모드의 버전을 표시합니다..").Value; toKG = ((BaseUnityPlugin)this).Config.Bind("번역", "KG으로 표기", false, "기본값은 false입니다.\ntrue로 설정하면 무게 수치를 kg으로 변환/표기합니다.").Value; toCelsius = ((BaseUnityPlugin)this).Config.Bind("번역", "섭씨로 표기", false, "기본값은 false입니다.\ntrue로 설정하면 온도를 섭씨로 변환/표기합니다.").Value; string path = Path.Combine(Paths.ConfigPath, "lckrVersion.txt"); if (File.Exists(path)) { string text = File.ReadAllText(path); if (text != "2.1.1") { ((BaseUnityPlugin)this).Logger.LogInfo((object)("버전 변경됨: " + text + " -> 2.1.1")); versionChanged = true; } } else { versionChanged = true; } File.WriteAllText(path, "2.1.1"); mls.LogInfo((object)"LCKR is loaded"); mls.LogInfo((object)("base.Config.ConfigFilePath: " + ((BaseUnityPlugin)this).Config.ConfigFilePath)); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); } private void LoadAssets() { try { Bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(PluginDirectory), "lckorean")); } catch (Exception ex) { mls.LogError((object)("Couldn't load asset bundle: " + ex.Message)); return; } try { font3270_HUDIngame = Bundle.LoadAsset("3270-HUDIngame.asset"); font3270_HUDIngame_Variant = Bundle.LoadAsset("3270-HUDIngame - Variant.asset"); font3270_HUDIngameB = Bundle.LoadAsset("3270-HUDIngameB.asset"); font3270_Regular_SDF = Bundle.LoadAsset("3270-Regular SDF.asset"); font3270_b = Bundle.LoadAsset("b.asset"); font3270_DialogueText = Bundle.LoadAsset("DialogueText.asset"); fontEdunline = Bundle.LoadAsset("edunline SDF.asset"); fontAds = Bundle.LoadAsset("HakgyoansimMalgeunnalB SDF.asset"); snareKorean = Bundle.LoadAsset("SnareFleaTipChannel2.m4v"); resetPanel = Bundle.LoadAsset("LCKRComponent.prefab"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Successfully loaded assets!"); } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogError((object)("Couldn't load assets: " + ex2.Message)); } } private void ReplaceImageFile() { string location = Assembly.GetExecutingAssembly().Location; string directoryName = Path.GetDirectoryName(location); string text = "example.png"; string text2 = Path.Combine(directoryName, text); if (!File.Exists(text2)) { ((BaseUnityPlugin)this).Logger.LogError((object)("이미지 파일이 " + text2 + "에 없습니다.")); return; } string text3 = Path.Combine("게임_이미지_파일_경로", text); if (!File.Exists(text3)) { ((BaseUnityPlugin)this).Logger.LogError((object)("게임 내 이미지 파일이 " + text3 + "에 없습니다.")); return; } try { File.Copy(text2, text3, overwrite: true); ((BaseUnityPlugin)this).Logger.LogInfo((object)("이미지 파일 " + text + "이 " + text3 + "에 성공적으로 덮어쓰기되었습니다.")); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("이미지 파일 덮어쓰기 중 오류 발생: " + ex.Message)); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LCKRL"; public const string PLUGIN_NAME = "LCKRL"; public const string PLUGIN_VERSION = "2.1.1"; } } namespace LCKR.Patches { [HarmonyPatch(typeof(EntranceTeleport))] internal class EntranceTeleportPatch { } [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { } [HarmonyPatch(typeof(GrabbableObject))] internal class GrabbableObjectPatch { } [HarmonyPatch(typeof(HUDManager))] internal class HUDManagerPatch { private static readonly FieldInfo forceChangeTextCoroutineField = AccessTools.Field(typeof(HUDManager), "forceChangeTextCoroutine"); private static readonly MethodInfo forceChangeTextMethod = AccessTools.Method(typeof(HUDManager), "ForceChangeText", (Type[])null, (Type[])null); private string amPM; private string newLine; [HarmonyPostfix] [HarmonyPatch("Start")] private static void Start_Postfix(ref PlayerLevel[] ___playerLevels) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) PlayerLevel[] array = ___playerLevels; foreach (PlayerLevel val in array) { val.levelName = TranslationManager.GetArrayTranslation("PlayerLevel", val.levelName); } ((TMP_Text)HUDManager.Instance.planetRiskLevelText).transform.localPosition = new Vector3(336.5525f, 274.1743f, -74f); } private static void TranslateAdvertText(HUDManager __instance) { TextMeshProUGUI advertTopText = __instance.advertTopText; TextMeshProUGUI advertBottomText = __instance.advertBottomText; if (!((TMP_Text)advertTopText).text.Contains("")) { ((TMP_Text)advertTopText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertTopText).text, "Item", ((TMP_Text)advertTopText).text); ((TMP_Text)advertTopText).text = "" + ((TMP_Text)advertTopText).text; } if (!((TMP_Text)advertBottomText).text.Contains("")) { ((TMP_Text)advertBottomText).text = "" + ((TMP_Text)advertBottomText).text; ((TMP_Text)advertBottomText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertBottomText).text, "HUD", "OFF"); ((TMP_Text)advertBottomText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertBottomText).text, "HUD", "AVAILABLE NOW"); ((TMP_Text)advertBottomText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertBottomText).text, "HUD", "CURES CANCER"); ((TMP_Text)advertBottomText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertBottomText).text, "HUD", "NO WAY"); ((TMP_Text)advertBottomText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertBottomText).text, "HUD", "LIMITED TIME ONLY"); ((TMP_Text)advertBottomText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertBottomText).text, "HUD", "GET YOURS TODAY"); } } [HarmonyPostfix] [HarmonyPatch("Update")] private static void Update_Postfix(HUDManager __instance, ref TextMeshProUGUI ___weightCounter, ref Animator ___weightCounterAnimator, ref TextMeshProUGUI ___holdButtonToEndGameEarlyText, ref TextMeshProUGUI ___holdButtonToEndGameEarlyVotesText) { if (GameNetworkManager.Instance.gameVersionNum >= 70) { TranslateAdvertText(__instance); } ((TMP_Text)___holdButtonToEndGameEarlyText).text = TranslationManager.ReplaceArrayTextAll(((TMP_Text)___holdButtonToEndGameEarlyText).text, "HUD"); if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead) { if (Plugin.toKG) { float num = Mathf.RoundToInt(Mathf.Clamp(GameNetworkManager.Instance.localPlayerController.carryWeight - 1f, 0f, 100f) * 105f / 2.2f); ((TMP_Text)___weightCounter).text = $"{num}kg"; ___weightCounterAnimator.SetFloat("weight", num / 130f); } else { float num2 = Mathf.RoundToInt(Mathf.Clamp(GameNetworkManager.Instance.localPlayerController.carryWeight - 1f, 0f, 100f) * 105f); ((TMP_Text)___weightCounter).text = $"{num2} lb"; ___weightCounterAnimator.SetFloat("weight", num2 / 130f); } } } [HarmonyPrefix] [HarmonyPatch("DisplaySpectatorTip")] private static void DisplaySpectatorTip_Postfix(string tipText, ref TextMeshProUGUI ___spectatorTipText) { string arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "TipMouse"); if (StartOfRound.Instance.localPlayerUsingController) { arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "TipController"); } ((TMP_Text)___spectatorTipText).text = arrayTranslation; } [HarmonyPostfix] [HarmonyPatch("DisplayStatusEffect")] private static void DisplayStatusEffect_Postfix(string statusEffect, ref TextMeshProUGUI ___statusEffectText) { if (statusEffect == "VISIBILITY LOW!\n\nSteam leak detected in area") { ((TMP_Text)___statusEffectText).text = TranslationManager.GetArrayTranslation("HUD", "SteamLeakDetected") + "\n\n" + TranslationManager.GetArrayTranslation("HUD", "SteamLeakDetected", 1) + "\n" + TranslationManager.GetArrayTranslation("HUD", "SteamLeakDetected", 2); } else if (statusEffect.Contains("Oxygen")) { ((TMP_Text)___statusEffectText).text = TranslationManager.GetArrayTranslation("HUD", "OxygenLow"); } else if (statusEffect.Contains("HEALTH RISK!")) { ((TMP_Text)___statusEffectText).text = TranslationManager.GetArrayTranslation("HUD", "HealthRisk") + "\n" + TranslationManager.GetArrayTranslation("HUD", "HealthRisk", 1) + "\n" + TranslationManager.GetArrayTranslation("HUD", "HealthRisk", 2); } else if (statusEffect.Contains("HIGH FEVER DETECTED!") && statusEffect.Contains("REACHING")) { string text = ((TMP_Text)___statusEffectText).text; string text2 = text; if (Plugin.toCelsius) { text2 = Regex.Replace(text, "-?\\d+(\\.\\d+)?", delegate(Match match) { float num = float.Parse(match.Value); float num2 = (num - 32f) * 5f / 9f; return Mathf.RoundToInt(num2).ToString(); }).Replace("°F", "°C"); ((TMP_Text)___statusEffectText).text = text2; } ((TMP_Text)___statusEffectText).text = ((TMP_Text)___statusEffectText).text.Replace("HIGH FEVER DETECTED!", TranslationManager.GetArrayTranslation("HUD", "HighFever")); ((TMP_Text)___statusEffectText).text = ((TMP_Text)___statusEffectText).text.Replace("REACHING", TranslationManager.GetArrayTranslation("HUD", "HighFever", 1)); ((TMP_Text)___statusEffectText).text = text2; } else if (statusEffect.Contains("HIGH FEVER DETECTED!!!")) { TextMeshProUGUI obj = ___statusEffectText; string text3 = (((TMP_Text)___statusEffectText).text = TranslationManager.GetArrayTranslation("HUD", "HighFever2") + "\n\n" + TranslationManager.GetArrayTranslation("HUD", "HighFever2", 1) + "\n\n" + TranslationManager.GetArrayTranslation("HUD", "HighFever2", 2)); ((TMP_Text)obj).text = text3; } } [HarmonyPostfix] [HarmonyPatch("SetSpectatingTextToPlayer")] private static void SetSpectatingTextToPlayer_Postfix(ref TextMeshProUGUI ___spectatingPlayerText) { ((TMP_Text)___spectatingPlayerText).text = TranslationManager.ReplaceArrayText(((TMP_Text)___spectatingPlayerText).text, "HUD", "Spectating"); } [HarmonyPostfix] [HarmonyPatch("ApplyPenalty")] private static void ApplyPenalty_Postfix(ref EndOfGameStatUIElements ___statsUIElements) { TMP_Text penaltyAddition = (TMP_Text)(object)___statsUIElements.penaltyAddition; penaltyAddition.text = TranslationManager.ReplaceArrayText(penaltyAddition.text, "HUD", " casualties"); penaltyAddition.text = TranslationManager.ReplaceArrayText(penaltyAddition.text, "HUD", " bodies recovered"); } [HarmonyPrefix] [HarmonyPatch("ReadDialogue")] private static void ReadDialogue_Prefix(DialogueSegment[] dialogueArray) { foreach (DialogueSegment val in dialogueArray) { val.speakerText = TranslationManager.GetArrayTranslation("Dialogue", val.speakerText); float shipLeaveAutomaticallyTime = TimeOfDay.Instance.shipLeaveAutomaticallyTime; if (val.bodyText == "AM. A vote has been cast") { val.bodyText = TranslationManager.GetArrayTranslation("Dialogue", "ReturnAM").Replace("{time}", GetClockTimeFormatted(shipLeaveAutomaticallyTime, TimeOfDay.Instance.numberOfHours, createNewLine: false)); } else if (val.bodyText == "PM. A vote has been cast") { val.bodyText = TranslationManager.GetArrayTranslation("Dialogue", "ReturnPM").Replace("{time}", GetClockTimeFormatted(shipLeaveAutomaticallyTime, TimeOfDay.Instance.numberOfHours, createNewLine: false)); } else { val.bodyText = TranslationManager.GetArrayTranslation("Dialogue", val.bodyText); } } } public static string GetClockTimeFormatted(float timeNormalized, float numberOfHours, bool createNewLine = true) { int num = (int)(timeNormalized * (60f * numberOfHours)) + 360; int num2 = (int)Mathf.Floor((float)(num / 60)); string text = (createNewLine ? "\n" : " "); if (num2 >= 24) { return "오전" + text + "12:00"; } string text2 = ((num2 >= 12) ? "오후" : "오전"); if (num2 > 12) { num2 %= 12; } int num3 = num % 60; string text3 = $"{num2:00}:{num3:00}".TrimStart('0'); return text2 + text + text3; } [HarmonyPostfix] [HarmonyPatch("DisplayTip")] private static void DisplayTip_Postfix(TextMeshProUGUI ___tipsPanelHeader, TextMeshProUGUI ___tipsPanelBody) { switch (((TMP_Text)___tipsPanelHeader).text) { case "To read the manual:": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "ReadManual"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "ReadManual", 1); break; case "TIP:": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "TipTerminal"); if (((TMP_Text)___tipsPanelBody).text == "Use the ship computer terminal to access secure doors.") { ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "TipTerminal", 1); } else { ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "TipLockedDoor", 1); } break; case "Welcome!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "Welcome"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "Welcome", 1); break; case "Got scrap!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "GotScrap"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "GotScrap", 1); break; case "Items missed!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "ItemMissed"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "ItemMissed", 1); break; case "Item stored!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "ItemStored"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "ItemStored", 1); break; case "HALT!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "DeadlineWarning"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "DeadlineWarning", 1); break; case "Weather alert!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "EclipseWarning"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "EclipseWarning", 1); break; case "???": ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "MissingEntrance", 1); break; case "ALERT!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "LightningWarning"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "LightningWarning", 1); break; case "Welcome back!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "WelcomeBack"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "WelcomeBack", 1); break; case "Tip": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "TipShipObject"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "TipShipObject", 1); break; case "Equipped to utility belt!": ((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "UtilityBelt"); ((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "UtilityBelt", 1); break; } } [HarmonyPostfix] [HarmonyPatch("DisplayNewScrapFound")] private static void DisplayNewScrapFound_Postfix() { ScrapCollectionBox(HUDManager.Instance.ScrapItemBoxes[0]); ScrapCollectionBox(HUDManager.Instance.ScrapItemBoxes[1]); ScrapCollectionBox(HUDManager.Instance.ScrapItemBoxes[2]); } private static void ScrapCollectionBox(ScrapItemHUDDisplay scrapBox) { ((TMP_Text)scrapBox.headerText).text = TranslationManager.ReplaceArrayText(((TMP_Text)scrapBox.headerText).text, "Item", ((TMP_Text)scrapBox.headerText).text.Replace(" collected!", "")); ((TMP_Text)scrapBox.headerText).text = TranslationManager.ReplaceArrayText(((TMP_Text)scrapBox.headerText).text, "HUD", "collected"); ((TMP_Text)scrapBox.valueText).text = TranslationManager.ReplaceArrayText(((TMP_Text)scrapBox.valueText).text, "HUD", "Value"); } [HarmonyPostfix] [HarmonyPatch("DisplayCreditsEarning")] private static void DisplayCreditsEarning_Postfix(ref TextMeshProUGUI ___moneyRewardsTotalText) { ((TMP_Text)___moneyRewardsTotalText).text = TranslationManager.ReplaceArrayText(((TMP_Text)___moneyRewardsTotalText).text, "HUD", "TOTAL"); } [HarmonyPostfix] [HarmonyPatch("DisplayDaysLeft")] private static void DisplayDaysLeft_Postfix(ref TextMeshProUGUI ___profitQuotaDaysLeftText, ref TextMeshProUGUI ___profitQuotaDaysLeftText2) { string text = TranslationManager.ReplaceArrayText(((TMP_Text)___profitQuotaDaysLeftText).text, "HUD", Regex.Replace(((TMP_Text)___profitQuotaDaysLeftText).text, "\\d", "")); ((TMP_Text)___profitQuotaDaysLeftText).text = text; ((TMP_Text)___profitQuotaDaysLeftText2).text = text; } [HarmonyPostfix] [HarmonyPatch("ChangeControlTip")] private static void ChangeControlTip_Postfix(HUDManager __instance, ref TextMeshProUGUI[] ___controlTipLines, int toolTipNumber, string changeTo, bool clearAllOther = false) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown string text = changeTo.Split(':')[0].Trim(); string text2 = text; text2 = changeTo.Replace(text, TranslationManager.GetArrayTranslation("ControlTip", text, 0, partialMatch: true)); ((TMP_Text)___controlTipLines[toolTipNumber]).text = text2; Coroutine val = (Coroutine)forceChangeTextCoroutineField.GetValue(__instance); if (val != null) { ((MonoBehaviour)__instance).StopCoroutine(val); } IEnumerator enumerator = (IEnumerator)forceChangeTextMethod.Invoke(__instance, new object[2] { ___controlTipLines[toolTipNumber], text2 }); Coroutine value = ((MonoBehaviour)__instance).StartCoroutine(enumerator); forceChangeTextCoroutineField.SetValue(__instance, value); } [HarmonyPostfix] [HarmonyPatch("ChangeControlTipMultiple")] private static void ChangeControlTipMultiple_Postfix(ref TextMeshProUGUI[] ___controlTipLines, string[] allLines, bool holdingItem, Item itemProperties) { if (!holdingItem || allLines == null) { return; } ((TMP_Text)___controlTipLines[0]).text = TranslationManager.GetArrayTranslation("Item", itemProperties.itemName) + " 떨어뜨리기 : [G]"; int num = Mathf.Min(allLines.Length, ___controlTipLines.Length); for (int i = 0; i < num; i++) { if (allLines.Length > i && !string.IsNullOrEmpty(allLines[i])) { string text = allLines[i]; string text2 = text.Split(':')[0].Trim(); ((TMP_Text)___controlTipLines[i + 1]).text = ((TMP_Text)___controlTipLines[i + 1]).text.Replace(text2, TranslationManager.GetArrayTranslation("ControlTip", text2, 0, partialMatch: true)); } } } [HarmonyPrefix] [HarmonyPatch("Update")] private static void Update_Prefix(ref TextMeshProUGUI ___planetInfoHeaderText, ref TextMeshProUGUI ___globalNotificationText, ref TextMeshProUGUI ___loadingText, ref TextMeshProUGUI[] ___controlTipLines) { if (((TMP_Text)___loadingText).text == "Waiting for crew...") { ((TMP_Text)___loadingText).text = TranslationManager.GetArrayTranslation("HUD", "WaitingForCrew"); } string text = ((TMP_Text)___planetInfoHeaderText).text; if (text.Contains("CELESTIAL BODY:")) { text = TranslationManager.ReplaceArrayText(text, "Planets", "CELESTIAL BODY"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Experimentation"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Where the Company resides"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Assurance"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Offense"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Adamance"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Rend"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Dine"); text = TranslationManager.ReplaceArrayText(text, "Planets", "March"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Vow"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Titan"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Artifice"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Embrion"); text = TranslationManager.ReplaceArrayText(text, "Planets", "Gordion"); ((TMP_Text)___planetInfoHeaderText).text = text; } if (((TMP_Text)___globalNotificationText).text == "New creature data sent to terminal!") { ((TMP_Text)___globalNotificationText).text = TranslationManager.GetArrayTranslation("HUD", "NewCreature"); } else if (((TMP_Text)___globalNotificationText).text.Contains("Found journal entry:")) { string arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "FoundJournal"); ((TMP_Text)___globalNotificationText).text = ((TMP_Text)___globalNotificationText).text.Replace("Found journal entry:", arrayTranslation); } } [HarmonyPostfix] [HarmonyPatch("AttemptScanNode")] private static void AttemptScanNode_Prefix(ScanNodeProperties node) { if ((Object)(object)node == (Object)null) { return; } string arrayTranslation = TranslationManager.GetArrayTranslation("ScanNode", node.headerText); string text = node.subText; if (node.subText.Contains("Value: ") || node.subText.Contains("value: ") || node.subText.Contains("VALUE: ")) { text = text.Replace("Value: ", TranslationManager.GetArrayTranslation("ScanNode", "valueCheck", 1)); text = text.Replace("value: ", TranslationManager.GetArrayTranslation("ScanNode", "valueCheck", 1)); text = text.Replace("VALUE: ", TranslationManager.GetArrayTranslation("ScanNode", "valueCheck", 1)); } else { string arrayTranslation2 = TranslationManager.GetArrayTranslation("ScanNode", node.headerText, 1); if (!string.IsNullOrEmpty(arrayTranslation2) && arrayTranslation2 != node.headerText) { text = arrayTranslation2; } } node.headerText = arrayTranslation; if (arrayTranslation != text) { node.subText = text; } } [HarmonyPostfix] [HarmonyPatch("DisplayNewDeadline")] private static void DisplayNewDeadline_Postfix(ref TextMeshProUGUI ___reachedProfitQuotaBonusText) { ((TMP_Text)___reachedProfitQuotaBonusText).text = TranslationManager.ReplaceArrayText(((TMP_Text)___reachedProfitQuotaBonusText).text, "HUD", "Overtime bonus"); } } [HarmonyPatch(typeof(IngamePlayerSettings))] internal class IngamePlayerSettingsPatch { [HarmonyPrefix] [HarmonyPatch("SetSettingsOptionsText")] private static void SetSettingsOptionsText_Prefix(SettingsOptionType optionType, string setToText) { setToText = setToText.Replace("Current input device:", "현재 입력 장치:"); setToText = setToText.Replace("No device found \n (click to refresh)", "장치 발견되지 않음 \n (클릭하여 새로고침)"); setToText = setToText.Replace("MODE: Push to talk", "모드: 눌러서 말하기"); setToText = setToText.Replace("MODE: Voice activation", "모드: 음성 감지"); } } [HarmonyPatch(typeof(InteractTrigger))] internal class InteractTriggerPatch { } [HarmonyPatch(typeof(ManualCameraRenderer))] internal class ManualCameraRendererPatch { [HarmonyPostfix] [HarmonyPatch("Update")] private static void Update_Postfix(UnlockableSuit __instance) { TextMeshProUGUI mapScreenPlayerName = StartOfRound.Instance.mapScreenPlayerName; ((TMP_Text)mapScreenPlayerName).text = TranslationManager.ReplaceArrayText(((TMP_Text)mapScreenPlayerName).text, "Ingame", "MONITORING"); } } [HarmonyPatch(typeof(MenuManager))] internal class MenuManagerPatch { [HarmonyPostfix] [HarmonyPatch("DisplayMenuNotification")] private static void DisplayMenuNotification_Prefix(string notificationText, string buttonText, ref GameObject ___menuNotification, ref TextMeshProUGUI ___menuNotificationText, ref TextMeshProUGUI ___menuNotificationButtonText) { if (notificationText.Contains("Some of your save files may not be compatible")) { ((TMP_Text)___menuNotificationText).text = $"일부 저장 파일은 버전 {GameNetworkManager.Instance.compatibleFileCutoffVersion}과 호환되지 않을 수 있으며, 플레이할 경우 손상될 수 있습니다."; ((TMP_Text)___menuNotificationButtonText).text = "[ 닫기 ]"; ___menuNotification.SetActive(true); EventSystem.current.SetSelectedGameObject(((Component)___menuNotification.GetComponentInChildren