View Single Post
08/25/15, 05:50 AM   #36
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Here's my current diff against FilterIt 2.9
diff Code:
  1. diff -ru autoupdate/unpacked/FilterIt/FilterIt.lua modified/FilterIt/FilterIt.lua
  2. --- autoupdate/unpacked/FilterIt/FilterIt.lua   2015-08-10 05:24:30.000000000 +0200
  3. +++ modified/FilterIt/FilterIt.lua  2015-08-25 13:28:05.000000000 +0200
  4. @@ -77,10 +77,6 @@
  5.     FilterIt.SetFilterActivation(ZO_PlayerBankTabs.m_object.m_currentSubMenuBar)
  6.     FilterIt.SetFilterActivation(ZO_GuildBankTabs.m_object.m_currentSubMenuBar)
  7.    
  8. -   -- Changes the layouts for the inventories: Trading House
  9. -   -- Moved to player activation to watch & see if AGS gets loaded
  10. -   FilterIt.LayoutTradingHouse()
  11. -  
  12.     -- Unregister here to catch loaded addons
  13.     EVENT_MANAGER:UnregisterForEvent(FilterIt.name, EVENT_ADD_ON_LOADED)
  14.    
  15. @@ -164,7 +160,6 @@
  16.     FilterIt.HookInvButtons()
  17.    
  18.     -- Changes the layouts for the inventories: backpack, bank, & guild bank, mail, exc..
  19. -   -- Trading House layout is called in player Activation for AGS compatability
  20.     FilterIt.SetLayouts()
  21.    
  22.     FilterIt.BuildImprovementPanelTabMenu()
diff Code:
  1. diff -ru autoupdate/unpacked/FilterIt/Layout/FilterIt_InvLayout.lua modified/FilterIt/Layout/FilterIt_InvLayout.lua
  2. --- autoupdate/unpacked/FilterIt/Layout/FilterIt_InvLayout.lua  2015-07-22 20:27:20.000000000 +0200
  3. +++ modified/FilterIt/Layout/FilterIt_InvLayout.lua 2015-08-25 13:41:47.000000000 +0200
  4. @@ -7,22 +7,10 @@
  5.  local function LayoutBackpack()
  6.     ZO_PlayerInventorySearchBox:SetDimensions(SEARCH_BOX_WIDTH, SEARCH_BOX_HEIGHT)
  7.    
  8. -   -- Trading house is handled in a separate function due to other checks
  9. -   -- that need to be made for AGS & other code that needs to be run.
  10. -   local tBackpackLayouts = {
  11. -   [1] = BACKPACK_BANK_LAYOUT_FRAGMENT.layoutData,
  12. -   [2] = BACKPACK_MENU_BAR_LAYOUT_FRAGMENT.layoutData,
  13. -   [3] = BACKPACK_MAIL_LAYOUT_FRAGMENT.layoutData,
  14. -   [4] = BACKPACK_PLAYER_TRADE_LAYOUT_FRAGMENT.layoutData,
  15. -   [5] = BACKPACK_STORE_LAYOUT_FRAGMENT.layoutData,
  16. -   [6] = BACKPACK_FENCE_LAYOUT_FRAGMENT.layoutData,
  17. -   [7] = BACKPACK_LAUNDER_LAYOUT_FRAGMENT.layoutData,
  18. -   --[5] = BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData,
  19. -   }
  20. -   for k,v in pairs(tBackpackLayouts) do
  21. -       v.backpackOffsetY = 136
  22. -       v.sortByOffsetY = 103
  23. -   end
  24. +    -- this enables filters on guild store SELL tab
  25. +    local libCIF = LibStub:GetLibrary("libCommonInventoryFilters")
  26. +    libCIF:addBackpackLayoutShiftY(40)
  27. +    libCIF:disableSearchBoxes()
  28.    
  29.     --local FilterItInventoryDivider = CreateControlFromVirtual("FilterIt_InventoryDivider", ZO_PlayerInventory, "ZO_InventoryFilterDivider")
  30.     -- Changed Parent for AGS
  31. @@ -75,45 +63,10 @@
  32.     FilterItBankDivider:SetAnchor(point0, relativeTo0, relativePoint0, offsetX0, offsetY0+5)
  33.  end
  34.  
  35. -function FilterIt.LayoutTradingHouse()
  36. -   if FilterIt.loadedAddons["AwesomeGuildStore"] then return end
  37. -  
  38. -   local layoutData = BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData
  39. -   local sellFiltersEnabled = layoutData.sellFiltersEnabled
  40. -   -- Check if someone has already enabled it:
  41. -   if sellFiltersEnabled then return end
  42. -  
  43. -   -- Check if its turned on in my addon:
  44. -   --if not MY_ADDON_SETTING_ON then return end
  45. -  
  46. -   -- Set flag:
  47. -   layoutData.sellFiltersEnabled = true
  48. -  
  49. -   -- Set the new layoutData:
  50. -   layoutData.inventoryTopOffsetY = 43
  51. -   layoutData.hiddenFilters = { [ITEMFILTERTYPE_QUEST] = true }  
  52. -   local origAdditionalFilter = layoutData.additionalFilter
  53. -   layoutData.additionalFilter = function (slot)
  54. -               return origAdditionalFilter(slot) and (not IsItemBound(slot.bagId, slot.slotIndex))
  55. -           end
  56. -  
  57. -   -- Prehook HandleTabSwitch for sell mode:
  58. -   local function OnHandleTabSwitch(self, tabData)
  59. -       local mode = tabData.descriptor
  60. -      
  61. -       if mode == ZO_TRADING_HOUSE_MODE_SELL then
  62. -           ZO_PlayerInventoryTabs:SetHidden(false)
  63. -       end
  64. -       return false
  65. -   end
  66. -   ZO_PreHook(TRADING_HOUSE, "HandleTabSwitch", OnHandleTabSwitch)
  67. -end
  68.  
  69.  function FilterIt.SetLayouts()
  70.     LayoutBackpack()
  71.     LayoutBank()
  72.     LayoutGuildBank()
  73. -   -- Changed, this is now called in player Activation for AGS compatability
  74. -   --LayoutTradingHouse()
  75.  end

It works regardless of AGS setting "disable custom selltab filter". Although with that setting OFF, the search box slightly overlaps subfilters or items, because it's at FilterIt position. But once you turn it ON, FilterIt shows up on the sell tab, and it looks good.
  Reply With Quote