diff --git a/TurnIn.lua b/TurnIn.lua index 6e0911d..7009994 100644 --- a/TurnIn.lua +++ b/TurnIn.lua @@ -207,6 +207,9 @@ function TI_SlashCmdHandler(cmd) window = function () TI_OptionsFrame:Show(); end, + config = function () + TI_OptionsFrame:Show(); + end, recent = function () TI_TempNPCListWindow:Show(); end, @@ -314,7 +317,7 @@ function TI_OnEvent(self, event, ...) TI_debug("Quest Detail"); TI_gossipclosed = false; if(TI_IsNPCOn(UnitName("npc"), "availquest")) then - AcceptQuest(); + TI_HandleAcceptQuest(); end TI_ResetPointers(); end @@ -328,6 +331,11 @@ function TI_OnEvent(self, event, ...) end end +function TI_HandleAcceptQuest() + QuestInfoFadingFrame_OnUpdate(QuestInfoFadingFrame, 1); + QuestDetailAcceptButton_OnClick(); +end + function TI_HandleQuestProgress() local questname = GetTitleText(); @@ -357,10 +365,12 @@ end function TI_CompleteQuest() if(IsQuestCompletable()) then + TI_debug("quest is completable, completeing"); CompleteQuest(); TI_ResetPointers(); else - DeclineQuest(); + TI_debug("quest is not completable, declining"); + QuestDetailDeclineButton_OnClick(); end end @@ -616,17 +626,20 @@ end function TI_TabulateGossipAvailableQuests(...) local x = {}; - for i=1, select("#", ...), 5 do + for i=1, select("#", ...), 6 do local temp = {}; temp.name = select(i, ...); - isTrivial = select(i+2, ...); - isDaily = select(i+3, ...); - isRepeatable = select(i+4, ...); + local isTrivial = select(i+2, ...); + local isDaily = select(i+3, ...); + local isRepeatable = select(i+4, ...); + local isLegendary = select(i+5, ...); if ( isDaily ) then temp.icon = "Interface\\GossipFrame\\DailyQuestIcon"; elseif ( isRepeatable ) then temp.icon = "Interface\\GossipFrame\\DailyActiveQuestIcon"; + elseif ( isLegendary ) then + temp.icon = "Interface\\GossipFrame\\AvailableLegendaryQuestIcon"; else temp.icon = "Interface\\GossipFrame\\AvailableQuestIcon"; end @@ -639,13 +652,18 @@ end function TI_TabulateGossipActiveQuests(...) local x = {}; - for i=1, select("#", ...), 4 do + for i=1, select("#", ...), 5 do local temp = {}; temp.name = select(i, ...); - isComplete = select(i+3, ...); + local isComplete = select(i+3, ...); + local isLegendary = select(i+4, ...); if(isComplete) then - temp.icon = "Interface\\GossipFrame\\ActiveQuestIcon"; + if(isLegendary) then + temp.icon = "Interface\\GossipFrame\\ActiveLegendaryQuestIcon"; + else + temp.icon = "Interface\\GossipFrame\\ActiveQuestIcon"; + end else temp.icon = "Interface\\GossipFrame\\IncompleteQuestIcon"; end diff --git a/TurnIn.toc b/TurnIn.toc index 3a65d96..cc538c8 100644 --- a/TurnIn.toc +++ b/TurnIn.toc @@ -1,7 +1,7 @@ -## Interface: 40000 -## X-Compatible-With: 40000 +## Interface: 50000 +## X-Compatible-With: 50000 ## Title: Turn In ## Notes: Automates the selection of quest and gossip options. ## SavedVariables: TI_status, TI_NPCDB, TI_NPCIndex ## Version: 2.1 -TurnIn.xml \ No newline at end of file +TurnIn.xml