View Single Post
03-24-14, 12:28 AM   #7
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I'm again digging into this. Now with flyout buttons.

I've finally managed to set up a flyout button without using the type "action".
Lua Code:
  1. btn:SetAttribute("type", "flyout")
  2. btn:SetAttribute("spell", <flyoutnumber>)
But ... I didn't found a way to support a pick up action for the button.
Right now I'm picking up the button via the flyout id and the PickupSpellBookItem.

Lua Code:
  1. local name = GetFlyoutInfo(value)
  2.     local found
  3.     local spellName = ""
  4.     local i = 1
  5.     while true do
  6.        local spellName = GetSpellBookItemName(i, BOOKTYPE_SPELL)
  7.         if spellName == name then
  8.             found = i
  9.             break
  10.         end
  11.        if not spellName then
  12.           do break end
  13.        end
  14.        i = i + 1
  15.     end
  16.    
  17.     if found then
  18.         PickupSpellBookItem(found, BOOKTYPE_SPELL)
  19.     end

But, well ... this is unsecure. Is there really no way to support dragging flyout buttons from the button frame without using "action" and an action id?

Last edited by Duugu : 03-24-14 at 12:30 AM.
  Reply With Quote