Skip to content

Commit

Permalink
Fixed an error when sometimes opening the Siren Isle map was giving a…
Browse files Browse the repository at this point in the history
…n error
  • Loading branch information
Tercioo committed Dec 28, 2024
1 parent 86f9458 commit 576bbb9
Showing 1 changed file with 55 additions and 49 deletions.
104 changes: 55 additions & 49 deletions WorldQuestTracker_ZoneMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ function WorldQuestTracker.AdjustThatThingInTheBottomLeftCorner()
end
end

local specialPinsMapBans = {
[2369] = true, --Siren Isle
}

--atualiza as quest do mapa da zona ~updatezone ~zoneupdate
function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
--get the map shown in the map frame
Expand Down Expand Up @@ -746,56 +750,58 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
WorldQuestTracker.HideAllPOIPins()

--~locked ~poi ~areapoi
for pin in map:EnumeratePinsByTemplate("AreaPOIPinTemplate") do
local atlasName = pin.Texture:GetAtlas()
pin.Texture:SetAlpha(0.934)
if (atlasName == "worldquest-Capstone-questmarker-epic-Locked") then
--how to identify the point of interest?
if (not WorldQuestTracker.db.profile.pins_discovered["worldquest-Capstone-questmarker-epic-Locked"][pin.areaPoiID]) then
local poiInfo = pin:GetPoiInfo() --table
local mapData = pin:GetMap() --function

local poiId = poiInfo.areaPoiID
local mapId = mapData:GetMapID()
local position = poiInfo.position
local mapInfo = C_Map.GetMapInfo(mapId)
local parentMapInfo = C_Map.GetMapInfo(mapInfo.parentMapID)

--need check if a waypoint already exists
local mapPoint = UiMapPoint.CreateFromCoordinates(mapId, position.x, position.y)
C_Map.SetUserWaypoint(mapPoint)
local worldPosition = C_Map.GetUserWaypointPositionForMap(parentMapInfo.mapID)
C_Map.ClearUserWaypoint()

---@class wqt_poidata
---@field poiID number
---@field mapID number
---@field zoneX number
---@field zoneY number
---@field continentID number
---@field worldX number
---@field worldY number
---@field tooltipSetId number

local pointOfInterestData = {
["poiID"] = poiId,
["mapID"] = mapId,
["zoneX"] = pin.normalizedX,
["zoneY"] = pin.normalizedY,
["continentID"] = parentMapInfo.mapID,
["worldX"] = worldPosition.x,
["worldY"] = worldPosition.y,
["tooltipSetId"] = poiInfo.tooltipWidgetSet,
}

WorldQuestTracker.db.profile.pins_discovered["worldquest-Capstone-questmarker-epic-Locked"][poiId] = pointOfInterestData
end
if (not specialPinsMapBans[mapId]) then
for pin in map:EnumeratePinsByTemplate("AreaPOIPinTemplate") do
local atlasName = pin.Texture:GetAtlas()
pin.Texture:SetAlpha(0.934)
if (atlasName == "worldquest-Capstone-questmarker-epic-Locked") then
--how to identify the point of interest?
if (not WorldQuestTracker.db.profile.pins_discovered["worldquest-Capstone-questmarker-epic-Locked"][pin.areaPoiID]) then
local poiInfo = pin:GetPoiInfo() --table
local mapData = pin:GetMap() --function

local poiId = poiInfo.areaPoiID
local mapId = mapData:GetMapID()
local position = poiInfo.position
local mapInfo = C_Map.GetMapInfo(mapId)
local parentMapInfo = C_Map.GetMapInfo(mapInfo.parentMapID)

--need check if a waypoint already exists
local mapPoint = UiMapPoint.CreateFromCoordinates(mapId, position.x, position.y)
C_Map.SetUserWaypoint(mapPoint)
local worldPosition = C_Map.GetUserWaypointPositionForMap(parentMapInfo.mapID)
C_Map.ClearUserWaypoint()

---@class wqt_poidata
---@field poiID number
---@field mapID number
---@field zoneX number
---@field zoneY number
---@field continentID number
---@field worldX number
---@field worldY number
---@field tooltipSetId number

local pointOfInterestData = {
["poiID"] = poiId,
["mapID"] = mapId,
["zoneX"] = pin.normalizedX,
["zoneY"] = pin.normalizedY,
["continentID"] = parentMapInfo.mapID,
["worldX"] = worldPosition.x,
["worldY"] = worldPosition.y,
["tooltipSetId"] = poiInfo.tooltipWidgetSet,
}

WorldQuestTracker.db.profile.pins_discovered["worldquest-Capstone-questmarker-epic-Locked"][poiId] = pointOfInterestData
end

pin.Texture:SetScale(1.2)
else
pin.Texture:SetScale(1)
end
end
pin.Texture:SetScale(1.2)
else
pin.Texture:SetScale(1)
end
end
end

for pin in map:EnumeratePinsByTemplate("QuestPinTemplate") do
pin:SetAlpha(0.923)
Expand Down

1 comment on commit 576bbb9

@RudolphRiedel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update, this was throwing errors every time I opened the map anywhere, including raids.
I only could not put the finger on what was throwing these bugs as Bugsack pointed to the Blizzard map frame.

Please sign in to comment.