Back to Home

ESO Lua File v101038

pregame/accountlogin/keyboard/createlinkaccountdialogs_keyboard.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
local WARNING_COLOR = ZO_ColorDef:New("DC8122")
local PARTNER_ICONS =
{
    [PLATFORM_SERVICE_TYPE_DMM] = "EsoUI/Art/Login/link_Login_DMM.dds",
    [PLATFORM_SERVICE_TYPE_STEAM] = "EsoUI/Art/Login/link_Login_Steam.dds",
    [PLATFORM_SERVICE_TYPE_EPIC] = "EsoUI/Art/Login/link_Login_Epic.dds",
}
local function LinkAccountsDialogSetup(dialog, data)
    local partnerAccountName = dialog:GetNamedChild("PartnerAccount")
    local optionalTextLabel = dialog:GetNamedChild("OptionalText")
    local partnerIcon = dialog:GetNamedChild("PartnerIcon")
    local serviceType = GetPlatformServiceType()
    local iconPath = PARTNER_ICONS[serviceType]
    if iconPath then
        partnerIcon:SetTexture(iconPath)
    end
    if serviceType == PLATFORM_SERVICE_TYPE_DMM then
        optionalTextLabel:SetText(WARNING_COLOR:Colorize(GetString(SI_KEYBOARD_LINKACCOUNT_CROWN_LOSS_WARNING)))
        partnerAccountName:SetText(GetString(SI_KEYBOARD_LINKACCOUNT_GENERIC_ACCOUNT_NAME_DMM))
    else
        partnerAccountName:SetText(data.partnerAccount or "")
    end
    local accountTypeName = GetString("SI_PLATFORMSERVICETYPE", serviceType)
    if accountTypeName then
        local confirmWarning = dialog:GetNamedChild("LinkConfirm2")
        confirmWarning:SetText(zo_strformat(GetString(SI_LINKACCOUNT_CONFIRM_2_FORMAT), accountTypeName))
    end
    dialog:GetNamedChild("ESOAccount"):SetText(data.esoAccount or "")
end
    ZO_Dialogs_RegisterCustomDialog("LINK_ACCOUNT_KEYBOARD",
    {
        customControl = control,
        setup = LinkAccountsDialogSetup,
        canQueue = true,
        title =
        {
            text = SI_KEYBOARD_LINKACCOUNT_DIALOG_HEADER,
        },
        buttons =
        {
            {
                control = control:GetNamedChild("Link"),
                text    = SI_DIALOG_ACCEPT,
                callback = function(dialog)
                        local data = dialog.data
                        LOGIN_MANAGER_KEYBOARD:AttemptAccountLink(data.esoAccount, data.password)
                    end,
            },
            {
                control = control:GetNamedChild("Cancel"),
                text    = SI_DIALOG_CANCEL,
            },
        }
    })
end