Back to Home

ESO Lua File v101044

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
64
65
66
67
68
69
70
71
72
73
74
75
do
    function ZO_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
    local levelString = ZO_GetLevelOrChampionPointsStringNoIcon(level, championPoints)
    if levelString ~= "" then
        if championPoints and championPoints > 0 then
            levelString = zo_strformat(SI_SCREEN_NARRATION_CHAMPION_LEVEL_FORMATTER, levelString)
        end
        return levelString
    end
    return ""
end
function ZO_GetChampionIconMarkupString(iconSize)
    if iconSize then
        local championIcon
        if IsInGamepadPreferredMode() then
            championIcon = ZO_GetGamepadChampionPointsIcon()
        else
            championIcon = ZO_GetChampionPointsIconSmall()
        end
        return zo_iconFormat(championIcon, iconSize, iconSize)
    end
end
    if iconSize then
        local championIcon
        if IsInGamepadPreferredMode() then
            championIcon = ZO_GetGamepadChampionPointsIcon()
        else
            championIcon = ZO_GetChampionPointsIconSmall()
        end
        return zo_iconFormatInheritColor(championIcon, iconSize, iconSize)
    end
end
function ZO_GetLevelOrChampionPointsString(level, championPoints, iconSize)
    local iconString = ""
    
    if championPoints and championPoints > 0 and iconSize then
        iconString = ZO_GetChampionIconMarkupString(iconSize)
    end
    
    return string.format("%s%s", iconString, ZO_GetLevelOrChampionPointsStringNoIcon(level, championPoints))
end
function ZO_GetLevelOrChampionPointsRangeString(minLevel, maxLevel, isChampionPoints, iconSize)
    local iconString = ""
    
    if isChampionPoints and iconSize then
        iconString = ZO_GetChampionIconMarkupString(iconSize)
    end
    return string.format("%s%s-%s", iconString, minLevel, maxLevel)
end