So, regarding your addon you need to change
Lua Code:
local categoryTopLevelIndex = GetCategoryInfoFromAchievementId(achId)
into something more complex:
- Get the PreviousAchievementInLine()
- If it's not 0, get the AchievementInfo from it
- If the AchievementInfo completed == true, get the CategoryInfo to get the correct category
- If not, repeat and get previouspreviousAchievementInLine()
- If it IS 0, you can just get the CategoryInfo