From 29e33f73a5eec8ac748555d1b87cb7267f3dab0c Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Tue, 25 Nov 2025 11:40:49 -0500 Subject: [PATCH] Add support for built-in waypoints if TomTom not installed --- Locale/enUS.lua | 2 +- TillerTracker.lua | 25 ++++++++++++++----------- TillerTracker.toc | 2 +- TillerTracker_Mists.toc | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Locale/enUS.lua b/Locale/enUS.lua index ca2a320..643a48d 100644 --- a/Locale/enUS.lua +++ b/Locale/enUS.lua @@ -20,7 +20,7 @@ L["A Dish for Tina"] = true L["|cFF00FF00Complete|r"] = true L["|cFFFF0000Not Complete|r"] = true -L["|cFFFFFF00Click|r a quest in the tooltip to set a TomTom waypoint at the farmer's home"] = true +L["|cFFFFFF00Click|r a quest in the tooltip to set a waypoint at the farmer's home"] = true L["|cFFFFFF00Click|r the main button to toggle whether the tooltip stays open"] = true L["|cFFFFFF00Right Click|r the main button to cycle through which ingredient to track"] = true L["|cFFFFFF00Ctrl-Click|r the main button to queue craftable foods in Skillet"] = true diff --git a/TillerTracker.lua b/TillerTracker.lua index 504f856..0dd610b 100644 --- a/TillerTracker.lua +++ b/TillerTracker.lua @@ -326,13 +326,16 @@ end local function Entry_OnMouseUp(frame, info, button) if button == "LeftButton" then - if not _G.TomTom then - return - end - local location = info["LOCATION"] - - _G.TomTom:AddWaypoint(376, location[1] / 100, location[2] / 100, { title = info["NAME"] }) + + if _G.TomTom then + _G.TomTom:AddWaypoint(376, location[1] / 100, location[2] / 100, { title = info["NAME"] }) + elseif C_Map.CanSetUserWaypointOnMap then + if C_Map.CanSetUserWaypointOnMap(376) then + local mapPoint = UiMapPoint.CreateFromCoordinates(376, location[1] / 100, location[2] / 100) + C_Map.SetUserWaypoint(mapPoint) + end + end end end @@ -598,8 +601,8 @@ function TillerTracker:UpdateTooltip() -- Add the line with info about the current quest line = private.tooltip:AddLine(quest["NAME_DISPLAY"], quest["FOOD_DISPLAY"], quest["AMOUNT_DISPLAY"], quest["STATUS"], quest["NEED"]) - -- If TomTom is installed then set the line script - if _G.TomTom then + -- Set the line script if TomTom is installed or the game supports waypoints + if C_Map.CanSetUserWaypointOnMap or _G.TomTom then private.tooltip:SetLineScript(line, "OnMouseUp", Entry_OnMouseUp, { NAME = quest["NAME"], LOCATION = quest["LOCATION"] }) end end @@ -613,10 +616,10 @@ function TillerTracker:UpdateTooltip() line = private.tooltip:AddLine() private.tooltip:SetCell(line, 1, L["|cFFFFFF00Right Click|r the main button to cycle through which ingredient to track"], "LEFT", private.tooltip:GetColumnCount()) - -- If TomTom is installed then add a hint to the end - if _G.TomTom then + -- Add a hint to the end if TomTom is installed or the game supports waypoints + if C_Map.CanSetUserWaypointOnMap or _G.TomTom then line = private.tooltip:AddLine() - private.tooltip:SetCell(line, 1, L["|cFFFFFF00Click|r a quest in the tooltip to set a TomTom waypoint at the farmer's home"], "LEFT", private.tooltip:GetColumnCount()) + private.tooltip:SetCell(line, 1, L["|cFFFFFF00Click|r a quest in the tooltip to set a waypoint at the farmer's home"], "LEFT", private.tooltip:GetColumnCount()) end -- Add the Skillet hint if installed diff --git a/TillerTracker.toc b/TillerTracker.toc index 81a9c2b..ca41c48 100644 --- a/TillerTracker.toc +++ b/TillerTracker.toc @@ -1,6 +1,6 @@ ## Interface: 110205 ## Title: Tiller Tracker -## Version: 11.0.5 +## Version: 11.0.6 ## Notes: Helps with the daily Tiller food quests ("A Dish for...") by keeping track of what quests have been completed that day, how many dishes need to be cooked, and what materials are required. ## Author: Amanoa ## SavedVariables: TillerTrackerDB diff --git a/TillerTracker_Mists.toc b/TillerTracker_Mists.toc index 76dbad6..0cdb20f 100644 --- a/TillerTracker_Mists.toc +++ b/TillerTracker_Mists.toc @@ -1,6 +1,6 @@ ## Interface: 50500 ## Title: Tiller Tracker -## Version: 11.0.5 +## Version: 11.0.6 ## Notes: Helps with the daily Tiller food quests ("A Dish for...") by keeping track of what quests have been completed that day, how many dishes need to be cooked, and what materials are required. ## Author: Amanoa ## SavedVariables: TillerTrackerDB