Thread Tools Display Modes
10/24/19, 09:26 PM   #1
goobsnake
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 1
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

Last edited by goobsnake : 10/24/19 at 09:32 PM.
  Reply With Quote
10/25/19, 02:01 AM   #2
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
I think you have to call your hook as explained by Baertram here: https://www.esoui.com/forums/showpos...45&postcount=6

Keldor
  Reply With Quote
10/25/19, 03:36 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
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.

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).

Last edited by Baertram : 10/25/19 at 03:38 AM.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » BetterUI (Gamepad) add-on - Issue with newly protected "SelectSlotItem"

Thread Tools
Display Modes

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