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

◆ AssignRandomWorldName()

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

Definition at line 867 of file UIWorldCreation.cs.

868 {
869 do
870 {
871 LocalizedText localizedText = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Composition."));
872 LocalizedText localizedText4 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Adjective."));
873 LocalizedText localizedText2 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Location."));
874 LocalizedText localizedText3 = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Noun."));
875 var obj = new
876 {
878 Location = localizedText2.Value,
879 Noun = localizedText3.Value
880 };
881 _optionwWorldName = localizedText.FormatWith(obj);
882 if (Main.rand.Next(10000) == 0)
883 {
884 _optionwWorldName = Language.GetTextValue("SpecialWorldName.TheConstant");
885 }
886 }
887 while (_optionwWorldName.Length > 27);
888 }
static LocalizedText SelectRandom(LanguageSearchFilter filter, UnifiedRandom random=null)
Selects a single random LocalizedText that satisfies the filter parameter. Typically used with M:Ter...
Definition Language.cs:107
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
Contains the localization value corresponding to a key for the current game language....

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function: