Back to Home

ESO Lua File v100032

libraries/utility/zo_primaryplayername.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
USE_INTERNAL_FORMAT = true
    local setting = IsInGamepadPreferredMode() and UI_SETTING_PRIMARY_PLAYER_NAME_GAMEPAD or UI_SETTING_PRIMARY_PLAYER_NAME_KEYBOARD
    return tonumber(GetSetting(SETTING_TYPE_UI, setting)) == PRIMARY_PLAYER_NAME_SETTING_PREFER_USERID
end
function ZO_GetPrimaryPlayerNameFromUnitTag(unitTag, useInternalFormat)
    if ZO_ShouldPreferUserId() then
        local displayName = GetUnitDisplayName(unitTag)
        return useInternalFormat and displayName or ZO_FormatUserFacingDisplayName(displayName)
    else
          local characterName = GetUnitName(unitTag)
        return useInternalFormat and characterName or ZO_FormatUserFacingCharacterName(characterName);
    end 
end
function ZO_GetSecondaryPlayerNameFromUnitTag(unitTag, useInternalFormat)
    if not ZO_ShouldPreferUserId() then
        local displayName = GetUnitDisplayName(unitTag)
        return useInternalFormat and displayName or ZO_FormatUserFacingDisplayName(displayName)
    else
        local characterName = GetUnitName(unitTag)
        return useInternalFormat and characterName or ZO_FormatUserFacingCharacterName(characterName);
    end 
end
function ZO_GetPrimaryPlayerName(displayName, characterName, useInternalFormat)
    if ZO_ShouldPreferUserId() then
        return useInternalFormat and displayName or ZO_FormatUserFacingDisplayName(displayName)
    else
          return useInternalFormat and characterName or ZO_FormatUserFacingCharacterName(characterName)
    end
end
function ZO_GetSecondaryPlayerName(displayName, characterName, useInternalFormat)
    if not ZO_ShouldPreferUserId() then
        return useInternalFormat and displayName or ZO_FormatUserFacingDisplayName(displayName)
    else
          return useInternalFormat and characterName or ZO_FormatUserFacingCharacterName(characterName)
    end
end
    local name = ZO_GetSecondaryPlayerNameFromUnitTag(unitTag)
    local title = GetUnitTitle(unitTag)
    if title ~= "" then
        return zo_strformat(SI_PLAYER_NAME_WITH_TITLE_FORMAT, name, title)
    else
        return name
    end
end
function ZO_GetPrimaryPlayerNameWithSecondary(displayName, characterName)
    local primaryName = ZO_GetPrimaryPlayerName(displayName, characterName)
    local secondaryName = ZO_GetSecondaryPlayerName(displayName, characterName)
    return zo_strformat(SI_PLAYER_PRIMARY_AND_SECONDARY_NAME_FORMAT, primaryName, secondaryName)
end
    if ZO_ShouldPreferUserId() then
        return ZO_GetPlatformAccountLabel()
    else
        return GetString(SI_SOCIAL_LIST_PANEL_HEADER_CHARACTER)
    end
end