Thread Tools Display Modes
10-24-17, 01:44 PM   #1
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
World Map Icon Addon Update

Hello everyone,

In the past I enlisted the help of this forum to make a custom addon that would hide flight path icons (and a few others I've added) from the world map. An awesome member named Phanx wrote it up for me free of charge, and I've used it ever since! I recently returned from a WoW hiatus and it seems to have broken somehow. I'm no addon coder by any means; could you help me update it again so it'll keep functioning?

I have an addon that does the main task of hiding the icons, and I also have a macro that scans the world map I'm in for landmark POI numbers. The problem I'm having now is that the icons aren't being hidden, and the macro returns a list of nil.

This is what the addon looks like currently:
Code:
hooksecurefunc("WorldMapFrame_Update", function()
    for i = 1, GetNumMapLandmarks() do
        local _, name, _, textureIndex = GetMapLandmarkInfo(i)
        if textureIndex == 0 or textureIndex == 5 or textureIndex == 6 or textureIndex == 46 or textureIndex == 48 or textureIndex == 178 or textureIndex == 179 or textureIndex == 180 or textureIndex == 188 or textureIndex == 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)
And the macro is as follows:
Code:
/run for i = 1, GetNumMapLandmarks() do local _, name, _, textureIndex = GetMapLandmarkInfo(i) print(i, textureIndex, name) end
I'm guessing the POI or map system got changed in some way.
For reference, the initial thread request: http://www.wowinterface.com/forums/s...ad.php?t=44204
And once last year, when it needed updating: http://www.wowinterface.com/forums/s...ad.php?t=54004

Any ideas what I'd need to fix?
  Reply With Quote
10-24-17, 02:51 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
After making a copy, try changing:
Code:
local _, name, _, textureIndex = GetMapLandmarkInfo(i)
too
Code:
local landmarkType, name = C_WorldMap.GetMapLandmarkInfo(i)
and replace occurences of textureIndex with landmarkType

The macro becomes
Code:
/run for i = 1, GetNumMapLandmarks() do local landmarkType, name = C_WorldMap.GetMapLandmarkInfo(i) print(i, landmarkType, name) end
I'm not sure landmarkType is a direct correlation or can be mapped to what was the textureIndex but you're no worse off

These are the landmarkType used in the WorldMapFrame (there may be more)

LE_MAP_LANDMARK_TYPE_TAMER = 1
LE_MAP_LANDMARK_TYPE_GOSSIP = 3
LE_MAP_LANDMARK_TYPE_TAXINODE = 5
LE_MAP_LANDMARK_TYPE_VIGNETTE = 6
LE_MAP_LANDMARK_TYPE_INVASION = 8
LE_MAP_LANDMARK_TYPE_DUNGEON_ENTRANCE = 9
LE_MAP_LANDMARK_TYPE_CONTRIBUTION = 10
LE_MAP_LANDMARK_TYPE_MAP_LINK = 11
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-24-17 at 04:44 PM.
  Reply With Quote
10-25-17, 07:56 PM   #3
Thon
A Deviate Faerie Dragon
Join Date: Sep 2012
Posts: 12
That did it! Thank you, Fizzlemizz! Seems I don't need a separate entry for neutral, horde and alliance flight points anymore.

This forum has been incredibly helpful, I can't thank you enough. <3
  Reply With Quote

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

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