ESO Lua File v100015

ingame/zo_loot/gamepad/lootinventory_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
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
90
91
92
93
94
95
96
97
98
99
100
local ZO_LootInventory_Gamepad = ZO_Object.MultiSubclass(ZO_Loot_Gamepad_Base, ZO_Gamepad_ParametricList_Screen)
function ZO_LootInventory_Gamepad:New(...)
    local screen = ZO_Object.New(self)
    screen:Initialize(...)
    return screen
end
function ZO_LootInventory_Gamepad:Initialize(control)
    local DONT_CREATE_TABBAR = false
    ZO_Gamepad_ParametricList_Screen.Initialize(self, control, DONT_CREATE_TABBAR)
    self.initialLootUpdate = true
    self.keybindDirty = false
    self.isInitialized = false
    self.isResizable = false
    self.headerData = {
        titleText = ""
    }
    local function OnStateChanged(...)
        self:OnStateChanged(...)
    end
    LOOT_INVENTORY_SCENE_GAMEPAD = ZO_Scene:New("lootInventoryGamepad", SCENE_MANAGER)
    LOOT_INVENTORY_SCENE_GAMEPAD:RegisterCallback("StateChange", OnStateChanged)
end
function ZO_LootInventory_Gamepad:SetupList(list)
    list:AddDataTemplate("ZO_GamepadItemSubEntryTemplate", ZO_SharedGamepadEntry_OnSetup)
    self.itemList = list
end
function ZO_LootInventory_Gamepad:OnSelectionChanged(list, selectedData, oldSelectedData)
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
    GAMEPAD_TOOLTIPS:ClearLines(GAMEPAD_LEFT_TOOLTIP)
    if selectedData then
        if not selectedData.currencyType then 
            local itemLink = GetLootItemLink(selectedData.lootId)
            GAMEPAD_TOOLTIPS:LayoutItemWithStackCountSimple(GAMEPAD_LEFT_TOOLTIP, itemLink, selectedData.stackCount)
        end
        self:UpdateButtonTextOnSelection(selectedData)
    end
end
function ZO_LootInventory_Gamepad:DeferredInitialize()
    self:SetTitle(self.headerData.titleText)
    self.isInitialized = true
end
function ZO_LootInventory_Gamepad:OnHide()
    KEYBIND_STRIP:RestoreDefaultExit()
end
function ZO_LootInventory_Gamepad:OnShow()
    local OPEN_LOOT_WINDOW = false
    ZO_PlayMonsterLootSound(OPEN_LOOT_WINDOW)
end
function ZO_LootInventory_Gamepad:Hide()
    SCENE_MANAGER:Hide("lootInventoryGamepad")
end
function ZO_LootInventory_Gamepad:Show()
    KEYBIND_STRIP:RemoveDefaultExit()
    SCENE_MANAGER:Push("lootInventoryGamepad")
end
function ZO_LootInventory_Gamepad:InitializeKeybindStripDescriptors()
    local NOT_ETHEREAL = false
end
function ZO_LootInventory_Gamepad:SetTitle(title)
    self.headerData.titleText = title
end
local TAKE_BUTTON_INDEX = 2
local TAKE_ALL_BUTTON_INDEX = 3
function ZO_LootInventory_Gamepad:UpdateKeybindDescriptor()
    KEYBIND_STRIP:UpdateKeybindButtonGroup(self.keybindStripDescriptor)
    self.keybindDirty = false
end
function ZO_LootInventory_Gamepad:PerformUpdate()
    self:UpdateList()
    if self.keybindDirty then
        self:UpdateKeybindDescriptor()
    end
end
--[[ Global Handlers ]]--
    LOOT_INVENTORY_WINDOW_GAMEPAD = ZO_LootInventory_Gamepad:New(control)
end