Thread Tools Display Modes
09-28-16, 07:41 PM   #1
TimothyLuke
A Fallenroot Satyr
 
TimothyLuke's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 24
Create Draggable "Button" that can be embedded in Action Bar

First off I may have the terminology completely wrong. What I want to do is create a button that I can drag to an ActionBar.

I have attempted this via LibActionButton - my code attempt and results are located https://www.curseforge.com/forums/wo...actionbutton-1

GS-E has a bank of Frames that are a button.
Lua Code:
  1. local button = CreateFrame('Button', name, nil, 'SecureActionButtonTemplate,SecureHandlerBaseTemplate')
  2. button:SetAttribute('type', 'macro')
  3. button:Execute('name, macros = self:GetName(), newtable([=======[' .. strjoin(']=======],[=======[', unpack(GSTRUnEscapeSequence(sequence))) .. ']=======])')
  4. button:SetAttribute('step', 1)
  5. button:SetAttribute('PreMacro','\n' .. preparePreMacro(sequence.PreMacro or ''))
  6. GSPrintDebugMessage(L["createButton PreMacro: "] .. button:GetAttribute('PreMacro'))
  7. button:SetAttribute('PostMacro', '\n' .. preparePostMacro(sequence.PostMacro or ''))
  8. GSPrintDebugMessage(L["createButton PostMacro: "] .. button:GetAttribute('PostMacro'))
  9. button:WrapScript(button, 'OnClick', format(OnClick, sequence.StepFunction or 'step = step % #macros + 1'))
  10. button.UpdateIcon = UpdateIcon
This is access by a macro in /macro that has the command "/click buttonname".

What I am trying to do is get rid of the dependency on the macro. I would like for the user to be able to drag this button straight to the ActionBar. If thats not possible I would like to be able to create a button that just has the click macro on it that doesnt need the /macro underneath it. I can create the button easy enough but its getting it to the Action Bar.
__________________
BattleNet: TimothyLuke#1860
WowLazyMacros/Curse/GitHub/WowInterface: TimothyLuke

Most Commonly Played Characters:
Huldrych@Dath'Remar
Draik@Nagrand
  Reply With Quote
09-29-16, 05:05 AM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
I don't fully understand what it is that you're wanting to do. You can't put arbitrary buttons on an action bar, only valid actions such as spells, items and macros. If you want the action bar to support custom stuff, you would probably have to edit the action bar code.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
09-29-16, 05:19 AM   #3
TimothyLuke
A Fallenroot Satyr
 
TimothyLuke's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 24
I'll try to rephrase.

I can create a frame and put buttons on it that execute macro text by setting the button type to macro and loading up the appropriate macro string into the buttons execute and onclick functions. This button doesn't need to be a spell, item or macro from your /macro list but I have to house it in my own frame. I want to be able to drag that button so i can place it on an action bar. To do that currently I have a macro with the command /click button. While that works I don't want to have to use up a macro slot if I don't need to.
__________________
BattleNet: TimothyLuke#1860
WowLazyMacros/Curse/GitHub/WowInterface: TimothyLuke

Most Commonly Played Characters:
Huldrych@Dath'Remar
Draik@Nagrand
  Reply With Quote
09-29-16, 03:50 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
If you want it on the actual action bars, you need to use a macro. You are confusing buttons that you can create yourself and buttons that already exist that you only drag an action/macro to in order to assign it a function.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-29-16, 04:36 PM   #5
TimothyLuke
A Fallenroot Satyr
 
TimothyLuke's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 24
It's what I suspected but had to ask. Thanks all.
__________________
BattleNet: TimothyLuke#1860
WowLazyMacros/Curse/GitHub/WowInterface: TimothyLuke

Most Commonly Played Characters:
Huldrych@Dath'Remar
Draik@Nagrand
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Create Draggable "Button" that can be embedded in Action Bar


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off