API:RevertDyePreview
From RoR Wiki
UI Lua API · Dye functions
Version: WAR 1.4.8
Removes a dye preview from one equipped item, showing its real colours again.
RevertDyePreview(location, slot)
Arguments
- location
number– Must beGameData.ItemLocs.EQUIPPED.- slot
number– Equipment slot of the item.
Returns
Nothing.
Details
- For any other
location, or an empty slot, nothing happens. - The item's appearance is set back to the dye colours the client has stored for the item. A channel without a dye shows the item's own colour. It undoes both DyePreview and DyeMerchantPreview.
- If there is no player object, nothing happens.
- The function needs at least two arguments and only reads the last two.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
Reverting the previously selected slot in the dye merchant view, from default/ea_characterwindow/source/characterwindow.lua:
-- revert the stuff we had selected RevertDyePreview( GameData.ItemLocs.EQUIPPED, WindowGetId( oldSelectedSlotName ) )
Before using a dye for real, from default/ea_modifyitem/source/useitemtargeting.lua:
RevertDyePreview( UseItemTargeting.TargetData.TargetLoc, UseItemTargeting.TargetData.TargetSlot ) UseItemTargeting.SendingUseTargetItem( tintMask )
