Originally Posted by Grimsin
In theory if you use the same method of creating secure template buttons you should be able to use it in combat as you can use the world targets in combat and they are secure to. Would it not be possible to do the same as we just did for the bindings? and then just rebuild the dropdown menu as one would normally for adding any button to it?
|
No. You cannot show or hide a secure frame while you are in combat except through the use of secure frame attributes, such as "when Secure Object A is clicked, show Secure Object B" or "when your target is hostile, show Secure Object A" or "while Shift is pressed, show Secure Object A". Dropdown menus are
not secure frames, so it is not possible to write code to automatically show a secure frame when a dropdown menu is shown, or hide a secure frame when a dropdown menu is hidden.
You also cannot change the position of a secure frame while you are in combat programmatically (eg. without the user actually clicking and dragging it), so even if you found some way to show the button, you could not position it to overlay the dropdown menu entry button.
Also, since dropdown menus are not secure, you cannot call restricted/protected functions inside normal dropdown menu click handlers.
You
might be able to get a working "menu" by using secure action buttons and adding textures to make them look like a dropdown menu. I'm not sure how you would show and hide it, though, as I haven't spent that much time dealing with the secure state/attribute system. It may not even be possible to show/hide secure action buttons by clicking on a secure unit button. Even if it is, you would have to create the entire "menu" from scratch, and you could not use any of Blizzard's dropdown menu code. You would also have to create a separate set of action buttons for each unit frame (since you cannot move a single set of action buttons to attach them to the specific frame clicked on) and you would not be able to dynamically change the menu contents depending on what kind of unit was currently displayed on the frame (eg. group member, hostile player, friendly mob) while in combat.
Originally Posted by Grimsin
like this
Code:
local GuildInviteButtonInfo = {
text = "Guild Invite",
value = "GUILD_INVITE",
func = function() GuildInvite(UIDROPDOWNMENU_OPEN_MENU.name) end,
notCheckable = 1,
}
|
Again, no. A dropdown menu click handler is
not secure. A keybinding is.
Even if it's possible to approximate a "dropdown menu" with working set/clear focus buttons (and I don't know that it is), it would be clunky in operation and an enormous amount of work to build, and I stand by my original assertion that it's not worth the effort.