Terraria ModLoader  0.11.1
A framework for Terraria mods
Terraria.ModLoader.Config.TooltipAttribute Class Reference

This attribute sets a hover tooltip for the annotated property or field to be shown in the ModConfig UI. This can be longer and more descriptive than Label. Starting the tooltip with $ means the tooltip should be interpreted as a Localization key. More...

+ Inheritance diagram for Terraria.ModLoader.Config.TooltipAttribute:
+ Collaboration diagram for Terraria.ModLoader.Config.TooltipAttribute:

Public Member Functions

 TooltipAttribute (string tooltip)
 

Public Attributes

string Tooltip => tooltip.StartsWith("$") ? Localization.Language.GetTextValue(tooltip.Substring(1)) : tooltip
 

Private Attributes

readonly string tooltip
 

Detailed Description

This attribute sets a hover tooltip for the annotated property or field to be shown in the ModConfig UI. This can be longer and more descriptive than Label. Starting the tooltip with $ means the tooltip should be interpreted as a Localization key.

Definition at line 63 of file ConfigAttributes.cs.

Constructor & Destructor Documentation

◆ TooltipAttribute()

Terraria.ModLoader.Config.TooltipAttribute.TooltipAttribute ( string  tooltip)

Definition at line 66 of file ConfigAttributes.cs.

67  {
68  this.tooltip = tooltip;
69  }

Member Data Documentation

◆ tooltip

readonly string Terraria.ModLoader.Config.TooltipAttribute.tooltip
private

Definition at line 65 of file ConfigAttributes.cs.

◆ Tooltip

string Terraria.ModLoader.Config.TooltipAttribute.Tooltip => tooltip.StartsWith("$") ? Localization.Language.GetTextValue(tooltip.Substring(1)) : tooltip

Definition at line 70 of file ConfigAttributes.cs.