tModLoader v2024.08
A mod to make and play Terraria mods
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...

Inherited by DrawableTooltipLine.

Public Member Functions

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

Public Attributes

bool IsModifier
 Whether or not this tooltip gives prefix information. This will make it so that the tooltip is colored either green or red.
 
bool IsModifierBad
 If isModifier is true, this determines whether the tooltip is colored green or red.
 
readonly string Mod
 The name of the mod adding this tooltip line. This will be "Terraria" for all vanilla tooltip lines.
 
readonly string Name
 The name of the tooltip, used to help you identify its function.
 
Color? OverrideColor
 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.
 
string Text
 The actual text that this tooltip displays.
 

Properties

string FullName [get]
 => $"{Mod}/{Name}"
 
bool Visible = true [get]
 

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.

Constructor & Destructor Documentation

◆ TooltipLine()

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.
  • "NoTransfer" - Warning that this item cannot be placed inside itself, used by Money Trough and Void Bag/Vault.
  • "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.
  • "NoSpeedScaling" - Whether this item does not scale with attack speed, added by tModLoader.
  • "SpecialSpeedScaling" - The multiplier this item applies to attack speed bonuses, added by tModLoader.
  • "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 regeneration.
  • "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.
  • "Master" - Whether the item is exclusive to Master Mode.
  • "JourneyResearch" - How many more items need to be researched to unlock duplication in Journey Mode.
  • "ModifiedByMods" - Whether the item has been modified by any mods and what mods when holding shift, added by tModLoader.
  • "BestiaryNotes" - Any bestiary notes, used when hovering items in the bestiary.
  • "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