ESO Lua File v100010

ingame/contacts/sociallist_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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    local textColor = data.online and ZO_SECOND_CONTRAST_TEXT or ZO_DISABLED_TEXT
    local iconColor = data.online and ZO_DEFAULT_ENABLED_COLOR or ZO_DISABLED_TEXT
    if(selected) then
        textColor = ZO_SELECTED_TEXT
        iconColor = ZO_SELECTED_TEXT
    end
    return textColor, iconColor
end
function ZO_SocialList_ColorRow(control, data, displayNameTextColor, iconColor, otherTextColor)
    local displayName = GetControl(control, "DisplayName")
    displayName:SetColor(displayNameTextColor:UnpackRGBA())
    if(data.hasCharacter) then
        local zone = GetControl(control, "Zone")
        zone:SetColor(otherTextColor:UnpackRGBA())        
        
        local veteran = GetControl(control, "Veteran")
        veteran:SetColor(iconColor:UnpackRGBA())
        local level = GetControl(control, "Level")
        level:SetColor(otherTextColor:UnpackRGBA())
        local alliance = GetControl(control, "Alliance")
        alliance:SetColor(iconColor:UnpackRGBA())
        local class = GetControl(control, "Class")
        class:SetColor(iconColor:UnpackRGBA())
    end
end
function ZO_SocialList_SetUpOnlineData(data, online, secsSinceLogoff)
    data.online = online
    data.secsSinceLogoff = online and -1 or secsSinceLogoff
    data.normalizedLogoffSort = online and -1 or ZO_NormalizeSecondsPositive(secsSinceLogoff)
    data.timeStamp = online and 0 or GetFrameTimeSeconds()
end
    local displayName = GetControl(control, "DisplayName")
    displayName:SetText(data.displayName)
    
    local status = GetControl(control, "Status")
    status:SetTexture(GetPlayerStatusIcon(data.status))
    local zone = GetControl(control, "Zone")
    local class = GetControl(control, "Class")
    local alliance = GetControl(control, "Alliance")
    local level = GetControl(control, "Level")
    local veteran = GetControl(control, "Veteran")
        
    local hideCharacterFields = not data.hasCharacter
    zone:SetHidden(hideCharacterFields)
    class:SetHidden(hideCharacterFields)
    alliance:SetHidden(hideCharacterFields)
    level:SetHidden(hideCharacterFields)
    veteran:SetHidden(hideCharacterFields)
    if(data.hasCharacter) then   
        zone:SetText(zo_strformat(SI_SOCIAL_LIST_LOCATION_FORMAT, data.zone))
        level:SetText(GetLevelOrVeteranRankStringNoIcon(data.level, data.veteranRank))
        if data.veteranRank and data.veteranRank > 0 then
            veteran:SetTexture(GetVeteranRankIcon())
        else
            veteran:SetHidden(true)
        end
        local allianceTexture = GetAllianceSymbolIcon(data.alliance)
        if(allianceTexture) then
            alliance:SetTexture(allianceTexture)
        else
            alliance:SetHidden(true)
        end
        local classTexture = GetClassIcon(data.class)
        if(classTexture) then
            class:SetTexture(classTexture)
        else
            class:SetHidden(true)
        end
    end
end