Back to Home

ESO Lua File v100028

ingame/globals/zo_championrankutils.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
53
54
55
56
57
58
59
60
61
62
63
do
    local CHAMPION_CAP = GetMaxSpendableChampionPointsInAttribute() * 3
    function GetLevelOrChampionPointsStringNoIcon(level, championPoints)
        if championPoints and championPoints > 0 then
            if championPoints > CHAMPION_CAP then
                return tostring(CHAMPION_CAP)
            else
                return tostring(championPoints)
            end
        elseif level and level > 0 then
            return tostring(level)
        else
            return ""
        end
    end
end
function GetChampionIconMarkupString(iconSize)
    if iconSize then
        local championIcon
        if IsInGamepadPreferredMode() then
            championIcon = GetGamepadChampionPointsIcon()
        else
            championIcon = GetChampionPointsIconSmall()
        end
        return zo_iconFormat(championIcon, iconSize, iconSize)
    end
end
    if iconSize then
        local championIcon
        if IsInGamepadPreferredMode() then
            championIcon = GetGamepadChampionPointsIcon()
        else
            championIcon = GetChampionPointsIconSmall()
        end
        return zo_iconFormatInheritColor(championIcon, iconSize, iconSize)
    end
end
function GetLevelOrChampionPointsString(level, championPoints, iconSize)
    local iconString = ""
    
    if championPoints and championPoints > 0 and iconSize then
        iconString = GetChampionIconMarkupString(iconSize)
    end
    
    return iconString .. GetLevelOrChampionPointsStringNoIcon(level, championPoints)
end
function GetLevelOrChampionPointsRangeString(minLevel, maxLevel, isChampionPoints, iconSize)
    local iconString = ""
    
    if isChampionPoints and iconSize then
        iconString = GetChampionIconMarkupString(iconSize)
    end
    return string.format("%s%s-%s", iconString, minLevel, maxLevel)
end