Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ UpdateItemDye()

void Terraria.Player.UpdateItemDye ( bool isNotInVanitySlot,
bool isSetToHidden,
Item armorItem,
Item dyeItem )
inlineprivate

Definition at line 9125 of file Player.cs.

9126 {
9127 if (armorItem.IsAir)
9128 {
9129 return;
9130 }
9131 bool num = armorItem.wingSlot > 0 || armorItem.type == 934 || armorItem.type == 4341 || armorItem.type == 5126 || armorItem.type == 4563 || armorItem.type == 1987;
9132 bool flag = isNotInVanitySlot && isSetToHidden;
9133 if (armorItem.shieldSlot > 0 && armorItem.shieldSlot < ArmorIDs.Shield.Count && (cShieldFallback == -1 || !flag))
9134 {
9136 }
9137 if (!num && flag)
9138 {
9139 return;
9140 }
9141 if (armorItem.handOnSlot > 0 && armorItem.handOnSlot < ArmorIDs.HandOn.Count)
9142 {
9143 cHandOn = dyeItem.dye;
9144 }
9145 if (armorItem.handOffSlot > 0 && armorItem.handOffSlot < ArmorIDs.HandOff.Count)
9146 {
9147 cHandOff = dyeItem.dye;
9148 }
9149 if (armorItem.backSlot > 0 && armorItem.backSlot < ArmorIDs.Back.Count)
9150 {
9152 {
9153 cBackpack = dyeItem.dye;
9154 }
9155 else if (ArmorIDs.Back.Sets.DrawInTailLayer[armorItem.backSlot])
9156 {
9157 cTail = dyeItem.dye;
9158 }
9159 else
9160 {
9161 cBack = dyeItem.dye;
9162 }
9163 }
9164 if (armorItem.frontSlot > 0 && armorItem.frontSlot < ArmorIDs.Front.Count)
9165 {
9166 cFront = dyeItem.dye;
9167 }
9168 if (armorItem.shoeSlot > 0 && armorItem.shoeSlot < ArmorIDs.Shoe.Count)
9169 {
9170 if (armorItem.type == 4822 || armorItem.type == 4874)
9171 {
9172 cFlameWaker = dyeItem.dye;
9173 }
9174 else
9175 {
9176 cShoe = dyeItem.dye;
9177 }
9178 }
9179 if (armorItem.waistSlot > 0 && armorItem.waistSlot < ArmorIDs.Waist.Count)
9180 {
9181 cWaist = dyeItem.dye;
9182 }
9183 if (armorItem.shieldSlot > 0 && armorItem.shieldSlot < ArmorIDs.Shield.Count)
9184 {
9185 cShield = dyeItem.dye;
9186 }
9187 if (armorItem.neckSlot > 0 && armorItem.neckSlot < ArmorIDs.Neck.Count)
9188 {
9189 cNeck = dyeItem.dye;
9190 }
9191 if (armorItem.faceSlot > 0 && armorItem.faceSlot < ArmorIDs.Face.Count)
9192 {
9194 {
9195 cFaceHead = dyeItem.dye;
9196 }
9198 {
9199 cFaceFlower = dyeItem.dye;
9200 }
9201 else
9202 {
9203 cFace = dyeItem.dye;
9204 }
9205 }
9206 if (armorItem.beardSlot > 0 && armorItem.beardSlot < ArmorIDs.Beard.Count)
9207 {
9208 cBeard = dyeItem.dye;
9209 }
9210 if (armorItem.balloonSlot > 0 && armorItem.balloonSlot < ArmorIDs.Balloon.Count)
9211 {
9213 {
9214 cBalloonFront = dyeItem.dye;
9215 }
9216 else
9217 {
9218 cBalloon = dyeItem.dye;
9219 }
9220 }
9221 if (armorItem.wingSlot > 0 && armorItem.wingSlot < ArmorIDs.Wing.Count)
9222 {
9223 cWings = dyeItem.dye;
9224 }
9225 if (armorItem.type == 934)
9226 {
9227 cCarpet = dyeItem.dye;
9228 }
9229 if (armorItem.type == 4404)
9230 {
9231 cFloatingTube = dyeItem.dye;
9232 }
9233 if (armorItem.type == 4341 || armorItem.type == 5126)
9234 {
9235 cPortableStool = dyeItem.dye;
9236 }
9237 if (armorItem.type == 4563)
9238 {
9239 cUnicornHorn = dyeItem.dye;
9240 }
9241 if (armorItem.type == 1987)
9242 {
9243 cAngelHalo = dyeItem.dye;
9244 }
9245 if (armorItem.type == 4762)
9246 {
9247 cMinion = dyeItem.dye;
9248 }
9249 if (armorItem.type == 3929)
9250 {
9251 cLeinShampoo = dyeItem.dye;
9252 }
9253 }
static bool[] DrawInBackpackLayer
Definition ArmorIDs.cs:1591
static readonly int Count
Definition ArmorIDs.cs:1668
static bool[] DrawInFrontOfBackArmLayer
Definition ArmorIDs.cs:2045
static readonly int Count
Definition ArmorIDs.cs:2088
static readonly sbyte Count
Definition ArmorIDs.cs:2123
static bool[] DrawInFaceFlowerLayer
Definition ArmorIDs.cs:1987
static bool[] DrawInFaceHeadLayer
Definition ArmorIDs.cs:1989
static readonly sbyte Count
Definition ArmorIDs.cs:2036
static readonly int Count
Definition ArmorIDs.cs:1704
static readonly int Count
Definition ArmorIDs.cs:1582
static readonly int Count
Definition ArmorIDs.cs:1536
static readonly int Count
Definition ArmorIDs.cs:1972
static readonly int Count
Definition ArmorIDs.cs:1943
static readonly int Count
Definition ArmorIDs.cs:1770
static readonly int Count
Definition ArmorIDs.cs:1818
static readonly int Count
Definition ArmorIDs.cs:1920
int cShieldFallback
Definition Player.cs:2517

References Terraria.ID.ArmorIDs.HandOn.Count, Terraria.ID.ArmorIDs.HandOff.Count, Terraria.ID.ArmorIDs.Back.Count, Terraria.ID.ArmorIDs.Front.Count, Terraria.ID.ArmorIDs.Shoe.Count, Terraria.ID.ArmorIDs.Waist.Count, Terraria.ID.ArmorIDs.Wing.Count, Terraria.ID.ArmorIDs.Shield.Count, Terraria.ID.ArmorIDs.Neck.Count, Terraria.ID.ArmorIDs.Face.Count, Terraria.ID.ArmorIDs.Balloon.Count, Terraria.ID.ArmorIDs.Beard.Count, Terraria.ID.ArmorIDs.Back.Sets.DrawInBackpackLayer, Terraria.ID.ArmorIDs.Face.Sets.DrawInFaceFlowerLayer, Terraria.ID.ArmorIDs.Face.Sets.DrawInFaceHeadLayer, Terraria.ID.ArmorIDs.Balloon.Sets.DrawInFrontOfBackArmLayer, and Terraria.ID.ArmorIDs.Back.Sets.DrawInTailLayer.