Thread Tools Display Modes
06/16/15, 07:57 AM   #1
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Event_action_layer_pushed

How do I detect what type of layer was pushed to the UI? Do I use SI_GAMECAMERAACTIONTYPE? I'd like to detect when I approach an npc and have the ability to interact with it.
  Reply With Quote
06/16/15, 11:56 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
You can just use the event, create a callback function for that event and do a debug message output d("Active layer index: " .. activeLayerIndex) for the parameters layerIndex and activeLayerIndex.

If activeLayerIndex e.g. is 2 the main menu is shown somehow (inside the pop event).

Maybe there is some special activeLayerIndex for the NPC interaction too then.

But as I can see the answer for your search was given in that other lua/xml thread already.

Last edited by Baertram : 06/16/15 at 11:59 AM.
  Reply With Quote
06/22/15, 12:21 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Lua Code:
  1. EVENT_ACTION_LAYER_POPPED (integer eventCode, integer layerIndex, integer activeLayerIndex)
  2. EVENT_ACTION_LAYER_PUSHED (integer eventCode, integer layerIndex, integer activeLayerIndex)

Then there is a lot of API to find out information about it, below is only a few examples (there is more layer API than this), search the wiki API page for "layer" and just go through looking for the API that gives you the info you need.
Lua Code:
  1. GetNumActionLayers()
  2.         Returns: integer actionLayers
  3.  
  4.     GetActionLayerInfo(integer layerIndex)
  5.         Returns: string layerName, integer numLayerCategories
  6.  
  7.     GetActionLayerCategoryInfo(integer layerIndex, integer categoryIndex)
  8.         Returns: string categoryName, integer numActions
  9.  
  10.     GetActionInfo(integer layerIndex, integer categoryIndex, integer actionIndex)
  11.         Returns: string actionName, boolean isRebindable, boolean isHidden
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Event_action_layer_pushed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off