/// <summary> /// Gets the equipment texture for the specified equipment type and ID. /// </summary> /// <param name="type"></param> /// <param name="slot"></param> /// <returns></returns> public static EquipTexture GetEquipTexture(EquipType type, int slot) => EquipLoader.GetEquipTexture(type, slot);
internal void SetupItem(Item item) { SetupModItem(item); EquipLoader.SetSlot(item); item.modItem.SetDefaults(); }
internal void SetupContent() { foreach (ModItem item in items.Values) { Main.itemTexture[item.item.type] = ModLoader.GetTexture(item.texture); Main.itemName[item.item.type] = item.item.name; EquipLoader.SetSlot(item.item); item.SetDefaults(); DrawAnimation animation = item.GetAnimation(); if (animation != null) { Main.RegisterItemAnimation(item.item.type, animation); ItemLoader.animations.Add(item.item.type); } if (item.flameTexture.Length > 0) { Main.itemFlameTexture[item.item.type] = ModLoader.GetTexture(item.flameTexture); } } foreach (ModDust dust in dusts.Values) { dust.SetDefaults(); } foreach (ModTile tile in tiles.Values) { Main.tileTexture[tile.Type] = ModLoader.GetTexture(tile.texture); TileLoader.SetDefaults(tile); } foreach (GlobalTile globalTile in globalTiles.Values) { globalTile.SetDefaults(); } foreach (ModWall wall in walls.Values) { Main.wallTexture[wall.Type] = ModLoader.GetTexture(wall.texture); wall.SetDefaults(); } foreach (GlobalWall globalWall in globalWalls.Values) { globalWall.SetDefaults(); } foreach (ModProjectile projectile in projectiles.Values) { Main.projectileTexture[projectile.projectile.type] = ModLoader.GetTexture(projectile.texture); Main.projFrames[projectile.projectile.type] = 1; projectile.SetDefaults(); if (projectile.projectile.hostile) { Main.projHostile[projectile.projectile.type] = true; } if (projectile.projectile.aiStyle == 7) { Main.projHook[projectile.projectile.type] = true; } } foreach (ModNPC npc in npcs.Values) { Main.npcTexture[npc.npc.type] = ModLoader.GetTexture(npc.texture); Main.npcName[npc.npc.type] = npc.npc.name; npc.SetDefaults(); if (npc.npc.lifeMax > 32767 || npc.npc.boss) { Main.npcLifeBytes[npc.npc.type] = 4; } else if (npc.npc.lifeMax > 127) { Main.npcLifeBytes[npc.npc.type] = 2; } else { Main.npcLifeBytes[npc.npc.type] = 1; } } foreach (ModMountData modMountData in mountDatas.Values) { Mount.MountData temp = modMountData.mountData; temp.modMountData = modMountData; MountLoader.SetupMount(modMountData.mountData); Mount.mounts[modMountData.Type] = temp; } foreach (ModBuff buff in buffs.Values) { Main.buffTexture[buff.Type] = ModLoader.GetTexture(buff.texture); Main.buffName[buff.Type] = buff.Name; buff.SetDefaults(); } }
internal void SetupContent() { foreach (ModItem item in items.Values) { Main.itemTexture[item.item.type] = ModLoader.GetTexture(item.texture); Main.itemName[item.item.type] = item.item.name; EquipLoader.SetSlot(item.item); item.SetDefaults(); DrawAnimation animation = item.GetAnimation(); if (animation != null) { Main.RegisterItemAnimation(item.item.type, animation); ItemLoader.animations.Add(item.item.type); } } foreach (ModTile tile in tiles.Values) { Main.tileTexture[tile.Type] = ModLoader.GetTexture(tile.texture); TileLoader.SetDefaults(tile); } foreach (GlobalTile globalTile in globalTiles.Values) { globalTile.SetDefaults(); } foreach (ModWall wall in walls.Values) { Main.wallTexture[wall.Type] = ModLoader.GetTexture(wall.texture); wall.SetDefaults(); } foreach (GlobalWall globalWall in globalWalls.Values) { globalWall.SetDefaults(); } foreach (ModProjectile projectile in projectiles.Values) { Main.projectileTexture[projectile.projectile.type] = ModLoader.GetTexture(projectile.texture); Main.projFrames[projectile.projectile.type] = 1; projectile.SetDefaults(); if (projectile.projectile.hostile) { Main.projHostile[projectile.projectile.type] = true; } if (projectile.projectile.aiStyle == 7) { Main.projHook[projectile.projectile.type] = true; } } foreach (ModNPC npc in npcs.Values) { Main.npcTexture[npc.npc.type] = ModLoader.GetTexture(npc.texture); Main.npcName[npc.npc.type] = npc.npc.name; npc.SetDefaults(); if (npc.npc.lifeMax > 32767 || npc.npc.boss) { Main.npcLifeBytes[npc.npc.type] = 4; } else if (npc.npc.lifeMax > 127) { Main.npcLifeBytes[npc.npc.type] = 2; } else { Main.npcLifeBytes[npc.npc.type] = 1; } } foreach (ModGore gore in gores.Values) { Main.goreTexture[gore.Type] = ModLoader.GetTexture(gore.texture); } foreach (ModSound sound in sounds.Values) { Main.soundItem[sound.Type] = ModLoader.GetSound(sound.audioFilename); Main.soundInstanceItem[sound.Type] = Main.soundItem[sound.Type].CreateInstance(); } }
/// <summary> /// Automatically sets certain defaults. Override this if you do not want the properties to be set for you. /// </summary> public virtual void AutoDefaults() { EquipLoader.SetSlot(item); }