From 8b06985071a24cf62c90f117c882433f8424a93a Mon Sep 17 00:00:00 2001 From: Jim Whitehead Date: Thu, 11 Aug 2016 19:24:44 +0200 Subject: [PATCH] Add a fix for poi_OnClick Thanks to Jackalo for providing the fix! --- TomTom_POIIntegration.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua index 5221079..1f6d0a5 100755 --- a/TomTom_POIIntegration.lua +++ b/TomTom_POIIntegration.lua @@ -148,7 +148,7 @@ local function poi_OnClick(self, button) return end - if button == "RightButton" then + if button == "LeftButton" then for i = 1, #modifier do local mod = modifier:sub(i, i) local func = modTbl[mod] @@ -160,6 +160,9 @@ local function poi_OnClick(self, button) return end + local cvar = GetCVarBool("questPOI") + SetCVar("questPOI", 1) + -- Run our logic, and set a waypoint for this button local m, f = GetCurrentMapAreaID() @@ -178,6 +181,8 @@ local function poi_OnClick(self, button) questIndex = GetQuestIndexForWatch(self.index) end + QuestPOIUpdateIcons() + local title = GetQuestLogTitle(questIndex) local qid = getQIDFromIndex(questIndex) local completed, x, y, objective = QuestPOIGetIconInfo(qid) @@ -209,9 +214,22 @@ local function poi_OnClick(self, button) arrivaldistance = TomTom.profile.poi.arrival, }) poiclickwaypoints[key] = uid + else + local uid = poiclickwaypoints[key] + TomTom:SetCrazyArrow(uid, TomTom.profile.poi.arrival, title) end + + SetCVar("questPOI", cvar and 1 or 0) end +hooksecurefunc("TaskPOI_OnClick", function(self, button) + poi_OnClick(self, button) +end) + +hooksecurefunc("QuestPOIButton_OnClick", function(self, button) + poi_OnClick(self, button) +end) + function TomTom:EnableDisablePOIIntegration() enableClicks= TomTom.profile.poi.enable modifier = TomTom.profile.poi.modifier -- 1.7.9.5