Okay, thanks again for that head start, SDPhantom. I used your demo as a guide and put together a hook that covers just about everything I wanted to do:
lua Code:
hooksecurefunc("QuestWatch_Update",function()
local questIndex;
local watchTextIndex = 1;
local numObjectives;
local watchText;
for i=1, GetNumQuestWatches() do
local questIndex = GetQuestIndexForWatch(i);
if (questIndex) then
numObjectives = GetNumQuestLeaderBoards(questIndex);
-- Quest title
if ( numObjectives > 0 ) then
watchText = _G["QuestWatchLine"..watchTextIndex];
-- Font
watchText:SetFont("Fonts\\FRIZQT__.TTF", 15, "OUTLINE");
watchText:SetShadowColor(0,0,0,0);
watchText:SetAlpha(0.85);
-- Adjust padding between quests
if ( watchTextIndex > 1 ) then
watchText:SetPoint("TOPLEFT", "QuestWatchLine"..(watchTextIndex - 1), "BOTTOMLEFT", 0, -12);
end
watchTextIndex = watchTextIndex + 1;
end
-- Quest objectives
for j=1, numObjectives do
text = GetQuestLogLeaderBoard(j, questIndex);
watchText = _G["QuestWatchLine"..watchTextIndex];
watchText:SetText(text);
-- Font
watchText:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE");
watchText:SetShadowColor(0,0,0,0);
watchText:SetAlpha(0.85);
-- Adjust padding between objectives
watchText:SetPoint("TOPLEFT", "QuestWatchLine"..(watchTextIndex - 1), "BOTTOMLEFT", 0, -4);
watchTextIndex = watchTextIndex + 1;
end
end
end
And the result:
One question—the :SetJustifyH("RIGHT") parameter (not included in the above code) doesn't affect the quest titles or objectives. I'm thinking this could be due to the existing :SetPoint parameters that are used to position the text.
Is it possible to use :SetJustifyH or another method to right-align the titles and objectives without breaking the layout?
Thanks!
Edit: I had some success with getting right-aligned titles and objectives by adjusting the SetPoint parameters:
Lua Code:
hooksecurefunc("QuestWatch_Update",function()
local questIndex;
local watchTextIndex = 1;
local numObjectives;
local watchText;
for i=1, GetNumQuestWatches() do
local questIndex = GetQuestIndexForWatch(i);
if (questIndex) then
numObjectives = GetNumQuestLeaderBoards(questIndex);
-- Quest title
if ( numObjectives > 0 ) then
watchText = _G["QuestWatchLine"..watchTextIndex];
-- Font
watchText:SetFont("Fonts\\FRIZQT__.TTF", 15, "OUTLINE");
watchText:SetShadowColor(0,0,0,0);
watchText:SetAlpha(0.85);
-- Positioning
watchText:ClearAllPoints();
watchText:SetPoint("TOPRIGHT", QuestWatchFrame, "TOPRIGHT", -15, 0)
-- Adjust padding between quests
if ( watchTextIndex > 1 ) then
watchText:ClearAllPoints();
watchText:SetPoint("TOPRIGHT", "QuestWatchLine"..(watchTextIndex - 1), "TOPRIGHT", 0, -30)
end
watchTextIndex = watchTextIndex + 1;
end
-- Quest objectives
for j=1, numObjectives do
text = GetQuestLogLeaderBoard(j, questIndex);
watchText = _G["QuestWatchLine"..watchTextIndex];
watchText:SetText(text);
-- Font
watchText:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE");
watchText:SetShadowColor(0,0,0,0);
watchText:SetAlpha(0.85);
-- Adjust padding between objectives
watchText:ClearAllPoints();
watchText:SetPoint("TOPRIGHT", "QuestWatchLine"..(watchTextIndex - 1), "TOPRIGHT", 0, -18);
watchTextIndex = watchTextIndex + 1;
end
end
end
end);
Thanks again for setting me on the right path.