Back to Home

ESO Lua File v100021

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
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
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