Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/30/23, 11:09 AM   #1
Lykeion
 
Lykeion's Avatar
AddOn Author - Click to view addons
Join Date: May 2022
Posts: 22
Does LootItemById() throws an EVENT_INVENTORY_SINGLE_SLOT_UPDATE?

I tried to add an autobind feature to my autoloot addon, but I can't seem to get the information about the looted gear via EVENT_INVENTORY_SINGLE_SLOT_UPDATE when LootItemById. This is a bit strange, is there something I'm doing wrong?

A simplified version of my code looks like this. I have tried leaving the print statement inside _onInventorySlotUpdate, but it doesn't look like this function is being called
Code:
function MyAddon:LootSetItem(link, lootId, isUnresearched, isOrnate, isIntricate, isSetItem, isUncollected)
	local function _onInventorySlotUpdate(eventCode, bagId, slotIndex, isNewItem, itemSoundCategory, updateReason, stackCountChange)
                d('_onInventorySlotUpdate is called')
		if (db.autoBind) then 
			BindItem(bagId, slotIndex) 
		end
	end
	
	EVENT_MANAGER:RegisterForEvent("SLOT_UPDATE", EVENT_INVENTORY_SINGLE_SLOT_UPDATE, _onInventorySlotUpdate)
        LootItemById(lootId)
	EVENT_MANAGER:UnregisterForEvent("SLOT_UPDATE", EVENT_INVENTORY_SINGLE_SLOT_UPDATE)
end
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Does LootItemById() throws an EVENT_INVENTORY_SINGLE_SLOT_UPDATE?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off