WoW:API GetNumMacroIcons: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(docs)
 
m (Move page script moved page API GetNumMacroIcons to API GetNumMacroIcons without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:


==Example==
==Example==
  local numIcons, i = GetNumMacroIcons(); -- i will be nil, but we do not really care at this point.
  local numIcons = GetNumMacroIcons()
  for i=1,numIcons do
  for i=1,numIcons do
   DEFAULT_CHAT_FRAME:AddMessage(string.format("Icon %d: %s",i,GetMacroIconInfo(i)));
   DEFAULT_CHAT_FRAME:AddMessage(string.format("Icon %d: %s",i,GetMacroIconInfo(i)));

Latest revision as of 04:46, 15 August 2023

WoW API < GetNumMacroIcons

Returns the number of possible macro icons.

numIcons = GetNumMacroIcons();

Parameters[edit]

Returns[edit]

numIcons
Integer - Number of available macro icons.

Example[edit]

local numIcons = GetNumMacroIcons()
for i=1,numIcons do
 DEFAULT_CHAT_FRAME:AddMessage(string.format("Icon %d: %s",i,GetMacroIconInfo(i)));
end

Result[edit]

Outputs the IDs and texture names for all available macro icons to the default chat frame.

Notes[edit]

This function must be called before using GetMacroIconInfo(index) to retrieve texture information.