How to build custom pet action buttons?
I would like to create some pet action buttons.
I'm using secure buttons with type/pet and action/1-10, which is working as expected. But ... of course my custom buttons do not provide the right click functionality of the Blizzard pet buttons (enable/disable autocast if spell). I can't figure out how I could add this. The Bilzzard stuff is: Lua Code:
The only thing I could use is the macro Code:
/petautocasttoggle <spellname> Is there really no option to use pet action buttons except re-using the Blizzard buttons?? |
You have a few options. For one, I believe you can actually inherit the pet button template and then set the IDs on all buttons. I think Bartender does that for shapeshift buttons. The more waterproof solution would be to either bind the right click to macrotext attribute /petautocasttoggle... or, not sure how that'll work if it only takes names. Anyway, you can also just a click attribute on the whole button to click the default button.
|
Hey, thanks Lombra. That sounds good. :)
Quote:
Quote:
[e] Hm. On a second thought ... it has to be a right click to trigger the autocast on/off thing. :/ I've not tested it right now, but I'm almost sure that inheriting from the pet template will introduce a lot of new problems. [e2] Wouldn't a button that inherits vom PetActionButtonTemplate be blocked too if TogglePetAutocast(self:GetID()) is called on click? [e3] I'm just realizing that /click passes the mouse buttons to the target button. :) I'll try it tomorrow. Thanks again. |
Quote:
|
Ok, I got this working now. It's even more complicated and stupid than I thought.
"type/click" expects a object in "clickbutton". It doesn't work with a frame name. :/ In my secure code PetActionButtonx obv. isn't a valid reference. So I tried to pre-set a frame reference via unsecure code. Like Lua Code:
Lua Code:
Quote:
Must be another bug within the secure button stuff (see http://www.wowinterface.com/forums/s...493#post297493) Seems as I have to set the clickbutton2/frameref thing via unsecure code. :/ |
Quote:
|
I would like to build a bar that supports dragging pet buttons in combat and states that change the button actions.
Like state 1 = type/spell state 2 = type/pet To do this I have to set the buttons type attribute at OnStateChanged. And to fully support type/pet on a state change I'll have to securely set type2/clickbutton2 to the actual pet bar button ... which is not possible due to the broken GetFrameRef() function. :/ Whatever ... I'll skip that and use a "fixed" pet bar. It's not worth the trouble. |
All times are GMT -6. The time now is 05:41 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI