TourGuide
[WoW-TourGuide.git] / UnlistedQuest.lua
blob41db4840baeff2f24285f1295fe38e586de11e7c
2 local TourGuide = TourGuide
5 function TourGuide:IsQuestAcceptable(name)
6 for i,v in pairs(self.actions) do
7 if (v == "ACCEPT" or v == "COMPLETE" or v == "ITEM") and self.quests[i]:gsub("%s%(Part %d+%)", "") == name then return true end
8 end
9 end
12 local notlisted = CreateFrame("Frame", nil, QuestFrame)
13 notlisted:SetWidth(32)
14 notlisted:SetHeight(32)
15 notlisted:SetPoint("TOPLEFT", 70, -45)
18 notlisted:RegisterEvent("QUEST_DETAIL")
19 notlisted:RegisterEvent("QUEST_COMPLETE")
20 notlisted:SetScript("OnEvent", function(self, event)
21 if event == "QUEST_COMPLETE" then return self:Hide() end
22 local quest = GetTitleText()
23 if quest and TourGuide:IsQuestAcceptable(quest) then self:Hide()
24 else self:Show() end
25 end)
28 local nltex = notlisted:CreateTexture()
29 nltex:SetAllPoints()
30 nltex:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")