WoW:API GetMapContinents: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(+Outland, formatting)
Line 1: Line 1:
<center>'''GetMapContinents''' ''-Documentation by [[user:Meog|Meog]]-''</center>
{{wowapi}} __NOTOC__
 
Returns a list of continent names.
Returns a list of continent names
 
  continent_1, continent_2, ..., continent_N = GetMapContinents();
  continent_1, continent_2, ..., continent_N = GetMapContinents();


----
==Parameters==
;''Arguments''
===Returns===
 
:''none''
 
----
;''Returns''
 
:continent_1, continent_2, ..., continent_N
:continent_1, continent_2, ..., continent_N
:;continent_<i>i</i> : String - The name of the <i>i</i>'th continent, (i corresponds to the value [[API GetCurrentMapContinent|GetCurrentMapContinent()]] returns)
:;continent_<i>i</i> : String - The name of the <i>i</i>'th continent, (i corresponds to the value [[API GetCurrentMapContinent|GetCurrentMapContinent()]] returns)


----
==Example==
;''Example''
  local continentNames, key, val = { GetMapContinents() } ;
 
  for key, val in continentNames do
  continentNames = {};
  DEFAULT_CHAT_FRAME:AddMessage("#" .. key .. ": " .. val);
   
function LoadContinents(...)
    for i=1, arg.n, 1 do
      continentNames[i] = arg[i];
    end
  end
  end
LoadContinents(GetMapContinents());
Note that this can also be achieved with
continentNames = { GetMapContinents() } ;
;''Result''
The array ContinentNames holds all available continent names:
ContinentNames[1] == "Kalimdor"
ContinentNames[2] == "Eastern Kingdoms"
----
;''Details''
: At release this will be only two: "Kalimdor" and "Eastern Kingdoms", but when using this function keep in mind, that there maybe more sometime after release, and that they may get added before the existing ones.


===Result===
A list of the continent names is displayed in the default chat frame.
#1: Kalimdor
#2: Eastern Kingdoms
#3: Outland


----
==Details==
{{WoW API}}
Note that as more expansions are releases, the output of this function may change.

Revision as of 17:14, 23 December 2006

WoW API < GetMapContinents

Returns a list of continent names.

continent_1, continent_2, ..., continent_N = GetMapContinents();

Parameters

Returns

continent_1, continent_2, ..., continent_N
continent_i
String - The name of the i'th continent, (i corresponds to the value GetCurrentMapContinent() returns)

Example

local continentNames, key, val = { GetMapContinents() } ;
for key, val in continentNames do
 DEFAULT_CHAT_FRAME:AddMessage("#" .. key .. ": " .. val);
end

Result

A list of the continent names is displayed in the default chat frame.

#1: Kalimdor
#2: Eastern Kingdoms
#3: Outland

Details

Note that as more expansions are releases, the output of this function may change.