Back to Home

ESO Lua File v101041

pregame/statemanager/console/pregamestates_console.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
local consolePregameStates =
{
        ["LegalAgreements"] =
    {
        ShouldAdvance = function()
            return false
        end,
        OnEnter = function()
            LEGAL_AGREEMENT_SCREEN_GAMEPAD:ShowConsoleFetchedDocs()
        end,
        OnExit = function()
        end,
        GetStateTransitionData = function()
            return "AcceptLegalDocs"
        end,
    },
    ["AcceptLegalDocs"] =
    {
        ShouldAdvance = function()
            return false
        end,
        OnEnter = function()
            CREATE_LINK_LOADING_SCREEN_GAMEPAD:Show("AccountLogin", AcceptLegalDocs, GetString(SI_GAMEPAD_PREGAME_LOADING))
        end,
        OnExit = function()
        end,
        GetStateTransitionData = function()
            return "NoCreateLinkAccountLoading"
        end,
    },
}
local function OnProfileLoginResult(event, isSuccess, profileError)
    --Don't return to IIS if we're on Server Select and NO_PROFILE was returned because they probably cancelled the selection
    if isSuccess == false and not (profileError == PROFILE_LOGIN_ERROR_NO_PROFILE and SCENE_MANAGER:IsShowing("GameStartup")) then
        local errorStringFormat = GetString("SI_PROFILELOGINERROR", profileError)
        if errorStringFormat == "" then
            errorStringFormat = GetString("SI_PROFILELOGINERROR", PROFILE_LOGIN_ERROR_UNKNOWN_ERROR)
        end
        local errorString = zo_strformat(errorStringFormat, GetURLTextByType(APPROVED_URL_ESO_HELP))
        PREGAME_INITIAL_SCREEN_GAMEPAD:ShowError(GetString(SI_PROFILE_LOAD_FAILED_TITLE), errorString)
    end
end
local function PregameStateManager_Initialize()
    EVENT_MANAGER:RegisterForEvent("PregameStateManager", EVENT_PROFILE_LOGIN_RESULT, OnProfileLoginResult)
end