diff WorldPlan.lua @ 41:79e5e96e5f18 v1.0-rc10

- Clear Garrison minimap button pulse when shown
author Nenue
date Sun, 25 Dec 2016 15:17:35 -0500
parents 589c444d4837
children 77c2ffb5c7f5
line wrap: on
line diff
--- a/WorldPlan.lua	Sun Dec 25 13:04:57 2016 -0500
+++ b/WorldPlan.lua	Sun Dec 25 15:17:35 2016 -0500
@@ -180,12 +180,36 @@
   --hooksecurefunc(self, 'SetScript', function(...) self:print('|cFFFFFF00'..self:GetName()..':SetScript()|r', ...) end)
 end
 
-function WorldPlanCore:GetMapInfo()
+local BROKEN_ISLE_MAPS = {
+  [1007] = true, -- Broken Isle
+  [1014] = true, -- Dalaran
+  [1021] = true, -- Broken Shoree
+  [1024] = true, -- Highmountain
+  [1017] = true, -- Azsuna
+  [1018] = true, -- Val'Sharah
+  [1033] = true, -- Suramar
+  [1077] = true, -- Dreamgrove
+  [1096] = true, -- Eye of Azshara
+  [1080] = true, -- Thunder Totem
+  [1072] = true, -- True Shot Lodge,
 
-  db.currentMapID = GetCurrentMapAreaID()
-  db.isContinentMap = (db.currentMapID == BROKEN_ISLES_ID)
+}
+
+function WorldPlanCore:SetCurrentMap()
+  local mapAreaID = GetCurrentMapAreaID()
+  local isBrokenIsle = BROKEN_ISLE_MAPS[mapAreaID]
+
+
+  db.currentMapID = mapAreaID
+  db.isContinentMap = (mapAreaID == BROKEN_ISLES_ID)
   db.useContinentType = (WorldMapDetailFrame:GetScale() < 1)
 
+  for _, module in ipairs(db.OrderedModules) do
+    if module.OnMapInfo then
+      print('  |cFF00FFFF'..module:GetName() .. ':OnMapInfo()|r')
+      module:OnMapInfo(isBrokenIsle, mapAreaID)
+    end
+  end
 end
 
 
@@ -198,16 +222,9 @@
       self:Setup()
     end
   else
-    if (event == 'WORLD_MAP_UPDATE') or (event == 'PLAYER_ENTERING_WORLD') then
+    if (event == 'WORLD_MAP_UPDATE') or (event == 'PLAYER_ENTERING_WORLD') or (event == 'PLAYER_LOGIN') then
       print('|cFFFF4400currentMapID =', db.currentMapID, ...)
-      self:GetMapInfo()
-    end
-
-    for i, module in ipairs(db.OrderedModules) do
-      if module.OnEvent then
-        print('  |cFF00FFFF'..module:GetName() .. ':OnEvent()|r')
-        module:OnEvent(event, ...)
-      end
+      self:SetCurrentMap()
     end
   end
 end
@@ -294,7 +311,12 @@
 
   hooksecurefunc("WorldMapFrame_Update", function()
     print('|cFFFF4400WorldMapFrame_Update|r')
-    self:GetMapInfo()
+    for _,module in ipairs(db.OrderedModules) do
+      if module.OnWorldMapFrameUpdate then
+        print('  |cFFFF4400'..module:GetName()..'|r')
+        module:OnWorldMapFrameUpdate()
+      end
+    end
   end)