View Single Post
08-31-20, 08:09 PM   #1
Tair
A Deviate Faerie Dragon
Join Date: Aug 2020
Posts: 10
(Classic) Modifying the Quest Watch Frame

Hi everyone!

I've recently begun exploring writing my own simple addons. I have a decent beginner's understanding of how to create new functions with an addon, but I'm having a difficult time understanding how to best modify/override existing Blizzard frames.

As an example, I'd like to make some minor changes the Quest Watch frame in Classic. Simple cosmetic modifications like adjusting the fonts, text alignment, etc.

I've found the Blizzard function that I believe controls the things I want to modify, which is QuestWatch_Update(). Here's a segment of code from that function:

Code:
for j=1, numObjectives do
	text, type, finished = GetQuestLogLeaderBoard(j, questIndex);
	watchText = _G["QuestWatchLine"..watchTextIndex];
	-- Set Objective text
	watchText:SetText(" - "..text);
	-- Color the objectives
	if ( finished ) then
		watchText:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
		objectivesCompleted = objectivesCompleted + 1;
	else
		watchText:SetTextColor(0.8, 0.8, 0.8);
	end
	tempWidth = watchText:GetWidth();
	if ( tempWidth > questWatchMaxWidth ) then
		questWatchMaxWidth = tempWidth;
	end
	watchText:SetPoint("TOPLEFT", "QuestWatchLine"..(watchTextIndex - 1), "BOTTOMLEFT", 0, 0);
	watchText:Show();
	watchTextIndex = watchTextIndex + 1;
end

I'm looking for some help with understanding the correct way to reference/alias/override this code to, for example, get rid of the hyphen in front of a tracked objective:

Code:
-- original
watchText:SetText(" - "..text);
-- override
watchText:SetText(text);
I'd be grateful if anyone could point me in the right direction.

Thanks!
  Reply With Quote