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

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

Definition at line 62 of file NPCHeadLoader.cs.

References Terraria.ModLoader.ModContent.GetTexture().

62  {
63  if (bossHeads.ContainsKey(texture)) {
64  return bossHeads[texture];
65  }
66  else {
67  return -1;
68  }
69  }

+ Here is the call graph for this function:

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.

Definition at line 48 of file NPCHeadLoader.cs.

48  {
49  if (heads.ContainsKey(texture)) {
50  return heads[texture];
51  }
52  else {
53  return -1;
54  }
55  }

Member Data Documentation

int Terraria.ModLoader.NPCHeadLoader.nextBossHead = vanillaBossHeadCount
staticprivate

Definition at line 21 of file NPCHeadLoader.cs.

int Terraria.ModLoader.NPCHeadLoader.nextHead = vanillaHeadCount
staticprivate

Definition at line 20 of file NPCHeadLoader.cs.

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.

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.