Thread Tools Display Modes
08-13-18, 02:04 AM   #1
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
World Map Icon Addon Update #2

Hello all!

I've popped in from time to time to get some help with a custom addon you guys wrote for me a couple years ago. The function is mainly to hide flight path icons on the world map (not the flight map), though it tends to catch a few other icons too, such as cities/towns, PvP vendors, even Sentinax and similar things. Unfortunately since 8.0 it doesn't work anymore, not even the macro I have for identifying Map POIs.

I'm certainly no addon developer (though I really should learn the basics at this stage so I don't have to keep pestering you all), but you guys have been such tremendous help to me in the past. If you have the time, mind helping an old fan out to update his addon for the expansion launch?

This is the current code:
Code:
hooksecurefunc("WorldMapFrame_Update", function()
    for i = 1, GetNumMapLandmarks() do
        local landmarkType, name = C_WorldMap.GetMapLandmarkInfo(i)
        if landmarkType == 0 or landmarkType == 5 or landmarkType == 6 or landmarkType == 9 or landmarkType == 46 or landmarkType == 48 or landmarkType == 178 or landmarkType == 179 or landmarkType == 180 or landmarkType == 188 or landmarkType == 194 
then
            local poi = _G["WorldMapFramePOI"..i]
            if poi then
                -- The "if poi then" check is probably not needed, but better safe than sorry!
                poi:Hide()
            end
        end
    end
end)

hooksecurefunc("WorldMap_UpdateQuestBonusObjectives", function()
	local mapAreaID = GetCurrentMapAreaID()
	local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(mapAreaID)
	local numTaskPOIs = 0;
	if(taskInfo ~= nil) then
		numTaskPOIs = #taskInfo;
	end
	local taskIconCount = 1;
	if ( numTaskPOIs > 0 ) then
		for _, info  in next, taskInfo do
			local taskPOIName = "WorldMapFrameTaskPOI"..taskIconCount;
			local taskPOI = _G[taskPOIName];
			taskPOI:Hide();
			taskIconCount = taskIconCount + 1;
		end
	end
end)
And here's the macro to scan the map for POIs:
Code:
/run for i = 1, GetNumMapLandmarks() do local _, name, _, textureIndex = GetMapLandmarkInfo(i) print(i, textureIndex, name) end
Sometimes I've been able to change the POIs to fix it on my own, but this time nothing works. The macro doesn't return anything. From what I can tell, the only icon change to the maps are the added zeppelin/boat world travel markers, but there must be some underlying syntax change that's beyond my capabilities. Any ideas?
  Reply With Quote
08-13-18, 07:36 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Try this:
Lua Code:
  1. for provider in next, WorldMapFrame.dataProviders do
  2.     if(provider.ShouldShowTaxiNode) then
  3.         WorldMapFrame:RemoveDataProvider(provider)
  4.         break
  5.     end
  6. end

It's not the best solution, but it's pretty much the only way we can get the correct provider until Blizzard improves the data provider system.
  Reply With Quote
08-13-18, 04:03 PM   #3
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
That didn't seem to work, I'm afraid. It's quite different from the older code; no mention of landmarks or POIs. Have they changed the functionality completely?
  Reply With Quote
08-13-18, 08:08 PM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
The whole map system was rewritten from scratch in 8.0, so yes.
Any icon on the map is provided by "data providers", there's one for each type, and the example above is for removing the flightpoint provider.
  Reply With Quote
08-13-18, 08:53 PM   #5
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
Interesting. I do know they've switched to higher resolution maps where they can. I suppose it must've been part of the same process. What do you mean by Blizzard needing to improve the data provider system?

While it didn't work for me for now, is there a list of data providers so I could add more stuff (if I have enough know-how) to the code? Would something akin to the old macro be able to function in the new system? As a sidenote, the old code also hid Bonus Objectives, like the ones you'd see in Draenor. Are they still separate from the other icons?
  Reply With Quote
08-13-18, 10:22 PM   #6
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Thon View Post
What do you mean by Blizzard needing to improve the data provider system?
The fact that we have to "guess" to get the data provider instead of using something like its name.

Originally Posted by Thon View Post
While it didn't work for me for now, is there a list of data providers so I could add more stuff (if I have enough know-how) to the code?
Take a look at Blizzard_SharedMapDataProviders, it will probably answer your questions.
  Reply With Quote
08-14-18, 03:38 AM   #7
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
Originally Posted by p3lim View Post
Take a look at Blizzard_SharedMapDataProviders, it will probably answer your questions.
You've lost me already Can it be found on an online repository, or somewhere in the game files or some such?
  Reply With Quote
08-14-18, 06:02 AM   #8
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 133
Originally Posted by Thon View Post
You've lost me already Can it be found on an online repository, or somewhere in the game files or some such?
https://github.com/tomrus88/Blizzard...pDataProviders

Have fun! Their new map system is god awful. I've been going over it and it's one convoluted mess.
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }
  Reply With Quote
08-14-18, 09:28 PM   #9
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
Originally Posted by Xruptor View Post
https://github.com/tomrus88/Blizzard...pDataProviders

Have fun! Their new map system is god awful. I've been going over it and it's one convoluted mess.
Thanks! This is pretty interesting, it looks as if they've finally separated the different icons so I can pick and choose what to hide! It used to be just a catch-all. They've also incorporated Bonus Objectives and Dungeon Journal Boss Icons into the system so I don't need extra code to hide those as well.

I can pick out most of them, but I don't know what all of the providers are referring to. I guess it would take some experimenting. (Unless I'm misunderstanding it and they're all hiding under AreaPOIDataProvider)

Some of them seem to have an OnShow and OnHide function, and sometimes there's a Mixin section and a Pin section, though I can't say I know what either of them do.

I think this is still quite a bit over my head. I can somewhat identify certain icons (or their respective data provider) that I wish to hide, but I wouldn't even know where to begin with the coding. If any of you addon coders or enthusiasts out there want to take a crack at it, I'd be much appreciative.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » World Map Icon Addon Update #2

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off