Quantcast [AddonHelp] adding a waypoint in TomTom - WoWInterface
Thread Tools Display Modes
06-14-18, 02:09 PM   #1
saxitoxin
A Wyrmkin Dreamwalker
 
saxitoxin's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 59
[AddonHelp] adding a waypoint in TomTom

How do i add a waypoint in TomTom from inside a addon

in the TomTom_Waypoints.lua file line 7-8 it says
Code:
--  don't call TomTom:SetWaypoint() or TomTom:ClearWaypoint(), use the public
--  TomTom:AddZWaypoint() and TomTom:RemoveWaypoint() instead.
so i'm trying the following
Lua Code:
  1. local waypoint = "Wintergrasp 50.4 16.4 Vault of Archavon"
  2. if waypoint then
  3.     if IsAddOnLoaded("TomTom") then
  4.         TomTom:AddZWaypoint(waypoint)
  5.     else
  6.         print(waypoint)
  7.     end
  8. end

if someone could help me out that would be very great
  Reply With Quote
06-14-18, 03:28 PM   #2
Ammako
A Frostmaul Preserver
 
Ammako's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
TomTom:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, callbacks, silent, crazy)

In the hopes of making the meaning of those parameters more obvious:

lua Code:
  1. -- TODO: Make this not suck
  2. function TomTom:AddWaypoint(x, y, desc, persistent, minimap, world, silent)
  3.     local c,z = GetCurrentMapContinent(), GetCurrentMapZone()
  4.  
  5.     if not c or not z or c < 1 then
  6.         --self:Print("Cannot find a valid zone to place the coordinates")
  7.         return
  8.     end
  9.  
  10.     return self:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, nil, silent)
  11. end
  12.  
  13. function TomTom:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, callbacks, silent, crazy)
  14.     -- Convert the c,z,x,y tuple to m,f,x,y and pass the work off to AddMFWaypoint()
  15.     local mapId, floor = hbd:GetMapIDFromCZ(c, z)
  16.     if not mapId then
  17.         return
  18.     end
  19.  
  20.     return self:AddMFWaypoint(mapId, floor, x/100, y/100, {
  21.         title = desc,
  22.         persistent = persistent,
  23.         minimap = minimap,
  24.         world = world,
  25.         callbacks = callbacks,
  26.         silent = silent,
  27.         crazy = crazy,
  28.     })
  29. end
__________________
  Reply With Quote
06-14-18, 11:57 PM   #3
saxitoxin
A Wyrmkin Dreamwalker
 
saxitoxin's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 59
Originally Posted by Ammako View Post
...
sorry, but I did not figure it out :/

but I made the button a secureActionButton and running a macro onClick

Lua Code:
  1. if InCombatLockdown() then return end
  2.         if activeStepIndex then
  3.             local mountID, itemID, pretext, place, kill, mode, note, chance, raidID, worldBossID, waypoint = unpack(cfg.infoList[activeStepIndex])
  4.             if waypoint then
  5.                 if IsAddOnLoaded("TomTom") then
  6.                 self:SetAttribute("macrotext", "/way "..waypoint)
  7.                 else
  8.                     print(waypoint)
  9.                 end
  10.             end
  11.         end
  Reply With Quote
06-15-18, 01:30 AM   #4
Ammako
A Frostmaul Preserver
 
Ammako's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
I'll try and figure it out sometime later. I posted that because your initial usage was incorrect and I was hoping this would help fix it, but I've never actually used that myself.
__________________
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » [AddonHelp] adding a waypoint in TomTom

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