API:RemoveItemEnhancement
From RoR Wiki
UI Lua API · ItemEnhancement functions
Version: WAR 1.4.8
Asks the server to take the enhancement out of one slot of the item being enhanced.
RemoveItemEnhancement(enhancementSlot)
Arguments
- enhancementSlot
number– Enhancement slot on the item,1to3.
Returns
Nothing.
Details
- Nothing is sent if
enhancementSlotis not 1, 2 or 3. - Otherwise a "remove enhancement" request for that slot is sent to the server. The client does not check that the slot holds anything; the stock UI only calls it for enhancements that are not fused yet.
- If one of the player's state flags blocks item enhancement, no request is sent and a built-in error message is printed to the Chat log instead.
- Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From default/ea_itemenhancementwindow/source/itemenhancementwindow.lua:
-- Only request a removal of the enhancement item if it has an inventory slot greater than 0.
-- (That's what signals it as removable)
local enhItem = ItemEnhancementWindow.enhancedItem
if (enhItem.enhSlot[g_clickedEnhSlotId].inventorySlot > 0) then
RemoveItemEnhancement (g_clickedEnhSlotId)
end
