WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Hide world map arrow and ping (https://www.wowinterface.com/forums/showthread.php?t=55865)

ovce 11-20-17 10:09 AM

Hide world map arrow and ping
 
Hello, im struggling to find/write an addon i used back on wotlk - to hide my positon on the world map (forcing me to navigate by landmarks not by gps)
Any idea of an addon that does that or advice which function to use?

ShowWorldMapArrowFrame doesnt seem to work or im not using it correctly

ovce 11-24-17 11:41 AM

or any idea why this code (which worked on cata) is not working anymore?

function Hidearrow_Onload()

WorldMapPing:SetModelScale(0.0);
PlayerArrowFrame:SetModelScale(0.0)
PlayerArrowEffectFrame:SetModelScale(PlayerArrowFrame:GetModelScale())
DEFAULT_CHAT_FRAME:AddMessage("HideArrow Map Addon loaded!")
DEFAULT_CHAT_FRAME:AddMessage("/hidearrow or /ha for help")
SLASH_HIDEARROW1 = "/hidearrow";
SLASH_HIDEARROW2 = "/ha";
SlashCmdList["HIDEARROW"] = HIDEARROW_SlashHandler;
end


function HIDEARROW_SlashHandler(msg)
if (msg=="show") then
PlayerArrowFrame:SetModelScale(1.0)
PlayerArrowEffectFrame:SetModelScal(PlayerArrowFrame:GetModelScale())
end
if (msg=="hide") then
PlayerArrowFrame:SetModelScale(0.0)
PlayerArrowEffectFrame:SetModelScal(PlayerArrowFrame:GetModelScale())
end
if (msg=="") then
DEFAULT_CHAT_FRAME:AddMessage("To Hide/Show the Map arrow, type: /hidearrow hide/show")
end

end

Fizzlemizz 11-24-17 12:57 PM

Edited to make into a toggleable (if that's even a word) addon
Code:

SLASH_HIDEARROW1 = "/hidearrow";
SLASH_HIDEARROW2 = "/ha";
SlashCmdList["HIDEARROW"] = function(msg)
        if WorldMapUnitPositionFrame:GetAlpha() == 0 then
                WorldMapUnitPositionFrame:SetAlpha(1)
        else
                WorldMapUnitPositionFrame:SetAlpha(0)
        end
end


ovce 11-24-17 04:15 PM

Thanks.
After a lot of googling it seem that blizzard removed the PlayerArrowFrame and PlayerArrowEffectFrame during MoP and possibly replaced them with WorldMapPlayerLower and Upper, however these were also removed during 7.1 so im stuck again.
Maybe it would possible to replace the arrow texture with an empty file?

Ammako 11-24-17 06:42 PM

I'm not sure I understand what your issue is. Fizzlemizz's code should already be doing what you want to achieve.

ovce 11-25-17 01:55 AM

Ah, my mistake, didnt read that properly. Thanks a lot, thats exactly what I was looking for and works perfectly :)


All times are GMT -6. The time now is 08:11 PM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI