This PR provides three new mod.Calls getequipslotitem, getvanityslotitem and getvisibleitem, with each returning an Item. Called on demand, not in PostSetupContent because WingSlotPlayer isn't initialized yet.
When needing the item inside the slot for certain purposes, for example when iterating through the accessory/equip slots.
Example:
Item wingItem = null;
if (ModLoader.GetMod("WingSlot") is Mod wingSlot && wingSlot != null) {
wingItem = (Item)wingSlot.Call("getvisibleitem", player.whoAmI);
}
for (int j = 3; j < 8 + player.extraAccessorySlots; j++)
{
Item item = player.armor[j];
if (!item.IsAir && item.wingSlot > 0)
{
wingItem = item;
}
}
if (wingItem != null) //stuff
This PR provides three new mod.Calls getequipslotitem, getvanityslotitem and getvisibleitem, with each returning an
Item
. Called on demand, not in PostSetupContent because WingSlotPlayer isn't initialized yet.Example: