View Single Post
02-06-10, 01:50 AM   #144
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,961
Grr, just when I thought I had everything working .. this doesn't seem to make sense though.

Okay, it widens and increases the criteria perquest but despite setting the max achievement watch count to 20 it won't go passed 10. Although, it doesn't report the error. The achievement window and watch frame just refuses to cooperate. I can't see anything obvious apart from this code but it should work as it is.

All I can think of is that I can set a hardcoded value to WATCHFRAME_MAXACHIEVEMENTS but not programmatically do it. If thats the case I'll just set them all to 50 and leave it at that. Is this a Lua restriction ? I think C has a similar restriction so possibly so. Well, apart from that little nugget all of the new items are coded in ready to roll. So once I get that figured out it should be good to go.

Code:
function AchievementButton_ToggleTracking (id)
	if ( trackedAchievements[id] ) then
		RemoveTrackedAchievement(id);
		AchievementFrameAchievements_ForceUpdate();
		WatchFrame_Update();
		return;
	end
	
	local count = GetNumTrackedAchievements();
	
	if ( count >= WATCHFRAME_MAXACHIEVEMENTS ) then
		UIErrorsFrame:AddMessage(format(ACHIEVEMENT_WATCH_TOO_MANY, WATCHFRAME_MAXACHIEVEMENTS), 1.0, 0.1, 0.1, 1.0);
		return;
	end
	
	local _, _, _, completed = GetAchievementInfo(id)
	if ( completed ) then
		UIErrorsFrame:AddMessage(ERR_ACHIEVEMENT_WATCH_COMPLETED, 1.0, 0.1, 0.1, 1.0);
		return;
	end
	
	AddTrackedAchievement(id);
	AchievementFrameAchievements_ForceUpdate();
	WatchFrame_Update();
	
	return true;
end
__________________


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