View Single Post
02-05-10, 11:32 PM   #143
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
Well, after reading a comment on Seerah's watchframe addon and looking into the possibility of that request I noticed how to get the following problems I was trying to solve.

1. Change the width but the quest text didn't change.
Solution: Hook into WatchFrame_Update and add this line 'WATCHFRAME_MAXLINEWIDTH = addonData["ScrollFrame"].Width - 30;' It will now automatically resize the length of the quest/achievement lines to reflect the new width.

2. Now that we have no real limits on what we can show, how do we stop the .. You can't track more than ??? quests rofl.
Solution: Add the following lines to override the blizzard defaults
WATCHFRAME_MAXQUESTS = 50;
WATCHFRAME_MAXACHIEVEMENTS = 50;
WATCHFRAME_CRITERIA_PER_ACHIEVEMENT = 50;
Of course I will have to make sure that they aren't changed by another addon somewhere so I will have those values in as a changeable value and use the newly created local WatchFrame_Update function to keep them updated.

3. If we want to hide the frame if there are no quests and achievements to watch, like the blizzard one does how do we do it ?
Solution:
Code:
	hooksecurefunc("WatchFrame_Update",function(self)
		WATCHFRAME_MAXLINEWIDTH = addonData["ScrollFrame"].Width - 30;
		if ( addonData["WatchFrame"].AutoHide ) then
			if ( GetNumTrackedAchievements() == 0 and GetNumQuestWatches() == 0 ) then 
				f:Hide();
			else
				f:Show();
			end
		end
	end);
f being the scroll frame container that we are in full control of

I probably won't get a chance to fully update the code until Monday though unless the StarTrek servers go down alot more over the weekend rofl. But just need to add the AutoHide option as a saved variable and changeable value. As well as the AutoWidth, Max Achievement and Quest watches etc.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818