WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   WoW Action Button (https://www.wowinterface.com/forums/showthread.php?t=57099)

D4KiR 04-06-19 02:11 PM

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.

elcius 04-06-19 03:11 PM

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.

D4KiR 04-06-19 03:45 PM

Quote:

Originally Posted by elcius (Post 331880)
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

elcius 04-06-19 04:35 PM

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.


All times are GMT -6. The time now is 06:25 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI