Thread Tools Display Modes
Prev Previous Post   Next Post Next
07-23-17, 04:56 PM   #1
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
Any way to change ActionBar Page in combat? [SOLVED]

Hi all,

I know you can't (in principle, or maybe at all?) call ChangeActionBarPage(number) in combat but I was wondering if there is some context (e.g. in Restricted Environment) or maybe some alternative method to switching Blizzard's main action bar page, while in combat.

As for the first alternative, the "secure context", I must admit it's likely way way way over my head. but I did try declaring my events-handling frame as inheriting from SecureHandlerBaseTemplate. Like so:
Lua Code:
  1. CreateFrame("Frame", "AlkalineTweaks_EventsFrame", UiParent, "SecureHandlerBaseTemplate");
Checking the result of issecure() immediately afterwards I get that the execution path is insecure, as it was already before declaring the frame. And that's enough to leave me completely lost.
In any case, I think I understand the intention of implementing a Restricted Environment for your addon is so that the frames you create can do things they normaly couldn't, but to themselves only. I'm guessing it doesn't help at all when it comes to using such an environment to control Blizzard frames. Am I right?

As for the second alternative, I tried the following:
Lua Code:
  1. ActionBarDownButton:Click();
And it works just as well as ChangeActionBarPage(number), i.e. fine out of combat, not at all in combat.

For further clarification, I was trying to do these calls in response to ACTIONBAR_UPDATE_STATE and after checking GetActionBarPage() ~= 1, to bring it back to 1.
I have macros to switch between page 1 and 2 through 4, which work fine in combat. Furthermore, the macro bellow also works fine in combat:
Code:
/cast Some Spell
/changeactionbar 1
I'm just trying to find a way to do just that without having to write a macro for everything I place in a button on those three pages.

Any thoughts would be greatly appreciated!

Last edited by aallkkaa : 07-30-17 at 05:15 AM. Reason: Sollution given.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Any way to change ActionBar Page in combat?

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