[Feature Request] Provide option to use built-in navigation in Shadowlands instead of TomTom
Caerdon opened this issue ยท 7 comments
I'd love to see an option to use the built-in navigation system in Shadowlands (and please make it available based on a click on the alert instead of automatic as others have requested!) It might not be as nice as TomTom, but it will be generally available to all users (and does have some nice aspects with regard to 3D spacial location).
Here's some basic code that will set the waypoint:
function goThere(xPos, yPos)
local mapID = C_Map.GetBestMapForUnit("player")
if xPos ~= nil and yPos ~= nil then
local uiMapPoint = UiMapPoint.CreateFromCoordinates(mapID, xPos / 100, yPos / 100);
if uiMapPoint ~= nil then
C_Map.SetUserWaypoint(uiMapPoint);
C_SuperTrack.SetSuperTrackedUserWaypoint(true);
end
end
end
Thanks for the sample code for it -- saves me a bunch of research time. I will take a look at this.
I don't know if we can do anything for the 3d stuff, though -- the common case is going to be vignettes, which I don't think have any height information available. (Unless it's been added, of course.)
Take a look at that in the shadowlands
branch, see it it does what you're thinking?
Nice! I think it's close. The trick with the supertracker is that it can only ever focus on one thing, of course, and you can only ever have one user waypoint, so I think you'd want to account for that when you're setting / clearing automatically. You could do something like (not tested):
local currentUserWaypoint = C_Map.GetUserWaypoint(), isTrackingUserWaypoint = C_SuperTrack.IsSuperTrackingUserWaypoint()
-- Do your timer based user waypoint stuff here
-- Reset things back to what the client was tracking
if currentUserWaypoint then
C_Map.SetUserWaypoint(currentUserWayPoint); -- even if they weren't tracking it, they shouldn't lose it
else
C_Map.ClearUserWaypoint()
end
C_SuperTrack.SetSuperTrackedUserWaypoint(isTrackingUserWaypoint);
I think if they have any quest tracking it will automatically fall back if needed since you aren't changing that part.
I'd still advocate for also exposing an option to only trigger this by manual clicking on the alert so arrows (TomTom or built-in) aren't just changing on folks in flight when they don't care about a mob.
You'll probably want to incorporate C_Map.CanSetUserWaypointOnMap(mapID) to ensure they're allowed to make one...