Aww, stupid... After bashing over a wall of air, it finally worked quite nicely.
Lua Code:
local tooltip = CreateFrame("GameTooltip", "MyPrivateStuff_QTipFrame", UIParent, "GameTooltipTemplate")
function tooltip:GetQuestTitle()
local title = MyPrivateStuff_QTipFrameTextLeft1:GetText()
DEFAULT_CHAT_FRAME:AddMessage(self["message"]:format(title))
self:SetScript("OnTooltipSetQuest", nil)
end
-- activation code
if IsQuestFlaggedCompleted(argv[2]) then
tooltip["message"] = ("Quest |cffffff00|Hquest:%d|h[%%s]|h|r flagged as completed."):format(argv[2])
else
tooltip["message"] = ("Quest |cffffff00|Hquest:%d|h[%%s]|h|r is not completed or not available to character."):format(argv[2])
end
DEFAULT_CHAT_FRAME:AddMessage("Retrieving quest information...")
tooltip:SetOwner(UIParent, "ANCHOR_NONE")
tooltip:SetScript("OnTooltipSetQuest", tooltip.GetQuestTitle)
tooltip:SetHyperlink("quest:" .. argv[2])
Tested on
quest id:25323, it properly spit only one line. (Without unsetting OnTooltipSetQuest, it prints a second line, when quest item data is accessed, as
semlar pointed out earlier.)