API:SendCustomizeItemIcon
From RoR Wiki
UI Lua API · Item functions
Version: WAR 1.4.8
Asks the server to give an equipped item the appearance of another item, or to remove a custom appearance.
SendCustomizeItemIcon(equipSlot, sourceSlot, sourceLocation)
Arguments
- equipSlot
number– Equipment slot of the item to change.- sourceSlot
number– Slot of the item whose appearance is copied, starting at 1. 0 removes the custom appearance.- sourceLocation
number– Location of that item, as aGameData.ItemLocsvalue. 0 when removing.
Returns
Nothing.
Details
GameData.ItemLocs.BANKis handled as a source. So areINVENTORY,QUEST_ITEM,CRAFTING_ITEM,CURRENCY_ITEMandEQUIPPED.- The request is sent when the source converts to a valid slot, or when
sourceSlotis 0. With an unsupported source location and a non-zerosourceSlot, nothing is sent. - The client does not check that the two items fit the same equipment slot. The stock UI checks this (and asks for confirmation) before calling.
- If there is no player object, nothing happens.
- The function needs at least three arguments and only reads the last three.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
From default/ea_characterwindow/source/characterwindowitemappearance.lua:
local function ApplyItemAppearance()
-- Try to customize the item in the slot
SendCustomizeItemIcon( slot, sourceSlot, source )
end
Removing the custom appearance, from the same file:
local function RemoveItemAppearance()
-- Try to remove the item's customized icon
SendCustomizeItemIcon( slot, 0, 0 )
end
