comparison 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
comparison
equal deleted inserted replaced
40:589c444d4837 41:79e5e96e5f18
178 function WorldPlanCore:OnShow() 178 function WorldPlanCore:OnShow()
179 --print(self:GetName()..':OnShow()') 179 --print(self:GetName()..':OnShow()')
180 --hooksecurefunc(self, 'SetScript', function(...) self:print('|cFFFFFF00'..self:GetName()..':SetScript()|r', ...) end) 180 --hooksecurefunc(self, 'SetScript', function(...) self:print('|cFFFFFF00'..self:GetName()..':SetScript()|r', ...) end)
181 end 181 end
182 182
183 function WorldPlanCore:GetMapInfo() 183 local BROKEN_ISLE_MAPS = {
184 184 [1007] = true, -- Broken Isle
185 db.currentMapID = GetCurrentMapAreaID() 185 [1014] = true, -- Dalaran
186 db.isContinentMap = (db.currentMapID == BROKEN_ISLES_ID) 186 [1021] = true, -- Broken Shoree
187 [1024] = true, -- Highmountain
188 [1017] = true, -- Azsuna
189 [1018] = true, -- Val'Sharah
190 [1033] = true, -- Suramar
191 [1077] = true, -- Dreamgrove
192 [1096] = true, -- Eye of Azshara
193 [1080] = true, -- Thunder Totem
194 [1072] = true, -- True Shot Lodge,
195
196 }
197
198 function WorldPlanCore:SetCurrentMap()
199 local mapAreaID = GetCurrentMapAreaID()
200 local isBrokenIsle = BROKEN_ISLE_MAPS[mapAreaID]
201
202
203 db.currentMapID = mapAreaID
204 db.isContinentMap = (mapAreaID == BROKEN_ISLES_ID)
187 db.useContinentType = (WorldMapDetailFrame:GetScale() < 1) 205 db.useContinentType = (WorldMapDetailFrame:GetScale() < 1)
188 206
207 for _, module in ipairs(db.OrderedModules) do
208 if module.OnMapInfo then
209 print(' |cFF00FFFF'..module:GetName() .. ':OnMapInfo()|r')
210 module:OnMapInfo(isBrokenIsle, mapAreaID)
211 end
212 end
189 end 213 end
190 214
191 215
192 function WorldPlanCore:OnEvent (event, ...) 216 function WorldPlanCore:OnEvent (event, ...)
193 217
196 220
197 if IsLoggedIn() and not self.initialized then 221 if IsLoggedIn() and not self.initialized then
198 self:Setup() 222 self:Setup()
199 end 223 end
200 else 224 else
201 if (event == 'WORLD_MAP_UPDATE') or (event == 'PLAYER_ENTERING_WORLD') then 225 if (event == 'WORLD_MAP_UPDATE') or (event == 'PLAYER_ENTERING_WORLD') or (event == 'PLAYER_LOGIN') then
202 print('|cFFFF4400currentMapID =', db.currentMapID, ...) 226 print('|cFFFF4400currentMapID =', db.currentMapID, ...)
203 self:GetMapInfo() 227 self:SetCurrentMap()
204 end
205
206 for i, module in ipairs(db.OrderedModules) do
207 if module.OnEvent then
208 print(' |cFF00FFFF'..module:GetName() .. ':OnEvent()|r')
209 module:OnEvent(event, ...)
210 end
211 end 228 end
212 end 229 end
213 end 230 end
214 231
215 function WorldPlanCore:OnNext(func) 232 function WorldPlanCore:OnNext(func)
292 end) 309 end)
293 310
294 311
295 hooksecurefunc("WorldMapFrame_Update", function() 312 hooksecurefunc("WorldMapFrame_Update", function()
296 print('|cFFFF4400WorldMapFrame_Update|r') 313 print('|cFFFF4400WorldMapFrame_Update|r')
297 self:GetMapInfo() 314 for _,module in ipairs(db.OrderedModules) do
315 if module.OnWorldMapFrameUpdate then
316 print(' |cFFFF4400'..module:GetName()..'|r')
317 module:OnWorldMapFrameUpdate()
318 end
319 end
298 end) 320 end)
299 321
300 322
301 SLASH_WORLDPLAN1 = "/worldplan" 323 SLASH_WORLDPLAN1 = "/worldplan"
302 SLASH_WORLDPLAN2 = "/wp" 324 SLASH_WORLDPLAN2 = "/wp"