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

◆ ModSlotDyeSwap()

static Item Terraria.UI.ItemSlot.ModSlotDyeSwap ( Item item,
out bool success )
inlinestaticprivate

Alters the ItemSlot.DyeSwap method for modded slots; Unfortunately, I (Solxan) couldn't ever get ItemSlot.DyeSwap invoked so pretty sure this and its vanilla code is defunct. Here in case someone proves my statement wrong later.

Definition at line 4203 of file ItemSlot.cs.

4204 {
4205 Item item2 = item;
4207 int dyeSlotCount = 0;
4208 Item[] dyes = msPlayer.exDyesAccessory;
4209 for (int i = 0; i < dyeSlotCount; i++)
4210 {
4211 if (dyes[i].type == 0)
4212 {
4213 dyeSlotCount = i;
4214 break;
4215 }
4216 }
4217 if (dyeSlotCount >= msPlayer.SlotCount)
4218 {
4219 success = false;
4220 return item2;
4221 }
4222 item2 = dyes[dyeSlotCount].Clone();
4223 dyes[dyeSlotCount] = item.Clone();
4225 Recipe.FindRecipes();
4226 success = true;
4227 return item2;
4228 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static ModAccessorySlotPlayer ModSlotPlayer(Player player)
This serves as a central place to store equipment slots and their corresponding textures....
static int dyeSlotCount
Definition ItemSlot.cs:163

References Terraria.Item.Clone(), Terraria.UI.ItemSlot.dyeSlotCount, Terraria.Recipe.FindRecipes(), Terraria.Main.LocalPlayer, Terraria.ModLoader.AccessorySlotLoader.ModSlotPlayer(), and Terraria.Audio.SoundEngine.PlaySound().

Referenced by Terraria.UI.ItemSlot.DyeSwap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: