WoW:API ChangeActionBarPage: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Changes the current action button set.)
 
m (Move page script moved page API ChangeActionBarPage to API ChangeActionBarPage without leaving a redirect)
 
(9 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<center>'''ChangeActionBarPage''' ''-Documentation by The Nerd Wonder''</center>
{{wowapi}}


Changes the current action button set.
Changes the current action button to the one specified in the arguments.


----
ChangeActionBarPage(actionBarPage)
;''Arguments''
== Parameters ==
 
=== Arguments ===
<!-- List each argument, together with its type -->
:(actionBarPage)
 
No arguments are passed. This function checks the current value of the global CURRENT_ACTIONBAR_PAGE and sets the action bar to show that page. Possible page numbers are in the range 1 - NUM_ACTIONBAR_PAGES.


----
:;actionBarPage : Numeric - Which page of your action bar to switch to. Expects an integer 1-6.
;''Returns''


:;nil
=== Returns ===
:''nil''


----
== Example ==
;''Example''
<!-- begin code -->
 
  function ActionBar_FirstPage()
  function ActionBar_PageUp()
     ChangeActionBarPage(1);
     CURRENT_ACTIONBAR_PAGE = CURRENT_ACTIONBAR_PAGE + 1;
    if ( CURRENT_ACTIONBAR_PAGE > NUM_ACTIONBAR_PAGES ) then
      CURRENT_ACTIONBAR_PAGE = 1;
    end
    ChangeActionBarPage();
  end
  end
<!-- end code -->


;''Result''
Or for a macro:


This function does the same thing as pressing the Page Up button. It increments CURRENT_ACTIONBAR_PAGE, checks for a valid page number, then calls ChangeActionBarPage() to change the action bar.
<!-- begin code -->
/script ChangeActionBarPage(2);
<!-- end code -->


This function can be found in Interface/FrameXML/ActionButton.lua.
== Details ==
: Notifies the UI that the current action button set has been updated to the current value of the CURRENT_ACTIONBAR_PAGE global variable.


----
: Will cause an ACTIONBAR_PAGE_CHANGED event to fire only if there was actually a change (tested in 2.3.0).
;''Details''


: Changes the current action button set.
: Do nothing in combat mode


----
----
{{Template:WoW API}}
__NOTOC__
[[Category:API Functions|Action Functions]]

Latest revision as of 04:45, 15 August 2023

WoW API < ChangeActionBarPage

Changes the current action button to the one specified in the arguments.

ChangeActionBarPage(actionBarPage)

Parameters[edit]

Arguments[edit]

(actionBarPage)
actionBarPage
Numeric - Which page of your action bar to switch to. Expects an integer 1-6.

Returns[edit]

nil

Example[edit]

function ActionBar_FirstPage()
   ChangeActionBarPage(1);
end

Or for a macro:

/script ChangeActionBarPage(2);

Details[edit]

Notifies the UI that the current action button set has been updated to the current value of the CURRENT_ACTIONBAR_PAGE global variable.
Will cause an ACTIONBAR_PAGE_CHANGED event to fire only if there was actually a change (tested in 2.3.0).
Do nothing in combat mode