Terraria ModLoader  0.10.1.5
A framework for 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

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.

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

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. Note that this is only called for body armor. Also note that this hook is only ever called through this item's associated equipment texture.
Definition: ModItem.cs:690

+ Here is the caller graph for this function:

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.

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

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:566
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

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:680
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

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:660
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

143  {
144  if (item != null) {
145  item.DrawHair(ref drawHair, ref drawAltHair);
146  }
147  }
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 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:645

+ Here is the caller graph for this function:

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.

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

132  {
133  if (item != null) {
134  item.DrawHands(ref drawHands, ref drawArms);
135  }
136  }
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 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:637

+ Here is the caller graph for this function:

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.

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

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:652
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

169  {
170  return item == null || item.DrawLegs();
171  }
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53
virtual bool DrawLegs()
Return false to hide the player's legs when this leg armor or shoe accessory is worn. Returns true by default. Note that this hook is only ever called through this item's associated equipment texture.
Definition: ModItem.cs:668

+ Here is the caller graph for this function:

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.

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

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:712
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

76  {
77  if (item == null) {
78  return false;
79  }
80  return item.IsVanitySet(head, body, legs);
81  }
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53
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:531

+ Here is the caller graph for this function:

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.

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

87  {
88  if (item != null) {
89  item.PreUpdateVanitySet(player);
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:551
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

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:577
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

63  {
64  if (item != null) {
65  item.UpdateVanity(player, type);
66  }
67  }
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 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:505

+ Here is the caller graph for this function:

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.

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

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:558
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

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:702
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53

+ Here is the caller graph for this function:

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.

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

235  {
236  return item?.WingUpdate(player, inUse) ?? false;
237  }
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this...
Definition: EquipTexture.cs:53
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:721

+ Here is the caller graph for this function:

Property Documentation

ModItem Terraria.ModLoader.EquipTexture.item
getset

The item that is associated with this equipment texture. Null if no item is associated with this.

Definition at line 53 of file EquipTexture.cs.

Referenced by Terraria.ModLoader.Mod.AddEquipTexture(), and Terraria.ModLoader.ItemLoader.GetWing().

Mod Terraria.ModLoader.EquipTexture.mod
getset

The mod that added this equipment texture.

Definition at line 21 of file EquipTexture.cs.

Referenced by Terraria.ModLoader.Mod.AddEquipTexture().

string Terraria.ModLoader.EquipTexture.Name
getset

The internal name of this equipment texture.

Definition at line 29 of file EquipTexture.cs.

Referenced by Terraria.ModLoader.Mod.AddEquipTexture().

int Terraria.ModLoader.EquipTexture.Slot
getset

The slot (internal ID) of this equipment texture.

Definition at line 45 of file EquipTexture.cs.

Referenced by Terraria.ModLoader.Mod.AddEquipTexture().

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.

Referenced by Terraria.ModLoader.Mod.AddEquipTexture(), and Terraria.ModLoader.EquipLoader.GetEquipTexture().

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.

Referenced by Terraria.ModLoader.Mod.AddEquipTexture().