Quantcast
WoWInterface - View Single Post - Adding Questtags
View Single Post
07-30-16, 11:14 AM   #1
liquidbase
A Warpwood Thunder Caller
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 95
Adding Questtags

Hell @all!

Currently I try to add permanently questtags to the objectivetracker. To achieve this I use the code below. Problem with this code is, on login I see the questtags, if I open the world map the questtags appear and on closing the world map the tags disappear, same on a reload of the UI. If I aquire a new quest the tags changes randomly at the objectivetracker. At the moment I have no idea why this might be. One of you may have even an idea how I can change the code so that it also works properly and the tags are displayed at all times correctly.

Thanks in advance for all help

Lua Code:
  1. local function CreateQuestTag(level, questTag, frequency)
  2.     local tag = ""
  3.    
  4.     if level == -1 then level = "*" else level = tostring(level) end
  5.    
  6.     if questTag == ELITE then
  7.         tag = "+"
  8.     elseif questTag == QUEST_TAG_GROUP then
  9.         tag = "g"
  10.     elseif questTag == QUEST_TAG_PVP then
  11.         tag = "pvp"
  12.     elseif questTag == QUEST_TAG_DUNGEON then
  13.         tag = "d"
  14.     elseif questTag == QUEST_TAG_HEROIC then
  15.         tag = "hc"
  16.     elseif questTag == QUEST_TAG_RAID then
  17.         tag = "r"
  18.     elseif questTag == QUEST_TAG_RAID10 then
  19.         tag = "r10"
  20.     elseif questTag == QUEST_TAG_RAID25 then
  21.         tag = "r25"
  22.     elseif questTag == QUEST_TAG_SCENARIO then
  23.         tag = "s"
  24.     elseif questTag == QUEST_TAG_ACCOUNT then
  25.         tag = "a"
  26.     elseif questTag == QUEST_TAG_LEGENDARY then
  27.         tag = "leg"
  28.     end
  29.    
  30.     if frequency == 2 then tag = tag.."!" elseif frequency == 3 then tag = tag.."!!" end
  31.     if tag ~= "" then tag = ("|cff00b3ff%s|r"):format(tag) end
  32.     tag = ("[%s %s] "):format(level, tag)
  33.     return tag
  34. end
  35.  
  36. --[[Questtitle]]--
  37. hooksecurefunc(QUEST_TRACKER_MODULE, "Update", function(self)
  38.     for i = 1, GetNumQuestWatches() do
  39.         local title, level, groupSize, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isBounty, isStory = GetQuestLogTitle(i)
  40.         if not questID then break end
  41.         local block = QUEST_TRACKER_MODULE:GetBlock(questID)
  42.         local tagID = GetQuestTagInfo(questID)
  43.  
  44.         block.HeaderText:SetFont(STANDARD_TEXT_FONT, 11)
  45.         block.HeaderText:SetShadowOffset(.7, -.7)
  46.         block.HeaderText:SetShadowColor(0, 0, 0, 1)
  47.         block.HeaderText:SetWordWrap(true)
  48.  
  49.         local heightcheck = block.HeaderText:GetNumLines()
  50.  
  51.         if heightcheck == 2 then
  52.             local height = block:GetHeight()
  53.             block:SetHeight(height + 16)
  54.         end
  55.  
  56.         if block then
  57.             local oldBlockHeight = block.height
  58.             local oldHeight = QUEST_TRACKER_MODULE:SetStringText(block.HeaderText, title, nil, OBJECTIVE_TRACKER_COLOR["Header"])
  59.             local newTitle = CreateQuestTag(level, tagID, frequency) .. title
  60.             local newHeight = QUEST_TRACKER_MODULE:SetStringText(block.HeaderText, newTitle, nil, OBJECTIVE_TRACKER_COLOR["Header"])
  61.         end
  62.     end
  63. end)

Last edited by liquidbase : 07-30-16 at 11:16 AM.
  Reply With Quote