Back to Home

ESO Lua File v100016

ingame/achievements/achievements_shared.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function ZO_GetNextInProgressAchievementInLine(achievementId)
    local nextAchievementId = achievementId
    while nextAchievementId ~= 0 do
        achievementId = nextAchievementId
        if not IsAchievementComplete(achievementId) then
            return achievementId
        end
        nextAchievementId = GetNextAchievementInLine(achievementId)
    end
    return achievementId
end
    if filterType == SI_ACHIEVEMENT_FILTER_SHOW_ALL then
        return true
    end
    while id ~= 0 do
        local _, _, _, _, completed, _, _= GetAchievementInfo(id)
        if completed then
            if filterType == SI_ACHIEVEMENT_FILTER_SHOW_EARNED then
                return true
            end
            -- This achievement was completed, but we want to show unearned, so see if there are any unearned achievements in this line
            id = GetNextAchievementInLine(id)
        else -- This achievement wasn't completed
            if filterType == SI_ACHIEVEMENT_FILTER_SHOW_UNEARNED then
                return true
            end
            -- Otherwise we only want to show earned achievements, so find the first completed achievement working backwards from this one
            id = GetPreviousAchievementInLine(id)
        end
    end
    -- Either this achievement wasn't a line, or everything in it was filtered.
    return false
end
function ZO_GetAchievementIds(categoryIndex, subCategoryIndex, numAchievements)
    result = {}
    for i = 1, numAchievements do
        table.insert(result, GetAchievementId(categoryIndex, subCategoryIndex, i))
    end
    return result
end