Quantcast

Add silencing to some errant AddMessage calls.

Ludovicus [06-24-19 - 19:47]
Add silencing to some errant AddMessage calls.
Filename
TomTom.lua
TomTom_POIIntegration.lua
diff --git a/TomTom.lua b/TomTom.lua
index c5d7bbe..f038142 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -1135,8 +1135,10 @@ function TomTom:SetClosestWaypoint()
         local ctxt = RoundCoords(x, y, 2)
         local desc = data.title and data.title or ""
         local sep = data.title and " - " or ""
-        local msg = string.format(L["|cffffff78TomTom:|r Selected waypoint (%s%s%s) in %s"], desc, sep, ctxt, zoneName)
-        ChatFrame1:AddMessage(msg)
+        if not opts.silent and self.profile.general.announce then
+            local msg = string.format(L["|cffffff78TomTom:|r Selected waypoint (%s%s%s) in %s"], desc, sep, ctxt, zoneName)
+            ChatFrame1:AddMessage(msg)
+        end
     else
         local msg
         if not self.profile.arrow.closestusecontinent then
@@ -1146,6 +1148,7 @@ function TomTom:SetClosestWaypoint()
         end
         ChatFrame1:AddMessage(msg)
     end
+    return uid
 end

 SLASH_TOMTOM_CLOSEST_WAYPOINT1 = "/cway"
diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua
index b7df590..94ce985 100755
--- a/TomTom_POIIntegration.lua
+++ b/TomTom_POIIntegration.lua
@@ -205,7 +205,10 @@ local function poi_OnClick(self, button)
     if not x or not y then
         -- No coordinate information for this quest/objective
         local header = "|cFF33FF99TomTom|r"
-        print(L["%s: No coordinate information found for '%s' at this map level"]:format(header, title or self.questID))
+        if not opts.silent and self.profile.general.announce then
+            local msg = L["%s: No coordinate information found for '%s' at this map level"]:format(header, title or self.questID)
+            ChatFrame1:AddMessage(msg)
+        end
         return
     end