Decompiled source of LCKRL v2.1.3

BepInEx/plugins/Asta-LCKRL/LCKRL.dll

Decompiled 3 weeks ago
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.Reflection.Emit;
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.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("LCKRL")]
[assembly: AssemblyDescription("Lightweight Korean translation mod for Lethal Company")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCKRL")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8ee335db-0cbe-470c-8fbc-69263f01b35a")]
[assembly: AssemblyFileVersion("2.1.3.0")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AnimationModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AssetBundleModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AudioModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.CoreModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ImageConversionModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UIModule")]
[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("2.1.3.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.3")]
	[BepInIncompatibility("Piggy.LCKR")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "asta.light.LCKR";

		private const string modName = "LCKR";

		public const string modVersion = "2.1.3";

		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 lightweightFonts;

		public static bool toKG;

		public static bool toCelsius;

		public static bool checkTranslationUpdates;

		public static bool replaceTextures;

		public static bool keepTextureReadable;

		public static bool replaceLargeTextures;

		public static bool loadKoreanTvVideo;

		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;
			TranslationFilePath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Config.ConfigFilePath), "LCKR_Translation");
			DefTranslationFilePath = Path.Combine(TranslationFilePath, "Default");
			mls = Logger.CreateLogSource("asta.light.LCKR");
			patchFont = ((BaseUnityPlugin)this).Config.Bind<bool>("폰트", "폰트 변경", true, "기본값은 true입니다.\nFontPatcher 등 외부 폰트 모드를 사용하려면 이 값을 false로 설정하세요. false로 설정하면 본 모드에서 폰트를 변경하지 않습니다.").Value;
			lightweightFonts = ((BaseUnityPlugin)this).Config.Bind<bool>("폰트", "경량 폰트 모드", true, "기본값은 true입니다. 한 개의 공통 한글 폰트를 재사용해 시작 시간과 메모리를 줄입니다. 원래 UI별 폰트 스타일을 원하면 false로 설정하세요.").Value;
			showVersion = ((BaseUnityPlugin)this).Config.Bind<bool>("일반", "버전 표시", true, "기본값은 true입니다.\ntrue로 설정하면 메인 화면에 모드의 버전을 표시합니다.").Value;
			toKG = ((BaseUnityPlugin)this).Config.Bind<bool>("번역", "KG으로 표기", false, "기본값은 false입니다.\ntrue로 설정하면 무게 수치를 kg으로 변환/표기합니다.").Value;
			toCelsius = ((BaseUnityPlugin)this).Config.Bind<bool>("번역", "섭씨로 표기", false, "기본값은 false입니다.\ntrue로 설정하면 온도를 섭씨로 변환/표기합니다.").Value;
			checkTranslationUpdates = ((BaseUnityPlugin)this).Config.Bind<bool>("번역", "자동 번역 업데이트 확인", false, "기본값은 false입니다. 시작 시 네트워크 요청을 없애려면 false로 유지하세요. true일 때도 하루에 한 번만 확인합니다.").Value;
			replaceTextures = ((BaseUnityPlugin)this).Config.Bind<bool>("텍스처", "텍스처 교체", false, "기본값은 false입니다. true로 설정하면 한국어 이미지 텍스처를 불러오고 장면별로 교체 대상을 탐색합니다.").Value;
			keepTextureReadable = ((BaseUnityPlugin)this).Config.Bind<bool>("텍스처", "CPU 복사본 유지", false, "기본값은 false입니다.\n다른 모드가 교체된 텍스처의 픽셀을 읽어야 할 때만 true로 설정하세요. true는 메모리를 더 사용합니다.").Value;
			replaceLargeTextures = ((BaseUnityPlugin)this).Config.Bind<bool>("텍스처", "4K 텍스처 교체", false, "기본값은 false입니다. true로 설정하면 4K 텍스처까지 교체하지만 로딩 시간과 메모리 사용량이 크게 늘어납니다.").Value;
			loadKoreanTvVideo = ((BaseUnityPlugin)this).Config.Bind<bool>("영상", "TV 한국어 영상", false, "기본값은 false입니다. true로 설정하면 TV 영상 자산을 추가로 불러옵니다.").Value;
			LoadAssets();
			if (replaceTextures)
			{
				TextureReplacer.Setup();
			}
			TranslationManager.Setup();
			try
			{
				string path = Path.Combine(Paths.ConfigPath, "lckrVersion.txt");
				if (File.Exists(path))
				{
					string text = File.ReadAllText(path).Trim();
					if (text != "2.1.3")
					{
						((BaseUnityPlugin)this).Logger.LogInfo((object)("버전 변경됨: " + text + " -> 2.1.3"));
						versionChanged = true;
					}
				}
				File.WriteAllText(path, "2.1.3");
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("LCKR 버전 기록을 읽거나 저장하지 못했습니다: " + ex.Message));
			}
			mls.LogInfo((object)"LCKR is loaded");
			mls.LogInfo((object)("base.Config.ConfigFilePath: " + ((BaseUnityPlugin)this).Config.ConfigFilePath));
			try
			{
				harmony.PatchAll(Assembly.GetExecutingAssembly());
				mls.LogInfo((object)"LCKR 번역 Harmony 패치 등록을 완료했습니다.");
			}
			catch (Exception arg)
			{
				harmony.UnpatchSelf();
				mls.LogError((object)$"Harmony 패치를 적용하지 못해 LCKR 번역 패치를 비활성화합니다: {arg}");
			}
		}

		private void LoadAssets()
		{
			try
			{
				Bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(PluginDirectory), "lckorean"));
				if ((Object)(object)Bundle == (Object)null)
				{
					mls.LogError((object)"lckorean 에셋 번들을 찾지 못했거나 읽을 수 없습니다. 에셋 기반 기능을 건너뜁니다.");
					return;
				}
			}
			catch (Exception ex)
			{
				mls.LogError((object)("Couldn't load asset bundle: " + ex.Message));
				return;
			}
			try
			{
				if (patchFont)
				{
					font3270_HUDIngame = Bundle.LoadAsset<TMP_FontAsset>("3270-HUDIngame.asset");
					if (lightweightFonts)
					{
						font3270_HUDIngame_Variant = font3270_HUDIngame;
						font3270_HUDIngameB = font3270_HUDIngame;
						font3270_Regular_SDF = font3270_HUDIngame;
						font3270_b = font3270_HUDIngame;
						font3270_DialogueText = font3270_HUDIngame;
						fontEdunline = font3270_HUDIngame;
						fontAds = font3270_HUDIngame;
					}
					else
					{
						font3270_HUDIngame_Variant = Bundle.LoadAsset<TMP_FontAsset>("3270-HUDIngame - Variant.asset");
						font3270_HUDIngameB = Bundle.LoadAsset<TMP_FontAsset>("3270-HUDIngameB.asset");
						font3270_Regular_SDF = Bundle.LoadAsset<TMP_FontAsset>("3270-Regular SDF.asset");
						font3270_b = Bundle.LoadAsset<TMP_FontAsset>("b.asset");
						font3270_DialogueText = Bundle.LoadAsset<TMP_FontAsset>("DialogueText.asset");
						fontEdunline = Bundle.LoadAsset<TMP_FontAsset>("edunline SDF.asset");
						fontAds = Bundle.LoadAsset<TMP_FontAsset>("HakgyoansimMalgeunnalB SDF.asset");
					}
					if ((Object)(object)font3270_HUDIngame == (Object)null || (!lightweightFonts && ((Object)(object)font3270_HUDIngame_Variant == (Object)null || (Object)(object)font3270_HUDIngameB == (Object)null || (Object)(object)font3270_Regular_SDF == (Object)null || (Object)(object)font3270_b == (Object)null || (Object)(object)font3270_DialogueText == (Object)null || (Object)(object)fontEdunline == (Object)null || (Object)(object)fontAds == (Object)null)))
					{
						mls.LogWarning((object)"일부 한글 폰트를 불러오지 못했습니다. 해당 텍스트는 원래 폰트를 유지합니다.");
					}
				}
				if (loadKoreanTvVideo)
				{
					snareKorean = Bundle.LoadAsset<VideoClip>("SnareFleaTipChannel2.m4v");
				}
				resetPanel = Bundle.LoadAsset<GameObject>("LCKRComponent.prefab");
				if (loadKoreanTvVideo && (Object)(object)snareKorean == (Object)null)
				{
					mls.LogWarning((object)"한국어 TV 영상을 불러오지 못해 원본 영상을 유지합니다.");
				}
				if ((Object)(object)resetPanel == (Object)null)
				{
					mls.LogWarning((object)"번역 재설정 UI를 불러오지 못해 해당 메뉴를 건너뜁니다.");
				}
			}
			catch (Exception ex2)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Couldn't load assets: " + ex2.Message));
			}
			finally
			{
				Bundle.Unload(false);
				Bundle = null;
			}
		}

		private void OnDestroy()
		{
			ManualLogSource obj = mls;
			if (obj != null)
			{
				obj.LogInfo((object)"LCKR 플러그인 객체가 파괴되었지만 번역 패치는 유지합니다.");
			}
		}

		private void OnApplicationQuit()
		{
			harmony.UnpatchSelf();
			TextureReplacer.Shutdown();
			if ((Object)(object)Bundle != (Object)null)
			{
				Bundle.Unload(false);
				Bundle = null;
			}
			if ((Object)(object)Instance == (Object)(object)this)
			{
				Instance = null;
			}
		}
	}
}
namespace LCKR.Patches
{
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal class GameNetworkManagerPatch
	{
	}
	[HarmonyPatch(typeof(GrabbableObject))]
	internal class GrabbableObjectPatch
	{
	}
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		private sealed class ScanNodeTranslationState
		{
			internal string HeaderText;

			internal string SubText;
		}

		private static string clockAm = "오전";

		private static string clockPm = "오후";

		private static string clockAmWithSpace = " 오전";

		private static string leaveEarlyController = "Tell autopilot ship to leave early : [R-trigger] (Hold)";

		private static string leaveEarlyMouse = "Tell autopilot ship to leave early : [RMB] (Hold)";

		private static string votedForLeave = "Voted for ship to leave early";

		private static string votesFormat = "({0}/{1} Votes)";

		private static readonly ConditionalWeakTable<ScanNodeProperties, ScanNodeTranslationState> ScanNodeTranslationCache = new ConditionalWeakTable<ScanNodeProperties, ScanNodeTranslationState>();

		internal static void RefreshLocalizedText()
		{
			clockAm = TranslationManager.GetArrayTranslation("Ingame", "AM");
			clockPm = TranslationManager.GetArrayTranslation("Ingame", "PM");
			if (string.IsNullOrEmpty(clockAm) || clockAm == "AM")
			{
				clockAm = "오전";
			}
			if (string.IsNullOrEmpty(clockPm) || clockPm == "PM")
			{
				clockPm = "오후";
			}
			clockAmWithSpace = " " + clockAm;
			string arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "Tell autopilot ship to leave early");
			string arrayTranslation2 = TranslationManager.GetArrayTranslation("HUD", "Hold");
			votedForLeave = TranslationManager.GetArrayTranslation("HUD", "Voted for ship to leave early");
			string text = TranslationManager.GetArrayTranslation("HUD", "Votes").Replace("{", "{{").Replace("}", "}}");
			leaveEarlyController = arrayTranslation + " : [R-trigger] (" + arrayTranslation2 + ")";
			leaveEarlyMouse = arrayTranslation + " : [RMB] (" + arrayTranslation2 + ")";
			votesFormat = "({0}/{1} " + text + ")";
		}

		[HarmonyTranspiler]
		[HarmonyPatch("SetClock")]
		private static IEnumerable<CodeInstruction> SetClock_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			FieldInfo amField = AccessTools.Field(typeof(HUDManagerPatch), "clockAm");
			FieldInfo pmField = AccessTools.Field(typeof(HUDManagerPatch), "clockPm");
			FieldInfo amWithSpaceField = AccessTools.Field(typeof(HUDManagerPatch), "clockAmWithSpace");
			foreach (CodeInstruction instruction in instructions)
			{
				if (instruction.opcode == OpCodes.Ldstr)
				{
					switch (instruction.operand as string)
					{
					case "AM":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = amField;
						break;
					case "PM":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = pmField;
						break;
					case " AM":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = amWithSpaceField;
						break;
					}
				}
				yield return instruction;
			}
		}

		[HarmonyTranspiler]
		[HarmonyPatch("Update")]
		private static IEnumerable<CodeInstruction> Update_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			FieldInfo controllerField = AccessTools.Field(typeof(HUDManagerPatch), "leaveEarlyController");
			FieldInfo mouseField = AccessTools.Field(typeof(HUDManagerPatch), "leaveEarlyMouse");
			FieldInfo votedField = AccessTools.Field(typeof(HUDManagerPatch), "votedForLeave");
			FieldInfo votesField = AccessTools.Field(typeof(HUDManagerPatch), "votesFormat");
			foreach (CodeInstruction instruction in instructions)
			{
				if (instruction.opcode == OpCodes.Ldstr)
				{
					switch (instruction.operand as string)
					{
					case "Tell autopilot ship to leave early : [R-trigger] (Hold)":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = controllerField;
						break;
					case "Tell autopilot ship to leave early : [RMB] (Hold)":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = mouseField;
						break;
					case "Voted for ship to leave early":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = votedField;
						break;
					case "({0}/{1} Votes)":
						instruction.opcode = OpCodes.Ldsfld;
						instruction.operand = votesField;
						break;
					}
				}
				yield return instruction;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("DisplayGlobalNotification")]
		private static void DisplayGlobalNotification_Prefix(ref string displayText)
		{
			if (displayText == "New creature data sent to terminal!")
			{
				string arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "NewCreature");
				if (arrayTranslation != "NewCreature")
				{
					displayText = arrayTranslation;
				}
			}
			else if (!string.IsNullOrEmpty(displayText) && displayText.Contains("Found journal entry:"))
			{
				string arrayTranslation2 = TranslationManager.GetArrayTranslation("HUD", "FoundJournal");
				if (arrayTranslation2 != "FoundJournal")
				{
					displayText = displayText.Replace("Found journal entry:", arrayTranslation2);
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix(ref PlayerLevel[] ___playerLevels, ref TextMeshProUGUI ___weightCounter, ref Animator ___weightCounterAnimator)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			if (___playerLevels != null)
			{
				PlayerLevel[] array = ___playerLevels;
				foreach (PlayerLevel val in array)
				{
					if (val != null)
					{
						val.levelName = TranslationManager.GetArrayTranslation("PlayerLevel", val.levelName);
					}
				}
			}
			if ((Object)(object)HUDManager.Instance?.planetRiskLevelText != (Object)null)
			{
				((TMP_Text)HUDManager.Instance.planetRiskLevelText).transform.localPosition = new Vector3(336.5525f, 274.1743f, -74f);
			}
			ApplyKilogramWeight(___weightCounter, ___weightCounterAnimator);
		}

		private static void TranslateAdvertText(HUDManager __instance)
		{
			if (!((Object)(object)__instance?.advertTopText == (Object)null) && !((Object)(object)__instance.advertBottomText == (Object)null))
			{
				TextMeshProUGUI advertTopText = __instance.advertTopText;
				TextMeshProUGUI advertBottomText = __instance.advertBottomText;
				if (!((TMP_Text)advertTopText).text.Contains("<size=35>"))
				{
					((TMP_Text)advertTopText).text = TranslationManager.ReplaceArrayText(((TMP_Text)advertTopText).text, "Item", ((TMP_Text)advertTopText).text);
					((TMP_Text)advertTopText).text = "<size=35>" + ((TMP_Text)advertTopText).text;
				}
				if (!((TMP_Text)advertBottomText).text.Contains("<size=35>"))
				{
					((TMP_Text)advertBottomText).text = "<size=35>" + ((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("BeginDisplayAd")]
		private static void BeginDisplayAd_Postfix(HUDManager __instance)
		{
			TranslateAdvertText(__instance);
		}

		[HarmonyPostfix]
		[HarmonyPatch("UpdateWeightCounter")]
		private static void UpdateWeightCounter_Postfix(ref TextMeshProUGUI ___weightCounter, ref Animator ___weightCounterAnimator)
		{
			ApplyKilogramWeight(___weightCounter, ___weightCounterAnimator);
		}

		private static void ApplyKilogramWeight(TextMeshProUGUI weightCounter, Animator weightCounterAnimator)
		{
			if (Plugin.toKG && !((Object)(object)weightCounter == (Object)null) && !((Object)(object)GameNetworkManager.Instance?.localPlayerController == (Object)null) && !GameNetworkManager.Instance.localPlayerController.isPlayerDead)
			{
				float num = Mathf.RoundToInt(Mathf.Clamp(GameNetworkManager.Instance.localPlayerController.carryWeight - 1f, 0f, 100f) * 105f);
				float num2 = Mathf.RoundToInt(num / 2.2f);
				string text = $"{num2}kg";
				if (((TMP_Text)weightCounter).text != text)
				{
					((TMP_Text)weightCounter).text = text;
				}
				if (weightCounterAnimator != null)
				{
					weightCounterAnimator.SetFloat("weight", num / 130f);
				}
			}
		}

		[HarmonyPostfix]
		[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!"))
			{
				string text = statusEffect.Replace("HEALTH RISK!", TranslationManager.GetArrayTranslation("HUD", "HealthRisk")).Replace("Air filter overwhelmed by particulates;", TranslationManager.GetArrayTranslation("HUD", "HealthRisk", 1) + " " + TranslationManager.GetArrayTranslation("HUD", "HealthRisk", 2) + ".").Replace("Air filter overwhelmed by particulates", TranslationManager.GetArrayTranslation("HUD", "HealthRisk", 1) + " " + TranslationManager.GetArrayTranslation("HUD", "HealthRisk", 2))
					.Replace("Filter quality:", "필터 품질:")
					.Replace("Filter inoperative!", "필터가 작동하지 않습니다!");
				((TMP_Text)___statusEffectText).text = text;
			}
			else if (statusEffect.Contains("HIGH FEVER DETECTED!") && statusEffect.Contains("REACHING"))
			{
				string text2 = ((TMP_Text)___statusEffectText).text;
				string text3 = text2;
				if (Plugin.toCelsius)
				{
					text3 = Regex.Replace(text2, "-?\\d+(\\.\\d+)?", (Match match) => Mathf.RoundToInt((float.Parse(match.Value) - 32f) * 5f / 9f).ToString()).Replace("°F", "°C");
				}
				((TMP_Text)___statusEffectText).text = text3.Replace("HIGH FEVER DETECTED!", TranslationManager.GetArrayTranslation("HUD", "HighFever")).Replace("REACHING", TranslationManager.GetArrayTranslation("HUD", "HighFever", 1));
			}
			else if (statusEffect.Contains("HIGH FEVER DETECTED!!!"))
			{
				((TMP_Text)___statusEffectText).text = TranslationManager.GetArrayTranslation("HUD", "HighFever2") + "\n\n" + TranslationManager.GetArrayTranslation("HUD", "HighFever2", 1) + "\n\n" + TranslationManager.GetArrayTranslation("HUD", "HighFever2", 2);
			}
		}

		[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)
		{
			TextMeshProUGUI penaltyAddition = ___statsUIElements.penaltyAddition;
			((TMP_Text)penaltyAddition).text = TranslationManager.ReplaceArrayText(((TMP_Text)penaltyAddition).text, "HUD", " casualties");
			((TMP_Text)penaltyAddition).text = TranslationManager.ReplaceArrayText(((TMP_Text)penaltyAddition).text, "HUD", " bodies recovered");
		}

		[HarmonyPrefix]
		[HarmonyPatch("ReadDialogue")]
		private static void ReadDialogue_Prefix(DialogueSegment[] dialogueArray)
		{
			if (dialogueArray == null)
			{
				return;
			}
			foreach (DialogueSegment val in dialogueArray)
			{
				if (val == null)
				{
					continue;
				}
				val.speakerText = TranslationManager.GetArrayTranslation("Dialogue", val.speakerText);
				if (!string.IsNullOrEmpty(val.bodyText) && val.bodyText.Contains(". A vote has been cast"))
				{
					TimeOfDay instance = TimeOfDay.Instance;
					if (!((Object)(object)instance == (Object)null))
					{
						string key = (val.bodyText.Contains("PM.") ? "ReturnPM" : "ReturnAM");
						string text = GetClockTimeFormatted(instance.shipLeaveAutomaticallyTime, instance.numberOfHours, createNewLine: false);
						int num = text.IndexOf(' ');
						if (num >= 0 && num + 1 < text.Length)
						{
							text = text.Substring(num + 1);
						}
						val.bodyText = TranslationManager.GetArrayTranslation("Dialogue", key).Replace("{time}", text);
					}
				}
				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)
		{
			string text = ((TMP_Text)___tipsPanelHeader).text;
			if (text == null)
			{
				return;
			}
			switch (text.Length)
			{
			case 13:
				switch (text[0])
				{
				case 'I':
					if (text == "Items missed!")
					{
						((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "ItemMissed");
						((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "ItemMissed", 1);
					}
					break;
				case 'W':
					if (text == "Welcome back!")
					{
						((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "WelcomeBack");
						((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "WelcomeBack", 1);
					}
					break;
				}
				break;
			case 3:
				switch (text[0])
				{
				case '?':
					if (text == "???")
					{
						((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "MissingEntrance", 1);
					}
					break;
				case 'T':
					if (text == "Tip")
					{
						((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "TipShipObject");
						((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "TipShipObject", 1);
					}
					break;
				}
				break;
			case 19:
				if (text == "To read the manual:")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "ReadManual");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "ReadManual", 1);
				}
				break;
			case 4:
				if (text == "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 8:
				if (text == "Welcome!")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "Welcome");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "Welcome", 1);
				}
				break;
			case 10:
				if (text == "Got scrap!")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "GotScrap");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "GotScrap", 1);
				}
				break;
			case 12:
				if (text == "Item stored!")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "ItemStored");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "ItemStored", 1);
				}
				break;
			case 5:
				if (text == "HALT!")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "DeadlineWarning");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "DeadlineWarning", 1);
				}
				break;
			case 14:
				if (text == "Weather alert!")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "EclipseWarning");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "EclipseWarning", 1);
				}
				break;
			case 6:
				if (text == "ALERT!")
				{
					((TMP_Text)___tipsPanelHeader).text = TranslationManager.GetArrayTranslation("Tip", "LightningWarning");
					((TMP_Text)___tipsPanelBody).text = TranslationManager.GetArrayTranslation("Tip", "LightningWarning", 1);
				}
				break;
			case 25:
				if (text == "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;
		}

		[HarmonyPrefix]
		[HarmonyPatch("ChangeControlTip")]
		private static void ChangeControlTip_Prefix(ref string changeTo)
		{
			if (!string.IsNullOrEmpty(changeTo))
			{
				string text = changeTo.Split(':')[0].Trim();
				changeTo = changeTo.Replace(text, TranslationManager.GetArrayTranslation("ControlTip", text, 0, partialMatch: true));
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("ChangeControlTipMultiple")]
		private static void ChangeControlTipMultiple_Postfix(ref TextMeshProUGUI[] ___controlTipLines, string[] allLines, bool holdingItem, Item itemProperties)
		{
			if (!holdingItem || allLines == null || ___controlTipLines == null || ___controlTipLines.Length == 0 || !((Object)(object)___controlTipLines[0] != (Object)null) || !((Object)(object)itemProperties != (Object)null))
			{
				return;
			}
			((TMP_Text)___controlTipLines[0]).text = TranslationManager.GetArrayTranslation("Item", itemProperties.itemName) + " 떨어뜨리기 : [G]";
			int num = Mathf.Min(allLines.Length, Mathf.Max(0, ___controlTipLines.Length - 1));
			for (int i = 0; i < num; i++)
			{
				if (allLines.Length > i && !string.IsNullOrEmpty(allLines[i]))
				{
					string text = allLines[i].Split(':')[0].Trim();
					if (!((Object)(object)___controlTipLines[i + 1] == (Object)null))
					{
						((TMP_Text)___controlTipLines[i + 1]).text = ((TMP_Text)___controlTipLines[i + 1]).text.Replace(text, TranslationManager.GetArrayTranslation("ControlTip", text, 0, partialMatch: true));
					}
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("AttemptScanNode")]
		private static void AttemptScanNode_Prefix(ScanNodeProperties node)
		{
			if ((Object)(object)node == (Object)null)
			{
				return;
			}
			string text = node.headerText ?? string.Empty;
			string text2 = node.subText ?? string.Empty;
			if (ScanNodeTranslationCache.TryGetValue(node, out var value) && value.HeaderText == text && value.SubText == text2)
			{
				return;
			}
			string arrayTranslation = TranslationManager.GetArrayTranslation("ScanNode", text);
			string text3 = text2;
			if (text3.Contains("Value: ") || text3.Contains("value: ") || text3.Contains("VALUE: "))
			{
				text3 = text3.Replace("Value: ", TranslationManager.GetArrayTranslation("ScanNode", "valueCheck", 1));
				text3 = text3.Replace("value: ", TranslationManager.GetArrayTranslation("ScanNode", "valueCheck", 1));
				text3 = text3.Replace("VALUE: ", TranslationManager.GetArrayTranslation("ScanNode", "valueCheck", 1));
			}
			else
			{
				string arrayTranslation2 = TranslationManager.GetArrayTranslation("ScanNode", text, 1);
				if (!string.IsNullOrEmpty(arrayTranslation2) && arrayTranslation2 != text)
				{
					text3 = arrayTranslation2;
				}
			}
			node.headerText = arrayTranslation;
			if (arrayTranslation != text3)
			{
				node.subText = text3;
			}
			if (value == null)
			{
				value = new ScanNodeTranslationState();
				ScanNodeTranslationCache.Add(node, value);
			}
			value.HeaderText = node.headerText;
			value.SubText = node.subText;
		}

		[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, ref 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", "모드: 음성 감지");
		}

		[HarmonyTranspiler]
		[HarmonyPatch("SetChangesNotAppliedTextVisible")]
		private static IEnumerable<CodeInstruction> SetChangesNotAppliedTextVisible_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			foreach (CodeInstruction instruction in instructions)
			{
				if (instruction.opcode == OpCodes.Ldstr)
				{
					switch (instruction.operand as string)
					{
					case "DISCARD":
						instruction.operand = "취소";
						break;
					case "BACK":
					case "Back":
						instruction.operand = "뒤로";
						break;
					case "Discard changes":
						instruction.operand = "변경 사항 취소";
						break;
					}
				}
				yield return instruction;
			}
		}
	}
	[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<Button>()).gameObject);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("HostSetLobbyPublic")]
		private static void HostSetLobbyPublic_Postfix(bool setPublic, ref TextMeshProUGUI ___privatePublicDescription)
		{
			if (!((Object)(object)GameNetworkManager.Instance == (Object)null) && !GameNetworkManager.Instance.disableSteam && !((Object)(object)___privatePublicDescription == (Object)null))
			{
				((TMP_Text)___privatePublicDescription).text = (setPublic ? "공개로 설정하면 모든 사람이 볼 수 있도록 서버가 서버 목록에 표시됩니다." : "비공개로 설정하면 Steam을 통해 플레이어에게 초대를 보내야 합니다.");
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix(MenuManager __instance, ref TextMeshProUGUI ___versionNumberText)
		{
			if (Plugin.showVersion && (Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)___versionNumberText != (Object)null)
			{
				((TMP_Text)___versionNumberText).text = "   <size=14>LCKR 2.1.3" + Plugin.modVerType + "</size>\n" + ((TMP_Text)___versionNumberText).text;
			}
			if (!__instance.isInitScene)
			{
				GameObject val = GameObject.Find("MenuContainer");
				GameObject val2 = GameObject.Find("MainButtons");
				if ((Object)(object)Plugin.resetPanel == (Object)null || (Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null)
				{
					Plugin.mls.LogWarning((object)"번역 재설정 메뉴를 구성할 UI를 찾지 못해 해당 메뉴를 건너뜁니다.");
				}
				else
				{
					((Component)Object.Instantiate<GameObject>(Plugin.resetPanel, val.transform).AddComponent<LCKRPanel>()).transform.SetSiblingIndex(val2.transform.GetSiblingIndex() + 1);
				}
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		private const int CursorTranslationCacheLimit = 256;

		private static readonly Dictionary<string, string> CursorTranslationCache = new Dictionary<string, string>(StringComparer.Ordinal);

		private static string lastCursorSource;

		private static string lastCursorTranslation;

		[HarmonyTranspiler]
		[HarmonyPatch("SetHoverTipAndCurrentInteractTrigger")]
		private static IEnumerable<CodeInstruction> SetHoverTipAndCurrentInteractTrigger_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			MethodInfo textSetter = AccessTools.PropertySetter(typeof(TMP_Text), "text");
			MethodInfo translator = AccessTools.Method(typeof(PlayerControllerBPatch), "TranslateCursorText", (Type[])null, (Type[])null);
			foreach (CodeInstruction instruction in instructions)
			{
				if (CodeInstructionExtensions.Calls(instruction, textSetter))
				{
					CodeInstruction val = new CodeInstruction(OpCodes.Call, (object)translator);
					val.labels.AddRange(instruction.labels);
					instruction.labels.Clear();
					val.blocks.AddRange(instruction.blocks);
					instruction.blocks.Clear();
					yield return val;
				}
				yield return instruction;
			}
		}

		private static string TranslateCursorText(string source)
		{
			if (string.IsNullOrEmpty(source))
			{
				return source;
			}
			if (string.Equals(source, lastCursorSource, StringComparison.Ordinal))
			{
				return lastCursorTranslation;
			}
			if (CursorTranslationCache.TryGetValue(source, out var value))
			{
				lastCursorSource = source;
				lastCursorTranslation = value;
				return value;
			}
			if (CursorTranslationCache.Count >= 256)
			{
				CursorTranslationCache.Clear();
			}
			value = TranslationManager.ReplaceArrayTextAll(source, "CursorTip");
			CursorTranslationCache[source] = value;
			lastCursorSource = source;
			lastCursorTranslation = value;
			return value;
		}

		internal static void ClearTranslationCache()
		{
			CursorTranslationCache.Clear();
			lastCursorSource = null;
			lastCursorTranslation = null;
		}

		[HarmonyPostfix]
		[HarmonyPatch("SpawnDeadBody")]
		private static void SpawnDeadBody_Postfix(PlayerControllerB __instance)
		{
			DeadBodyInfo obj = __instance?.deadBody;
			ScanNodeProperties val = ((obj != null) ? ((Component)obj).GetComponentInChildren<ScanNodeProperties>() : null);
			if (!((Object)(object)val == (Object)null))
			{
				string arrayTranslation = TranslationManager.GetArrayTranslation("DeathReasons", "PlayerBody");
				string text = val.headerText ?? string.Empty;
				if (arrayTranslation != "PlayerBody" && !text.Contains(arrayTranslation))
				{
					val.headerText = text.Replace("Body of ", "") + arrayTranslation;
				}
				string text2 = val.subText ?? string.Empty;
				int num = text2.IndexOf(':');
				if (num >= 0)
				{
					string key = text2.Substring(0, num).Trim();
					string key2 = text2.Substring(num + 1).Trim();
					text2 = TranslationManager.ReplaceArrayText(text2, "DeathReasons", key);
					val.subText = TranslationManager.ReplaceArrayText(text2, "DeathReasons", key2);
				}
			}
		}
	}
	[HarmonyPatch(typeof(PreInitSceneScript))]
	internal class PreInitSceneScriptPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("PressContinueButton")]
		private static void PressContinueButton_Postfix(ref int ___currentLaunchSettingPanel, ref GameObject[] ___LaunchSettingsPanels, ref Animator ___blackTransition, ref GameObject ___continueButton, ref TextMeshProUGUI ___headerText)
		{
			if ((Object)(object)___headerText != (Object)null && ((TMP_Text)___headerText).text == "LAUNCH MODE")
			{
				((TMP_Text)___headerText).text = "실행 모드";
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("SkipToFinalSetting")]
		private static void SkipToFinalSetting_Postfix(ref TextMeshProUGUI ___headerText)
		{
			if ((Object)(object)___headerText != (Object)null)
			{
				((TMP_Text)___headerText).text = "실행 모드";
			}
		}
	}
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		private static TextMeshProUGUI _loadingText;

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix()
		{
			if (!((Object)(object)GameNetworkManager.Instance != (Object)null) || GameNetworkManager.Instance.gameVersionNum < 80 || !((Object)(object)_loadingText == (Object)null))
			{
				return;
			}
			_loadingText = HUDManager.Instance?.loadingText;
			if ((Object)(object)_loadingText != (Object)null)
			{
				string arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "LoadText");
				if (arrayTranslation != "LoadText")
				{
					((TMP_Text)_loadingText).text = arrayTranslation;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("GenerateNewLevelClientRpc")]
		private static void GenerateNewLevelClientRpc_Postfix()
		{
			TextMeshProUGUI val = HUDManager.Instance?.loadingText;
			if ((Object)(object)val != (Object)null && ((TMP_Text)val).text.Contains("Random seed"))
			{
				((TMP_Text)val).text = TranslationManager.ReplaceArrayText(((TMP_Text)val).text, "HUD", "Random seed");
			}
		}
	}
	[HarmonyPatch(typeof(SaveFileUISlot))]
	internal class SaveFileUISlotPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("OnEnable")]
		private static void OnEnable_Postfix(SaveFileUISlot __instance, ref string ___fileString)
		{
			if (__instance.fileNum == -1)
			{
				((TMP_Text)__instance.fileNameText).text = GameNetworkManager.Instance.GetNameForWeekNumber(-1);
			}
			if (ES3.FileExists(___fileString) && __instance.fileNum != -1)
			{
				int num = ES3.Load<int>("GroupCredits", ___fileString, 0);
				int num2 = ES3.Load<int>("Stats_DaysSpent", ___fileString, 0);
				((TMP_Text)__instance.fileStatsText).text = $"${num}\n{num2}일차";
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetFileToThis")]
		private static void SetFileToThis_Postfix(ref TextMeshProUGUI ___specialTipText)
		{
			if ((Object)(object)___specialTipText != (Object)null && ((Behaviour)___specialTipText).enabled)
			{
				((TMP_Text)___specialTipText).text = ((TMP_Text)___specialTipText).text.Replace("This is the weekly challenge moon. You have one day to make as much profit as possible.", "주간 챌린지 위성입니다. 하루 안에 가능한 한 많은 수익을 획득하세요.");
			}
		}
	}
	[HarmonyPatch(typeof(ShipBuildModeManager))]
	internal class ShipBuildModeManagerPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("CreateGhostObjectAndHighlight")]
		private static void CreateGhostObjectAndHighlight_Postfix(ShipBuildModeManager __instance)
		{
			if (!((Object)(object)__instance.placingObject == (Object)null) && !((Object)(object)HUDManager.Instance?.buildModeControlTip == (Object)null))
			{
				string text = ((TMP_Text)HUDManager.Instance.buildModeControlTip).text.Replace("Confirm", "배치");
				text = text.Replace("Rotate", "회전");
				text = text.Replace("Store", "보관");
				((TMP_Text)HUDManager.Instance.buildModeControlTip).text = text;
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix()
		{
			try
			{
				TranslatePlanet();
				TranslatePlanetInfoSummary();
			}
			catch (Exception ex)
			{
				Plugin.mls.LogError((object)("행성 리스트를 번역하는 과정에서 오류가 발생했습니다!\n" + ex));
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("openingDoorsSequence")]
		private static void OpeningDoorsSequence_Postfix(ref IEnumerator __result)
		{
			if (__result != null)
			{
				__result = TranslatePlanetInfoSummary(__result);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("waitingForOtherPlayersToRevive")]
		private static void WaitingForOtherPlayersToRevive_Postfix(ref IEnumerator __result)
		{
			if (__result != null)
			{
				__result = TranslateWaitingForCrew(__result);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("SceneManager_OnLoadComplete1")]
		private static void SceneManager_OnLoadComplete1_Postfix()
		{
			TranslateWaitingForCrew();
		}

		private static IEnumerator TranslatePlanetInfoSummary(IEnumerator original)
		{
			try
			{
				while (original.MoveNext())
				{
					TranslatePlanetInfoSummary();
					yield return original.Current;
				}
				TranslatePlanetInfoSummary();
			}
			finally
			{
				(original as IDisposable)?.Dispose();
			}
		}

		private static IEnumerator TranslateWaitingForCrew(IEnumerator original)
		{
			bool translationComplete = false;
			try
			{
				while (original.MoveNext())
				{
					if (!translationComplete)
					{
						translationComplete = TranslateWaitingForCrew();
					}
					yield return original.Current;
				}
				if (!translationComplete)
				{
					TranslateWaitingForCrew();
				}
			}
			finally
			{
				(original as IDisposable)?.Dispose();
			}
		}

		private static bool TranslateWaitingForCrew()
		{
			TextMeshProUGUI val = HUDManager.Instance?.loadingText;
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			string arrayTranslation = TranslationManager.GetArrayTranslation("HUD", "WaitingForCrew");
			if (arrayTranslation == "WaitingForCrew")
			{
				return true;
			}
			if (((TMP_Text)val).text == "Waiting for crew...")
			{
				((TMP_Text)val).text = arrayTranslation;
			}
			return ((TMP_Text)val).text == arrayTranslation;
		}

		private static void TranslatePlanetInfoSummary()
		{
			TextMeshProUGUI val = HUDManager.Instance?.planetInfoSummaryText;
			SelectableLevel val2 = StartOfRound.Instance?.currentLevel;
			TextMeshProUGUI val3 = HUDManager.Instance?.planetInfoHeaderText;
			if ((Object)(object)val3 != (Object)null && ((TMP_Text)val3).text.Contains("CELESTIAL BODY:"))
			{
				string arrayTranslation = TranslationManager.GetArrayTranslation("Planets", ((TMP_Text)val3).text, 0, partialMatch: true);
				if (arrayTranslation != ((TMP_Text)val3).text)
				{
					((TMP_Text)val3).text = arrayTranslation;
				}
			}
			if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null))
			{
				string arrayTranslation2 = TranslationManager.GetArrayTranslation("Planets", val2.LevelDescription, 0, partialMatch: true);
				if (((TMP_Text)val).text != arrayTranslation2)
				{
					((TMP_Text)val).text = arrayTranslation2;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("SceneManager_OnLoad")]
		private static void SceneManager_OnLoad_Postfix()
		{
			if (((TMP_Text)HUDManager.Instance.loadingText).text == "LOADING WORLD...")
			{
				((TMP_Text)HUDManager.Instance.loadingText).text = "세계 불러오는 중...";
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("FirePlayersAfterDeadlineClientRpc")]
		private static void FirePlayersAfterDeadlineClientRpc_Postfix()
		{
			TextMeshProUGUI endOfRunStatsText = HUDManager.Instance.EndOfRunStatsText;
			((TMP_Text)endOfRunStatsText).text = TranslationManager.ReplaceArrayText(((TMP_Text)endOfRunStatsText).text, "HUD", "Days on the job");
			((TMP_Text)endOfRunStatsText).text = TranslationManager.ReplaceArrayText(((TMP_Text)endOfRunStatsText).text, "HUD", "Scrap value collected");
			((TMP_Text)endOfRunStatsText).text = TranslationManager.ReplaceArrayText(((TMP_Text)endOfRunStatsText).text, "HUD", "Deaths");
			((TMP_Text)endOfRunStatsText).text = TranslationManager.ReplaceArrayText(((TMP_Text)endOfRunStatsText).text, "HUD", "Steps taken");
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetMapScreenInfoToCurrentLevel")]
		private static void SetMapScreenInfoToCurrentLevel_Postfix(ref TextMeshProUGUI ___screenLevelDescription)
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Invalid comparison between Unknown and I4
			TranslatePlanet();
			if ((Object)(object)HUDManager.Instance?.planetRiskLevelText != (Object)null)
			{
				((TMP_Text)HUDManager.Instance.planetRiskLevelText).text = TranslationManager.ReplaceArrayText(((TMP_Text)HUDManager.Instance.planetRiskLevelText).text, "Planets", "Safe");
			}
			string text;
			if ((int)StartOfRound.Instance.currentLevel.currentWeather != -1)
			{
				string arrayTranslation = TranslationManager.GetArrayTranslation("Planets", "Weather");
				string arrayTranslation2 = TranslationManager.GetArrayTranslation("Planets", ((object)Unsafe.As<LevelWeatherType, LevelWeatherType>(ref StartOfRound.Instance.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString());
				text = arrayTranslation + ": " + arrayTranslation2;
			}
			else
			{
				text = "";
			}
			string levelDescription = StartOfRound.Instance.currentLevel.LevelDescription;
			if (StartOfRound.Instance.isChallengeFile)
			{
				((TMP_Text)StartOfRound.Instance.screenLevelDescription).text = string.Concat(TranslationManager.GetArrayTranslation("Planets", "Orbiting") + ": ", GameNetworkManager.Instance.GetNameForWeekNumber(-1), "\n", TranslationManager.GetArrayTranslation("Planets", levelDescription, 0, partialMatch: true), "\n", text);
			}
			else
			{
				((TMP_Text)StartOfRound.Instance.screenLevelDescription).text = "공전 중: " + TranslationManager.GetArrayTranslation("Planets", StartOfRound.Instance.currentLevel.PlanetName, 0, partialMatch: true) + "\n" + TranslationManager.GetArrayTranslation("Planets", levelDescription, 0, partialMatch: true) + "\n" + text;
			}
		}

		private bool TryGetValueAfterColon(string text, string removalKey, out string value)
		{
			value = null;
			if (string.IsNullOrEmpty(text))
			{
				return false;
			}
			int num = text.IndexOf(':');
			if (num < 0)
			{
				return false;
			}
			if (text.Substring(0, num).Trim() != removalKey)
			{
				return false;
			}
			value = text.Substring(num + 1).Trim();
			return true;
		}

		[HarmonyPostfix]
		[HarmonyPatch("WritePlayerNotes")]
		public static void WritePlayerNotes_Postfix(ref EndOfGameStats ___gameStats, ref PlayerControllerB[] ___allPlayerScripts, ref int ___connectedPlayersAmount, ref bool ___localPlayerWasMostProfitableThisRound)
		{
			for (int i = 0; i < ___allPlayerScripts.Length; i++)
			{
				for (int j = 0; j < ___gameStats.allPlayerStats[i].playerNotes.Count; j++)
				{
					string key = ___gameStats.allPlayerStats[i].playerNotes[j];
					key = TranslationManager.GetArrayTranslation("HUD", key);
					___gameStats.allPlayerStats[i].playerNotes[j] = key;
				}
			}
		}

		private static void TranslatePlanet()
		{
		}
	}
	[HarmonyPatch]
	internal class TerminalPatch
	{
		private static FieldInfo modifyingTextField = AccessTools.Field(typeof(Terminal), "modifyingText");

		private static FieldInfo totalCostField = AccessTools.Field(typeof(Terminal), "totalCostOfItems");

		private static string confirmString;

		private static string denyString;

		private static readonly ConditionalWeakTable<Terminal, TerminalCommandLanguage> commandLanguages = new ConditionalWeakTable<Terminal, TerminalCommandLanguage>();

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Terminal), "Start")]
		private static void Start_Postfix(Terminal __instance, ref TerminalNodesList ___terminalNodes, ref List<TerminalNode> ___enemyFiles)
		{
			confirmString = TranslationManager.GetArrayTranslation("Terminal", "확인");
			denyString = TranslationManager.GetArrayTranslation("Terminal", "취소");
			Plugin.mls.LogInfo((object)("클라이언트 버전: " + GameNetworkManager.Instance?.gameVersionNum));
			commandLanguages.GetValue(__instance, (Terminal _) => new TerminalCommandLanguage()).Capture(___terminalNodes);
			TranslateKeyword(__instance, ___terminalNodes, ___enemyFiles);
			TranslateNode(__instance);
			if ((Object)(object)GameNetworkManager.Instance != (Object)null && GameNetworkManager.Instance.gameVersionNum >= 55)
			{
				TranslateVehicle(__instance);
			}
			if (StartOfRound.Instance?.unlockablesList?.unlockables == null)
			{
				return;
			}
			foreach (UnlockableItem unlockable in StartOfRound.Instance.unlockablesList.unlockables)
			{
				TranslateUnlockable(unlockable);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Terminal), "ParsePlayerSentence")]
		private static void ParsePlayerSentence_Prefix(Terminal __instance, out IDisposable __state)
		{
			__state = null;
			if (commandLanguages.TryGetValue(__instance, out var value))
			{
				TMP_InputField screenText = __instance.screenText;
				string text = ((screenText != null) ? screenText.text : null);
				int textAdded = __instance.textAdded;
				if (text != null && textAdded > 0 && textAdded <= text.Length)
				{
					__state = value.UseOriginalWords(text.Substring(text.Length - textAdded));
				}
			}
		}

		[HarmonyFinalizer]
		[HarmonyPatch(typeof(Terminal), "ParsePlayerSentence")]
		private static void ParsePlayerSentence_Finalizer(IDisposable __state)
		{
			__state?.Dispose();
		}

		private static void TranslateVehicle(Terminal instance)
		{
			if (instance?.buyableVehicles == null)
			{
				return;
			}
			BuyableVehicle[] buyableVehicles = instance.buyableVehicles;
			foreach (BuyableVehicle val in buyableVehicles)
			{
				if (val != null && val.vehicleDisplayName == "Cruiser")
				{
					val.vehicleDisplayName = "크루저";
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Terminal), "LoadNewNode")]
		public static bool LoadNewNode_Prefix(Terminal __instance, TerminalNode node)
		{
			modifyingTextField.SetValue(__instance, true);
			__instance.RunTerminalEvents(node);
			((Selectable)__instance.screenText).interactable = true;
			string text = "";
			if (node.clearPreviousText)
			{
				text = "\n\n\n" + node.displayText.ToString();
			}
			else
			{
				text = "\n\n" + __instance.screenText.text.ToString() + "\n\n" + node.displayText.ToString();
				int num = text.Length - 250;
				text = text.Substring(Mathf.Clamp(num, 0, text.Length)).ToString();
			}
			try
			{
				text = TextPostProcess(__instance, text, node);
			}
			catch (Exception arg)
			{
				Debug.LogError((object)$"An error occured while post processing terminal text: {arg}");
			}
			__instance.screenText.text = text;
			__instance.currentText = __instance.screenText.text;
			__instance.textAdded = 0;
			if (node.playSyncedClip != -1)
			{
				__instance.PlayTerminalAudioServerRpc(node.playSyncedClip);
			}
			else if ((Object)(object)node.playClip != (Object)null)
			{
				__instance.terminalAudio.PlayOneShot(node.playClip);
			}
			__instance.LoadTerminalImage(node);
			__instance.currentNode = node;
			return false;
		}

		private static string TextPostProcess(Terminal __instance, string modifiedDisplayText, TerminalNode node)
		{
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Invalid comparison between Unknown and I4
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Invalid comparison between Unknown and I4
			int num = modifiedDisplayText.Split("[planetTime]").Length - 1;
			if (num > 0)
			{
				for (int i = 0; i < num; i++)
				{
					if (__instance.moonsCatalogueList == null)
					{
						break;
					}
					if (__instance.moonsCatalogueList.Length <= i)
					{
						break;
					}
					SelectableLevel val = __instance.moonsCatalogueList[i];
					string value = (((Object)(object)val == (Object)null) ? "" : ((GameNetworkManager.Instance.isDemo && val.lockedForDemo) ? TranslationManager.GetArrayTranslation("Terminal", "Locked") : (((int)val.currentWeather != -1) ? ("(" + TranslationManager.GetArrayTranslation("Planets", ((object)Unsafe.As<LevelWeatherType, LevelWeatherType>(ref val.currentWeather)/*cast due to .constrained prefix*/).ToString()) + ")") : "")));
					int num2 = modifiedDisplayText.IndexOf("[planetTime]", StringComparison.Ordinal);
					if (num2 < 0)
					{
						break;
					}
					modifiedDisplayText = modifiedDisplayText.Remove(num2, "[planetTime]".Length).Insert(num2, value);
				}
			}
			try
			{
				if (node.displayPlanetInfo != -1)
				{
					string newValue = (((int)StartOfRound.Instance.levels[node.displayPlanetInfo].currentWeather != -1) ? (TranslationManager.GetArrayTranslation("Planets", ((object)Unsafe.As<LevelWeatherType, LevelWeatherType>(ref StartOfRound.Instance.levels[node.displayPlanetInfo].currentWeather)/*cast due to .constrained prefix*/).ToString()) ?? "") : TranslationManager.GetArrayTranslation("Planets", "mild weather"));
					modifiedDisplayText = modifiedDisplayText.Replace("[currentPlanetTime]", newValue);
				}
			}
			catch
			{
				Debug.Log((object)$"Exception occured on terminal while setting node planet info; current node displayPlanetInfo:{node.displayPlanetInfo}");
			}
			if (modifiedDisplayText.Contains("[warranty]"))
			{
				modifiedDisplayText = ((!__instance.hasWarrantyTicket) ? modifiedDisplayText.Replace("[warranty]", "") : modifiedDisplayText.Replace("[warranty]", TranslationManager.GetArrayTranslation("Terminal", "FreeWarranty", 0, partialMatch: false, "[warranty]")));
			}
			if (modifiedDisplayText.Contains("[currentScannedEnemiesList]"))
			{
				if (__instance.scannedEnemyIDs == null || __instance.scannedEnemyIDs.Count <= 0)
				{
					modifiedDisplayText = modifiedDisplayText.Replace("[currentScannedEnemiesList]", TranslationManager.GetArrayTranslation("Terminal", "NoCreatureData", 0, partialMatch: false, "No data collected on wildlife. Scans are required."));
				}
				else
				{
					StringBuilder stringBuilder = new StringBuilder();
					for (int j = 0; j < __instance.scannedEnemyIDs.Count; j++)
					{
						Debug.Log((object)$"scanID # {j}: {__instance.scannedEnemyIDs[j]}; {__instance.enemyFiles[__instance.scannedEnemyIDs[j]].creatureName}");
						Debug.Log((object)$"scanID # {j}: {__instance.scannedEnemyIDs[j]}");
						stringBuilder.Append("\n" + __instance.enemyFiles[__instance.scannedEnemyIDs[j]].creatureName);
						if (__instance.newlyScannedEnemyIDs.Contains(__instance.scannedEnemyIDs[j]))
						{
							stringBuilder.Append(" (" + TranslationManager.GetArrayTranslation("Terminal", "NEW") + ")");
						}
					}
					modifiedDisplayText = modifiedDisplayText.Replace("[currentScannedEnemiesList]", stringBuilder.ToString());
				}
			}
			if (modifiedDisplayText.Contains("[buyableItemsList]"))
			{
				if (__instance.buyableItemsList == null || __instance.buyableItemsList.Length == 0)
				{
					modifiedDisplayText = modifiedDisplayText.Replace("[buyableItemsList]", TranslationManager.GetArrayTranslation("Terminal", "NoStock"));
				}
				else
				{
					StringBuilder stringBuilder2 = new StringBuilder();
					for (int k = 0; k < __instance.buyableItemsList.Length; k++)
					{
						stringBuilder2.Append("\n* " + TranslationManager.GetArrayTranslation("Item", __instance.buyableItemsList[k].itemName) + "  //  " + TranslationManager.GetArrayTranslation("Terminal", "Price") + ": $" + (float)__instance.buyableItemsList[k].creditsWorth * ((float)__instance.itemSalesPercentages[k] / 100f));
						if (__instance.itemSalesPercentages[k] != 100)
						{
							stringBuilder2.Append(string.Format("   ({0}% " + TranslationManager.GetArrayTranslation("Terminal", "OFF!") + ")", 100 - __instance.itemSalesPercentages[k]));
						}
					}
					modifiedDisplayText = modifiedDisplayText.Replace("[buyableItemsList]", stringBuilder2.ToString());
				}
			}
			if (modifiedDisplayText.Contains("[buyableVehiclesList]"))
			{
				if (__instance.buyableVehicles == null || __instance.buyableVehicles.Length == 0)
				{
					modifiedDisplayText = modifiedDisplayText.Replace("[buyableVehiclesList]", TranslationManager.GetArrayTranslation("Terminal", "NoStock"));
				}
				else
				{
					StringBuilder stringBuilder3 = new StringBuilder();
					for (int l = 0; l < __instance.buyableVehicles.Length; l++)
					{
						stringBuilder3.Append("\n* " + __instance.buyableVehicles[l].vehicleDisplayName + "  //  " + TranslationManager.GetArrayTranslation("Terminal", "Price") + ": $" + (float)__instance.buyableVehicles[l].creditsWorth * ((float)__instance.itemSalesPercentages[l + __instance.buyableItemsList.Length] / 100f));
						if (__instance.itemSalesPercentages[l + __instance.buyableItemsList.Length] != 100)
						{
							stringBuilder3.Append(string.Format("   ({0}% " + TranslationManager.GetArrayTranslation("Terminal", "OFF!") + ")", 100 - __instance.itemSalesPercentages[l + __instance.buyableItemsList.Length]));
						}
					}
					modifiedDisplayText = modifiedDisplayText.Replace("[buyableVehiclesList]", stringBuilder3.ToString());
				}
			}
			if (modifiedDisplayText.Contains("[currentUnlockedLogsList]"))
			{
				if (__instance.unlockedStoryLogs == null || __instance.unlockedStoryLogs.Count <= 0)
				{
					modifiedDisplayText = modifiedDisplayText.Replace("[currentUnlockedLogsList]", TranslationManager.GetArrayTranslation("Terminal", "DataCorrupted"));
				}
				else
				{
					StringBuilder stringBuilder4 = new StringBuilder();
					for (int m = 0; m < __instance.unlockedStoryLogs.Count; m++)
					{
						stringBuilder4.Append("\n" + __instance.logEntryFiles[__instance.unlockedStoryLogs[m]].creatureName);
						if (__instance.newlyUnlockedStoryLogs.Contains(__instance.unlockedStoryLogs[m]))
						{
							stringBuilder4.Append(" (" + TranslationManager.GetArrayTranslation("Terminal", "NEW") + ")");
						}
					}
					modifiedDisplayText = modifiedDisplayText.Replace("[currentUnlockedLogsList]", stringBuilder4.ToString());
				}
			}
			if (modifiedDisplayText.Contains("[unlockablesSelectionList]"))
			{
				if (__instance.ShipDecorSelection == null || __instance.ShipDecorSelection.Count <= 0)
				{
					modifiedDisplayText = modifiedDisplayText.Replace("[unlockablesSelectionList]", TranslationManager.GetArrayTranslation("Terminal", "NoItems"));
				}
				else
				{
					StringBuilder stringBuilder5 = new StringBuilder();
					for (int n = 0; n < __instance.ShipDecorSelection.Count; n++)
					{
						stringBuilder5.Append($"\n{__instance.ShipDecorSelection[n].creatureName}  //  ${__instance.ShipDecorSelection[n].itemCost}");
					}
					modifiedDisplayText = modifiedDisplayText.Replace("[unlockablesSelectionList]", stringBuilder5.ToString());
				}
			}
			if (modifiedDisplayText.Contains("[storedUnlockablesList]"))
			{
				StringBuilder stringBuilder6 = new StringBuilder();
				bool flag = false;
				for (int num3 = 0; num3 < StartOfRound.Instance.unlockablesList.unlockables.Count; num3++)
				{
					if (StartOfRound.Instance.unlockablesList.unlockables[num3].inStorage)
					{
						flag = true;
						stringBuilder6.Append("\n" + StartOfRound.Instance.unlockablesList.unlockables[num3].unlockableName);
					}
				}
				modifiedDisplayText = (flag ? modifiedDisplayText.Replace("[storedUnlockablesList]", stringBuilder6.ToString()) : modifiedDisplayText.Replace("[storedUnlockablesList]", TranslationManager.GetArrayTranslation("Terminal", "NotStored")));
			}
			if (modifiedDisplayText.Contains("[scanForItems]"))
			{
				modifiedDisplayText = modifiedDisplayText.Replace("[scanForItems]", BuildScanResult());
			}
			modifiedDisplayText = ((__instance.numberOfItemsInDropship > 0) ? modifiedDisplayText.Replace("[numberOfItemsOnRoute]", string.Format(TranslationManager.GetArrayTranslation("Terminal", "BoughtItemsInRoute"), __instance.numberOfItemsInDropship)) : modifiedDisplayText.Replace("[numberOfItemsOnRoute]", ""));
			CultureInfo cultureInfo = CultureInfo.GetCultureInfo("ko-KR");
			modifiedDisplayText = modifiedDisplayText.Replace("[currentDay]", DateTime.Now.ToString("dddd", cultureInfo));
			modifiedDisplayText = modifiedDisplayText.Replace("[variableAmount]", __instance.playerDefinedAmount.ToString());
			modifiedDisplayText = modifiedDisplayText.Replace("[playerCredits]", "$" + __instance.groupCredits);
			modifiedDisplayText = modifiedDisplayText.Replace("[totalCost]", "$" + totalCostField.GetValue(__instance).ToString());
			modifiedDisplayText = modifiedDisplayText.Replace("[companyBuyingPercent]", $"{Mathf.RoundToInt(StartOfRound.Instance.companyBuyingRate * 100f)}%");
			if (Object.op_Implicit((Object)(object)__instance.displayingPersistentImage))
			{
				modifiedDisplayText = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + modifiedDisplayText;
			}
			return modifiedDisplayText;
		}

		private static string BuildScanResult()
		{
			StartOfRound instance = StartOfRound.Instance;
			if ((Object)(object)instance == (Object)null)
			{
				return string.Empty;
			}
			Random random = new Random(instance.randomMapSeed + 91);
			int num = 0;
			int num2 = 0;
			GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>();
			for (int i = 0; i < array.Length; i++)
			{
				GrabbableObject val = array[i];
				if (!((Object)(object)val?.itemProperties == (Object)null) && val.itemProperties.isScrap)
				{
					if (instance.inShipPhase)
					{
						num2 += val.scrapValue;
						num++;
					}
					else if (!val.isInShipRoom && !val.isInElevator)
					{
						int num3 = ((val.itemProperties.maxValue > val.itemProperties.minValue) ? random.Next(val.itemProperties.minValue, val.itemProperties.maxValue) : val.itemProperties.minValue);
						num2 += Mathf.Clamp(num3, val.scrapValue - 6 * i, val.scrapValue + 9 * i);
						num++;
					}
				}
			}
			return string.Format(instance.inShipPhase ? "함선 안에 {0}개의 물체가 있으며, 총 ${1}의 가치가 있습니다." : TranslationManager.GetArrayTranslation("Terminal", "ScanForItems"), num, num2);
		}

		private static void TranslateNode(Terminal instance)
		{
			foreach (TerminalNode specialNode in instance.terminalNodes.specialNodes)
			{
				specialNode.displayText = TranslationManager.GetArrayTranslation("Terminal", ((Object)specialNode).name, 0, partialMatch: false, specialNode.displayText);
			}
		}

		private static void TranslateUnlockable(UnlockableItem unlockableItem)
		{
			if ((Object)(object)unlockableItem.shopSelectionNode == (Object)null)
			{
				return;
			}
			TerminalNode shopSelectionNode = unlockableItem.shopSelectionNode;
			string unlockableName = unlockableItem.unlockableName;
			if (unlockableName == null)
			{
				return;
			}
			switch (unlockableName.Length)
			{
			case 8:
				switch (unlockableName[0])
				{
				case 'B':
					if (unlockableName == "Bunkbeds")
					{
						unlockableItem.unlockableName = "벙커침대";
						shopSelectionNode.displayText = "벙커침대\n\n";
						shopSelectionNode.creatureName = "벙커침대";
					}
					break;
				case 'C':
					if (unlockableName == "Cupboard")
					{
						unlockableItem.unlockableName = "수납장";
						shopSelectionNode.displayText = "수납장\n\n";
						shopSelectionNode.creatureName = "수납장";
					}
					break;
				case 'G':
					if (unlockableName == "Goldfish")
					{
						unlockableItem.unlockableName = "금붕어";
						shopSelectionNode.displayText = BuildOrderPrompt("금붕어 어항");
						shopSelectionNode.creatureName = "금붕어";
					}
					break;
				}
				break;
			case 12:
				switch (unlockableName[0])
				{
				case 'F':
					if (unlockableName == "File Cabinet")
					{
						unlockableItem.unlockableName = "파일 캐비닛";
						shopSelectionNode.displayText = "파일 캐비닛\n\n";
						shopSelectionNode.creatureName = "파일 캐비닛";
					}
					break;
				case 'J':
					if (unlockableName == "JackOLantern")
					{
						unlockableItem.unlockableName = "잭오랜턴";
						shopSelectionNode.displayText = BuildOrderPrompt("잭오랜턴");
						shopSelectionNode.creatureName = "잭오랜턴";
					}
					break;
				}
				break;
			case 10:
				switch (unlockableName[4])
				{
				case 'p':
					if (unlockableName == "Teleporter")
					{
						unlockableItem.unlockableName = "순간이동기";
						shopSelectionNode.displayText = "순간이동기를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
						shopSelectionNode.creatureName = "순간이동기";
					}
					break;
				case 'v':
					if (unlockableName == "Television")
					{
						unlockableItem.unlockableName = "텔레비전";
						shopSelectionNode.displayText = "텔레비전을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
						shopSelectionNode.creatureName = "텔레비전";
					}
					break;
				case ' ':
					if (unlockableName == "Sofa chair")
					{
						unlockableItem.unlockableName = "소파 의자";
						shopSelectionNode.displayText = BuildOrderPrompt("소파 의자");
						shopSelectionNode.creatureName = "소파 의자";
					}
					break;
				case 'o':
					if (unlockableName == "Disco Ball")
					{
						unlockableItem.unlockableName = "디스코 볼";
						shopSelectionNode.displayText = BuildOrderPrompt("디스코 볼");
						shopSelectionNode.creatureName = "디스코 볼";
					}
					break;
				}
				break;
			case 6:
				switch (unlockableName[0])
				{
				case 'T':
					if (unlockableName == "Toilet")
					{
						unlockableItem.unlockableName = "변기";
						shopSelectionNode.displayText = "변기를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
						shopSelectionNode.creatureName = "변기";
					}
					break;
				case 'S':
					if (unlockableName == "Shower")
					{
						unlockableItem.unlockableName = "샤워 부스";
						shopSelectionNode.displayText = BuildOrderPrompt("샤워 부스");
						shopSelectionNode.creatureName = "샤워 부스";
					}
					break;
				case 'F':
					if (unlockableName == "Fridge")
					{
						unlockableItem.unlockableName = "냉장고";
						shopSelectionNode.displayText = BuildOrderPrompt("냉장고");
						shopSelectionNode.creatureName = "냉장고";
					}
					break;
				}
				break;
			case 9:
				switch (unlockableName[0])
				{
				case 'M':
					if (unlockableName == "Microwave")
					{
						unlockableItem.unlockableName = "전자레인지";
						shopSelectionNode.displayText = BuildOrderPrompt("전자레인지");
						shopSelectionNode.creatureName = "전자레인지";
					}
					break;
				case 'L':
					if (unlockableName == "Loud horn")
					{
						unlockableItem.unlockableName = "시끄러운 경적";
						shopSelectionNode.displayText = BuildOrderPrompt("시끄러운 경적");
						shopSelectionNode.creatureName = "시끄러운 경적";
					}
					break;
				}
				break;
			case 18:
				switch (unlockableName[0])
				{
				case 'I':
					if (unlockableName == "Inverse Teleporter")
					{
						unlockableItem.unlockableName = "역방향 순간이동기";
						shopSelectionNode.displayText = BuildOrderPrompt("역방향 순간이동기");
						shopSelectionNode.creatureName = "역방향 순간이동기";
					}
					break;
				case 'P':
					if (unlockableName == "Plushie pajama man")
					{
						unlockableItem.unlockableName = "인형 파자마 맨";
						shopSelectionNode.displayText = BuildOrderPrompt("인형 파자마 맨");
						shopSelectionNode.creatureName = "인형 파자마 맨";
					}
					break;
				}
				break;
			case 13:
				if (unlockableName == "Record player")
				{
					unlockableItem.unlockableName = "레코드 플레이어";
					shopSelectionNode.displayText = BuildOrderPrompt("레코드 플레이어");
					shopSelectionNode.creatureName = "레코드";
				}
				break;
			case 5:
				if (unlockableName == "Table")
				{
					unlockableItem.unlockableName = "테이블";
					shopSelectionNode.displayText = BuildOrderPrompt("테이블");
					shopSelectionNode.creatureName = "테이블";
				}
				break;
			case 14:
				if (unlockableName == "Romantic table")
				{
					unlockableItem.unlockableName = "로맨틱한 테이블";
					shopSelectionNode.displayText = BuildOrderPrompt("로맨틱한 테이블");
					shopSelectionNode.creatureName = "로맨틱한 테이블";
				}
				break;
			case 17:
				if (unlockableName == "Signal translator")
				{
					unlockableItem.unlockableName = "신호 해석기";
					shopSelectionNode.displayText = BuildOrderPrompt("신호 해석기");
					shopSelectionNode.creatureName = "신호 해석기";
				}
				break;
			case 11:
				if (unlockableName == "Welcome mat")
				{
					unlockableItem.unlockableName = "웰컴 매트";
					shopSelectionNode.displayText = BuildOrderPrompt("웰컴 매트");
					shopSelectionNode.creatureName = "웰컴 매트";
				}
				break;
			case 7:
			case 15:
			case 16:
				break;
			}
		}

		private static string BuildOrderPrompt(string itemName)
		{
			return itemName + "을(를) 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + (confirmString?.ToUpperInvariant() ?? "CONFIRM") + " 또는 " + (denyString?.ToUpperInvariant() ?? "DENY") + "을(를) 입력하세요.\n\n";
		}

		private static string BuildMoonsCatalogue(Terminal terminal)
		{
			StringBuilder stringBuilder = new StringBuilder("위성 카탈로그에 오신 것을 환영합니다.\n함선의 경로를 지정하려면 ROUTE를 입력하세요.\n위성에 대해 알아보려면 INFO를 입력하세요.\n____________________________\n\n* 회사 건물   //   [companyBuyingPercent]에 매입 중.\n\n");
			SelectableLevel[] array = terminal?.moonsCatalogueList;
			if (array != null)
			{
				SelectableLevel[] array2 = array;
				foreach (SelectableLevel val in array2)
				{
					string value = (((Object)(object)val == (Object)null) ? "?" : TranslationManager.GetArrayTranslation("Planets", val.PlanetName));
					stringBuilder.Append("* ").Append(value).Append(" [planetTime]\n");
				}
			}
			stringBuilder.Append('\n');
			return stringBuilder.ToString();
		}

		private static void TranslateKeyword(Terminal terminal, TerminalNodesList terminalNodes, List<TerminalNode> ___enemyFiles)
		{
			if (___enemyFiles != null)
			{
				foreach (TerminalNode ___enemyFile in ___enemyFiles)
				{
					if (!((Object)(object)___enemyFile == (Object)null))
					{
						if (!Utility.IsNullOrWhiteSpace(TranslationManager.GetArrayTranslation("Terminal", ((Object)___enemyFile).name)))
						{
							___enemyFile.creatureName = TranslationManager.GetArrayTranslation("Terminal", ((Object)___enemyFile).name);
						}
						if (!Utility.IsNullOrWhiteSpace(TranslationManager.GetArrayTranslation("Terminal", ((Object)___enemyFile).name, 1)))
						{
							___enemyFile.displayText = TranslationManager.GetArrayTranslation("Terminal", ((Object)___enemyFile).name, 1);
						}
					}
				}
			}
			if (!((Object)(object)terminalNodes != (Object)null) || terminalNodes.allKeywords == null)
			{
				return;
			}
			TerminalKeyword[] allKeywords = terminalNodes.allKeywords;
			foreach (TerminalKeyword val in allKeywords)
			{
				if (((Object)val).name.Contains("LogFile"))
				{
					val.word = TranslationManager.GetArrayTranslation("Sigurd", ((Object)val).name, 0, partialMatch: false, val.word);
					CompatibleNoun[] compatibleNouns = val.defaultVerb.compatibleNouns;
					foreach (CompatibleNoun val2 in compatibleNouns)
					{
						val2.result.creatureName = TranslationManager.GetArrayTranslation("Sigurd", ((Object)val2.noun).name, 1, partialMatch: false, val2.result.creatureName);
						val2.result.displayText = TranslationManager.GetArrayTranslation("Sigurd", ((Object)val2.noun).name, 2, partialMatch: false, val2.result.displayText);
					}
				}
				switch (val.word)
				{
				case "buy":
				{
					CompatibleNoun[] compatibleNouns = val.compatibleNouns;
					foreach (CompatibleNoun val4 in compatibleNouns)
					{
						switch (((Object)val4.result).name)
						{
						case "buyProFlashlight1":
							val4.result.displayText = "프로 손전등을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 프로 손전등을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							val4.result.terminalOptions[0].noun.word = confirmString;
							val4.result.terminalOptions[1].result.displayText = "주문을 취소했습니다.\n\n";
							val4.result.terminalOptions[1].noun.word = denyString;
							break;
						case "buyFlash":
							val4.result.displayText = "손전등을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 손전등을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyLockpickers":
							val4.result.displayText = "자물쇠 따개를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 자물쇠 따개를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyBoombox":
							val4.result.displayText = "붐박스를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 붐박스를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyExtensLadder":
							val4.result.displayText = "연장형 사다리를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 연장형 사다리를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyJetpack":
							val4.result.displayText = "제트팩을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 제트팩을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyRadarBooster":
							val4.result.displayText = "레이더 부스터를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 레이더 부스터를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyShovel":
							val4.result.displayText = "철제 삽을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 철제 삽을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buySpraypaint":
							val4.result.displayText = "스프레이 페인트를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 스프레이 페인트를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyStunGrenade":
							val4.result.displayText = "기절 수류탄을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 기절 수류탄을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyTZP":
							val4.result.displayText = "TZP-흡입제를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 TZP-흡입제를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyWalkieTalkie":
							val4.result.displayText = "무전기를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 무전기를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyZapGun":
							val4.result.displayText = "잽건을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 잽건을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyWeedkiller":
							val4.result.displayText = "제초제를 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 제초제를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyBeltBag":
							val4.result.displayText = "전술 벨트 배낭을 주문하려고 합니다. 수량: [variableAmount]. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "[variableAmount]개의 전술 벨트 배낭을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n\n";
							break;
						case "buyCruiser":
							val4.result.displayText = "컴퍼니 크루저를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "컴퍼니 크루저를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n당사는 이 제품의 품질을 매우 확신하며, 보증이 제공됩니다! 크루저를 분실하거나 파손한 경우, 한 번 무료로 교체할 수 있습니다. 차량을 운반하는 동안에는 아이템을 구매할 수 없습니다.\n\n";
							break;
						case "CozyLightsBuy1":
							val4.result.creatureName = "아늑한 조명";
							val4.result.displayText = "아늑한 조명을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "아늑한 조명을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n전등 스위치를 사용해 아늑한 조명을 활성화하세요.\n\n";
							break;
						case "GreenSuitBuy1":
							val4.result.creatureName = "초록색 슈트";
							val4.result.displayText = "초록색 슈트를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "초록색 슈트를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n\n";
							break;
						case "HazardSuitBuy1":
							val4.result.creatureName = "방호복 슈트";
							val4.result.displayText = "방호복 슈트를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "방호복 슈트를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n\n";
							break;
						case "LoudHornBuy1":
							val4.result.creatureName = "시끄러운 경적";
							val4.result.displayText = "시끄러운 경적을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "시끄러운 경적을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n코드를 길게 당겨 시끄러운 경적을 활성화합니다.\n\n";
							break;
						case "PajamaSuitBuy1":
							val4.result.creatureName = "파자마 슈트";
							val4.result.displayText = "파자마 슈트를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "파자마 슈트를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n\n";
							break;
						case "PurpleSuitBuy1":
							val4.result.creatureName = "보라색 슈트";
							val4.result.displayText = "보라색 슈트를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "보라색 슈트를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n\n";
							break;
						case "RomTableBuy1":
							val4.result.creatureName = "로맨틱한 테이블";
							val4.result.displayText = "로맨틱한 테이블을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "로맨틱한 테이블을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "SofaChairBuy":
							val4.result.creatureName = "소파 의자";
							val4.result.displayText = "소파 의자를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "소파 의자를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n";
							break;
						case "MicrowaveBuy":
							val4.result.creatureName = "전자레인지";
							val4.result.displayText = "전자레인지를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "전자레인지를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n";
							break;
						case "FridgeBuy":
							val4.result.creatureName = "냉장고";
							val4.result.displayText = "냉장고를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "냉장고를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n";
							break;
						case "ElectricChairBuy":
							val4.result.creatureName = "전기 의자";
							val4.result.displayText = "전기 의자를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "전기 의자를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n";
							break;
						case "DoghouseBuy":
							val4.result.creatureName = "개집";
							val4.result.displayText = "개집을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "개집을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n";
							break;
						case "ClassicPaintingBuy":
							val4.result.creatureName = "고전적인 그림";
							val4.result.displayText = "고전적인 그림을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "고전적인 그림을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n";
							break;
						case "ShowerBuy1":
							val4.result.creatureName = "샤워 부스";
							val4.result.displayText = "샤워 부스를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "샤워 부스를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "TableBuy1":
							val4.result.creatureName = "테이블";
							val4.result.displayText = "테이블을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "테이블을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "TeleporterBuy1":
							val4.result.creatureName = "순간이동기";
							val4.result.displayText = "순간이동기를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "순간이동기를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n버튼을 눌러 순간이동기를 활성화합니다. 현재 함선의 레이더에 모니터링 중인 사람을 순간이동시킵니다. 순간이동기를 통해 보유한 아이템은 보관할 수 없습니다. 재충전하는 데 약 10초가 걸립니다.\n\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "InverseTeleporterBuy":
							val4.result.creatureName = "역방향 순간이동기";
							val4.result.displayText = "역방향 순간이동기를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "역방향 순간이동기를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n버튼을 누르고 역방향 순간이동기가 활성화되는 동안 위에 올라가세요.\n\n";
							break;
						case "TelevisionBuy1":
							val4.result.creatureName = "텔레비전";
							val4.result.displayText = "텔레비전을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "텔레비전을 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "ToiletBuy1":
							val4.result.creatureName = "변기";
							val4.result.displayText = "변기를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "변기를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "WelcomeMatBuy":
							val4.result.creatureName = "웰컴 매트";
							val4.result.displayText = "웰컴 매트를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "웰컴 매트를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n";
							break;
						case "SignalTranslatorBuy":
							val4.result.creatureName = "신호 해석기";
							val4.result.displayText = "신호 해석기를 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "신호 해석기를 주문했습니다! 당신의 현재 소지금은 [playerCredits]입니다.\n함선 안의 물체를 재배치하려면 [B]를 누르세요. 배치를 확정하려면 [V]를 누르세요.\n\n\n신호 해석기는 'transmit' 명령 뒤에 10글자 미만의 메시지를 입력해서 사용할 수 있습니다.\n\n";
							break;
						case "FishBowlBuy":
							val4.result.creatureName = "금붕어";
							val4.result.displayText = "금붕어 어항을 주문하려고 합니다. \n아이템의 총 가격: [totalCost].\n\n" + confirmString.ToUpper() + " 또는 " + denyString.ToUpper() + "을(를) 입력하세요.\n\n";
							val4.result.terminalOptions[0].result.displayText = "금붕어 어항을 주문했습니다! 당신의 현재 소지금은 [play