This code is unnecessary:
Warning: Spoiler
Lua Code:
local tradingHouseHiddenColumns = { statValue = true, age = true }
local zorgGetTabFilterInfo = PLAYER_INVENTORY.GetTabFilterInfo
function PLAYER_INVENTORY:GetTabFilterInfo(inventoryType, tabControl)
if libCIF._tradingHouseModeEnabled then
local filterType, activeTabText = zorgGetTabFilterInfo(self, inventoryType, tabControl)
return filterType, activeTabText, tradingHouseHiddenColumns
else
return zorgGetTabFilterInfo(self, inventoryType, tabControl)
end
end
Those columns are already hidden. If your seeing them then some other addon is messing it up:
Warning: Spoiler
Lua Code:
-- These are already defined:
local tradingHouseHiddenColumns =
{
["statValue"] = true,
["age"] = true,
}
-- this gets called:
CreateNewTabFilterData(TradingHouseFilter, INVENTORY_BACKPACK, "", "", "", tradingHouseHiddenColumns),
local function CreateNewTabFilterData(filterType, inventoryType, normal, pressed, highlight, hiddenColumns)
...
local tabData =
{
-- Custom data
filterType = filterType,
inventoryType = inventoryType,
hiddenColumns = hiddenColumns,
-- which sets the hidden columns there
...
end
Bug? Or are you only counting on me to call this function in FilterIt?
Lua Code:
-- What if multiple addons call this:
function libCIF:addBackpackLayoutShiftY(shiftY)
libCIF._backpackLayoutShiftY = (libCIF._backpackLayoutShiftY or 0) + shiftY
end
libCIF._backpackLayoutShiftY = nil
libCIF:addBackpackLayoutShiftY(40) -- now its 40
libCIF:addBackpackLayoutShiftY(40) -- now 80
libCIF:addBackpackLayoutShiftY(40) -- now 120
Are we sure these items you left out aren't needed anywhere else?
I know that currentFilter = TradingHouseFilter is used in ShouldAddSlotToList(..) to filter out bound items...although we are breaking that by allowing the menu bar to be shown & buttons to be clicked (yes we also fixed it by adding to the additional filter to hide bound items), but are we sure its not also needed somewhere else? What about code we don't have access to?
Warning: Spoiler
Lua Code:
function ZO_InventoryManager:SetTradingHouseModeEnabled(enabled)
local inventory = self.inventories[INVENTORY_BACKPACK]
if(enabled) then
inventory.previousFilter = inventory.currentFilter
inventory.currentFilter = TradingHouseFilter
else
inventory.currentFilter = inventory.previousFilter or ITEMFILTERTYPE_ALL
inventory.previousFilter = nil
end
ZO_PlayerInventorySearchBox:SetHidden(not enabled)
ZO_PlayerInventoryTabs:SetHidden(enabled)
ZO_MenuBar_SelectDescriptor(inventory.filterBar, inventory.currentFilter)
end
This may be trivial, but by leaving those out it prevents code from knowing which btn was previously selected & returning to it. By saving the current filter, then reloading it, & then calling ZO_MenuBar_SelectDescriptor(inventory.filterBar, inventory.currentFilter) It returns the menu bar to its previously selected descriptor.