Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AssignRandomWorldName()

void Terraria.GameContent.UI.States.UIWorldCreation.AssignRandomWorldName ( )
inlineprivate

Definition at line 822 of file UIWorldCreation.cs.

823 {
824 do
825 {
826 LocalizedText localizedText = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Composition."));
827 LocalizedText localizedText2 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Adjective."));
828 LocalizedText localizedText3 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Location."));
829 LocalizedText localizedText4 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Noun."));
830 var obj = new
831 {
833 Location = localizedText3.Value,
834 Noun = localizedText4.Value
835 };
836 _optionwWorldName = localizedText.FormatWith(obj);
837 if (Main.rand.Next(10000) == 0)
838 {
839 _optionwWorldName = Language.GetTextValue("SpecialWorldName.TheConstant");
840 }
841 }
842 while (_optionwWorldName.Length > 27);
843 }
static LocalizedText SelectRandom(LanguageSearchFilter filter, UnifiedRandom random=null)
Definition Language.cs:65
static string GetTextValue(string key)
Definition Language.cs:15

References Terraria.GameContent.UI.States.UIWorldCreation._optionwWorldName, Terraria.Lang.CreateDialogFilter(), Terraria.Localization.Language.GetTextValue(), System.obj, Terraria.Main.rand, and Terraria.Localization.Language.SelectRandom().

Referenced by Terraria.GameContent.UI.States.UIWorldCreation.ClickRandomizeName(), and Terraria.GameContent.UI.States.UIWorldCreation.SetDefaultOptions().