tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.TooltipLine Class Reference

This class serves as a way to store information about a line of tooltip for an item. You will create and manipulate objects of this class if you use the ModifyTooltips hook. More...

+ Inheritance diagram for Terraria.ModLoader.TooltipLine:
+ Collaboration diagram for Terraria.ModLoader.TooltipLine:

Public Member Functions

 TooltipLine (Mod mod, string name, string text)
 Creates a tooltip line object with the given mod, identifier name, and text. More...
 

Public Attributes

bool isModifier = false
 Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colored either green or red. More...
 
bool isModifierBad = false
 If isModifier is true, this determines whether the tooltip is colored green or red. More...
 
readonly string mod
 The name of the mod adding this tooltip line. This will be "Terraria" for all vanilla tooltip lines. More...
 
readonly string Name
 The name of the tooltip, used to help you identify its function. More...
 
Color? overrideColor = null
 This completely overrides the color the tooltip is drawn in. If it is set to null (the default value) then the tooltip's color will not be overridden. More...
 
string text
 The actual text that this tooltip displays. More...
 

Detailed Description

This class serves as a way to store information about a line of tooltip for an item. You will create and manipulate objects of this class if you use the ModifyTooltips hook.

Definition at line 8 of file TooltipLine.cs.

Constructor & Destructor Documentation

◆ TooltipLine()

Terraria.ModLoader.TooltipLine.TooltipLine ( Mod  mod,
string  name,
string  text 
)

Creates a tooltip line object with the given mod, identifier name, and text.

These are the names of the vanilla tooltip lines, in the order in which they appear, along with their functions. All of them will have a mod name of "Terraria". Remember that most of these tooltip lines will not exist depending on the item.

  • "ItemName" - The name of the item.
  • "Favorite" - Tells if the item is favorited.
  • "FavoriteDesc" - Tells what it means when an item is favorited.
  • "Social" - Tells if the item is in a social slot.
  • "SocialDesc" - Tells what it means for an item to be in a social slot.
  • "Damage" - The damage value and type of the weapon.
  • "CritChance" - The critical strike chance of the weapon.
  • "Speed" - The use speed of the weapon.
  • "Knockback" - The knockback of the weapon.
  • "FishingPower" - Tells the fishing power of the fishing pole.
  • "NeedsBait" - Tells that a fishing pole requires bait.
  • "BaitPower" - The bait power of the bait.
  • "Equipable" - Tells that an item is equipable.
  • "WandConsumes" - Tells what item a tile wand consumes.
  • "Quest" - Tells that this is a quest item.
  • "Vanity" - Tells that this is a vanity item.
  • "Defense" - Tells how much defense the item gives when equipped.
  • "PickPower" - The item's pickaxe power.
  • "AxePower" - The item's axe power.
  • "HammerPower" - The item's hammer power.
  • "TileBoost" - How much farther the item can reach than normal items.
  • "HealLife" - How much health the item recovers when used.
  • "HealMana" - How much mana the item recovers when used.
  • "UseMana" - Tells how much mana the item consumes upon usage.
  • "Placeable" - Tells if the item is placeable.
  • "Ammo" - Tells if the item is ammo.
  • "Consumable" - Tells if the item is consumable.
  • "Material" - Tells if the item can be used to craft something.
  • "Tooltip#" - A tooltip line of the item. # will be 0 for the first line, 1 for the second, etc.
  • "EtherianManaWarning" - Warning about how the item can't be used without Etherian Mana until the Eternia Crystal has been defeated.
  • "WellFedExpert" - In expert mode, tells that food increases life renegeration.
  • "BuffTime" - Tells how long the item's buff lasts.
  • "OneDropLogo" - The One Drop logo for yoyos.This is a specially-marked tooltip line that has no text.
  • "PrefixDamage" - The damage modifier of the prefix.
  • "PrefixSpeed" - The usage speed modifier of the prefix.
  • "PrefixCritChance" - The critical strike chance modifier of the prefix.
  • "PrefixUseMana" - The mana consumption modifier of the prefix.
  • "PrefixSize" - The melee size modifier of the prefix.
  • "PrefixShootSpeed" - The shootSpeed modifier of the prefix.
  • "PrefixKnockback" - The knockback modifier of the prefix.
  • "PrefixAccDefense" - The defense modifier of the accessory prefix.
  • "PrefixAccMaxMana" - The maximum mana modifier of the accessory prefix.
  • "PrefixAccCritChance" - The critical strike chance modifier of the accessory prefix.
  • "PrefixAccDamage" - The damage modifier of the accessory prefix.
  • "PrefixAccMoveSpeed" - The movement speed modifier of the accessory prefix.
  • "PrefixAccMeleeSpeed" - The melee speed modifier of the accessory prefix.
  • "SetBonus" - The set bonus description of the armor set.
  • "Expert" - Tells whether the item is from expert-mode.
  • "SpecialPrice" - Tells the alternate currency price of an item.
  • "Price" - Tells the price of an item.
Parameters
modThe mod instance
nameThe name of the tooltip
textThe content of the tooltip

Definition at line 96 of file TooltipLine.cs.

96 {
97 this.mod = mod.Name;
98 this.Name = name;
99 this.text = text;
100 }
string text
The actual text that this tooltip displays.
Definition: TooltipLine.cs:21
readonly string mod
The name of the mod adding this tooltip line. This will be "Terraria" for all vanilla tooltip lines.
Definition: TooltipLine.cs:13

References Terraria.ModLoader.TooltipLine.mod, and Terraria.ModLoader.TooltipLine.text.

Member Data Documentation

◆ isModifier

bool Terraria.ModLoader.TooltipLine.isModifier = false

Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colored either green or red.

Definition at line 25 of file TooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ isModifierBad

bool Terraria.ModLoader.TooltipLine.isModifierBad = false

If isModifier is true, this determines whether the tooltip is colored green or red.

Definition at line 29 of file TooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ mod

readonly string Terraria.ModLoader.TooltipLine.mod

The name of the mod adding this tooltip line. This will be "Terraria" for all vanilla tooltip lines.

Definition at line 13 of file TooltipLine.cs.

Referenced by Terraria.ModLoader.TooltipLine.TooltipLine().

◆ Name

readonly string Terraria.ModLoader.TooltipLine.Name

The name of the tooltip, used to help you identify its function.

Definition at line 17 of file TooltipLine.cs.

◆ overrideColor

Color? Terraria.ModLoader.TooltipLine.overrideColor = null

This completely overrides the color the tooltip is drawn in. If it is set to null (the default value) then the tooltip's color will not be overridden.

Definition at line 33 of file TooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine().

◆ text

string Terraria.ModLoader.TooltipLine.text

The actual text that this tooltip displays.

Definition at line 21 of file TooltipLine.cs.

Referenced by Terraria.ModLoader.DrawableTooltipLine.DrawableTooltipLine(), and Terraria.ModLoader.TooltipLine.TooltipLine().