ESO Lua File v100014

libraries/zo_templates/gamepad/windowtemplates_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
function ZO_GamepadEditBox_FocusGained(editControl)
    editControl.descriptor =
    {
        alignment = KEYBIND_STRIP_ALIGN_LEFT,
          {
               name = GetString(SI_GAMEPAD_ACCEPT_OPTION),
               keybind = "UI_SHORTCUT_PRIMARY",
               callback = function()
                   editControl:LoseFocus()
               end,
            sound = SOUNDS.DIALOG_ACCEPT,
          },
          {
               name = GetString(SI_CANCEL),
               keybind = "UI_SHORTCUT_NEGATIVE",
               callback = function()
                editControl:SetText(editControl.oldText)
                   editControl:LoseFocus()
               end,
            sound = SOUNDS.DIALOG_DECLINE,
          },
          {
            ethereal = true,
               keybind = "DIALOG_PRIMARY",
               callback = function()
                   editControl:LoseFocus()
               end,
            sound = SOUNDS.DIALOG_ACCEPT,
          },
          {
               ethereal = true,
               keybind = "DIALOG_NEGATIVE",
               callback = function()
                editControl:SetText(editControl.oldText)
                   editControl:LoseFocus()
               end,
            sound = SOUNDS.DIALOG_DECLINE,
          },
    }
    editControl.oldText = editControl:GetText() 
    editControl.m_keybindState = KEYBIND_STRIP:PushKeybindGroupState()
    KEYBIND_STRIP:RemoveDefaultExit(editControl.m_keybindState)
    KEYBIND_STRIP:AddKeybindButtonGroup(editControl.descriptor, editControl.m_keybindState)
end
function ZO_GamepadEditBox_FocusLost(editControl)
    if(editControl.descriptor) then
        KEYBIND_STRIP:RemoveKeybindButtonGroup(editControl.descriptor, editControl.m_keybindState)
        KEYBIND_STRIP:RestoreDefaultExit(editControl.m_keybindState)
        KEYBIND_STRIP:PopKeybindGroupState()
    end
end