//in Terraria.Player.PlayerFrame after armor sets creating dust call this internal static void UpdateVanitySet(Player player) { EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head); EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body); EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs); if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs)) { headTexture.UpdateVanitySet(player); } if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs)) { bodyTexture.UpdateVanitySet(player); } if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs)) { legTexture.UpdateVanitySet(player); } foreach (GlobalItem globalItem in globalItems) { string set = globalItem.IsVanitySet(player.head, player.body, player.legs); if (set.Length > 0) { globalItem.UpdateVanitySet(player, set); } } }
//in Terraria.Main.DrawPlayers after armor combinations setting flags call // ItemLoader.ArmorSetShadows(player, ref flag, ref flag2, ref flag3, ref flag4); internal static void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) { EquipTexture headTexture = EquipLoader.GetEquipTexture(EquipType.Head, player.head); EquipTexture bodyTexture = EquipLoader.GetEquipTexture(EquipType.Body, player.body); EquipTexture legTexture = EquipLoader.GetEquipTexture(EquipType.Legs, player.legs); if (headTexture != null && headTexture.IsVanitySet(player.head, player.body, player.legs)) { headTexture.ArmorSetShadows(player, ref longTrail, ref smallPulse, ref largePulse, ref shortTrail); } if (bodyTexture != null && bodyTexture.IsVanitySet(player.head, player.body, player.legs)) { bodyTexture.ArmorSetShadows(player, ref longTrail, ref smallPulse, ref largePulse, ref shortTrail); } if (legTexture != null && legTexture.IsVanitySet(player.head, player.body, player.legs)) { legTexture.ArmorSetShadows(player, ref longTrail, ref smallPulse, ref largePulse, ref shortTrail); } foreach (GlobalItem globalItem in globalItems) { string set = globalItem.IsVanitySet(player.head, player.body, player.legs); if (set.Length > 0) { globalItem.ArmorSetShadows(player, set, ref longTrail, ref smallPulse, ref largePulse, ref shortTrail); } } }
internal static void UpdateVanity(Player player) { foreach (EquipType type in Enum.GetValues(typeof(EquipType))) { int slot = EquipLoader.GetPlayerEquip(player, type); EquipTexture texture = EquipLoader.GetEquipTexture(type, slot); if (texture != null) { texture.UpdateVanity(player, type); } } }
/// <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);