fix: Shift-click now toggles tracking for all quests in quest log
This commit is contained in:
@@ -16,10 +16,9 @@ function Hooks:HookQuestLogTitle()
|
|||||||
Questie:Debug(Questie.DEBUG_DEVELOP, "[Hooks] Hooking Quest Log Title")
|
Questie:Debug(Questie.DEBUG_DEVELOP, "[Hooks] Hooking Quest Log Title")
|
||||||
|
|
||||||
hooksecurefunc("QuestLogTitleButton_OnClick", function(self, button)
|
hooksecurefunc("QuestLogTitleButton_OnClick", function(self, button)
|
||||||
-- FIX: Added InCombatLockdown guard to prevent taining secure execution paths.
|
-- FIX: Added InCombatLockdown guard to prevent tainting secure execution paths.
|
||||||
-- This hook can be called during combat if the player interacts with the quest log
|
-- This hook can be called during combat if the player interacts with the quest log
|
||||||
-- while in combat, which may cause taint that propagates to protected functions.
|
-- while in combat, which may cause taint that propagates to protected functions.
|
||||||
print("[DEBUG] QuestLogTitleButton_OnClick hook! button=" .. tostring(button) .. " isLeft=" .. tostring(button == "LeftButton") .. " shift=" .. tostring(IsShiftKeyDown()))
|
|
||||||
if InCombatLockdown() then return end
|
if InCombatLockdown() then return end
|
||||||
if (not self) or self.isHeader then
|
if (not self) or self.isHeader then
|
||||||
return
|
return
|
||||||
@@ -27,7 +26,6 @@ function Hooks:HookQuestLogTitle()
|
|||||||
|
|
||||||
local questLogLineIndex
|
local questLogLineIndex
|
||||||
if Questie.IsWotlk or QuestieCompat.Is335 then
|
if Questie.IsWotlk or QuestieCompat.Is335 then
|
||||||
-- With Wotlk the offset is no longer required cause the API already hands the correct index
|
|
||||||
questLogLineIndex = self:GetID()
|
questLogLineIndex = self:GetID()
|
||||||
else
|
else
|
||||||
questLogLineIndex = self:GetID() + FauxScrollFrame_GetOffset(QuestLogListScrollFrame)
|
questLogLineIndex = self:GetID() + FauxScrollFrame_GetOffset(QuestLogListScrollFrame)
|
||||||
@@ -45,19 +43,16 @@ function Hooks:HookQuestLogTitle()
|
|||||||
-- but for chat links the original function usually just selects the quest anyway.
|
-- but for chat links the original function usually just selects the quest anyway.
|
||||||
end
|
end
|
||||||
|
|
||||||
-- For all other clicks (including tracking/untracking), use the original function
|
-- For shift-click tracking toggle, only handle if tracker is enabled
|
||||||
-- only call Questie's tracker if we actually want to fix this quest (normal quests already call AQW_insert)
|
if Questie.db.profile.trackerEnabled and IsShiftKeyDown() then
|
||||||
-- Only handle tracking on shift-click for "Talk to" quests (no objectives)
|
|
||||||
print("[DEBUG] questLogLineIndex=", questLogLineIndex, "numLeaderBoards=", GetNumQuestLeaderBoards(questLogLineIndex), "shift=", IsShiftKeyDown(), "autoTrack=", Questie.db.profile.autoTrackQuests)
|
|
||||||
if Questie.db.profile.trackerEnabled and GetNumQuestLeaderBoards(questLogLineIndex) == 0 and IsShiftKeyDown() then
|
|
||||||
local _, _, _, isHeader, _, _, _, questId = GetQuestLogTitle(questLogLineIndex)
|
local _, _, _, isHeader, _, _, _, questId = GetQuestLogTitle(questLogLineIndex)
|
||||||
print("[DEBUG] After GetQuestLogTitle - isHeader=", isHeader, "questId=", questId, "Tracked=", Questie.db.char.TrackedQuests[questId], "AutoUntracked=", Questie.db.char.AutoUntrackedQuests[questId])
|
if questId and questId > 0 and not isHeader then
|
||||||
if questId and questId > 0 then
|
-- Toggle tracking: if tracked, untrack; if untracked, track
|
||||||
if Questie.db.char.TrackedQuests[questId] or (Questie.db.profile.autoTrackQuests and (not Questie.db.char.AutoUntrackedQuests[questId])) then
|
if Questie.db.char.TrackedQuests[questId] or (Questie.db.profile.autoTrackQuests and not Questie.db.char.AutoUntrackedQuests[questId]) then
|
||||||
-- Quest is currently tracked — hidden it
|
-- Quest is currently tracked — untrack it
|
||||||
pcall(QuestieTracker.UntrackQuestId, QuestieTracker, questId)
|
pcall(QuestieTracker.UntrackQuestId, QuestieTracker, questId)
|
||||||
else
|
else
|
||||||
-- Quest is currently hidden — show it
|
-- Quest is currently untracked — track it
|
||||||
pcall(QuestieTracker.AQW_Insert, QuestieTracker, questLogLineIndex, QUEST_WATCH_NO_EXPIRE)
|
pcall(QuestieTracker.AQW_Insert, QuestieTracker, questLogLineIndex, QUEST_WATCH_NO_EXPIRE)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user