Back to Home

ESO Lua File v101044

ingame/help/gamepad/help_legal_gamepad.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
local ZO_GamepadHelpLegal = ZO_InitializingObject:Subclass()
local URL_LABEL_Y_OFFSET = 55
function ZO_GamepadHelpLegal:Initialize(control)
    self.control = control
    self.scene = ZO_Scene:New("helpLegalDocsGamepad", SCENE_MANAGER)
    self.scene:AddFragment(ZO_FadeSceneFragment:New(control))
    self.headerData = {
        titleText = GetString(SI_GAMEPAD_HELP_LEGAL_HEADER),
        messageText = GetString(SI_GAMEPAD_HELP_LEGAL_TEXT),
    }
    self:SetupText()
    self.scene:RegisterCallback("StateChange", function(oldState, newState)
        if newState == SCENE_SHOWING then
            KEYBIND_STRIP:AddKeybindButtonGroup(self.keybindDescriptors)
            SCREEN_NARRATION_MANAGER:QueueCustomEntry("helpLegal")
        elseif newState == SCENE_HIDDEN then
            KEYBIND_STRIP:RemoveKeybindButtonGroup(self.keybindDescriptors)
        end
    end)
    local narrationInfo =
    {
        canNarrate = function()
            return self.scene:IsShowing()
        end,
        selectedNarrationFunction = function()
            local narrations = {}
            ZO_AppendNarration(narrations, SCREEN_NARRATION_MANAGER:CreateNarratableObject(GetString(SI_GAMEPAD_HELP_LEGAL_HEADER)))
            ZO_AppendNarration(narrations, SCREEN_NARRATION_MANAGER:CreateNarratableObject(GetString(SI_GAMEPAD_HELP_LEGAL_TEXT)))
            ZO_AppendNarration(narrations, SCREEN_NARRATION_MANAGER:CreateNarratableObject(GetString(SI_GAMEPAD_TOS_WEBSITE)))
            return narrations
        end,
    }
    SCREEN_NARRATION_MANAGER:RegisterCustomObject("helpLegal", narrationInfo)
end
function ZO_GamepadHelpLegal:InitializeKeybindDescriptors()
    self.keybindDescriptors = {}
    ZO_Gamepad_AddBackNavigationKeybindDescriptors(self.keybindDescriptors, GAME_NAVIGATION_TYPE_BUTTON)
end
function ZO_GamepadHelpLegal:SetupText()
    local container = self.control:GetNamedChild("Mask"):GetNamedChild("Container")
    local header = container:GetNamedChild("HeaderContainer"):GetNamedChild("Header")
    local urlLabel = CreateControlFromVirtual("LegalURL", container, "ZO_GamepadHelpLegalURL")
    urlLabel:SetAnchor(TOPLEFT, header, BOTTOMLEFT, 0, URL_LABEL_Y_OFFSET)
    urlLabel:SetAnchor(TOPRIGHT, header, BOTTOMRIGHT, 0, URL_LABEL_Y_OFFSET)
    ZO_GamepadGenericHeader_Initialize(header, ZO_GAMEPAD_HEADER_TABBAR_DONT_CREATE)
end
    HELP_LEGAL_GAMEPAD = ZO_GamepadHelpLegal:New(control)
end