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

This class serves as a central place from which NPC head slots are stored and NPC head textures are assigned. This can be used to obtain the corresponding slots to head textures. More...

+ Collaboration diagram for Terraria.ModLoader.NPCHeadLoader:

Static Public Member Functions

static int GetBossHeadSlot (string texture)
 Gets the index of the boss head texture corresponding to the given texture path. More...
 
static int GetHeadSlot (string texture)
 Gets the index of the head texture corresponding to the given texture path. More...
 

Static Public Attributes

static readonly int vanillaBossHeadCount = Main.npcHeadBossTexture.Length
 The number of vanilla boss head textures that exist. More...
 
static readonly int vanillaHeadCount = Main.npcHeadTexture.Length
 The number of vanilla town NPC head textures that exist. More...
 

Static Private Attributes

static int nextBossHead = vanillaBossHeadCount
 
static int nextHead = vanillaHeadCount
 

Detailed Description

This class serves as a central place from which NPC head slots are stored and NPC head textures are assigned. This can be used to obtain the corresponding slots to head textures.

Definition at line 10 of file NPCHeadLoader.cs.

Member Function Documentation

◆ GetBossHeadSlot()

static int Terraria.ModLoader.NPCHeadLoader.GetBossHeadSlot ( string  texture)
static

Gets the index of the boss head texture corresponding to the given texture path.

Parameters
texture
Returns

References Terraria.ModLoader.ModContent.GetTexture(), Terraria.ModLoader.NPCHeadLoader.nextBossHead, and Terraria.ModLoader.NPCHeadLoader.nextHead.

+ Here is the call graph for this function:

◆ GetHeadSlot()

static int Terraria.ModLoader.NPCHeadLoader.GetHeadSlot ( string  texture)
static

Gets the index of the head texture corresponding to the given texture path.

Parameters
textureRelative texture path
Returns
The index of the texture in the heads array, -1 if not found.

Member Data Documentation

◆ nextBossHead

int Terraria.ModLoader.NPCHeadLoader.nextBossHead = vanillaBossHeadCount
staticprivate

Definition at line 21 of file NPCHeadLoader.cs.

Referenced by Terraria.ModLoader.NPCHeadLoader.GetBossHeadSlot().

◆ nextHead

int Terraria.ModLoader.NPCHeadLoader.nextHead = vanillaHeadCount
staticprivate

Definition at line 20 of file NPCHeadLoader.cs.

Referenced by Terraria.ModLoader.NPCHeadLoader.GetBossHeadSlot().

◆ vanillaBossHeadCount

readonly int Terraria.ModLoader.NPCHeadLoader.vanillaBossHeadCount = Main.npcHeadBossTexture.Length
static

The number of vanilla boss head textures that exist.

Definition at line 19 of file NPCHeadLoader.cs.

◆ vanillaHeadCount

readonly int Terraria.ModLoader.NPCHeadLoader.vanillaHeadCount = Main.npcHeadTexture.Length
static

The number of vanilla town NPC head textures that exist.

Definition at line 15 of file NPCHeadLoader.cs.