GetItemInfo tainting secure cast functions?
Hello,
This request has also been posted on wow-europe's UI forums, but I'm not totally sure if many coders still read this forum (I haven't been there for a while). My problem is that it seems that the non secured function GetItemInfo taints secured functions if hooked. Basically, with no addon up, if you execute this code... Code:
oldGetItemInfo = GetItemInfo My questions are: - Why? - Is there a way to hook GetItemInfo without screwing up the game? - Else, is there any other way to modify the icon of a given number of items if I want my addon to remain independent from the action bar / bag addons? (else, I'll just code something that works with mine, but it would be annoying to change it every time I change my other addons, and not being able to make my friends or other randomly interested people profit from my work) Thank you for reading, -- Layrajha |
Code:
hooksecurefunc("GetItemInfo", function (...) |
Yes, I would do that if I didn't want the returned value to actually change, which isn't possible through hooksecurefunction. Basically, I'm coding a small addon that is supposed to change the icons on the various [Major Combat Mana Potion], replacing them with modified versions that also include a text like "AV" or "WSG" to design the BG marks that were used to buy it.
Thus, my first idea to make it work not only on my ArkInventory / Bartender3, but on any bags / action bars addon, was to hook every function that returns an item's texture with something that looks like this (a bit more customized in the addon's code, but easier to understand here): Code:
function GetItemInfo(item) |
As suggested on wow-europe's forums, I've checked the taint log. Basically, what gets tainted when I hook GetItemInfo is the "/cast" and "/castrandom" actions. In fact, their code is (I think this is the last live version, I haven't checked WDN for test updates though):
Code:
SecureCmdList["CAST"] = function(msg) Code:
SecureCmdList["CASTRANDOM"] = function(msg) It is really disappointing. This function that returns 10 values is here used only to check if a string matches the name of an item in cache. Because of that, the function cannot be hooked. Considering the cost of the addition of something like SecureItemExists and the replacement of the occurrences of GetItemInfo in ChatFrame.lua's secured cast functions, I wonder if I should post about this in the "Wish List" board. Do you think that it's worth it, and do you think that it could be applied? Or is there any drawback to this suggestion? |
All times are GMT -6. The time now is 11:42 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI