ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Help/Support (https://www.esoui.com/forums/forumdisplay.php?f=164)
-   -   BetterUI (Gamepad) add-on - Issue with newly protected "SelectSlotItem" (https://www.esoui.com/forums/showthread.php?t=8814)

goobsnake 10/24/19 09:26 PM

BetterUI (Gamepad) add-on - Issue with newly protected "SelectSlotItem"
 
I've been maintaining this gamepad add-on for awhile now but am running into issues with one of the new protected functions. In the past, the code called self:ShowQuickslot() to bring up the gamepad quickslots radial to assign/remove inventory quickslot items without issue.

With the latest patch, ShowQuickslot() is still bringing up the radial but it appears somewhere down the line the "assign" button click is now protected via "SelectSlotItem" (likely similar to how use/equip, etc. are protected). I'm having difficulty finding a way to re-implement the quickslots assign/remove functionality as any way I'm bringing up the quickslots radial eventually leads to this same error.

The documentation states SelectSlotItem is now protected but my LUA error is saying its private?

Any help or suggestions appreciated.


Lua Error:

Code:

EsoUI/Ingame/Quickslot/Gamepad/GamepadQuickslot.lua:339: Attempt to access a private function 'SelectSlotItem' from insecure code. The callstack became untrusted 1 stack frame(s) from the top.
stack traceback:
EsoUI/Ingame/Quickslot/Gamepad/GamepadQuickslot.lua:339: in function 'ZO_GamepadQuickslot:TryAssignItemToSlot'
<Locals> self = [table:1]{itemToSlotId = 1, itemToSlotIndex = 27, assignmentType = 1, isActiveEmpty = F}, selectedData = [table:2]{name = "Empty", activeIcon = "EsoUI/Art/Quickslots/quickslot...", data = 10, inactiveIcon = "EsoUI/Art/Quickslots/quickslot..."} </Locals>
EsoUI/Ingame/Quickslot/Gamepad/GamepadQuickslot.lua:154: in function 'callback'
EsoUI/Libraries/ZO_KeybindStrip/ZO_KeybindStrip.lua:645: in function 'ZO_KeybindStrip:TryHandlingKeybindDown'
<Locals> self = [table:3]{allowDefaultExit = T, insertionId = 25, batchUpdating = F}, keybind = "UI_SHORTCUT_PRIMARY", buttonOrEtherealDescriptor = ud, keybindButtonDescriptor = [table:4]{name = "Assign", addedForSceneName = "gamepad_quickslot", alignment = 1, keybind = "UI_SHORTCUT_PRIMARY", order = -500} </Locals>
(tail call): ?
(tail call): ?|r


Keldor 10/25/19 02:01 AM

I think you have to call your hook as explained by Baertram here: https://www.esoui.com/forums/showpos...45&postcount=6

Keldor

Baertram 10/25/19 03:36 AM

I'd wait for ZOs to apply the patch they have mentioned to come.

There exist problems if addons get into the InventoryCreation functions before the inventory has "finally securely finished" it's creation. These will lead to the isnecure call error messages currently.
ZOs found somethign and will fix this, not sure when. I hope on Monday.

Quote:

It's because the security of the handlers comes from the security of the function plus the security level when they are set (this second part is new). So when an addon tells the inventory to build a bunch of inventory slots, all those handlers are insecure and cannot call private functions. The next patch will change that so those handlers will be secure which will make these errors go away.

Things that change the bag that is shown by calling UpdateList on the inventory for example.

If you open the inventory first then the stock UI will make all the slots securely. Then when the addon does it they'll already be there to use.
So this is why opening the inv first made the errors stop for some time.
But it also can be that you are using a own build PostHook somewhere, overwriting base function code in your own function, and calling the original function code first + your code later. This shouldn't be done anymore, at least not next to inventory related stuff. You can use the new function SecurePostHook for it now (works like ZO_PreHook, but calls the code after the original function was run).


All times are GMT -6. The time now is 12:09 AM.

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