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

This serves as a place for you to program behaviors of equipment textures. This is useful for equipment slots that do not have any item associated with them (for example, the Werewolf buff). Note that this class is purely for visual effects. More...

Public Member Functions

virtual void ArmorArmGlowMask (Player drawPlayer, float shadow, ref int glowMask, ref Color color)
 Allows you to modify which glow mask and in what color is drawn on the player's arms. Note that this is only called for body equipment textures. By default this will call the associated ModItem's ArmorArmGlowMask if there is an associated ModItem. More...
 
virtual void ArmorSetShadows (Player player)
 Allows you to determine special visual effects this vanity set has on the player without having to code them yourself. By default this will call the associated ModItem's ArmorSetShadows if there is an associated ModItem. More...
 
virtual void DrawArmorColor (Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
 Allows you to modify the colors in which this armor texture and surrounding accessories are drawn, in addition to which glow mask and in what color is drawn. By default this will call the associated ModItem's DrawArmorColor if there is an associated ModItem. More...
 
virtual bool DrawBody ()
 Return false to hide the player's body when this body equipment texture is worn. By default this will return the associated ModItem's DrawBody, or true if there is no associated ModItem. More...
 
virtual void DrawHair (ref bool drawHair, ref bool drawAltHair)
 Allows you to determine whether the player's hair or alt (hat) hair draws when this head equipment texture is worn. By default both flags will be false. If there is an associated ModItem, by default this will call that ModItem's DrawHair. More...
 
virtual void DrawHands (ref bool drawHands, ref bool drawArms)
 Allows you to determine whether the skin/shirt on the player's arms and hands are drawn when this body equipment texture is worn. By default both flags will be false. Note that if drawHands is false, the arms will not be drawn either. If there is an associated ModItem, by default this will call that ModItem's DrawHands. More...
 
virtual bool DrawHead ()
 Return false to hide the player's head when this head equipment texture is worn. By default this will return the associated ModItem's DrawHead, or true if there is no associated ModItem. More...
 
virtual bool DrawLegs ()
 Return false to hide the player's legs when this leg or shoe equipment texture is worn. By default this will return the associated ModItem's DrawLegs, or true if there is no associated ModItem. More...
 
virtual void HorizontalWingSpeeds (Player player, ref float speed, ref float acceleration)
 Allows you to modify horizontal wing speeds. More...
 
virtual bool IsVanitySet (int head, int body, int legs)
 Returns whether or not the head armor, body armor, and leg armor textures make up a set. This hook is used for the PreUpdateVanitySet, UpdateVanitySet, and ArmorSetShadow hooks. By default this will return the same thing as the associated ModItem's IsVanitySet, or false if no ModItem is associated. More...
 
virtual void PreUpdateVanitySet (Player player)
 Allows you to create special effects (such as the necro armor's hurt noise) when the player wears this equipment texture's vanity set. This hook is called regardless of whether the player is frozen in any way. By default this will call the associated ModItem's PreUpdateVanitySet if there is an associated ModItem. More...
 
virtual void SetMatch (bool male, ref int equipSlot, ref bool robes)
 Allows you to modify the equipment that the player appears to be wearing. This hook will only be called for head, body and leg textures. Note that equipSlot is not the same as the item type of the armor the player will appear to be wearing. Worn equipment has a separate set of IDs. You can find the vanilla equipment IDs by looking at the headSlot, bodySlot, and legSlot fields for items, and modded equipment IDs by looking at EquipLoader. If this hook is called on body armor, equipSlot allows you to modify the leg armor the player appears to be wearing. If you modify it, make sure to set robes to true. If this hook is called on leg armor, equipSlot allows you to modify the leg armor the player appears to be wearing, and the robes parameter is useless. By default, if there is an associated ModItem, this will call that ModItem's SetMatch. More...
 
virtual void UpdateVanity (Player player, EquipType type)
 Allows you to create special effects (such as dust) when this equipment texture is displayed on the player under the given equipment type. By default this will call the associated ModItem's UpdateVanity if there is an associated ModItem. More...
 
virtual void UpdateVanitySet (Player player)
 Allows you to create special effects (such as dust) when the player wears this equipment texture's vanity set. This hook will only be called if the player is not frozen in any way. By default this will call the associated ModItem's UpdateVanitySet if there is an associated ModItem. More...
 
virtual void VerticalWingSpeeds (Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
 Allows you to modify vertical wing speeds. More...
 
virtual bool WingUpdate (Player player, bool inUse)
 Allows for wing textures to do various things while in use. "inUse" is whether or not the jump button is currently pressed. Called when this wing texture visually appears on the player. Use to animate wings, create dusts, invoke sounds, and create lights. By default this will call the associated ModItem's WingUpdate if there is an associated ModItem. More...
 

Properties

ModItem item [get, set]
 The item that is associated with this equipment texture. Null if no item is associated with this. More...
 
Mod mod [get, set]
 The mod that added this equipment texture. More...
 
string Name [get, set]
 The internal name of this equipment texture. More...
 
int Slot [get, set]
 The slot (internal ID) of this equipment texture. More...
 
string Texture [get, set]
 The name and folders of the texture file used by this equipment texture. More...
 
EquipType Type [get, set]
 The type of equipment that this equipment texture is used as. More...
 

Detailed Description

This serves as a place for you to program behaviors of equipment textures. This is useful for equipment slots that do not have any item associated with them (for example, the Werewolf buff). Note that this class is purely for visual effects.

Definition at line 8 of file EquipTexture.cs.

Member Function Documentation

◆ ArmorArmGlowMask()

virtual void Terraria.ModLoader.EquipTexture.ArmorArmGlowMask ( Player  drawPlayer,
float  shadow,
ref int  glowMask,
ref Color  color 
)
virtual

Allows you to modify which glow mask and in what color is drawn on the player's arms. Note that this is only called for body equipment textures. By default this will call the associated ModItem's ArmorArmGlowMask if there is an associated ModItem.

Parameters
drawPlayer
shadow
glowMask
color

Definition at line 194 of file EquipTexture.cs.

194 {
195 if (item != null) {
196 item.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
197 }
198 }
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this.
Definition: EquipTexture.cs:53
virtual void ArmorArmGlowMask(Player drawPlayer, float shadow, ref int glowMask, ref Color color)
Allows you to modify which glow mask and in what color is drawn on the player's arms....
Definition: ModItem.cs:761

References Terraria.ModLoader.ModItem.ArmorArmGlowMask(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.ArmorArmGlowMask().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ArmorSetShadows()

virtual void Terraria.ModLoader.EquipTexture.ArmorSetShadows ( Player  player)
virtual

Allows you to determine special visual effects this vanity set has on the player without having to code them yourself. By default this will call the associated ModItem's ArmorSetShadows if there is an associated ModItem.

Parameters
player

Definition at line 107 of file EquipTexture.cs.

107 {
108 if (item != null) {
109 item.ArmorSetShadows(player);
110 }
111 }
virtual void ArmorSetShadows(Player player)
Allows you to determine special visual effects this vanity set has on the player without having to co...
Definition: ModItem.cs:637

References Terraria.ModLoader.ModItem.ArmorSetShadows(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.ArmorSetShadows().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawArmorColor()

virtual void Terraria.ModLoader.EquipTexture.DrawArmorColor ( Player  drawPlayer,
float  shadow,
ref Color  color,
ref int  glowMask,
ref Color  glowMaskColor 
)
virtual

Allows you to modify the colors in which this armor texture and surrounding accessories are drawn, in addition to which glow mask and in what color is drawn. By default this will call the associated ModItem's DrawArmorColor if there is an associated ModItem.

Parameters
drawPlayer
shadow
color
glowMask
glowMaskColor

Definition at line 181 of file EquipTexture.cs.

181 {
182 if (item != null) {
183 item.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
184 }
185 }
virtual void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
Allows you to modify the colors in which this armor and surrounding accessories are drawn,...
Definition: ModItem.cs:751

References Terraria.ModLoader.ModItem.DrawArmorColor(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.DrawArmorColor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawBody()

virtual bool Terraria.ModLoader.EquipTexture.DrawBody ( )
virtual

Return false to hide the player's body when this body equipment texture is worn. By default this will return the associated ModItem's DrawBody, or true if there is no associated ModItem.

Returns

Definition at line 161 of file EquipTexture.cs.

161 {
162 return item == null || item.DrawBody();
163 }
virtual bool DrawBody()
Return false to hide the player's body when this body armor is worn. Returns true by default....
Definition: ModItem.cs:731

References Terraria.ModLoader.ModItem.DrawBody(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.DrawBody().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawHair()

virtual void Terraria.ModLoader.EquipTexture.DrawHair ( ref bool  drawHair,
ref bool  drawAltHair 
)
virtual

Allows you to determine whether the player's hair or alt (hat) hair draws when this head equipment texture is worn. By default both flags will be false. If there is an associated ModItem, by default this will call that ModItem's DrawHair.

Parameters
drawHair
drawAltHair

Definition at line 143 of file EquipTexture.cs.

143 {
144 if (item != null) {
145 item.DrawHair(ref drawHair, ref drawAltHair);
146 }
147 }
virtual void DrawHair(ref bool drawHair, ref bool drawAltHair)
Allows you to determine whether the player's hair or alt (hat) hair draws when this head armor is wor...
Definition: ModItem.cs:716

References Terraria.ModLoader.ModItem.DrawHair(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.DrawHair().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawHands()

virtual void Terraria.ModLoader.EquipTexture.DrawHands ( ref bool  drawHands,
ref bool  drawArms 
)
virtual

Allows you to determine whether the skin/shirt on the player's arms and hands are drawn when this body equipment texture is worn. By default both flags will be false. Note that if drawHands is false, the arms will not be drawn either. If there is an associated ModItem, by default this will call that ModItem's DrawHands.

Parameters
drawHands
drawArms

Definition at line 132 of file EquipTexture.cs.

132 {
133 if (item != null) {
134 item.DrawHands(ref drawHands, ref drawArms);
135 }
136 }
virtual void DrawHands(ref bool drawHands, ref bool drawArms)
Allows you to determine whether the skin/shirt on the player's arms and hands are drawn when this bod...
Definition: ModItem.cs:708

References Terraria.ModLoader.ModItem.DrawHands(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.DrawHands().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawHead()

virtual bool Terraria.ModLoader.EquipTexture.DrawHead ( )
virtual

Return false to hide the player's head when this head equipment texture is worn. By default this will return the associated ModItem's DrawHead, or true if there is no associated ModItem.

Returns

Definition at line 153 of file EquipTexture.cs.

153 {
154 return item == null || item.DrawHead();
155 }
virtual bool DrawHead()
Return false to hide the player's head when this head armor is worn. Returns true by default....
Definition: ModItem.cs:723

References Terraria.ModLoader.ModItem.DrawHead(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.DrawHead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawLegs()

virtual bool Terraria.ModLoader.EquipTexture.DrawLegs ( )
virtual

Return false to hide the player's legs when this leg or shoe equipment texture is worn. By default this will return the associated ModItem's DrawLegs, or true if there is no associated ModItem.

Returns

Definition at line 169 of file EquipTexture.cs.

169 {
170 return item == null || item.DrawLegs();
171 }
virtual bool DrawLegs()
Return false to hide the player's legs when this leg armor or shoe accessory is worn....
Definition: ModItem.cs:739

References Terraria.ModLoader.ModItem.DrawLegs(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.DrawLegs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HorizontalWingSpeeds()

virtual void Terraria.ModLoader.EquipTexture.HorizontalWingSpeeds ( Player  player,
ref float  speed,
ref float  acceleration 
)
virtual

Allows you to modify horizontal wing speeds.

Parameters
player
speed
acceleration

Definition at line 223 of file EquipTexture.cs.

223 {
224 if (item != null) {
225 item.HorizontalWingSpeeds(player, ref speed, ref acceleration);
226 }
227 }
virtual void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
Allows you to modify these wing's horizontal flight speed and acceleration.
Definition: ModItem.cs:783

References Terraria.ModLoader.ModItem.HorizontalWingSpeeds(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.HorizontalWingSpeeds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsVanitySet()

virtual bool Terraria.ModLoader.EquipTexture.IsVanitySet ( int  head,
int  body,
int  legs 
)
virtual

Returns whether or not the head armor, body armor, and leg armor textures make up a set. This hook is used for the PreUpdateVanitySet, UpdateVanitySet, and ArmorSetShadow hooks. By default this will return the same thing as the associated ModItem's IsVanitySet, or false if no ModItem is associated.

Parameters
head
body
legs
Returns

Definition at line 76 of file EquipTexture.cs.

76 {
77 if (item == null) {
78 return false;
79 }
80 return item.IsVanitySet(head, body, legs);
81 }
virtual bool IsVanitySet(int head, int body, int legs)
Returns whether or not the head armor, body armor, and leg armor textures make up a set....
Definition: ModItem.cs:602

References Terraria.ModLoader.ModItem.IsVanitySet(), and Terraria.ModLoader.EquipTexture.item.

Referenced by Terraria.ModLoader.ItemLoader.ArmorSetShadows(), Terraria.ModLoader.ItemLoader.PreUpdateVanitySet(), and Terraria.ModLoader.ItemLoader.UpdateVanitySet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PreUpdateVanitySet()

virtual void Terraria.ModLoader.EquipTexture.PreUpdateVanitySet ( Player  player)
virtual

Allows you to create special effects (such as the necro armor's hurt noise) when the player wears this equipment texture's vanity set. This hook is called regardless of whether the player is frozen in any way. By default this will call the associated ModItem's PreUpdateVanitySet if there is an associated ModItem.

Parameters
player

Definition at line 87 of file EquipTexture.cs.

87 {
88 if (item != null) {
90 }
91 }
virtual void PreUpdateVanitySet(Player player)
Allows you to create special effects (such as the necro armor's hurt noise) when the player wears thi...
Definition: ModItem.cs:622

References Terraria.ModLoader.EquipTexture.item, and Terraria.ModLoader.ModItem.PreUpdateVanitySet().

Referenced by Terraria.ModLoader.ItemLoader.PreUpdateVanitySet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMatch()

virtual void Terraria.ModLoader.EquipTexture.SetMatch ( bool  male,
ref int  equipSlot,
ref bool  robes 
)
virtual

Allows you to modify the equipment that the player appears to be wearing. This hook will only be called for head, body and leg textures. Note that equipSlot is not the same as the item type of the armor the player will appear to be wearing. Worn equipment has a separate set of IDs. You can find the vanilla equipment IDs by looking at the headSlot, bodySlot, and legSlot fields for items, and modded equipment IDs by looking at EquipLoader. If this hook is called on body armor, equipSlot allows you to modify the leg armor the player appears to be wearing. If you modify it, make sure to set robes to true. If this hook is called on leg armor, equipSlot allows you to modify the leg armor the player appears to be wearing, and the robes parameter is useless. By default, if there is an associated ModItem, this will call that ModItem's SetMatch.

Parameters
male
equipSlot
robes

Definition at line 121 of file EquipTexture.cs.

121 {
122 if (item != null) {
123 item.SetMatch(male, ref equipSlot, ref robes);
124 }
125 }
virtual void SetMatch(bool male, ref int equipSlot, ref bool robes)
Allows you to modify the equipment that the player appears to be wearing. This hook will only be call...
Definition: ModItem.cs:648

References Terraria.ModLoader.EquipTexture.item, and Terraria.ModLoader.ModItem.SetMatch().

Referenced by Terraria.ModLoader.ItemLoader.SetMatch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateVanity()

virtual void Terraria.ModLoader.EquipTexture.UpdateVanity ( Player  player,
EquipType  type 
)
virtual

Allows you to create special effects (such as dust) when this equipment texture is displayed on the player under the given equipment type. By default this will call the associated ModItem's UpdateVanity if there is an associated ModItem.

Parameters
player
type

Definition at line 63 of file EquipTexture.cs.

63 {
64 if (item != null) {
65 item.UpdateVanity(player, type);
66 }
67 }
virtual void UpdateVanity(Player player, EquipType type)
Allows you to create special effects (such as dust) when this item's equipment texture of the given e...
Definition: ModItem.cs:576

References Terraria.ModLoader.EquipTexture.item, and Terraria.ModLoader.ModItem.UpdateVanity().

Referenced by Terraria.ModLoader.ItemLoader.UpdateVanity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateVanitySet()

virtual void Terraria.ModLoader.EquipTexture.UpdateVanitySet ( Player  player)
virtual

Allows you to create special effects (such as dust) when the player wears this equipment texture's vanity set. This hook will only be called if the player is not frozen in any way. By default this will call the associated ModItem's UpdateVanitySet if there is an associated ModItem.

Parameters
player

Definition at line 97 of file EquipTexture.cs.

97 {
98 if (item != null) {
99 item.UpdateVanitySet(player);
100 }
101 }
virtual void UpdateVanitySet(Player player)
Allows you to create special effects (such as dust) when the player wears this item's vanity set....
Definition: ModItem.cs:629

References Terraria.ModLoader.EquipTexture.item, and Terraria.ModLoader.ModItem.UpdateVanitySet().

Referenced by Terraria.ModLoader.ItemLoader.UpdateVanitySet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerticalWingSpeeds()

virtual void Terraria.ModLoader.EquipTexture.VerticalWingSpeeds ( Player  player,
ref float  ascentWhenFalling,
ref float  ascentWhenRising,
ref float  maxCanAscendMultiplier,
ref float  maxAscentMultiplier,
ref float  constantAscend 
)
virtual

Allows you to modify vertical wing speeds.

Parameters
player
ascentWhenFalling
ascentWhenRising
maxCanAscendMultiplier
maxAscentMultiplier
constantAscend

Definition at line 209 of file EquipTexture.cs.

210 {
211 if (item != null) {
212 item.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
213 ref maxAscentMultiplier, ref constantAscend);
214 }
215 }
virtual void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
Allows you to modify the speeds at which you rise and fall when these wings are equipped.
Definition: ModItem.cs:773

References Terraria.ModLoader.EquipTexture.item, and Terraria.ModLoader.ModItem.VerticalWingSpeeds().

Referenced by Terraria.ModLoader.ItemLoader.VerticalWingSpeeds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WingUpdate()

virtual bool Terraria.ModLoader.EquipTexture.WingUpdate ( Player  player,
bool  inUse 
)
virtual

Allows for wing textures to do various things while in use. "inUse" is whether or not the jump button is currently pressed. Called when this wing texture visually appears on the player. Use to animate wings, create dusts, invoke sounds, and create lights. By default this will call the associated ModItem's WingUpdate if there is an associated ModItem.

Parameters
player
inUse
Returns

Definition at line 235 of file EquipTexture.cs.

235 {
236 return item?.WingUpdate(player, inUse) ?? false;
237 }
virtual bool WingUpdate(Player player, bool inUse)
Allows for Wings to do various things while in use. "inUse" is whether or not the jump button is curr...
Definition: ModItem.cs:792

References Terraria.ModLoader.EquipTexture.item, and Terraria.ModLoader.ModItem.WingUpdate().

Referenced by Terraria.ModLoader.ItemLoader.WingUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Property Documentation

◆ item

◆ mod

Mod Terraria.ModLoader.EquipTexture.mod
getset

The mod that added this equipment texture.

Definition at line 21 of file EquipTexture.cs.

21 {
22 get;
23 internal set;
24 }

◆ Name

string Terraria.ModLoader.EquipTexture.Name
getset

The internal name of this equipment texture.

Definition at line 29 of file EquipTexture.cs.

29 {
30 get;
31 internal set;
32 }

◆ Slot

int Terraria.ModLoader.EquipTexture.Slot
getset

The slot (internal ID) of this equipment texture.

Definition at line 45 of file EquipTexture.cs.

45 {
46 get;
47 internal set;
48 }

◆ Texture

string Terraria.ModLoader.EquipTexture.Texture
getset

The name and folders of the texture file used by this equipment texture.

Definition at line 13 of file EquipTexture.cs.

13 {
14 get;
15 internal set;
16 }

◆ Type

EquipType Terraria.ModLoader.EquipTexture.Type
getset

The type of equipment that this equipment texture is used as.

Definition at line 37 of file EquipTexture.cs.

37 {
38 get;
39 internal set;
40 }