17_18_LochModan.lua confirmed working, added in .toc
[WoW-TourGuide.git] / UnlistedQuest.lua
blobe6ca998495a626fb8d82fed3b56bad6ff754e818
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") 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:SetFrameStrata("DIALOG")
14 notlisted:SetWidth(32)
15 notlisted:SetHeight(32)
16 notlisted:SetPoint("TOPLEFT", 70, -45)
19 notlisted:RegisterEvent("QUEST_DETAIL")
20 notlisted:RegisterEvent("QUEST_COMPLETE")
21 notlisted:RegisterEvent("QUEST_FINISHED")
22 notlisted:SetScript("OnEvent", function(self, event)
23 if event ~= "QUEST_DETAIL" then return self:Hide() end
24 local quest = GetTitleText()
25 if quest and TourGuide:IsQuestAcceptable(quest) then self:Hide()
26 else self:Show() end
27 end)
30 local nltex = notlisted:CreateTexture()
31 nltex:SetAllPoints()
32 nltex:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
34 local text = notlisted:CreateFontString(nil, "OVERLAY", "GameFontNormal")
35 text:SetPoint("TOPLEFT", notlisted, "TOPRIGHT")
36 text:SetPoint("BOTTOMLEFT", notlisted, "BOTTOMRIGHT")
37 text:SetPoint("RIGHT", notlisted, "RIGHT", 200, 0)
38 text:SetText("|cffff4500This quest is not listed in your current guide")