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:
local function CreateQuestTag(level, questTag, frequency)
local tag = ""
if level == -1 then level = "*" else level = tostring(level) end
if questTag == ELITE then
tag = "+"
elseif questTag == QUEST_TAG_GROUP then
tag = "g"
elseif questTag == QUEST_TAG_PVP then
tag = "pvp"
elseif questTag == QUEST_TAG_DUNGEON then
tag = "d"
elseif questTag == QUEST_TAG_HEROIC then
tag = "hc"
elseif questTag == QUEST_TAG_RAID then
tag = "r"
elseif questTag == QUEST_TAG_RAID10 then
tag = "r10"
elseif questTag == QUEST_TAG_RAID25 then
tag = "r25"
elseif questTag == QUEST_TAG_SCENARIO then
tag = "s"
elseif questTag == QUEST_TAG_ACCOUNT then
tag = "a"
elseif questTag == QUEST_TAG_LEGENDARY then
tag = "leg"
end
if frequency == 2 then tag = tag.."!" elseif frequency == 3 then tag = tag.."!!" end
if tag ~= "" then tag = ("|cff00b3ff%s|r"):format(tag) end
tag = ("[%s %s] "):format(level, tag)
return tag
end
--[[Questtitle]]--
hooksecurefunc(QUEST_TRACKER_MODULE, "Update", function(self)
for i = 1, GetNumQuestWatches() do
local title, level, groupSize, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isBounty, isStory = GetQuestLogTitle(i)
if not questID then break end
local block = QUEST_TRACKER_MODULE:GetBlock(questID)
local tagID = GetQuestTagInfo(questID)
block.HeaderText:SetFont(STANDARD_TEXT_FONT, 11)
block.HeaderText:SetShadowOffset(.7, -.7)
block.HeaderText:SetShadowColor(0, 0, 0, 1)
block.HeaderText:SetWordWrap(true)
local heightcheck = block.HeaderText:GetNumLines()
if heightcheck == 2 then
local height = block:GetHeight()
block:SetHeight(height + 16)
end
if block then
local oldBlockHeight = block.height
local oldHeight = QUEST_TRACKER_MODULE:SetStringText(block.HeaderText, title, nil, OBJECTIVE_TRACKER_COLOR["Header"])
local newTitle = CreateQuestTag(level, tagID, frequency) .. title
local newHeight = QUEST_TRACKER_MODULE:SetStringText(block.HeaderText, newTitle, nil, OBJECTIVE_TRACKER_COLOR["Header"])
end
end
end)