Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SlotLock v1.1.0
SlotLock.dll
Decompiled 8 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SlotLock")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SlotLock")] [assembly: AssemblyTitle("SlotLock")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SlotLock { [BepInPlugin("com.Azura.slotlock", "SlotLock", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PluginGUID = "com.Azura.slotlock"; public const string PluginName = "SlotLock"; public const string PluginVersion = "1.1.0"; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<KeyboardShortcut> LockKey; internal static ConfigEntry<bool> SyncOttoStash; internal static ConfigEntry<Color> FrameColor; private static readonly MethodInfo Survolee = AccessTools.Method(typeof(InventoryGrid), "GetHoveredElement", (Type[])null, (Type[])null); private void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Locked inventory slots keep their item."); LockKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("General", "LockKey", new KeyboardShortcut((KeyCode)107, Array.Empty<KeyCode>()), "With the inventory open, hover a slot of your inventory and press this key to lock or unlock it."); SyncOttoStash = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "SyncWithOttoStash", true, "If OttoStash is installed, a locked slot is also an OttoStash favorite slot, so its store shortcut leaves it alone."); FrameColor = ((BaseUnityPlugin)this).Config.Bind<Color>("General", "FrameColor", new Color(1f, 0.79f, 0.29f, 0.95f), "Color of the frame drawn around locked slots."); FrameColor.SettingChanged += delegate { Cadres.Sprite = null; }; new Harmony("com.Azura.slotlock").PatchAll(); } private void Update() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (!Enabled.Value) { return; } KeyboardShortcut value = LockKey.Value; if (!((KeyboardShortcut)(ref value)).IsDown() || !InventoryGui.IsVisible() || (Object)(object)Player.m_localPlayer == (Object)null || ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus()) || Console.IsVisible() || TextInput.IsVisible()) { return; } InventoryGrid playerGrid = InventoryGui.instance.m_playerGrid; if ((Object)(object)playerGrid != (Object)null) { object? obj = Survolee?.Invoke(playerGrid, null); InventoryElement val = (InventoryElement)((obj is InventoryElement) ? obj : null); if (val != null) { Verrous.Basculer(val.Position); } } } internal static bool EstMonInventaire(Inventory inv) { if (inv != null && (Object)(object)Player.m_localPlayer != (Object)null) { return inv == ((Humanoid)Player.m_localPlayer).GetInventory(); } return false; } } internal static class Verrous { private const string Cle = "SlotLock"; private static Player joueur; private static readonly Dictionary<Vector2i, string> Cases = new Dictionary<Vector2i, string>(); private static readonly MethodInfo Change = AccessTools.Method(typeof(Inventory), "Changed", (Type[])null, (Type[])null); internal static Dictionary<Vector2i, string> Actuels { get { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)(object)joueur) { joueur = localPlayer; Cases.Clear(); if ((Object)(object)localPlayer != (Object)null && localPlayer.m_customData.TryGetValue("SlotLock", out var value)) { string[] array = value.Split(';'); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { '=' }, 2); string[] array3 = array2[0].Split(','); if (array3.Length == 2 && int.TryParse(array3[0], out var result) && int.TryParse(array3[1], out var result2)) { Cases[new Vector2i(result, result2)] = ((array2.Length > 1) ? array2[1] : ""); } } } } return Cases; } } internal static bool EstVerrouillee(Vector2i pos) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Enabled.Value) { return Actuels.ContainsKey(pos); } return false; } internal static void Basculer(Vector2i pos) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { bool flag = !Actuels.ContainsKey(pos); if (flag) { Cases[pos] = ((Humanoid)localPlayer).GetInventory().GetItemAt(pos.x, pos.y)?.m_shared.m_name ?? ""; } else { Cases.Remove(pos); } Sauver(); OttoStash.Synchroniser(localPlayer, pos, flag); string objet = ((flag && Cases[pos] != "") ? Localization.instance.Localize(Cases[pos]) : ""); MessageHud instance = MessageHud.instance; if (instance != null) { instance.ShowMessage((MessageType)1, Textes.Message(flag, objet), 0, (Sprite)null, false, true); } } } internal static void Reserver(Vector2i pos, string nom) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (Actuels.TryGetValue(pos, out var value) && value != nom && !string.IsNullOrEmpty(nom)) { Cases[pos] = nom; Sauver(); } } internal static void RemettreEnPlace(Player p, ICollection<Vector2i> rangees) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Enabled.Value || (Object)(object)p == (Object)null || (Object)(object)p != (Object)(object)Player.m_localPlayer || Actuels.Count == 0) { return; } Inventory inventory = ((Humanoid)p).GetInventory(); bool flag = false; foreach (KeyValuePair<Vector2i, string> v in Actuels.ToList()) { if (!(v.Value == "") && inventory.GetItemAt(v.Key.x, v.Key.y) == null) { ItemData val = (from i in inventory.GetAllItems() where i?.m_shared != null && i.m_shared.m_name == v.Value && !EstVerrouillee(i.m_gridPos) && rangees.Contains(i.m_gridPos) orderby i.m_stack descending select i).FirstOrDefault(); if (val != null) { val.m_gridPos = v.Key; flag = true; } } } if (flag) { Change?.Invoke(inventory, new object[2] { false, false }); } } private static void Sauver() { if ((Object)(object)joueur == (Object)null) { return; } if (Cases.Count == 0) { joueur.m_customData.Remove("SlotLock"); return; } joueur.m_customData["SlotLock"] = string.Join(";", Cases.Select((KeyValuePair<Vector2i, string> c) => $"{c.Key.x},{c.Key.y}={c.Value}")); } } internal static class OttoStash { private static readonly Type Config = AccessTools.TypeByName("OttoStash.Patches.Favoriting.UserConfig"); private static readonly MethodInfo Get = ((Config != null) ? AccessTools.Method(Config, "GetPlayerConfig", (Type[])null, (Type[])null) : null); private static readonly MethodInfo Est = ((Config != null) ? AccessTools.Method(Config, "IsSlotFavorited", (Type[])null, (Type[])null) : null); private static readonly MethodInfo Basculer = ((Config != null) ? AccessTools.Method(Config, "ToggleSlotFavoriting", (Type[])null, (Type[])null) : null); internal static void Synchroniser(Player p, Vector2i pos, bool verrouille) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.SyncOttoStash.Value || Get == null || Est == null || Basculer == null) { return; } try { object obj = Get.Invoke(null, new object[1] { p.GetPlayerID() }); if ((bool)Est.Invoke(obj, new object[1] { pos }) != verrouille) { Basculer.Invoke(obj, new object[1] { pos }); } } catch (Exception ex) { Debug.LogWarning((object)("[SlotLock] OttoStash favorite not updated: " + ex.Message)); } } } internal static class InventorySlots { internal static readonly Type Type = AccessTools.TypeByName("InventorySlots.InventorySlotsPlugin"); internal static readonly MethodInfo CasesDuTri = ((Type != null) ? AccessTools.Method(Type, "GetPlayerActionSlots", (Type[])null, (Type[])null) : null); internal static readonly MethodInfo Protege = ((Type != null) ? AccessTools.Method(Type, "IsFavoriteProtected", (Type[])null, (Type[])null) : null); internal static readonly MethodInfo Tri = ((Type != null) ? AccessTools.Method(Type, "SortPlayerInventory", (Type[])null, (Type[])null) : null); private static readonly MethodInfo CaseUtilisable = ((Type != null) ? AccessTools.Method(Type, "IsUsableRegularCell", new Type[3] { typeof(Inventory), typeof(Player), typeof(Vector2i) }, (Type[])null) : null); internal static bool CaseNormale(Inventory inv, Player p, Vector2i pos) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (CaseUtilisable == null) { return true; } try { return (bool)CaseUtilisable.Invoke(null, new object[3] { inv, p, pos }); } catch { return true; } } internal static ICollection<Vector2i> Rangees(Player p, Inventory inv) { try { return new HashSet<Vector2i>((List<Vector2i>)CasesDuTri.Invoke(null, new object[4] { p, inv, false, true })); } catch { return new HashSet<Vector2i>(); } } } [HarmonyPatch] internal static class InventorySlots_Cases { private static bool Prepare() { return InventorySlots.CasesDuTri != null; } private static MethodBase TargetMethod() { return InventorySlots.CasesDuTri; } private static void Postfix(Inventory inventory, List<Vector2i> __result) { if (__result != null && Plugin.Enabled.Value && Plugin.EstMonInventaire(inventory)) { __result.RemoveAll(Verrous.EstVerrouillee); } } } [HarmonyPatch] internal static class InventorySlots_Protege { private static bool Prepare() { return InventorySlots.Protege != null; } private static MethodBase TargetMethod() { return InventorySlots.Protege; } private static void Postfix(Inventory inventory, ItemData item, ref bool __result) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!__result && item != null && Plugin.Enabled.Value && Plugin.EstMonInventaire(inventory) && Verrous.EstVerrouillee(item.m_gridPos)) { __result = true; } } } [HarmonyPatch] internal static class InventorySlots_Tri { private static bool Prepare() { if (InventorySlots.Tri != null) { return InventorySlots.CasesDuTri != null; } return false; } private static MethodBase TargetMethod() { return InventorySlots.Tri; } private static void Prefix(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)player != (Object)(object)Player.m_localPlayer || !Plugin.Enabled.Value) { return; } try { Verrous.RemettreEnPlace(player, InventorySlots.Rangees(player, ((Humanoid)player).GetInventory())); } catch (Exception ex) { Debug.LogWarning((object)("[SlotLock] Reserved items not put back before the sort: " + ex.Message)); } } } internal static class Textes { internal static string Message(bool verrouille, string objet) { if (verrouille) { if (!(objet != "")) { return Traductions.Texte("verrou_vide"); } return Traductions.Format("verrou_objet", null, new object[1] { objet }); } return Traductions.Texte("deverrou"); } } [HarmonyPatch(typeof(InventoryGrid), "UpdateGui")] internal static class Cadres { internal static Sprite Sprite; private static readonly FieldRef<InventoryGrid, List<InventoryElement>> Elements = AccessTools.FieldRefAccess<InventoryGrid, List<InventoryElement>>("m_elements"); private static void Postfix(InventoryGrid __instance) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)InventoryGui.instance == (Object)null || (Object)(object)__instance != (Object)(object)InventoryGui.instance.m_playerGrid || (Object)(object)Player.m_localPlayer == (Object)null) { return; } foreach (InventoryElement item in Elements.Invoke(__instance)) { if (!((Object)(object)item == (Object)null)) { bool flag = Verrous.EstVerrouillee(item.Position); Transform val = ((Component)item).transform.Find("SlotLock_Frame"); if (flag && (Object)(object)val == (Object)null) { val = Creer(((Component)item).transform); } if ((Object)(object)val != (Object)null && ((Component)val).gameObject.activeSelf != flag) { ((Component)val).gameObject.SetActive(flag); } } } } private static Transform Creer(Transform parent) { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Sprite == (Object)null) { Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false) { name = "SlotLock_Frame", filterMode = (FilterMode)1 }; Color value = Plugin.FrameColor.Value; Color val2 = default(Color); ((Color)(ref val2))..ctor(0f, 0f, 0f, 0f); for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { val.SetPixel(j, i, (j < 3 || i < 3 || j >= 29 || i >= 29) ? value : val2); } } val.Apply(); Sprite = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(4f, 4f, 4f, 4f)); } GameObject val3 = new GameObject("SlotLock_Frame", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val4 = (RectTransform)val3.transform; ((Transform)val4).SetParent(parent, false); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.offsetMin = new Vector2(1f, 1f); val4.offsetMax = new Vector2(-1f, -1f); Image component = val3.GetComponent<Image>(); component.sprite = Sprite; component.type = (Type)1; ((Graphic)component).raycastTarget = false; return val3.transform; } } [HarmonyPatch(typeof(InventoryGrid), "DropItem")] internal static class DepotManuel { private static void Postfix(InventoryGrid __instance, Vector2i pos, bool __result) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (__result && !((Object)(object)InventoryGui.instance == (Object)null) && !((Object)(object)__instance != (Object)(object)InventoryGui.instance.m_playerGrid) && !((Object)(object)Player.m_localPlayer == (Object)null)) { ItemData itemAt = ((Humanoid)Player.m_localPlayer).GetInventory().GetItemAt(pos.x, pos.y); if (itemAt != null) { Verrous.Reserver(pos, itemAt.m_shared.m_name); } } } } [HarmonyPatch] internal static class Transferts { private static readonly FieldRef<Inventory, List<ItemData>> Liste = AccessTools.FieldRefAccess<Inventory, List<ItemData>>("m_inventory"); private static IEnumerable<MethodBase> TargetMethods() { yield return AccessTools.Method(typeof(Inventory), "StackAll", new Type[2] { typeof(Inventory), typeof(bool) }, (Type[])null); yield return AccessTools.Method(typeof(Inventory), "MoveAll", new Type[1] { typeof(Inventory) }, (Type[])null); } private static void Prefix(Inventory fromInventory, out List<ItemData> __state) { __state = null; if (!Plugin.Enabled.Value || !Plugin.EstMonInventaire(fromInventory)) { return; } List<ItemData> list = Liste.Invoke(fromInventory); __state = list.Where((ItemData i) => Verrous.EstVerrouillee(i.m_gridPos)).ToList(); foreach (ItemData item in __state) { list.Remove(item); } } private static Exception Finalizer(Exception __exception, Inventory fromInventory, List<ItemData> __state) { if (__state != null && __state.Count > 0) { Liste.Invoke(fromInventory).AddRange(__state); } return __exception; } } [HarmonyPatch(typeof(Inventory), "AddItem", new Type[] { typeof(ItemData) })] internal static class AjoutEnCours { internal static string Nom; private static void Prefix(ItemData item) { Nom = item?.m_shared.m_name; } private static void Finalizer() { Nom = null; } } [HarmonyPatch(typeof(Inventory), "FindEmptySlot")] internal static class CaseLibre { private static void Postfix(Inventory __instance, bool topFirst, ref Vector2i __result) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Enabled.Value || !Plugin.EstMonInventaire(__instance)) { return; } if (AjoutEnCours.Nom != null) { foreach (KeyValuePair<Vector2i, string> actuel in Verrous.Actuels) { if (actuel.Value == AjoutEnCours.Nom && __instance.GetItemAt(actuel.Key.x, actuel.Key.y) == null) { __result = actuel.Key; return; } } } if (__result.x < 0 || !Verrous.Actuels.ContainsKey(__result)) { return; } Player localPlayer = Player.m_localPlayer; int width = __instance.GetWidth(); int height = __instance.GetHeight(); Vector2i val = default(Vector2i); for (int i = 0; i < height; i++) { int num = (topFirst ? i : (height - 1 - i)); for (int j = 0; j < width; j++) { ((Vector2i)(ref val))..ctor(j, num); if (__instance.GetItemAt(j, num) == null && !Verrous.Actuels.ContainsKey(val) && InventorySlots.CaseNormale(__instance, localPlayer, val)) { __result = val; return; } } } __result = new Vector2i(-1, -1); } } internal static class Traductions { internal static readonly string[] Langues = new string[36] { "English", "Swedish", "French", "Italian", "German", "Spanish", "Russian", "Romanian", "Bulgarian", "Macedonian", "Finnish", "Danish", "Norwegian", "Icelandic", "Turkish", "Lithuanian", "Czech", "Hungarian", "Slovak", "Polish", "Dutch", "Portuguese_European", "Portuguese_Brazilian", "Chinese", "Chinese_Trad", "Japanese", "Korean", "Hindi", "Thai", "Abenaki", "Croatian", "Georgian", "Greek", "Serbian", "Ukrainian", "Latvian" }; private static readonly string[] Cultures = new string[36] { "en-US", "sv-SE", "fr-FR", "it-IT", "de-DE", "es-ES", "ru-RU", "ro-RO", "bg-BG", "mk-MK", "fi-FI", "da-DK", "nb-NO", "is-IS", "tr-TR", "lt-LT", "cs-CZ", "hu-HU", "sk-SK", "pl-PL", "nl-NL", "pt-PT", "pt-BR", "zh-CN", "zh-TW", "ja-JP", "ko-KR", "hi-IN", "th-TH", "en-US", "hr-HR", "ka-GE", "el-GR", "sr-Latn-RS", "uk-UA", "lv-LV" }; internal static readonly Dictionary<string, string[]> Textes = new Dictionary<string, string[]> { ["verrou_objet"] = new string[36] { "Slot locked: {0} stays there", "Plats låst: {0} stannar där", "Case verrouillée : {0} y reste", "Casella bloccata: {0} resta lì", "Platz gesperrt: {0} bleibt dort", "Casilla bloqueada: {0} se queda ahí", "Ячейка заблокирована: {0} остаётся на месте", "Slot blocat: {0} rămâne acolo", "Клетката е заключена: {0} остава там", "Полето е заклучено: {0} останува таму", "Paikka lukittu: {0} pysyy siinä", "Plads låst: {0} bliver der", "Plass låst: {0} blir der", "Hólf læst: {0} verður þar", "Yuva kilitlendi: {0} orada kalır", "Langelis užrakintas: {0} lieka ten", "Políčko zamčeno: {0} zůstane na místě", "Hely zárolva: {0} ott marad", "Políčko zamknuté: {0} zostane na mieste", "Miejsce zablokowane: {0} zostaje na miejscu", "Vak vergrendeld: {0} blijft daar", "Espaço bloqueado: {0} fica lá", "Espaço travado: {0} fica ali", "格子已锁定:{0} 会留在原处", "格子已鎖定:{0} 會留在原處", "スロットをロック:{0} はそこに残ります", "칸 잠금: {0}은(는) 그 자리에 남습니다", "ख\u093eन\u093e ल\u0949क क\u093fय\u093e गय\u093e: {0} वह\u0940\u0902 रह\u0947ग\u093e", "ล\u0e47อกช\u0e48องแล\u0e49ว: {0} จะอย\u0e39\u0e48ท\u0e35\u0e48เด\u0e34ม", null, "Mjesto zaključano: {0} ostaje ondje", "უჯრა ჩაკეტილია: {0} იქვე დარჩება", "Η θέση κλειδώθηκε: {0} μένει εκεί", "Mesto zaključano: {0} ostaje tamo", "Комірку заблоковано: {0} залишається на місці", "Vieta bloķēta: {0} paliek tur" }, ["verrou_vide"] = new string[36] { "Slot locked (empty)", "Plats låst (tom)", "Case verrouillée (vide)", "Casella bloccata (vuota)", "Platz gesperrt (leer)", "Casilla bloqueada (vacía)", "Ячейка заблокирована (пустая)", "Slot blocat (gol)", "Клетката е заключена (празна)", "Полето е заклучено (празно)", "Paikka lukittu (tyhjä)", "Plads låst (tom)", "Plass låst (tom)", "Hólf læst (tómt)", "Yuva kilitlendi (boş)", "Langelis užrakintas (tuščias)", "Políčko zamčeno (prázdné)", "Hely zárolva (üres)", "Políčko zamknuté (prázdne)", "Miejsce zablokowane (puste)", "Vak vergrendeld (leeg)", "Espaço bloqueado (vazio)", "Espaço travado (vazio)", "格子已锁定(空)", "格子已鎖定(空)", "スロットをロック(空き)", "칸 잠금 (비어 있음)", "ख\u093eन\u093e ल\u0949क क\u093fय\u093e गय\u093e (ख\u093eल\u0940)", "ล\u0e47อกช\u0e48องแล\u0e49ว (ว\u0e48าง)", null, "Mjesto zaključano (prazno)", "უჯრა ჩაკეტილია (ცარიელი)", "Η θέση κλειδώθηκε (κενή)", "Mesto zaključano (prazno)", "Комірку заблоковано (порожня)", "Vieta bloķēta (tukša)" }, ["deverrou"] = new string[36] { "Slot unlocked", "Plats upplåst", "Case déverrouillée", "Casella sbloccata", "Platz entsperrt", "Casilla desbloqueada", "Ячейка разблокирована", "Slot deblocat", "Клетката е отключена", "Полето е отклучено", "Paikan lukitus avattu", "Plads låst op", "Plass låst opp", "Hólf opnað", "Yuva kilidi açıldı", "Langelis atrakintas", "Políčko odemčeno", "Hely feloldva", "Políčko odomknuté", "Miejsce odblokowane", "Vak ontgrendeld", "Espaço desbloqueado", "Espaço destravado", "格子已解锁", "格子已解鎖", "スロットのロックを解除", "칸 잠금 해제", "ख\u093eन\u093e अनल\u0949क क\u093fय\u093e गय\u093e", "ปลดล\u0e47อกช\u0e48องแล\u0e49ว", null, "Mjesto otključano", "უჯრა გაიხსნა", "Η θέση ξεκλειδώθηκε", "Mesto otključano", "Комірку розблоковано", "Vieta atbloķēta" } }; internal static string LangueDuJeu { get { if (Localization.instance == null) { return "English"; } return Localization.instance.GetSelectedLanguage(); } } internal static string Texte(string cle, string langue = null) { if (!Textes.TryGetValue(cle, out var value)) { return cle; } int num = Array.IndexOf(Langues, langue ?? LangueDuJeu); if (num <= 0 || num >= value.Length || string.IsNullOrEmpty(value[num])) { return value[0]; } return value[num]; } internal static string Format(string cle, string langue, object[] valeurs) { string text = Texte(cle, langue); if (valeurs != null && valeurs.Length != 0) { return string.Format(Culture(langue), text, valeurs); } return text; } internal static CultureInfo Culture(string langue = null) { int num = Array.IndexOf(Langues, langue ?? LangueDuJeu); try { return CultureInfo.GetCultureInfo((num >= 0) ? Cultures[num] : "en-US"); } catch { return CultureInfo.InvariantCulture; } } } }