|
TModLoader v1.4.4.9
TModLoader source code documentation
|
|
inline |
Creates a string from this LocalizedText populated with data from the provided obj parameter. The properties of the provided object are substituted by name into the placeholders of the original text. For example, when used with M:Terraria.Lang.CreateDialogSubstitutionObject(Terraria.NPC), the text "{Nurse}" will be replaced with the first name of the Nurse in the world. Modded substitutions are not currently supported.
When used in conjunction with M:Terraria.Localization.Language.SelectRandom(Terraria.Localization.LanguageSearchFilter,Terraria.Utilities.UnifiedRandom) and M:Terraria.Lang.CreateDialogFilter(System.String,System.Object), simple boolean conditions expressed in each LocalizedText can be used to filter a collection of LocalizedText.
M:Terraria.Localization.LocalizedText.Format(System.Object[]) is more commonly used to format LocalizedText placeholders. That method replaces placeholders such as "{0}", "{1}", etc with the string representation of the corresponding objects provided.
| obj |
Definition at line 64 of file LocalizedText.cs.
References Terraria.Localization.LocalizedText._substitutionRegex, Terraria.Localization.LocalizedText.ToString(), and Terraria.Localization.LocalizedText.Value.
Referenced by Terraria.GameContent.UI.GameTipsDisplay.GameTip.GameTip(), Terraria.Lang.BartenderHelpText(), Terraria.Lang.DyeTraderQuestChat(), and Terraria.Main.HelpText().
Here is the call graph for this function:
Here is the caller graph for this function: