From AddOn Studio
Jump to navigation Jump to search

Event API

"I" iconNote that this page is automatically generated; editing it is pointless. To edit event descriptions, edit the entries in the alphabetical pages, e.g. Events/A, Events/B, etc. Changes there will be copied over to here within a few hours.

Map related events

Category: Map

Supposed to fire whenever the world map is closed/hidden, though it doesn't. A workaround for this is to use "WORLD_MAP_UPDATE" to set a global variable to use elsewhere with an OnUpdate function; e.g.

 local Map_Changed = false;
 function MyAddon_OnEvent()
  if ( (event == "WORLD_MAP_UPDATE") and WorldMapFrame:IsVisible() ) then
   Map_Changed = true;
 function MyAddon_OnUpdate()
  if ( (Map_Changed) and not WorldMapFrame:IsVisible() ) then
   '' this...''
   Map_Changed = false;

When the second function is called, it checks to see if the map has been opened/closed (Map_Changed), then checks to see if the map is currently open (WorldMapFrame).
The effect is a code that executes only when the map closes.

Category: Map

Fired when the minimap is pinged.

UnitId of the one that created the ping (ie "player" or any of the group members)
Category: Map

Fired when the minimap scaling factor is changed. This happens, generally, whenever the player moves indoors from outside, or vice versa. There are no arguments to this event. To test the player's location, compare the minimapZoom and minimapInsideZoom CVars with the current minimap zoom level (see GetZoom).

This event does not relate to the + and - minimap zoom buttons.

Category: Map

Added in 2.3, this event is fired when the player selects a different tracking type from the menu attached to the mini map. There seems to be no useful arguments as of the time of this writing.

Mouse button used to click the tracking button (i.e. "LEFTBUTTON")
Category: Map
Category: Map

Fired when the world map should be updated.

When entering a battleground, this event won't fire until the zone is changed (i.e. in WSG when you walk outside of Warsong Lumber Mill or Silverwing Hold --Salanex

Category: Map

Fired when the player enters a new zone. Zones are the smallest named subdivions of the game world and are contained within areas (also called regions). Whenever the text over the minimap changes, this event is fired.

Category: Map

Fired when a player enters a new zone within a city.

Category: Map

Fired when the user enters a new zone and a new area. e.g. moving from Duskwood to Stranglethorn Vale. In interface terms, this is anytime you get a new set of channels. The ZONE_CHANGED events are mutually exclusive!

Note: When this event fires, the UI may still think you're in the zone you just left. Don't depend on GetRealZoneText() and similar functions to report the new zone in reaction to ZONE_CHANGED_NEW_AREA. (untested for similar events)