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

◆ ModifyTooltips()

override void Terraria.ModLoader.Default.UnloadedItem.ModifyTooltips ( List< TooltipLine > tooltips)
inlinevirtual

Allows you to modify all the tooltips that display for this item. See here for information about TooltipLine. To hide tooltips, please use M:Terraria.ModLoader.TooltipLine.Hide and defensive coding.

Parameters
tooltipsThe tooltips.

Reimplemented from Terraria.ModLoader.ModItem.

Definition at line 38 of file UnloadedItem.cs.

39 {
40 for (int i = 0; i < tooltips.Count; i++)
41 {
42 if (tooltips[i].Name == "Tooltip0")
43 {
44 tooltips[i].Text = Language.GetTextValue(this.GetLocalizationKey("UnloadedItemModTooltip"), ModName);
45 }
46 else if (tooltips[i].Name == "Tooltip1")
47 {
48 tooltips[i].Text = Language.GetTextValue(this.GetLocalizationKey("UnloadedItemItemNameTooltip"), ItemName);
49 }
50 }
51 }
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
string Name
The internal name of this instance.
Definition IModType.cs:13

References Terraria.Localization.Language.GetTextValue().

+ Here is the call graph for this function: