Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function poi_OnClick(self, button)
- if not enableClicks then
- return
- end
- if button == "LeftButton" then
- for i = 1, #modifier do
- local mod = modifier:sub(i, i)
- local func = modTbl[mod]
- if not func() then
- return
- end
- end
- else
- return
- end
- local cvar = GetCVarBool("questPOI")
- SetCVar("questPOI", 1)
- -- Run our logic, and set a waypoint for this button
- local m, f = GetCurrentMapAreaID()
- QuestPOIUpdateIcons()
- local questIndex = GetQuestLogIndexByID(self.questID)
- local title, completed, x, y
- if questIndex and questIndex ~= 0 then
- title = GetQuestLogTitle(questIndex)
- completed, x, y = QuestPOIGetIconInfo(self.questID)
- else
- title = C_TaskQuest.GetQuestInfoByQuestID(self.questID)
- completed = false
- x, y = C_TaskQuest.GetQuestLocation(self.questID)
- end
- if completed then
- title = "Turn in: " .. title
- end
- if not x or not y then
- local header = "|cFF33FF99TomTom|r"
- print(L["%s: No coordinate information found for '%s' at this map level"]:format(header, title or self.questID))
- return
- end
- local key = TomTom:GetKeyArgs(m, f, x, y, title)
- local alreadySet = false
- if poiclickwaypoints[key] then
- local uid = poiclickwaypoints[key]
- -- Check to see if it has been removed by the user
- if TomTom:IsValidWaypoint(uid) then
- alreadySet = true
- end
- end
- if not alreadySet then
- local uid = TomTom:AddMFWaypoint(m, f, x, y, {
- title = title,
- 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
Add Comment
Please, Sign In to add comment