Back to Home

ESO Lua File v101044

ingame/help/keyboard/helpcustomerservice_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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
local HelpCustomerService_Keyboard = ZO_Object:Subclass()
function HelpCustomerService_Keyboard:New(...)
    local help = ZO_Object.New(self)
    help:Initialize(...)
    return help
end
function HelpCustomerService_Keyboard:Initialize(control)
    self.control = control
    control.owner = self
    HELP_CUSTOMER_SUPPORT_SCENE = ZO_Scene:New("helpCustomerSupport", SCENE_MANAGER)
    local helpCustomerServiceFragment = ZO_FadeSceneFragment:New(control)
    HELP_CUSTOMER_SUPPORT_SCENE:AddFragment(helpCustomerServiceFragment)
    self:InitializeTree()
end
function HelpCustomerService_Keyboard:InitializeTree()
    self.tree = ZO_Tree:New(GetControl(self.control, "Categories"), 60, -10, 280)
    self.categoryFragmentToNodeLookup = {}
    local function CategorySetup(node, control, data, down)
        control.text:SetModifyTextType(MODIFY_TEXT_TYPE_UPPERCASE)
        control.text:SetText(data.name)
        control.icon:SetTexture(down and data.down or data.up)
        control.iconHighlight:SetTexture(data.over)
        ZO_IconHeader_Setup(control, down)
    end
    local function CategorySelected(control, data, selected, reselectingDuringRebuild)
        if selected then
            self:ShowCategory(data)
        end
        CategorySetup(nil, control, data, selected)
    end
    self.tree:AddTemplate("ZO_HelpCustomerService_Type", CategorySetup, CategorySelected, nil)
    self.tree:SetExclusive(true)
end
function HelpCustomerService_Keyboard:InitializeHelpDialogs()
    ZO_Dialogs_RegisterCustomDialog("HELP_CUSTOMER_SERVICE_SUBMITTING_TICKET_DIALOG",
    {
        showLoadingIcon = true,
        modal = false,
        title =
        {
            text = GetString(SI_CUSTOMER_SERVICE_SUBMITTING_TICKET),
        },
        mainText =
        {
           text = GetString(SI_CUSTOMER_SERVICE_SUBMITTING),
           align = TEXT_ALIGN_CENTER,
        },
    })
end
function HelpCustomerService_Keyboard:AddCategory(data)
    local node = self.tree:AddNode("ZO_HelpCustomerService_Type", data)
    self.categoryFragmentToNodeLookup[data.categoryFragment] = node
    self.tree:Commit()
end
function HelpCustomerService_Keyboard:ShowCategory(data)
    if self.currentFragment then
        HELP_CUSTOMER_SUPPORT_SCENE:RemoveFragment(self.currentFragment)
    end
    self.currentFragment = data.categoryFragment
    HELP_CUSTOMER_SUPPORT_SCENE:AddFragment(self.currentFragment)
end
function HelpCustomerService_Keyboard:OpenScreen(fragment)
    if not SCENE_MANAGER:IsShowing("helpCustomerSupport") then
        MAIN_MENU_KEYBOARD:ShowScene("helpCustomerSupport")
    end
    self.tree:SelectNode(self.categoryFragmentToNodeLookup[fragment])
end
-- Global XML --
    HELP_CUSTOMER_SUPPORT_KEYBOARD = HelpCustomerService_Keyboard:New(control)
end