Hello again!
I have another stumper that I'd like to ask a question about - while working on a generic unit frame addon last night, I completed all the requisite boiler plate concerning setting up unit frames for entities (players, party members, raid members, etc), but I ran into this issue I can't seem to find
much information on, and that is
SecureUnitButtonTemplate menuFunc dropdowns. I've been looking into WoW's secure API, and when setting up the appropriate drop-down menu for the unit, rough example:
Lua Code:
local testFrame = CreateFrame("Button", "TestFrame001", UIParent, "SecureUnitButtonTemplate");
testFrame:RegisterForClicks("AnyUp");
SecureUnitButton_OnLoad(testFrame, "player", ( function()
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, "cursor", 106, 27);
end);
The result works as expected, and you get the player's drop-down menu, but actions like Set Focus and others on other unit's drop down menus created this way are tainted (I evaluated the taint log) and thus blocked from fulfilling their actions. I researched the issue for quite some time, and I could never really find out what I'm supposed to do to prevent taint here, but still utilize the built-in drop down menus? I've looked into secure functions, and the like, but I either don't understand what's required to "securely" utilize Blizzard's unit dropdown menus, or it's not possible and I'm barking up the wrong tree.
Does anyone know what I'm missing, or can anyone point me in the right direction? I'm not satisfied with leaving it as is, I want this to work correctly. I studied Grid, and SUF, and both utilize Ace, which I suspect is helping with this issue, but I'd like to understand
how it's helping, and I'm not finding resources that explain this well. Just little bits here and there, nothing concrete.
I'd buy a beer for anyone who could help me figure this out.
Thank you!