Thread Tools Display Modes
Prev Previous Post   Next Post Next
07/27/19, 06:54 AM   #1
cOOLsp0T
 
cOOLsp0T's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2019
Posts: 17
how does EVENT_INVENTORY_SINGLE_SLOT_UPDATE exactly work?

Hi Folks, its me again.

I have a problem with an Event Handler wrapped around my function. The function itself loots all items, checks if the user whished to loot that item and destroys all left overs. My problem is, that the Event wouldnt fire. I register it right before the loot actions starts and unregister it when the looting action ends.

Code:
function LootManager.Lootinit()
	if Config.GeneralSettings.ClearNodes == true then
		EVENT_MANAGER:RegisterForEvent(LootManager.Name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE, function(...) LootManager.GarbageHandler(...) end)
		LootManager.Debugger(1)
	end
	LootMoney()
	local num = GetNumLootItems()
	for itemnumber = 1, num, 1 do	
		lootitem = LootManager.ItemFilter(itemnumber,nil,nil)
		LootManager.Debugger(0,num,itemnumber,lootitem)
		_,_,_,_,_,_,LootManager.isQuest,_ = GetLootItemInfo(itemnumber)
		if Config.GeneralSettings.Debug ~= true then
			if Config.GeneralSettings.ClearNodes == true then LootItemById(itemID) end
			if Config.GeneralSettings.ClearNodes == false and lootitem == true then LootItemById(itemID) end
		end
	end

	if Config.GeneralSettings.BlindLoot == true then EndLooting() end
	if Config.GeneralSettings.ClearNodes == true then
		EVENT_MANAGER:UnregisterForEvent(LootManager.Name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE)
		LootManager.Debugger(2)
	end
end
  Reply With Quote
 

ESOUI » AddOns » AddOn Help/Support » how does EVENT_INVENTORY_SINGLE_SLOT_UPDATE exactly work?


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