Quantcast WoW Action Button - WoWInterface
Thread Tools Display Modes
04-06-19, 02:11 PM   #1
D4KiR
A Defias Bandit
Join Date: Apr 2019
Posts: 2
Post WoW Action Button

Hi, i want to make more Action Buttons for my HUD.

so i tried this:

Code:
local btn = CreateFrame("Button", "myButton", UIParent, "SecureActionButtonTemplate");
btn:SetAttribute("type", "action");
btn:SetAttribute("action", 1);
But this is hidden in my hud.

Code:
local btn = CreateFrame("Button", "myButton", UIParent, "ActionButtonTemplate, SecureActionButtonTemplate");
btn:SetAttribute("type", "action");
btn:SetAttribute("action", 1); -- mirrors ActionButton1
This shows me the button, but it did not work like the wow ones. Also it mirror ActionButton1 because of the id 1.

So is there a tutorial or a template that is exactly like the WoW Action Buttons?
i dont want to use the hidden action buttons, i want to make new ones, more of them. I know there are some addons that do that, but i have different ideas for them.

i just want to learn how to make them, like the existing ones.
  Reply With Quote
04-06-19, 03:11 PM   #2
elcius
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 62
make it a CheckButton and inherit from ActionBarButtonTemplate instead, it contains all the action bar event handlers.
but action slots only go to like 120, if you need more you'll have to simulate it using non-action types.
  Reply With Quote
04-06-19, 03:45 PM   #3
D4KiR
A Defias Bandit
Join Date: Apr 2019
Posts: 2
Originally Posted by elcius View Post
make it a CheckButton and inherit from ActionBarButtonTemplate instead, it contains all the action bar event handlers.
but action slots only go to like 120, if you need more you'll have to simulate it using non-action types.
Thanks for the reply!

Code:
local btn = CreateFrame("CheckButton", "Example", UIParent, "ActionBarButtonTemplate")
Works great except that it is mirroring the button with ID 1 from 120 like you said.
yeah, but i want to make over the 120 (but over it, it is pet, stances and such)

so if i want to make more the 120 i need to recode the actionbutton?

i thought i can make an actionbutton and then save:
the hotkey
spell that it is in it
by myself

but when its not 1-120 ID it dont get the spell, when i put it in

and i cant find a tutorial how it is setup, so i can change it so it work for me

any response would help me

Last edited by D4KiR : 04-06-19 at 03:50 PM.
  Reply With Quote
04-06-19, 04:35 PM   #4
elcius
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 62
https://wow.gamepedia.com/SecureActionButtonTemplate

If you want the blizzard art and stuff you can inherit from ActionButtonTemplate again, but you'll need to do most of the event handlers yourself, since blizzards handlers will most likely assume the button is using an action slot.

https://github.com/tomrus88/Blizzard...onBarFrame.xml
https://github.com/tomrus88/Blizzard...tionButton.lua

if you want to have drag/drop you'll need to simulate PlaceAction() which does a bit of the lifting for the default action buttons, you'll have to process whatever the cursor is holding, and configure the frame attributes accordingly.
when assigning the hotkey you can just bind it to click the frame, or just perform the intended command directly.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » WoW Action Button

Thread Tools
Display Modes

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