View Single Post
12/25/15, 10:20 AM   #29
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by votan View Post
Although I still don't understand, why not doing the count upon first tooltip, checking if the world map is shown or about to be shown can be done this way:
Lua Code:
  1. local function WorldMapStateChanged(oldState, newState)
  2.         if (newState == SCENE_FRAGMENT_SHOWING) then
  3.         elseif (newState == SCENE_FRAGMENT_SHOWN) then
  4.         end
  5. end
  6. WORLD_MAP_SCENE:RegisterCallback("StateChange", WorldMapStateChanged)
I tried that but it only triggered when I changed to another map. Not when I just pressed "M".
Don't know if I did something wrong. Maybe it is because I had already previously opened the map in that zone?
  Reply With Quote