Esempio n. 1
0
        /// <summary>
        ///     Load translations for this mod.
        /// </summary>
        private void LoadTranslation()
        {
            var currentLanguage    = MyAPIGateway.Session.Config.Language;
            var supportedLanguages = new HashSet <MyLanguagesEnum>();

            switch (currentLanguage)
            {
            case MyLanguagesEnum.English:
                Lang.Add(MyLanguagesEnum.English, new Dictionary <string, string> {
                    { nameof(ModText.Description_Save), "Saves a Color Set with the given name." },
                    { nameof(ModText.Description_Load), "Loads a Color Set with the given name." },
                    { nameof(ModText.Description_Remove), "Removes a Color Set with given name." },
                    { nameof(ModText.Description_List), "Lists all available color sets." },
                    { nameof(ModText.Description_Help), "Shows this help page." },
                    { nameof(ModText.NoColorSetFound), "No color set with name '{0}' found." },
                    { nameof(ModText.NoColorSetsAvailable), "No color sets available." },
                    { nameof(ModText.ColorSetRemoved), "Color set '{0}' removed." },
                    { nameof(ModText.ColorSetSaved), "Color set '{0}' saved." }
                });
                break;

            case MyLanguagesEnum.German:
                Lang.Add(MyLanguagesEnum.German, new Dictionary <string, string> {
                    { nameof(ModText.Description_Save), "Speichert ein Color Set mit dem angegebenen namen." },
                    { nameof(ModText.Description_Load), "Lädt ein Color Set mit dem angegebenen Namen." },
                    { nameof(ModText.Description_Remove), "Entfernt ein Color Set mit dem angegebenen Namen." },
                    { nameof(ModText.Description_List), "Listet alle verfügbaren Color Sets auf." },
                    { nameof(ModText.Description_Help), "Zeigt diese Hilfe-Seite" },
                    { nameof(ModText.NoColorSetFound), "Kein Color Set mit dem namen {0} gefunden." },
                    { nameof(ModText.NoColorSetsAvailable), "Keine Color Sets verfügbar." },
                    { nameof(ModText.ColorSetRemoved), "Color Set '{0}' entfernt." },
                    { nameof(ModText.ColorSetSaved), "Color Set '{0}' gespeichert." }
                });
                break;
            }

            Texts.LoadSupportedLanguages(supportedLanguages);
            if (supportedLanguages.Contains(currentLanguage))
            {
                Texts.LoadTexts(currentLanguage);
            }
            else if (supportedLanguages.Contains(MyLanguagesEnum.English))
            {
                Texts.LoadTexts();
            }
        }
Esempio n. 2
0
        private static void OpenYNDialogue(GameObject shiny, string text, Func <bool> canBuy)
        {
            FSMUtility.LocateFSM(GameObject.Find("DialogueManager"), "Box Open YN").SendEvent("BOX UP YN");
            FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables
            .GetFsmGameObject("Requester").Value = shiny;

            Lang.Add("UI", "RANDOMIZER_YN_DIALOGUE", text);
            if (!canBuy())
            {
                KillGeoText().RunCoroutine();
            }

            FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables
            .GetFsmInt("Toll Cost").Value = 0;
            FSMUtility.LocateFSM(GameObject.Find("Text YN"), "Dialogue Page Control").FsmVariables
            .GetFsmGameObject("Geo Text").Value.SetActive(true);

            GameObject.Find("Text YN").GetComponent <DialogueBox>().StartConversation("RANDOMIZER_YN_DIALOGUE", "UI");
        }
Esempio n. 3
0
        private static void ApplyHint(string locId, string hintSheet, string hintKey)
        {
            string itemId = RandomizerMod.Instance.ItemPlacements.FirstOrDefault(i => i.Value == locId).Key;

            if (itemId == null)
            {
                return;
            }

            itemId = itemId.Substring(0, itemId.IndexOf('.'));
            Item item = RandoResources.Items.FirstOrDefault(i => i.Id == itemId);

            if (item == null || !item.TryGetNextStage(out ItemStage stage))
            {
                return;
            }

            Lang.Add(hintSheet, hintKey, Lang.Get(stage.Popup.Name, "UI"));
        }