From e115dfb4746de27c6575c58935e1e0c65617a201 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 24 Aug 2024 13:55:47 -0300 Subject: [PATCH] Fixed Skip Conversation button click when using the speed run feature --- WorldQuestTracker_ZoneMap.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/WorldQuestTracker_ZoneMap.lua b/WorldQuestTracker_ZoneMap.lua index 4e5f0de3..585f6176 100644 --- a/WorldQuestTracker_ZoneMap.lua +++ b/WorldQuestTracker_ZoneMap.lua @@ -2397,18 +2397,47 @@ end) local npcOptionsCache = {} +local findSkipConversationOption = function(children) + for i = 1, #children do + local child = children[i] + if (child.IsObjectType and child:IsObjectType("Button") and child:IsShown() and child:IsEnabled()) then + if (child.GetData) then + local data = child:GetData() + if (data and type(data) == "table" and data.info and data.info.gossipOptionID) then + local name = data.info.name + if (name and type(name) == "string" and name:len() > 2) then + if (name:find("<") and name:find(">") and name:find("%|c") and name:find("^%|cFF")) then + child:Click() + return true + end + end + end + end + end + end +end + --a frame with multiple quests to accept GossipFrame:HookScript("OnShow", function() local bAutoAccept = WorldQuestTracker.db.profile.speed_run.auto_accept local bAutoComplete = WorldQuestTracker.db.profile.speed_run.auto_complete --do return end + + --find + C_Timer.After(0, function() local greetingsFrame = GossipFrame.GreetingPanel local scrollBox = GossipFrame.GreetingPanel.ScrollBox local scrollTarget = GossipFrame.GreetingPanel.ScrollBox.ScrollTarget local children = {scrollTarget:GetChildren()} + if (findSkipConversationOption(children)) then + return + end + + do return end + for i = 1, #children do local child = children[i] if (child.IsObjectType and child:IsObjectType("Button") and child:IsShown() and child:IsEnabled()) then