ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Bug Reports (https://www.esoui.com/forums/forumdisplay.php?f=187)
-   -   [open] EVENT_INVENTORY_SINGLE_SLOT_UPDATE issue with Filleting Fish at Station (https://www.esoui.com/forums/showthread.php?t=10734)

ArtOfShred 11/10/23 01:52 AM

[open] EVENT_INVENTORY_SINGLE_SLOT_UPDATE issue with Filleting Fish at Station
 
This may not exactly be a "BUG" but I find the behavior here odd and possibly unintentional.

- In this example I'm filleting a stack of 5 salmon at the provisioning station. The only addons I'm using here are pChat to expand the chat window a bit (same behavior w/o enabled - just using this for the screenshots below) & a little addon I made that registers an event handler for EVENT_INVENTORY_SINGLE_SLOT_UPDATE and prints out some debug:
Code:

-- EVENT_INVENTORY_SINGLE_SLOT_UPDATE
local function InventoryUpdate(eventCode, bagId, slotId, isNewItem, itemSoundCategory, inventoryUpdateReason, stackCountChange)
    local newItem = isNewItem and "TRUE" or "FALSE" -- turn boolean into a string

    -- Get the stack count & itemLink for this bag slot
    local _, stack = GetItemInfo(bagId, slotId)
    local itemLink = GetItemLink(bagId, slotId)

    -- Print Debug
    d("Inventory Update: Slot ID: " .. slotId .. " " .. itemLink .. ": Current Stack = " .. stack .. ", Change Count = " .. stackCountChange .. ", Is New Item = " .. newItem)
end

  • There is an EVENT_INVENTORY_SINGLE_SLOT_UPDATE for every single Salmon that gets removed, and every single Fish that gets added.

  • Note that for every one of these events the values returned by GetItemInfo(bagId, slotId) return the same stack count of either 0 (for the Salmon) or 5 (for the Fish). This is the value for that slotId after all of these events has resolved.

Now for comparison, if I use the 5 fish I filleted in order to craft some Fishy Sticks:

  • There is only a single EVENT_INVENTORY_SLOT_UPDATE for each item. The stack of 5 fish is decremented to 0, and the stack of 16 Fishy Sticks I had in my inventory incremented to 36. The values returned by GetItemInfo(bagId, slotId) return correctly here.

  • At some # of fish filleted instead of the multitude of events you get same behavior as standard crafting. I'm not sure how many fish, 25 still throws a million events, I think somewhere around 50 fish you'll finally just get one stack update for each type.

This doesn't really stop anything from working. But it seems a bit odd since normal crafting doesn't work this way - this is also quite a lot of UI events to be going off at once. This behavior throws off my inventory indexing function in LUIE that displays items consumed/crafted when crafting, since as soon as the first event fires that shows 1 fish has been removed, checking the slot returns an empty slot. (I can write a workaround for this - but I figured I'd post this up here first).


All times are GMT -6. The time now is 06:41 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI