Adding magic localization table, deDE locale strings from decimad
[WoW-TourGuide.git] / UnlistedQuest.lua
blob1fd6f1d25deab43673aeea74596a6552fe42b2a6
2 local TourGuide = TourGuide
3 local L = TourGuide.Locale
6 function TourGuide:IsQuestAcceptable(name)
7 for i,v in pairs(self.actions) do
8 if (v == "ACCEPT" or v == "COMPLETE") and self.quests[i]:gsub(L.PART_GSUB, "") == name then return true end
9 end
10 end
13 local notlisted = CreateFrame("Frame", nil, QuestFrame)
14 notlisted:SetFrameStrata("DIALOG")
15 notlisted:SetWidth(32)
16 notlisted:SetHeight(32)
17 notlisted:SetPoint("TOPLEFT", 70, -45)
20 notlisted:RegisterEvent("QUEST_DETAIL")
21 notlisted:RegisterEvent("QUEST_COMPLETE")
22 notlisted:RegisterEvent("QUEST_FINISHED")
23 notlisted:SetScript("OnEvent", function(self, event)
24 if event ~= "QUEST_DETAIL" then return self:Hide() end
25 local quest = GetTitleText()
26 if quest and TourGuide:IsQuestAcceptable(quest) then self:Hide()
27 else self:Show() end
28 end)
31 local nltex = notlisted:CreateTexture()
32 nltex:SetAllPoints()
33 nltex:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
35 local text = notlisted:CreateFontString(nil, "OVERLAY", "GameFontNormal")
36 text:SetPoint("TOPLEFT", notlisted, "TOPRIGHT")
37 text:SetPoint("BOTTOMLEFT", notlisted, "BOTTOMRIGHT")
38 text:SetPoint("RIGHT", notlisted, "RIGHT", 200, 0)
39 text:SetText("|cffff4500This quest is not listed in your current guide")