Skip to content

Commit

Permalink
removed fortgotten chat output...
Browse files Browse the repository at this point in the history
added Antorus, The Burning Throne and Seat of the Triumvirate to the Broken Isles Continent Map with a temporary solution
  • Loading branch information
fuba82 committed Aug 14, 2024
1 parent 51decd5 commit db203f4
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 43 deletions.
134 changes: 95 additions & 39 deletions IPAInstancePortalPinTemplate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,57 +43,113 @@ function IPAInstancePortalMapDataProviderMixin:RefreshAllData(fromOnShow)

local mapInfo = C_Map.GetMapInfo(uiMapID);
IPAUIPrintDebug("mapInfo.mapType: "..tostring(mapInfo.mapType))
if not mapInfo then return end
if not mapInfo then return end
if mapInfo.mapType ~= Enum.UIMapType.Continent then return end

-- from here to generate every map pin from Wow internal information
local mapChildren = C_Map.GetMapChildrenInfo(uiMapID, Enum.UIMapType.Zone) -- get current map children
if ( (type(mapChildren) ~= 'table') or (#mapChildren < 1) ) then return end -- mapChildren is not table or empty

-- special case: Ny'alotha, the Waking City
if (uiMapID == 12) or (uiMapID == 424) then
for _, childMapInfo in ipairs(mapChildren) do -- enum "current" map for children
if childMapInfo and childMapInfo.mapID and (childMapInfo.mapID == 1527 or childMapInfo.mapID == 1530) then
local dungeonEntrances = C_EncounterJournal.GetDungeonEntrancesForMap(childMapInfo.mapID); -- get Dungeon Entrances for current Map
for _, dungeonEntranceInfo in ipairs(dungeonEntrances) do -- enum "dungeonEntrances"
if dungeonEntranceInfo.journalInstanceID == 1180 then -- Ny'alotha, the Waking City
local entranceInfo = {}

entranceInfo.areaPoiID = dungeonEntranceInfo.areaPoiID
local pos_vector = CreateVector2D(dungeonEntranceInfo.position.x, dungeonEntranceInfo.position.y)
if pos_vector then
local continentID, worldPosition = C_Map.GetWorldPosFromMapPos(childMapInfo.mapID, pos_vector)
if continentID and worldPosition then
local _, mapPosition = C_Map.GetMapPosFromWorldPos(continentID, worldPosition)
entranceInfo.position = CreateVector2D(mapPosition.x, mapPosition.y)
local mapChildren = C_Map.GetMapChildrenInfo(uiMapID, Enum.UIMapType.Zone) -- get current map children
if ( (type(mapChildren) == 'table') or (#mapChildren > 0) ) then -- mapChildren is table amd not empty
for _, childMapInfo in ipairs(mapChildren) do -- enum "current" map for children
if childMapInfo and childMapInfo.mapID and (childMapInfo.mapID == 1527 or childMapInfo.mapID == 1530) then
local dungeonEntrances = C_EncounterJournal.GetDungeonEntrancesForMap(childMapInfo.mapID); -- get Dungeon Entrances for current Map
for _, dungeonEntranceInfo in ipairs(dungeonEntrances) do -- enum "dungeonEntrances"
if dungeonEntranceInfo.journalInstanceID == 1180 then -- Ny'alotha, the Waking City
local entranceInfo = {}

entranceInfo.areaPoiID = dungeonEntranceInfo.areaPoiID
local pos_vector = CreateVector2D(dungeonEntranceInfo.position.x, dungeonEntranceInfo.position.y)
if pos_vector then
local continentID, worldPosition = C_Map.GetWorldPosFromMapPos(childMapInfo.mapID, pos_vector)
if continentID and worldPosition then
local _, mapPosition = C_Map.GetMapPosFromWorldPos(continentID, worldPosition)
entranceInfo.position = CreateVector2D(mapPosition.x, mapPosition.y)
end
end
end

entranceInfo.name = dungeonEntranceInfo.name
entranceInfo.description = dungeonEntranceInfo.description
entranceInfo.journalInstanceID = dungeonEntranceInfo.journalInstanceID
entranceInfo.atlasName = dungeonEntranceInfo.atlasName

print("\n")
DevTools_Dump(dungeonEntranceInfo)
local pin = self:GetMap():AcquirePin("IPAInstancePortalPinTemplate", entranceInfo);
pin.dataProvider = self;
pin:SetSuperTracked(false)

if C_SuperTrack.IsSuperTrackingMapPin() then
local areaPoiID = pin.poiInfo.areaPoiID or 0;
local superTrackedMapPinType, superTrackedMapPinTypeID = C_SuperTrack.GetSuperTrackedMapPin()
if (superTrackedMapPinType == Enum.SuperTrackingMapPinType.AreaPOI) and (areaPoiID == superTrackedMapPinTypeID) then
pin:SetSuperTracked(true)

entranceInfo.name = dungeonEntranceInfo.name
entranceInfo.description = dungeonEntranceInfo.description
entranceInfo.journalInstanceID = dungeonEntranceInfo.journalInstanceID
entranceInfo.atlasName = dungeonEntranceInfo.atlasName

local pin = self:GetMap():AcquirePin("IPAInstancePortalPinTemplate", entranceInfo);
pin.dataProvider = self;
pin:SetSuperTracked(false)

if C_SuperTrack.IsSuperTrackingMapPin() then
local areaPoiID = pin.poiInfo.areaPoiID or 0;
local superTrackedMapPinType, superTrackedMapPinTypeID = C_SuperTrack.GetSuperTrackedMapPin()
if (superTrackedMapPinType == Enum.SuperTrackingMapPinType.AreaPOI) and (areaPoiID == superTrackedMapPinTypeID) then
pin:SetSuperTracked(true)
end
end

end

end
end
end
end
end

-- special case: Antorus, The Burning Throne and Seat of the Triumvirate (Broken Isles Continent Map)
-- this is just temporary and will get changed soon... hopefuilly! :D
if (uiMapID == 619) then
local dungeonEntrances = C_EncounterJournal.GetDungeonEntrancesForMap(882); -- Zone: Eredat
for _, dungeonEntranceInfo in ipairs(dungeonEntrances) do
if dungeonEntranceInfo.journalInstanceID == 945 then -- Seat of the Triumvirate
local entranceInfo = {}
entranceInfo.areaPoiID = dungeonEntranceInfo.areaPoiID

entranceInfo.position = CreateVector2D(90/100, 10/100) -- fixed value (for now?)

entranceInfo.name = dungeonEntranceInfo.name
entranceInfo.description = dungeonEntranceInfo.description
entranceInfo.journalInstanceID = dungeonEntranceInfo.journalInstanceID
entranceInfo.atlasName = dungeonEntranceInfo.atlasName

local pin = self:GetMap():AcquirePin("IPAInstancePortalPinTemplate", entranceInfo);
pin.dataProvider = self;
pin:SetSuperTracked(false)

if C_SuperTrack.IsSuperTrackingMapPin() then
local areaPoiID = pin.poiInfo.areaPoiID or 0;
local superTrackedMapPinType, superTrackedMapPinTypeID = C_SuperTrack.GetSuperTrackedMapPin()
if (superTrackedMapPinType == Enum.SuperTrackingMapPinType.AreaPOI) and (areaPoiID == superTrackedMapPinTypeID) then
pin:SetSuperTracked(true)
end
end
end
end

dungeonEntrances = C_EncounterJournal.GetDungeonEntrancesForMap(885); -- Zone: Antoran Wastes
for _, dungeonEntranceInfo in ipairs(dungeonEntrances) do
if dungeonEntranceInfo.journalInstanceID == 946 then -- Seat of the Triumvirate
local entranceInfo = {}
entranceInfo.areaPoiID = dungeonEntranceInfo.areaPoiID

entranceInfo.position = CreateVector2D(83/100, 22/100) -- fixed value (for now?)

entranceInfo.name = dungeonEntranceInfo.name
entranceInfo.description = dungeonEntranceInfo.description
entranceInfo.journalInstanceID = dungeonEntranceInfo.journalInstanceID
entranceInfo.atlasName = dungeonEntranceInfo.atlasName

local pin = self:GetMap():AcquirePin("IPAInstancePortalPinTemplate", entranceInfo);
pin.dataProvider = self;
pin:SetSuperTracked(false)

if C_SuperTrack.IsSuperTrackingMapPin() then
local areaPoiID = pin.poiInfo.areaPoiID or 0;
local superTrackedMapPinType, superTrackedMapPinTypeID = C_SuperTrack.GetSuperTrackedMapPin()
if (superTrackedMapPinType == Enum.SuperTrackingMapPinType.AreaPOI) and (areaPoiID == superTrackedMapPinTypeID) then
pin:SetSuperTracked(true)
end
end
end
end

end

-- IPA databse
if IPAUIPinDB[uiMapID] then
local count = #IPAUIPinDB[uiMapID]
Expand Down Expand Up @@ -235,7 +291,7 @@ function IPAInstancePortalProviderPinMixin:OnMouseClickAction(button)
end
end

-- if anything is missing, TRY to use Pin itself as Source
-- if anything is missing, TRY to use Pin itself as Source
if not (wp_mapid and wp_x and wp_y and wp_name) then
IPAUIPrintDebug("Waypoint Info is missing, try to use PIN as Source")
for k, v in pairs({wp_mapid="wp_mapid", wp_x="wp_x", wp_y="wp_y", wp_name="wp_name"}) do
Expand Down
8 changes: 4 additions & 4 deletions IPAPinDB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ IPAUIPinDB = {
{45.5, 65.4, {777}}, --Assault on Violet Hold
--{64, 38, {721,861}, "Halls of Valor"}, --Trial of Valor

{90, 10, {945}}, --Seat of the Triumvirate
{83, 22, {946}}, --Antorus, the Burning Throne
--{90, 10, {945}}, --Seat of the Triumvirate
--{83, 22, {946}}, --Antorus, the Burning Throne

{47.082645, 47.276622, {786}}, -- The Nighthold
{49.157399, 49.704754, {800}}, -- Court of Stars
Expand Down Expand Up @@ -503,9 +503,9 @@ IPAUIPinDB = {

[905]={
-- Antoran Wastes
{22.51, 81.39, {946}}, -- Antorus, the Burning Throne
{32.00, 68.00, {946}}, -- Antorus, the Burning Throne
-- Eredath
{31.67, 36.24, {945}}, -- Seat of the Triumvirate
{54.00, 39.00, {945}}, -- Seat of the Triumvirate
},


Expand Down

0 comments on commit db203f4

Please sign in to comment.