From 826498340442ec9461bad43ae39f06bf035d3f39 Mon Sep 17 00:00:00 2001 From: Ludovicus Date: Sat, 19 Oct 2019 14:11:28 -0400 Subject: [PATCH] #472: Disable POI Integration code on Classic. --- TomTom_POIIntegration.lua | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua index 1e5a62c..d9877c8 100755 --- a/TomTom_POIIntegration.lua +++ b/TomTom_POIIntegration.lua @@ -1,6 +1,10 @@ local addonName, addon = ... local hbd = LibStub("HereBeDragons-2.0") +if addon.CLASSIC then + return +end + local enableClicks = true -- True if waypoint-clicking is enabled to set points local enableClosest = true -- True if 'Automatic' quest waypoints are enabled local modifier -- A string representing click-modifiers "CAS", etc. @@ -139,10 +143,9 @@ local function ObjectivesChanged() end local eventFrame = CreateFrame("Frame") -if not addon.CLASSIC then - eventFrame:RegisterEvent("QUEST_POI_UPDATE") - eventFrame:RegisterEvent("QUEST_LOG_UPDATE") -end +eventFrame:RegisterEvent("QUEST_POI_UPDATE") +eventFrame:RegisterEvent("QUEST_LOG_UPDATE") + eventFrame:SetScript("OnEvent", function(self, event, ...) if event == "QUEST_POI_UPDATE" then @@ -237,11 +240,11 @@ local function poi_OnClick(self, button) SetCVar("questPOI", cvar and 1 or 0) end -if not addon.CLASSIC then - hooksecurefunc("QuestPOIButton_OnClick", function(self, button) - poi_OnClick(self, button) - end) -end + +hooksecurefunc("QuestPOIButton_OnClick", function(self, button) + poi_OnClick(self, button) +end) + function TomTom:EnableDisablePOIIntegration() enableClicks= TomTom.profile.poi.enable -- 1.7.9.5