// ----------------------------------------------------------------------------------- // OnLangChanged // ----------------------------------------------------------------------------------- public void OnLangChanged() { LanguageTemplate tmpl = LanguageLibrary.GetTemplate(languageDropdown.options[languageDropdown.value].text); Obj.GetGame.language = tmpl; Show(); }
// ------------------------------------------------------------------------------- // ShowError // Displays an error message using the provided string as DescriptionTemplate name // ------------------------------------------------------------------------------- public void ShowError(string error) { SoundController.Play(errorSound); string tmp_vocab = LanguageLibrary.GetText(error); gameScreen.ShowError(tmp_vocab); }
// ----------------------------------------------------------------------------------- // getTooltip // ----------------------------------------------------------------------------------- public string getTooltip() { if (isValid && identified) { tooltip = "<b>" + template.description.getName; // Name if (level > 0) // Level { tooltip += " +" + level; } else if (level < 0) { tooltip += " " + level; } tooltip += "</b>\n"; tooltip += "<i>" + template.description.getDescription + "</i>\n"; // Description if (template is ItemEquipableTemplate) // Durability { tooltip += LanguageLibrary.GetText("_durability") + ": " + durability + "/" + template.maxDurability + "\n"; } if (template is ItemUseableTemplate || template is ItemEquipableTemplate && template.maxCharges > 0) // Charges { tooltip += LanguageLibrary.GetText("_charges") + ": " + charges + "/" + template.maxCharges + "\n"; } } return(tooltip); }
// ----------------------------------------------------------------------------------- // Show // ----------------------------------------------------------------------------------- public override void Show() { optionsHeadline.text = DescriptionLibrary.GetName("Hdl_Options"); musicVolumeHeadline.text = DescriptionLibrary.GetName("Hdl_MusicVolume"); soundVolumeHeadline.text = DescriptionLibrary.GetName("Hdl_SoundVolume"); continueButton.GetComponentInChildren <Text>().text = DescriptionLibrary.GetName("Btn_Confirm"); languageDropdown.options = LanguageLibrary.GetAllTemplates().Select( p => new Dropdown.OptionData(p.name) ).ToList(); base.Show(); }
// ------------------------------------------------------------------------------- // ShowText // ------------------------------------------------------------------------------- public void ShowText(string vocab) { string tmp_vocab = LanguageLibrary.GetText(vocab); gameScreen.ShowError(tmp_vocab); }