-
Notifications
You must be signed in to change notification settings - Fork 3
/
storms.lua
36 lines (32 loc) · 1.1 KB
/
storms.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local HBD = LibStub('HereBeDragons-2.0')
local DRAGON_ISLES_MAPS = {
[2022] = true, -- The Walking Shores
[2023] = true, -- Ohn'ahran Plains
[2024] = true, -- The Azure Span
[2025] = true, -- Thaldraszus
}
local function startsWith(str, start)
return string.sub(str, 1, string.len(start)) == start
end
local function updatePOIs(self)
local map = self:GetMap()
local mapID = map:GetMapID()
if mapID == 1978 then -- Dragon Isles
for childMapID in next, DRAGON_ISLES_MAPS do
for _, poiID in next, C_AreaPoiInfo.GetAreaPOIForMap(childMapID) do
local info = C_AreaPoiInfo.GetAreaPOIInfo(childMapID, poiID)
if info and startsWith(info.atlasName, 'ElementalStorm') then
local x, y = info.position:GetXY()
info.dataProvider = self
info.position:SetXY(HBD:TranslateZoneCoordinates(x, y, childMapID, mapID))
map:AcquirePin(self:GetPinTemplate(), info)
end
end
end
end
end
for provider in next, WorldMapFrame.dataProviders do
if provider.GetPinTemplate and provider:GetPinTemplate() == 'AreaPOIPinTemplate' then
hooksecurefunc(provider, 'RefreshAllData', updatePOIs)
end
end