WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Integration with TomTom (https://www.wowinterface.com/forums/showthread.php?t=59776)

Hubb777 01-27-24 11:11 PM

Integration with TomTom
 
Code:

local addonName, addon = ...
local listener = CreateFrame("Frame")
listener:RegisterEvent("CHAT_MSG_MONSTER_SAY")
listener:SetScript("OnEvent", function(self, event, text, monsterName)
    if event == "CHAT_MSG_MONSTER_SAY" then
        local mapID = C_Map.GetBestMapForUnit("player")
        if mapID ~= 2024 then return end
       
        for _, data in pairs(addon.db) do
            local announce = data.announce
            if announce and announce[GetLocale()] and (announce[GetLocale()] == text) then
                if C_Map.CanSetUserWaypointOnMap(mapID) then
                    local point = UiMapPoint.CreateFromCoordinates(2024, data.coordX/100, data.coordY/100)
                    C_Map.SetUserWaypoint(point)
                    C_SuperTrack.SetSuperTrackedUserWaypoint(true)
                end
if (IsAddOnLoaded("TomTom")) then
            addon.uid = TomTom:AddWaypoint(2024, data.coordX/100, data.coordY/100, {title = data.name} )
        end
            end
        end
    end
end)

The problem is that the direction arrow does not appear immediately. And it appears only after I have left this point. At 200-300 meters.


All times are GMT -6. The time now is 08:14 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI