Access a private function ShowMenu Bug
Code:
EsoUI/Ingame/Inventory/InventorySlot.lua:903: attempt to access a private function 'PickupInventoryItem' from insecure code Error deleting items every few hours. =( Looking for addon causing a bug Any addon showing a context-menu can causes it. But there is nothing wrong with the calling: ClearMenu() AddMenuItem ... ShowMenu(), right? How to reproduce: Do in chat window: 1. /reloadui 2. /script ClearMenu() AddMenuItem("") ShowMenu() ClearMenu() 3. Go and use an item of your inventory using context-menu unsecure code?!? Try this: 1. /reloadui 2. go and open journal and right-click a quest to open a context-menu. In fact any build-in context-menu would be ok. You could also open the context-menu of the inventory. 3. /script ClearMenu() AddMenuItem("") ShowMenu() ClearMenu() 4. Go and use an item of your inventory using context-menu now the same code is secure. The critical call is AddMenuItem("") Here is another example: "secure" code adding a normal button below the context-menu Lua Code:
"unsecure" code adding a ZO_MenuItem control. Lua Code:
Seems to be a game-in bug. Or AddMenuItem should not be public. What else should be used? |
We could create a library that does exactly the same thing as the ingame menu and use that instead :D
|
Quote:
Therefore I hoped ZOS would respond to this post. :) A library needs cooperation from addon developers. It's worthless to write a lib, if everybody says "My code is working without". And basically that is true, because it's just the build-in code that does not work anymore :D The main key to avoid this error is: Never create an instance of ZO_MenuItem from addon code => Never use ZO_Menu.itemPool, so that build-in code does not re-use pooled controls created by addon code => Never use AddMenuItem A library could introduce "AddCustomMenuItem", which uses its own pool using a template that mimics ZO_MenuItem. (The ZO_Menu.checkBoxPool respectively) But as far as I know, this must be a shared addon. Maybe a more experienced author finds a better solution? |
Quote:
|
Quote:
|
You just misswritten it.
it's : /reloadui /script ClearMenu() /script AddMenuItem("") /script ShowMenu() /script ClearMenu() Right click on an item > Delete : bug ;) I can reproduce the problem too. |
Quote:
btw after this /script ShowMenu() i got a visual glitch |
Quote:
Separating commands by space in one line works for me. :confused: But ok.... that's better. Thanks again. And thanks QuadroTony. The glitch is nearly as expected. The context-menu should be empty. That's what ShowMenu does. But what is this blue thing? |
when i mouseover this thing it become blue
like any context menu string when you mouseover it |
Quote:
|
Quote:
|
All times are GMT -6. The time now is 06:07 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI