View Single Post
01/02/15, 03:25 PM   #19
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,993
Hey QuadroTony,

this error happens here and there if you press the "E" keybinding too fast after another.
I've tried to track it down to the root but wasn't able to.
I expereienced this error in several addons now. It could be any addon that hooks into the keybindings.

Here is a technical explanation of merlight who has tried to find the root too:


Originally Posted by merlight View Post
ZO_InventorySlot_OnMouseEnter
> UpdateMouseoverCommand (local in ingame/inventory/inventoryslot.lua)
> ZO_ItemSlotActionsController:New > SetInventorySlot > RefreshKeybindStrip
> ZO_KeybindStrip:UpdateKeybindButtonGroup

I've been digging around this error for so long, but never really succeeded in identifying the primary cause, much less a fix. Any add-on that hooks ZO_InventorySlot_OnMouseEnter might cause it. Doesn't matter how you do that, whether manually or via ZO_PreHook, fact is the function is replaced by an add-on created function, which means everything it calls down the chain isn't allowed to call protected/private functions directly.

When UpdateMouseoverCommand is called for the first time, it calls ZO_ItemSlotActionsController:New, which creates parameters for the primary command. Among those is the callback function:
Lua Code:
  1. callback = function()
  2.             if(self.selectedAction) then
  3.                 self:DoSelectedAction()
  4.             else
  5.                 slotActions:DoPrimaryAction()
  6.             end
  7.         end,

It's an anonymous function, and if created from hooked (non-privileged) ZO_InventorySlot_OnMouseEnter, will be non-privileged as well. I don't know why it sometimes bugs and sometimes not, or why when it bugs I'm able to put items into bank via my custom context-menu command (I'm not hooking OnMouseEnter, but DiscoverSlotActionsFromActionList), via custom chat slash-command, but not via 'E' key. Maybe I should put in some code to reproduce it reliably and dig more, I've given up on this lately
  Reply With Quote