Back to Home

ESO Lua File v100023

ingame/tradinghouse/keyboard/enchantmentfilters_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
--[[
This filter is a little different. Armor, Weapon and Glyph (Gem) searches use it, so instead of registering
itself with the trading house manager, this allow other filters to obtain/instantiate the enchantment filter
object as necessary using the TRADING_HOUSE global.
At its base, it's just another filter type that can be told to apply itself to a search
NOTE: The parent should be something that's always shown so that when different filters use this
they don't need to hide/show something else.
--]]
ZO_TradingHouse_EnchantmentFilters = ZO_TradingHouseComboBoxSetter:Subclass()
function ZO_TradingHouse_EnchantmentFilters:New(...)
    return ZO_TradingHouseComboBoxSetter.New(self, ...)
end
function ZO_TradingHouse_EnchantmentFilters:Initialize(parentControl)
     local control = CreateControlFromVirtual("$(parent)Enchantments", parentControl, "TradingHouseSingleComboFilter")
    self.control = control
    local comboBox = ZO_ComboBox_ObjectFromContainer(control:GetNamedChild("Category"))
    ZO_TradingHouseComboBoxSetter.Initialize(self, TRADING_HOUSE_FILTER_TYPE_ENCHANTMENT, comboBox)
end
function ZO_TradingHouse_EnchantmentFilters:SetEnchantmentType(enchantmentType)
     local childControl = self.control:GetNamedChild("Category")
    if(enchantmentType) then
        ZO_TradingHouse_UpdateComboBox(childControl, ZO_TRADING_HOUSE_FILTER_ENCHANTMENT_TYPE_DATA[enchantmentType], self.SelectionChanged)
     else
          local comboBox = ZO_ComboBox_ObjectFromContainer(childControl)
          comboBox:ClearItems()
    end
end
function ZO_TradingHouse_EnchantmentFilters:SetAnchor(point, relativeTo, relativePoint, offsetX, offsetY)
    self.control:SetAnchor(point, relativeTo, relativePoint, offsetX, offsetY)
end
function ZO_TradingHouse_EnchantmentFilters:SetHidden(hidden)
    self.control:SetHidden(hidden)
end