Back to Home

ESO Lua File v100018

ingame/tradinghouse/gamepad/craftingfilter_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
local GamepadCraftingFilter = ZO_CategorySubtypeFilter:Subclass()
function GamepadCraftingFilter:New()
    return ZO_CategorySubtypeFilter.New(self, "Crafting", ZO_TRADING_HOUSE_FILTER_CRAFTING_SEARCHES, "armor")
end
function GamepadCraftingFilter:Initialize(name, filterData, traitType)
    ZO_CategorySubtypeFilter.Initialize(self, name, filterData, traitType)
    self:SetTraitType(nil) -- reset to nil to hide the trait filter combo box by default
end
function GamepadCraftingFilter:SetSubType(entry)
    self.categoryType = entry.minValue
    -- Add/Change/Remove Trait filter as needed
    if self.traitType ~= entry.maxValue then
        self:SetTraitType(entry.maxValue)
        ZO_GamepadTradingHouse_Filter.SetComboBoxes(self, self:GetComboBoxData())
    end
end
function GamepadCraftingFilter:SetCategoryTypeAndSubData(entry)
    self:GetFilterComboBoxData("SubType"):SetData(entry.minValue)
end
function GamepadCraftingFilter:ApplyToSearch(search)
    search:SetFilter(TRADING_HOUSE_FILTER_TYPE_SPECIALIZED_ITEM, self.categoryType)
    ZO_GamepadTradingHouse_Filter.ApplyToSearch(self, search)
end
TRADING_HOUSE_GAMEPAD:RegisterSearchFilter(GamepadCraftingFilter, SI_TRADING_HOUSE_BROWSE_ITEM_TYPE_CRAFTING)