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