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:
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:
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!