View Single Post
07-26-13, 01:00 AM   #7
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
Aww, stupid... After bashing over a wall of air, it finally worked quite nicely.

Lua Code:
  1. local tooltip = CreateFrame("GameTooltip", "MyPrivateStuff_QTipFrame", UIParent, "GameTooltipTemplate")
  2.  
  3. function tooltip:GetQuestTitle()
  4.   local title = MyPrivateStuff_QTipFrameTextLeft1:GetText()
  5.   DEFAULT_CHAT_FRAME:AddMessage(self["message"]:format(title))
  6.   self:SetScript("OnTooltipSetQuest", nil)
  7. end
  8.  
  9. -- activation code
  10.     if IsQuestFlaggedCompleted(argv[2]) then
  11.       tooltip["message"] = ("Quest |cffffff00|Hquest:%d|h[%%s]|h|r flagged as completed."):format(argv[2])
  12.     else
  13.       tooltip["message"] = ("Quest |cffffff00|Hquest:%d|h[%%s]|h|r is not completed or not available to character."):format(argv[2])
  14.     end
  15.     DEFAULT_CHAT_FRAME:AddMessage("Retrieving quest information...")
  16.     tooltip:SetOwner(UIParent, "ANCHOR_NONE")
  17.     tooltip:SetScript("OnTooltipSetQuest", tooltip.GetQuestTitle)
  18.     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.)
  Reply With Quote