49
edits
m (This revision and previous are available under: CC BY-SA 3.0. See list of authors in previous history below.) |
No edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__NOGALLERY__ __NONEWSECTIONLINK__ __NOWYSIWYG__ {{wowapi}} | __NOGALLERY__ __NONEWSECTIONLINK__ __NOWYSIWYG__ {{wowapi}} | ||
This is the main reference page for the WoW UI | This is the main reference page for the Lua based WoW UI API, and is available to user Macros and AddOns. This API is available during normal game play. See also [[World of Warcraft API/Glue|WoW Glue API]]. | ||
== | == Details == | ||
The '''World of Warcraft API''', or '''WoW API''', is a set of Lua functions and facilities provided by the Blizzard WoW Client, to allow interaction with the | The '''World of Warcraft API''', or '''WoW API''', is a set of Lua functions and facilities provided by the Blizzard WoW Client, to allow interaction with the [[wowwiki:World of Warcraft|World of Warcraft]] and its user interface. The list below is incomplete, and kept up to date through user contributions. See also the [[Global functions|an automatically-generated exhaustive list]] of all API functions present in the latest live client. | ||
For beginners, [[ | For beginners, [[AddOn]] contains a number of very informative sources to help get you started. You can also [[Viewing Blizzard's WoW user interface code|examine the existing UI code]] to find examples of how the various functions are used by the default UI. | ||
== Reference == | == Reference == | ||
| Line 12: | Line 12: | ||
* [[API types]] - variable value types, used here as parameters and return values. | * [[API types]] - variable value types, used here as parameters and return values. | ||
'''If you're contributing documentation, please read [[ | '''If you're contributing documentation, please read [[AddOn Studio Wiki:How to edit API pages|How to edit API pages]].''' | ||
Function names can be prefixed with the following tags, see [[ | Function names can be prefixed with the following tags, see [[AddOn Studio Wiki:API notation and conventions|API notation and conventions]]: | ||
* PROTECTED - can only be called from [[secure code]]. See [[:Category:World of Warcraft API/Protected Functions|Protected Functions]]. | * PROTECTED - can only be called from [[secure code]]. See [[:Category:World of Warcraft API/Protected Functions|Protected Functions]]. | ||
* NOCOMBAT - can only be called from [[secure code]] while out of combat. | * NOCOMBAT - can only be called from [[secure code]] while out of combat. | ||
| Line 34: | Line 34: | ||
=== Achievement === | === Achievement === | ||
These functions are only available in | These functions are only available in Patch 3.0. | ||
:{{id|API|AddTrackedAchievement}}(achievementId) - Add an achievement to tracking. | :{{id|API|AddTrackedAchievement}}(achievementId) - Add an achievement to tracking. | ||
:{{id|API|CanShowAchievementUI}}() - Returns if the AchievementUI can be displayed | :{{id|API|CanShowAchievementUI}}() - Returns if the AchievementUI can be displayed | ||
| Line 150: | Line 150: | ||
=== Archaeology === | === Archaeology === | ||
Functions for the Archaeology Profession. Added in 4.0.1 [[Cataclysm]]. | Functions for the Archaeology Profession. Added in 4.0.1 [[w:c:wowwiki:Cataclysm|Cataclysm]]. | ||
:{{id|API|CanSolveArtifact}}() | :{{id|API|CanSolveArtifact}}() | ||
:{{id|API|GetArtifactInfoByRace}}(raceIndex, projectIndex) | :{{id|API|GetArtifactInfoByRace}}(raceIndex, projectIndex) | ||
| Line 625: | Line 625: | ||
:{{id|API|GetCurrencyListInfo}}(index) - return information about an element in the currency list. | :{{id|API|GetCurrencyListInfo}}(index) - return information about an element in the currency list. | ||
:{{id|API|ExpandCurrencyList}}(index, state) - sets the expanded/collapsed state of a currency list header. | :{{id|API|ExpandCurrencyList}}(index, state) - sets the expanded/collapsed state of a currency list header. | ||
:UI {{id|API|MoneyInputFrame_GetCopper}}(frame) - Returns the amount of money entered in a MoneyInputFrame in copper pieces | |||
:{{id|API|SetCurrencyUnused}}(id, state) - alters whether a currency is marked as unused. | :{{id|API|SetCurrencyUnused}}(id, state) - alters whether a currency is marked as unused. | ||
:{{id|API|GetNumWatchedTokens}}() - returns the number of currently watched. | :{{id|API|GetNumWatchedTokens}}() - returns the number of currently watched. | ||
| Line 725: | Line 726: | ||
=== Equipment === | === Equipment === | ||
Equipment management was added in 3.1.2. | Equipment management was added in 3.1.2. | ||
:{{id|API| | :NOCOMBAT {{idc|API|C_EquipmentSet|UseEquipmentSet}}(equipmentSetID) : setWasEquipped - Equips items from a specified equipment set. | ||
:{{id|API|DeleteEquipmentSet}}("name") - Forgets an equipment set. | |||
:UI {{id|API|GetEquipmentSetIconInfo}}(index) - Returns information about available icons. | |||
:{{id|API|GetEquipmentSetInfo}}(index) - Returns information about an equipment set. | :{{id|API|GetEquipmentSetInfo}}(index) - Returns information about an equipment set. | ||
:{{id|API|GetEquipmentSetInfoByName}}("name") - Returns information about an equipment set. | :{{id|API|GetEquipmentSetInfoByName}}("name") - Returns information about an equipment set. | ||
:{{id|API|GetEquipmentSetItemIDs}}("name"[, returnTable]) - Populates and returns a table with the item IDs. | :{{id|API|GetEquipmentSetItemIDs}}("name"[, returnTable]) - Populates and returns a table with the item IDs. | ||
:{{id|API|GetEquipmentSetLocations}}("name"[, returnTable]) - Populates and returns a table with the item locations. | :{{id|API|GetEquipmentSetLocations}}("name"[, returnTable]) - Populates and returns a table with the item locations. | ||
:{{id|API|GetNumEquipmentSets}}() - Returns the number of saved equipment sets. | |||
:{{id|API|EquipmentManagerClearIgnoredSlotsForSave}}() - removes the ignore flag from all slots when saving an equipment set. | |||
:{{id|API|EquipmentManagerIgnoreSlotForSave}}(slot) - flags the slot to be ignored when saving an equipment set. | |||
:{{id|API|EquipmentManagerUnignoreSlotForSave}}(slot) - removes the ignore flag from a slot when saving an equipment set. | |||
:UI {{id|API|EquipmentManager|UnpackLocation|f=1}}(location) - Unpacks a location integer to determine the actual inventory location. | :UI {{id|API|EquipmentManager|UnpackLocation|f=1}}(location) - Unpacks a location integer to determine the actual inventory location. | ||
:{{id|API|EquipmentSetContainsLockedItems}}("name") - Checks if some of the items in the set are currently locked (pending client/server interaction). | |||
:{{id|API|PickupEquipmentSet}}(index) - Places an equipment set on the cursor. | :{{id|API|PickupEquipmentSet}}(index) - Places an equipment set on the cursor. | ||
:{{id|API|PickupEquipmentSetByName}}("name") - Places an equipment set on the cursor. | :{{id|API|PickupEquipmentSetByName}}("name") - Places an equipment set on the cursor. | ||
:{{id|API| | :{{id|API|RenameEquipmentSet}}("oldName", "newName") - Renames an equipment set. | ||
:{{id|API|SaveEquipmentSet}}("name", iconIndex) - Saves the currently equipped items in a set. | :{{id|API|SaveEquipmentSet}}("name", iconIndex) - Saves the currently equipped items in a set. | ||
:{{id|API| | :REMOVED {{id|API|UseEquipmentSet}}("name") - Equips an equipment set. | ||
=== Faction === | === Faction === | ||
| Line 1,259: | Line 1,261: | ||
:{{id|API|GetPlayerMapPosition}}("[[unitId|unit]]") - Returns the position of a unit on the current world map. | :{{id|API|GetPlayerMapPosition}}("[[unitId|unit]]") - Returns the position of a unit on the current world map. | ||
:{{id|API|ProcessMapClick}}(x,y) - Passes a click to the client, which then calculates if the zone has to be changed. | :{{id|API|ProcessMapClick}}(x,y) - Passes a click to the client, which then calculates if the zone has to be changed. | ||
:{{id|API|QuestMapGetPOIInfoForQuest}}(questIndex, poiIndex) - returns details about a point of interest on the map | |||
:{{id|API|RequestBattlefieldPositions}}() - Request new data for GetBattlefieldPosition(). | :{{id|API|RequestBattlefieldPositions}}() - Request new data for GetBattlefieldPosition(). | ||
:{{id|API|SetDungeonMapLevel}}(level) - Sets which level of a multi-level map (Dalaran, dungeons, etc) is currently shown. | :{{id|API|SetDungeonMapLevel}}(level) - Sets which level of a multi-level map (Dalaran, dungeons, etc) is currently shown. | ||
| Line 1,265: | Line 1,268: | ||
:{{id|API|SetMapZoom}}(continentIndex[, zoneIndex]) - Sets the current world map to a specific continent and optionally zone. | :{{id|API|SetMapZoom}}(continentIndex[, zoneIndex]) - Sets the current world map to a specific continent and optionally zone. | ||
:{{id|API|SetupFullscreenScale}}() - Configures scale of full-screen views, such as the world map, to best fill screen. | :{{id|API|SetupFullscreenScale}}() - Configures scale of full-screen views, such as the world map, to best fill screen. | ||
:UI {{id|API|ToggleWorldMap}}() - Turns the world map on/off. | |||
:{{id|API|UpdateMapHighlight}}(x,y) - Provides map rollover information for highlighting. | :{{id|API|UpdateMapHighlight}}(x,y) - Provides map rollover information for highlighting. | ||
:{{id|API|CreateWorldMapArrowFrame}}("frame") - create a arrow cursor for the player position and orientation. | :{{id|API|CreateWorldMapArrowFrame}}("frame") - create a arrow cursor for the player position and orientation. | ||
| Line 1,367: | Line 1,371: | ||
=== Petition === | === Petition === | ||
Petitions are signup documents for guilds and arena teams. Some functions below only apply to a particular petition type. | Petitions are signup documents for guilds and arena teams. Some functions below only apply to a particular petition type. | ||
:{{id|API|ClosePetition}}() - Closes the current petition. | :{{id|API|ClosePetition}}() - Closes the current petition. | ||
:{{id|API|GetNumPetitionNames}}() - Gets the number of signatures on the current petition. | :{{id|API|GetNumPetitionNames}}() - Gets the number of signatures on the current petition. | ||
| Line 1,395: | Line 1,398: | ||
:{{id|API|GetAvailableTitle}}(index) - Gets the title of an available quest (only available after QUEST_GREETING event). | :{{id|API|GetAvailableTitle}}(index) - Gets the title of an available quest (only available after QUEST_GREETING event). | ||
:{{id|API|GetAvailableQuestInfo}}(index) - Returns metadata (quest type) about an available quest. (added 3.3.3) | :{{id|API|GetAvailableQuestInfo}}(index) - Returns metadata (quest type) about an available quest. (added 3.3.3) | ||
:{{id|API|GetDailyQuestsCompleted}} - Return the current number of daily quests completed today. | |||
:{{id|API|GetGreetingText}}() | :{{id|API|GetGreetingText}}() | ||
:{{id|API|GetMaxDailyQuests}} - Returns the maximum number of daily quests completable in one day. | |||
:{{id|API|GetNumActiveQuests}} - Gets the number of currently active quests from this NPC (only available after QUEST_GREETING event). | :{{id|API|GetNumActiveQuests}} - Gets the number of currently active quests from this NPC (only available after QUEST_GREETING event). | ||
:{{id|API|GetNumAvailableQuests}} - Gets the number of currently available quests from this NPC (only available after QUEST_GREETING event). | :{{id|API|GetNumAvailableQuests}} - Gets the number of currently available quests from this NPC (only available after QUEST_GREETING event). | ||
| Line 1,409: | Line 1,414: | ||
:{{id|API|GetProgressText}}() - Returns quest progress text, displayed by the NPC before the player pressed "Continue". | :{{id|API|GetProgressText}}() - Returns quest progress text, displayed by the NPC before the player pressed "Continue". | ||
:{{id|API|GetQuestBackgroundMaterial}} - Returns the material string associated with the particular quest. | :{{id|API|GetQuestBackgroundMaterial}} - Returns the material string associated with the particular quest. | ||
:{{id|API|GetQuestsCompleted}}([table]) - Returns list of completed quests. only available after QUEST_QUERY_COMPLETE event. (added 3.3.0) | |||
:{{id|API|GetQuestGreenRange}}() - Return for how many levels below you quests and mobs remain "green" (i.e. yield xp) | :{{id|API|GetQuestGreenRange}}() - Return for how many levels below you quests and mobs remain "green" (i.e. yield xp) | ||
:{{id|API|GetQuestIndexForTimer}} | :{{id|API|GetQuestIndexForTimer}} | ||
| Line 1,431: | Line 1,437: | ||
:{{id|API|GetQuestLogTitle}}(index) - Returns verbose data about a particular quest log entry: level requirement, tag, suggested group, completed status, etc. | :{{id|API|GetQuestLogTitle}}(index) - Returns verbose data about a particular quest log entry: level requirement, tag, suggested group, completed status, etc. | ||
:{{id|API|GetQuestMoneyToGet}} - Returns amount of money required for quest currently displayed in gossip. | :{{id|API|GetQuestMoneyToGet}} - Returns amount of money required for quest currently displayed in gossip. | ||
:{{id|API|GetQuestResetTime}} - Returns number of seconds until quest reset. | |||
:{{id|API|GetQuestReward}}(rewardIndex) - Completes the quest with the specified quest reward. | :{{id|API|GetQuestReward}}(rewardIndex) - Completes the quest with the specified quest reward. | ||
:{{id|API|GetQuestText}} - Gets the description of the current quest. | :{{id|API|GetQuestText}} - Gets the description of the current quest. | ||
| Line 1,460: | Line 1,467: | ||
:{{id|API|ShiftQuestWatches}}(id1, id2) - Exchanges the order of two watched quests. (added 3.3.3) | :{{id|API|ShiftQuestWatches}}(id1, id2) - Exchanges the order of two watched quests. (added 3.3.3) | ||
:{{id|API|SortQuestWatches}}() - Sorts the watched quests according to proximity and returns whether the order changed since last sorting. (added 3.3.3) | :{{id|API|SortQuestWatches}}() - Sorts the watched quests according to proximity and returns whether the order changed since last sorting. (added 3.3.3) | ||
:{{id|API| | :UI {{id|API|ToggleQuestLog}}() - Returns whether the offered quest is a weekly quest. (added 6.0.2) | ||
:{{id|API|WatchFrame_Update}} - Updates the watch frame display. | :{{id|API|WatchFrame_Update}} - Updates the watch frame display. | ||
:{{id|API|QueryQuestsCompleted}}() - Query list of completed quests. (added 3.3.0) | :{{id|API|QueryQuestsCompleted}}() - Query list of completed quests. (added 3.3.0) | ||
:{{id|API|QuestIsDaily}}() - Returns whether the offered quest is a daily quest. (added 3.3.3) | :{{id|API|QuestIsDaily}}() - Returns whether the offered quest is a daily quest. (added 3.3.3) | ||
:{{id|API|QuestIsWeekly}}() - Returns whether the offered quest is a weekly quest. (added 3.3.3) | :{{id|API|QuestIsWeekly}}() - Returns whether the offered quest is a weekly quest. (added 3.3.3) | ||
| Line 1,607: | Line 1,611: | ||
:{{id|API|UpdateAddOnMemoryUsage}}() - Scan through memory profiling data and update the per-addon statistics | :{{id|API|UpdateAddOnMemoryUsage}}() - Scan through memory profiling data and update the per-addon statistics | ||
=== | === Protection === | ||
:{{id|API|issecure}}() - Determine if the current environment is secure. | :{{id|API|issecure}}() - Determine if the current environment is secure. | ||
:{{id|API|forceinsecure}}() - Taint the current execution path. | :{{id|API|forceinsecure}}() - Taint the current execution path. | ||
| Line 2,122: | Line 2,126: | ||
== See also == | == See also == | ||
* [[API change summaries]] document changes made in WoW patches, as summarized on the US official UI forum. | * [[API change summaries]] document changes made in WoW patches, as summarized on the US official UI forum. | ||
* [[Battle.net API]] | * [[Battle.net API]] previously known as the Community Web Platform API or Web API, for web API access. Info on functions to interact with [[wowwiki:Blizzard|Blizzard]] web sites, not in-game. | ||
* [[Widget API]] documents other general Lua methods that can be called on widget objects. | * [[Widget API]] documents other general Lua methods that can be called on widget objects. | ||
* [[XML UI]] documents the Ui XML interface, and includes other documentation relating to [[FrameXML]] and [[GlueXML]]. | * [[XML UI]] documents the Ui XML interface, and includes other documentation relating to [[FrameXML]] and [[GlueXML]]. | ||
* [[Lua functions|WoW Lua]] describe the Lua language and library functions available in the WoW client. | * [[Lua functions|WoW Lua]] describe the Lua language and library functions available in the WoW client. | ||
* [[ | * [[AddOn]] is the main reference for WoW AddOn development. | ||
* [[User Defined Functions]] lists various useful user-contributed functions. | * [[User Defined Functions]] lists various useful user-contributed functions. | ||
** [[:Category:AddOns Libraries]] contains some AddOns that do nothing but provide you with utility functions. | ** [[:Category:AddOns Libraries]] contains some AddOns that do nothing but provide you with utility functions. | ||
| Line 2,135: | Line 2,139: | ||
{{elink|type=bnetwoweu|site=Official Interface and Macros forum (EU)|link=http://eu.battle.net/wow/en/forum/874706/}} | {{elink|type=bnetwoweu|site=Official Interface and Macros forum (EU)|link=http://eu.battle.net/wow/en/forum/874706/}} | ||
News: | News: | ||
{{elink|type=wowinsider|link=http://wow.joystiq.com/2011/07/21/blizzards-apis-and-you-cool-information-and-tools-coming-down/|desc=Blizzard's APIs and You: Cool information and tools coming down the pipe|bydate=by | {{elink|type=wowinsider|link=http://wow.joystiq.com/2011/07/21/blizzards-apis-and-you-cool-information-and-tools-coming-down/|desc=Blizzard's APIs and You: Cool information and tools coming down the pipe|bydate=by wowinsider Mathew McCurley Jul 21st 2011 at 7:00PM}} | ||