Please read the description and check screenshots at the original addon page:
Original addon: AdvancedFilters

Finally, Advanced Filters! The default inventory has type filters, but they're still WAY too broad. This add-on fixes that!

Features:
Main inventory, junk, bank, guild bank, guild store, vendors, craft bag and crafting tables support!
Subfilters to find exactly what you're looking for!
(Shift+)Right click the filter buttons/subfilter butons to show the dropdown filter context menu
Custom icon work that makes the add-on feel like it came with the game!
Empty subfilters are greyed out and inaccessible to help save you time searching! (settings to change that)
Shortens the time you need to find an item in your inventory!
German, French, Russian, and Spanish localization! (some are partial, PM me for corrections/additions)
Extensible dropdown box filtersystem for authors ("plugins") to create additional dropdown filters! (See included documentation for details)
Right click the dropdown box to show a context menu (invert filters, select all).

Idea and base code were done by ingeniousclown and Randactyl.


AdvancedFilters does not support the gamepad mode!

Removed some libraries from the addon. You need the following libraries in order to make this addon worK:
LibFilters-3.0
LibCustomMenu
LibAddonMenu
LibMotifCategories-1.0 -> NOT included anymore. Needs to be installed as standalone version! (buggy: Motif filters may not work!)


Compatible inventory addons
Protect your items before they get sold/deconstructed/traded + many more features: FCO ItemSaver
Only show bank/inventory/both items at crafting tables: FCO CraftFilter


Other adopted addons:
1) Fix for CraftCompare


Information
-> SavedVars were changed to Server dependent + Character ID (not name anymore).


Information for developers
ATTENTION: Please ALWAYS add the stringsEN, stringsXX keys, and the callbackTable name keys
with your UNIQUE adon/plugin identifier!!!
-> ALL texts will be stored inside AdvancedFilters.strings table and having the same key twice will overwrite existing ones of other plugins/AdvancedFilters!





-Updated the filterInformation for the plugins so it can only be shown at some of the filterGroups. The tag is named "onlyGroups".
-> The possible filterGroups can be found here: AdvancedFilters/constants.lua -> table "subfilterButtonNames".
-> The table contains subtables with the filtertype as the key (e.g. ITEMFILTERTYPE_WEAPONS) and the possible subfilterGroups as entries in these subtables (e.g.
"HealStaff", "DestructionStaff", "Bow", "TwoHand", "OneHand", AF_CONST_ALL). AF_CONST_ALL is a constant for the "All" entries.
Code:
local filterInformation = {
	filterType = {ITEMFILTERTYPE_ALL},
        subfilters = {"All",},
        onlyGroups = {"Armor", "Junk"}
    },
-Updated the filterInformation for the plugins so it can exclude some of the LibFilters filterPanelIds. e.g. to hide the dropdown filter entries at the enchating panels. The tag is named "excludeFilterPanels".
Code:
local filterInformation = {
	filterType = {ITEMFILTERTYPE_ALL},
        subfilters = {"All",},
        excludeFilterPanels = {
           LF_ENCHANTING_CREATION,
           LF_ENCHANTING_EXTRACTION
        },
    },
-Updated the filterInformation for the plugins so it can exclude some of the subFilterss e.g. to hide the dropdown filter entries at the Alchemy and RefinedMaterial subfilters. The tag is named "excludeSubfilters".
Code:
local filterInformation = {
	filterType = {ITEMFILTERTYPE_ALL},
        subfilters = {"All",},
        excludeSubfilters = {"Alchemy", "Enchanting", "Provisioning",
                         "Style", "WeaponTrait", "ArmorTrait",
                         "RawMaterial", "RefinedMaterial", "Temper", "Resin", "Tannin",
                         "FurnishingMat"},
    },
-Updated the filterInformation for the plugins so it can use some more parameters in the "callbackTable".
-> Example filter plugin: AF_FCODuplicateItemsFilters

Possible parameters:
name: The unique name of your callback table entry, used for the Strings table to translate it
filterResetAtStart: Reset the filter at the current subfilterPanel to "All" before applying the new filters from this callback table entry
filterResetAtStartDelay: Delay the execution of the function filterStartCallback and filterCallback by this milliseconds. The delay will happen AFTER the filter was reset to "All" (if enabled).
filterStartCallback: This function is called before the new filters are applied. Can be used to rebuild needed internal tables e.g.
filterCallback: The normal callback function to be applied to the items
filterEndCallback: This function will be called after the filterCallback function applied the filters. Can be used to reset internal tables or do stuff with the now shown items.

Code:
local delay = 50
local FilterStartCallbackFunc = function()
 --e.g. if you only want to use the currently visible (pre-filtered) items in the inventory you can build an internal coimparison table here once which can be used in your function GetFilterCallbackForThisFilterPlugin for the comparison of items
 myAddon.prepareInternalStuff()
end
local FilterEndCallbackFunc = function()
 --Clear the internal table again so it will be build new in your FilterStartCallbackFunc 
 myAddon.clearInternalStuff()
end

--!!!Remember to use "unique" keys for the callback table's name key AND the relating stringsEN, stringsXX keys!!!
local dropdownCallback = {
    {name = "MyUniqueAddonPluginName_All",                 filterResetAtStart=true,  filterResetAtStartDelay=delay, filterStartCallback=FilterStartCallbackFunc, filterCallback=GetFilterCallbackForThisFilterPlugin("all"),                filterEndCallback=FilterEndCallbackFunc},
    {name = "MyUniqueAddonPluginName_Name",                filterResetAtStart=true,  filterResetAtStartDelay=delay, filterStartCallback=FilterStartCallbackFunc, filterCallback=GetFilterCallbackForThisFilterPlugin("name"),               filterEndCallback=FilterEndCallbackFunc},
end

local filterInformation = {
	filterType = {ITEMFILTERTYPE_ALL},
callbackTable = dropdownCallback ,
	filterType = {ITEMFILTERTYPE_ALL},
    subfilters = {"All",},
	enStrings = enStrings,
	deStrings = deStrings,
	frStrings = enStrings, },


-Updated to support filter plugins which use the "onlyGroups" parameter "Armor", "Weapons" and "Jewelry" filters:
They will automatically add themselves to crafting table filters "ArmorSmithing", "ArmorWoodworking", "ArmorClothier", "WeaponsSmithing", "WeaponsWoodworking", "JewelryCraftingStation" as well now.

-Added: Support for other addons which also filter the inventory/crafting stations. Other addons can register their filter function so the refresh of the subfilter buttons will recognize these functions as well and hide (grey out) the subfilter button if the other addon has filtered the items (e.g. at a crafting station FCOCraftFilter will hide all bank items. This will make AdvancedFilters recognize the change of the shown items according to FCOCraftFilter settings and also grey out the subfilter buttons if no items are shown in this subcategory).
Addons need to
Code:
##OptionallyDependOn: AdvancedFilters
and inject some code via a function just like the dropdown filter plugins do.
Lua Code:
  1. AdvancedFilters_RegisterSubfilterbarRefreshFilter(filterInformationTable)
filterInformationTable is a table and got the following contents:
Lua Code:
  1. if AdvancedFilters ~= nil and AdvancedFilters_RegisterSubfilterbarRefreshFilter ~= nil then
  2.             --Deconstruction
  3.             local subfilterRefreshFilterInformationTable = {
  4.                 inventoryType       = {INVENTORY_BACKPACK, INVENTORY_BANK}, --The inventory constants where the subfilter refresh plugin should be registered. Table with n entries. Each combination of inventoryType and craftingType will be registered at the one filterPanelId!
  5.                 craftingType        = {CRAFTING_TYPE_CLOTHIER, CRAFTING_TYPE_BLACKSMITHING, CRAFTING_TYPE_WOODWORKING}, --The crafting type constants where the subfilter refresh plugin should be registered. Table with n entries. Each combination of inventoryType and craftingType will be registered at the one filterPanelId!
  6.                 filterPanelId       = LF_SMITHING_DECONSTRUCT, -- The LibFilters-2.0 filterPanelId where the registration of this subfilter refresh plugin should be done. No table here! Only 1 entry possible for each call of AdvancedFilters_RegisterSubfilterbarRefreshFilter!
  7.                 filterName          = "FCOCraftFilter_Deconstruction", --The unique identifier which shoiuld be used for the subfilter refresh plugin
  8.                 callbackFunction    = function(slotData) -- The callback "filter" function having 1 parameter slotData, which basically contains the inventorySlot.dataEntry.data stuff (bnagId, slotIndex, itemType, filterTypes, etc.)
  9.                     return FCOCraftFilter_FilterCallbackFunctionDeconstruction(slotData.bagId, slotData.slotIndex)
  10.                 end,
  11.             }
  12.             --If just some parameters like the LibFilters-2.0 filterPanlId change you can redefine the needed values and re-apply it with the slightly changed parameters. Everything else will be kept from the call before.
  13.             AdvancedFilters_RegisterSubfilterbarRefreshFilter(subfilterRefreshFilterInformationTable)
  14.             --Improvement
  15.             subfilterRefreshFilterInformationTable.filterPanelId = LF_SMITHING_IMPROVEMENT
  16.             subfilterRefreshFilterInformationTable.filterName    = "FCOCraftFilter_Improvement"
  17.             AdvancedFilters_RegisterSubfilterbarRefreshFilter(subfilterRefreshFilterInformationTable)
  18.         end

Check the code of FCOCraftFilter so together with AdvancedFilters the changing of the shown items at a crafting panel (bag, bank, both) will change the subfilter buttons enabled/disabled state as well.

-DropdownCallback entries can use a new entry "addString = <string>" now. The <string> will be added to the name of the dropdown entry. The localization files need the entries for them too! This way you can easily add a suffix like "(medium)" or "(light)" or "(ring)" or "(neck)" to the armor/jewelry stuff to distinguish the traits/body parts of different armor classes.
Example for ArmorClothier:
Code:
ArmorClothier = {
        addonDropdownCallbacks = {},
        All = {
            filterCallback = GetFilterCallback(nil),
            dropdownCallbacks = {},
        },
        LightArmor = {
            filterCallback = GetFilterCallbackForArmorType({ARMORTYPE_LIGHT}),
            dropdownCallbacks = {
                {name = "Head", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_HEAD}, {ARMORTYPE_LIGHT})},
                {name = "Chest", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_CHEST}, {ARMORTYPE_LIGHT})},
                {name = "Shoulders", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_SHOULDERS}, {ARMORTYPE_LIGHT})},
                {name = "Hand", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_HAND}, {ARMORTYPE_LIGHT})},
                {name = "Waist", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_WAIST}, {ARMORTYPE_LIGHT})},
                {name = "Legs", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_LEGS}, {ARMORTYPE_LIGHT})},
                {name = "Feet", showIcon=true, addString="Light", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_FEET}, {ARMORTYPE_LIGHT})},
            },
        },
        Medium = {
            filterCallback = GetFilterCallbackForArmorType({ARMORTYPE_MEDIUM}),
            dropdownCallbacks = {
                {name = "Head", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_HEAD}, {ARMORTYPE_MEDIUM})},
                {name = "Chest", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_CHEST}, {ARMORTYPE_MEDIUM})},
                {name = "Shoulders", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_SHOULDERS}, {ARMORTYPE_MEDIUM})},
                {name = "Hand", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_HAND}, {ARMORTYPE_MEDIUM})},
                {name = "Waist", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_WAIST}, {ARMORTYPE_MEDIUM})},
                {name = "Legs", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_LEGS}, {ARMORTYPE_MEDIUM})},
                {name = "Feet", showIcon=true, addString="Medium", filterCallback = GetFilterCallbackForGear({EQUIP_TYPE_FEET}, {ARMORTYPE_MEDIUM})},
            },
        },
    },
-The plugin filterInformation accepts a table for "filterType" now! You can specify it like this in 1 filterInformation and do not need to repeat the same filter information + call to AdvancedFilters_RegisterFilter over and over again:
Lua Code:
  1. local filterInformation = {
  2.     submenuName = "MyUniqueAddonPluginName_LevelFilters",
  3.     callbackTable = fullLevelDropdownCallbacks,
  4.     filterType = {
  5.         ITEMFILTERTYPE_ALL,
  6.         ITEMFILTERTYPE_WEAPONS, ITEMFILTERTYPE_ARMOR,
  7.         ITEMFILTERTYPE_JEWELRY,
  8.     },
  9.     subfilters = {"All",},
  10.     enStrings = strings,
  11.     deStrings = stringsDE,
  12.     frStrings = strings,
  13.     ruStrings = strings,
  14.     esStrings = strings,
  15. }

ALL other entries of the filterInformation table will be used exactly the same for each of the filterType entries! If you need to use other parameters within filterInformation for each filterType you need to call it like today, split up into own tables + eacht ime a call to AdvancedFilter_RegisterFilter!

-Show the currently visible/filtered item count at the inventory's bottom info line. Where the inventory bag current space / total bag space is shown there is another dark orange (currently shown itemcount) entry now.
This works with AdvancedFilters filtered items (menu buttons, submenu buttons, dropdown filters).
FCOItemSaver and FCOCraftfilter are supported.

If you want your filter addon to upodate the AdvancedFilters filtered itemCount as well you can use the following function:
Code:
AdvancedFilters.util.UpdateCraftingInventoryFilteredCount(invType)
invType is the inventory type of the inventory to update.
The following inventory types can be used, or leave it empty so AdvancedFilters automatically determines the current inventoryType for you.
Code:
    [INVENTORY_BACKPACK]        = "PlayerInventory",
    [INVENTORY_BANK]            = "PlayerBank",
    [INVENTORY_GUILD_BANK]      = "GuildBank",
    [INVENTORY_CRAFT_BAG]       = "CraftBag",
    [INVENTORY_TYPE_VENDOR_BUY] = "VendorBuy",
    --[LF_SMITHING_CREATION]      = "SmithingCreate",
    [LF_SMITHING_REFINE]        = "SmithingRefine",
    [LF_SMITHING_DECONSTRUCT]   = "SmithingDeconstruction",
    [LF_SMITHING_IMPROVEMENT]   = "SmithingImprovement",
    --[LF_JEWELRY_CREATION]       = "JewelryCraftingCreate",
    [LF_JEWELRY_REFINE]         = "JewelryCraftingRefine",
    [LF_JEWELRY_DECONSTRUCT]    = "JewelryCraftingDeconstruction",
    [LF_JEWELRY_IMPROVEMENT]    = "JewelryCraftingImprovement",
    [LF_ENCHANTING_CREATION]    = "EnchantingCreation",
    [LF_ENCHANTING_EXTRACTION]  = "EnchantingExtraction",
    [INVENTORY_HOUSE_BANK]      = "HouseBankWithdraw",
    [LF_RETRAIT]                = "Retrait"
Added universal deconstruction panels (filterTypes!) and groups, for the plugins:
Code:
    filterType = {ITEMFILTERTYPE_ALL,
        ITEMFILTERTYPE_AF_UNIVERSAL_DECON_ALL,
        ITEMFILTERTYPE_AF_UNIVERSAL_DECON_ARMOR,
        ITEMFILTERTYPE_AF_UNIVERSAL_DECON_WEAPONS,
        ITEMFILTERTYPE_AF_UNIVERSAL_DECON_JEWELRY,
        ITEMFILTERTYPE_AF_UNIVERSAL_DECON_GLYPHS,
    },

Code:
local universalDeconStr = "UniversalDecon"
    onlyGroups = { "All" ..universalDeconStr, 
                           "Armor"..universalDeconStr, 
                          "Weapon"..universalDeconStr,
                          "Jewelry"..universalDeconStr,
                          "Glyphs"..universalDeconStr,
},
-> These are stored in AdvancedFilters.filterTypeNames:
Code:
AdvancedFilters.filterTypeNames = {
...
    [ITEMFILTERTYPE_AF_UNIVERSAL_DECON_ALL]         = "All" ..universalDeconStr,
    [ITEMFILTERTYPE_AF_UNIVERSAL_DECON_WEAPONS]     = "Weapons" ..universalDeconStr,
    [ITEMFILTERTYPE_AF_UNIVERSAL_DECON_ARMOR]       = "Armor" ..universalDeconStr,
    [ITEMFILTERTYPE_AF_UNIVERSAL_DECON_JEWELRY]     = "Jewelry" ..universalDeconStr,
    [ITEMFILTERTYPE_AF_UNIVERSAL_DECON_GLYPHS]      = "Glyphs" ..universalDeconStr,
}



Known bugs:
Check the addon's comment section, first "sticky" post -> Known bugs

返回
顶部