ESO Lua File v100010

ingame/repair/gamepad/repairkits_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
local MAX_SELECTED_OFFSET = 75
local ZO_RepairKits_Gamepad = ZO_InventoryItemImprovement_Gamepad:Subclass()
function ZO_RepairKits_Gamepad:New(...)
    return ZO_InventoryItemImprovement_Gamepad.New(self, ...)
end
function ZO_RepairKits_Gamepad:Initialize(control)
    local function SortComparator(left, right)
        return GetRepairKitTier(left.bag, left.index) < GetRepairKitTier(right.bag, right.index)
    end
    ZO_InventoryItemImprovement_Gamepad.Initialize(
        self, 
        control, 
        GetString(SI_REPAIR_KIT_TITLE),
        "repairGamepad",
        GetString(SI_REPAIR_KIT_SELECT),
        GetString(SI_REPAIR_KIT_NONE_FOUND),
        GetString(SI_REPAIR_KIT_CONFIRM),
        SOUNDS.INVENTORY_ITEM_REPAIR,
        IsItemNonCrownRepairKit,
        SortComparator,
        MAX_SELECTED_OFFSET)
end
function ZO_RepairKits_Gamepad:SetupScene()
    local repairKitsSceneGamepad = ZO_Scene:New(self.sceneName, SCENE_MANAGER)
    SYSTEMS:RegisterGamepadRootScene("repair", repairKitsSceneGamepad)
end
function ZO_RepairKits_Gamepad:UpdateTooltipOnSelectionChanged()
    GAMEPAD_TOOLTIPS:LayoutPendingItemRepair(GAMEPAD_LEFT_TOOLTIP, self.itemBag, self.itemIndex, self.improvementKitBag, self.improvementKitIndex)
end
function ZO_RepairKits_Gamepad:PerformItemImprovement()
    RepairItemWithRepairKit(self.itemBag, self.itemIndex, self.improvementKitBag, self.improvementKitIndex)
end
--[[ Global Handlers ]]--
    REPAIR_KITS_GAMEPAD = ZO_RepairKits_Gamepad:New(control)
    SYSTEMS:RegisterGamepadObject("repair", REPAIR_KITS_GAMEPAD)
end