Quantcast
Download
(116 Kb)
Download
Updated: 01/02/23 11:48 AM
Compatibility:
Firesong (8.2.5)
Lost Depths (8.1.5)
High Isle (8.0.0)
Ascending Tide (7.3.5)
Deadlands (7.2.5)
Waking Flame (7.1.5)
Blackwood (7.0.5)
Greymoor (6.0.5)
Updated:01/02/23 11:48 AM
Created:05/04/19 08:28 AM
Monthly downloads:29,775
Total downloads:1,296,651
Favorites:511
MD5:
8.2.5
LibFilters-3.0  Popular! (More than 5000 hits)
Version: 3.0r3.9
by: Baertram, Randactyl
LibFilters-3.0
This version of LibFilters does NOT need any dependency to other libraries anymore (e.g. no LibStub needed).
You simply reference it by using the global Variable
Code:
LibFilters3
Other libraries
This libray optionally supports the use of LibDebugLogger to log messages to the addon log instead of the normal chat.


Welcome to LibFilters-3.0!

The goal of LibFilters is to provide an easy interface for applying custom sorting rules to different lists of items found in the game. At the moment, you can filter the inventory, bank withdrawal, bank deposits, guild bank withdrawal, guild bank deposits, vendor buying, vendor selling, buyback, repair, guild store selling, mail sending, trading, smithing (refinement, deconstruction, improvement, research), alchemy creation, enchanting creation, enchanting extraction, fence selling, fence laundering, the craftbag, and the quickslot inventory.

Please check the LibFilters WIKI for examples, API functions and usage instructions:
LibFilters WIKI


LibFilters 3 r3 was totally recoded and now supports Gamepad mode too!
A very special thanks to IsJustaGhost for a lot of the Gamepad code, ideas and testing UI + help!


To use LibFilters in your addon, you simply assign a reference to it's global variable LibFilters3.
Yo do NOT need any call to LibStub for it anymore. In your manifest you need to add LibFilters-3.0 to the ##DependsOn tag:
Code:
##DependsOn: LibFilters-3.0>=339
In your addon, you need to invoke LibFilters with the global LibFilters3 variable and then initialize LibFilters:

Lua Code:
  1. local libFilters = LibFilters3
  2. --!!! Add LibFilters-3.0 to your ## DependsOn: or ## OptionalDependsOn: to assure the lib is loaded before your addon's EVENT_ADD_ON_LOADED fires!!!
  3. libFilters:InitializeLibFilters() -- Must be called ONCE at/After EVENT_ADD_ON_LOADED of your addon to make sure the LibFilters functions exists and everything is ready! Without calling this you won't see any filters applied/working!

This is the list of available filterType constants:
Code:
LF_INVENTORY                = 1
LF_BANK_WITHDRAW            = 2
LF_BANK_DEPOSIT             = 3
LF_GUILDBANK_WITHDRAW       = 4
LF_GUILDBANK_DEPOSIT        = 5
LF_VENDOR_BUY               = 6
LF_VENDOR_SELL              = 7
LF_VENDOR_BUYBACK           = 8
LF_VENDOR_REPAIR            = 9
LF_GUILDSTORE_BROWSE        = 10
LF_GUILDSTORE_SELL          = 11
LF_MAIL_SEND                = 12
LF_TRADE                    = 13
LF_SMITHING_REFINE          = 14
LF_SMITHING_CREATION        = 15
LF_SMITHING_DECONSTRUCT     = 16
LF_SMITHING_IMPROVEMENT     = 17
LF_SMITHING_RESEARCH        = 18
LF_ALCHEMY_CREATION         = 19
LF_ENCHANTING_CREATION      = 20
LF_ENCHANTING_EXTRACTION    = 21
LF_PROVISIONING_COOK        = 22
LF_PROVISIONING_BREW        = 23
LF_FENCE_SELL               = 24
LF_FENCE_LAUNDER            = 25
LF_CRAFTBAG                 = 26
LF_QUICKSLOT                = 27
LF_RETRAIT                  = 28
LF_HOUSE_BANK_WITHDRAW      = 29
LF_HOUSE_BANK_DEPOSIT       = 30
LF_JEWELRY_REFINE           = 31
LF_JEWELRY_CREATION         = 32
LF_JEWELRY_DECONSTRUCT      = 33
LF_JEWELRY_IMPROVEMENT      = 34
LF_JEWELRY_RESEARCH         = 35
LF_SMITHING_RESEARCH_DIALOG = 36
LF_JEWELRY_RESEARCH_DIALOG  = 37
LF_INVENTORY_QUEST = 38
LF_INVENTORY_COMPANION = 39

LF_FILTER_MIN                = LF_INVENTORY
LF_FILTER_MAX               = LF_INVENTORY_COMPANION
Universal Deconstruction is a special case as it does not provide any dedicated LF_UNIVERSAL_DECONSTRUCT filterType but reuses LF_SMIHING_DECONSTRUCT, LF_JEWELRY_DECONSTRUCT and LF_ENCHANTING_EXTRACTION at the UniversalDecon UI, depending on the selected UI Tab!
You need to register/unregister the according filterTypes for it.
UniversalDeconstruction callbacks will provide you the actual selected tab at universal decon (e.g. "all", "armor", "weapons", "jewelry" or "enchantments") as an additional parameter so you are able to differe them from normal smithing deconstruction/jewelry deconstruction/enchanting extraction! Non universal-decon panels will leave this param nil.



The filterTypes will pass information from the bag & slotIndex, or the inventorySlot, to a filterCallback function registered to that filterType.
For the slots, these are the keys available in the passed table:

Code:
inventory slot: age, bagId, condition, dataEntry, equipType, filterData,
  iconFile, inventory, isJunk, isPlayerLocked, itemInstanceId, itemType,
  launderPrice, locked, meetsUsageRequirement, name, quality, rawName,
  requiredLevel, searchData, sellPrice, slotControl, slotIndex,
  specializedItemType, stackCount, stackLaunderPrice, statValue, stolen,
  uniqueId

store slot: currencyQuantity1, currencyQuantity2, currencyType1,
  currencyType2, dataEntry, entryType, filterData, icon, isUnique,
  meetsRequirementsToBuy, meetsRequirementsToEquip, name, price, quality,
  questNameColor, sellPrice, slotIndex, stack, stackBuyPrice,
  stackBuyPriceCurrency1, stackBuyPriceCurrency2, statValue

buyback slot: icon, meetsRequirements, name, price, quality, slotIndex,
  stack, stackBuyPrice

repair slot: bagId, condition, dataEntry, icon, name, quality, repairCost,
  slotIndex, stackCount

quickslot slot: age, bagId, filterData, iconFile, locked,
  meetsUsageRequirement, name, quality, sellPrice, slotIndex, slotType,
  stackCount, stackSellPrice, stolen

Here is the mapping which filterId constant LF* uses which type of filter function: inventorySlot or bagdId & slotIndex
Example filter functions:
Lua Code:
  1. local function FilterSavedItemsForSlot(inventorySlot)
  2.   return true -- show the item in the list / false = hide item
  3. end
  4.  
  5. local function FilterSavedItemsForBagIdAndSlotIndex(bagId, slotIndex)
  6.   return true -- show the item in the list / false = hide item
  7. end

Code:
--Filter function with inventorySlot
All LF_ except the ones named below, e.g. LF_INVENTORY, LF_CRAFTBAG, LF_VENDOR_SELL

--Filter function with bagId and slotIndex (most of them are crafting related ones)
[LF_SMITHING_REFINE]                        = FilterSavedItemsForBagIdAndSlotIndex,
[LF_SMITHING_DECONSTRUCT]                   = FilterSavedItemsForBagIdAndSlotIndex,
[LF_SMITHING_IMPROVEMENT]                   = FilterSavedItemsForBagIdAndSlotIndex,
[LF_SMITHING_RESEARCH]                      = FilterSavedItemsForBagIdAndSlotIndex,
[LF_SMITHING_RESEARCH_DIALOG]               = FilterSavedItemsForBagIdAndSlotIndex,
[LF_JEWELRY_REFINE]                         = FilterSavedItemsForBagIdAndSlotIndex,
[LF_JEWELRY_DECONSTRUCT]                    = FilterSavedItemsForBagIdAndSlotIndex,
[LF_JEWELRY_IMPROVEMENT]                    = FilterSavedItemsForBagIdAndSlotIndex,
[LF_JEWELRY_RESEARCH]                       = FilterSavedItemsForBagIdAndSlotIndex,
[LF_JEWELRY_RESEARCH_DIALOG]                = FilterSavedItemsForBagIdAndSlotIndex,
[LF_ENCHANTING_CREATION]                    = FilterSavedItemsForBagIdAndSlotIndex,
[LF_ENCHANTING_EXTRACTION]                  = FilterSavedItemsForBagIdAndSlotIndex,
[LF_RETRAIT]                                = FilterSavedItemsForBagIdAndSlotIndex,
[LF_ALCHEMY_CREATION]                       = FilterSavedItemsForBagIdAndSlotIndex,
This library uses the inventory/fragment/dialog's attribute "additionalFilters" to register the filter callbackFunction, so it will run in addition to the original filter functions of the ZOs code (if any given, else it will add an additionalFilter attribute to the table).
It will store the filteres registered via LibFilters3:RegisterFilter internally and add the filter callback functions to the inventory.additionalFilters function, which then is called as the normal filters of the game are applied (e.g. at a refresh of the crafting table contents).
For this to work properly the UI needs to show the dependend filter panel, e.g. you cannot open the crafting table and stay at the refinement tab, but use filter functions of the desconstruction tab! At the refinement tab there are no updates to the filter tables done to include the LF_SMITHING_DECONSTRUCTION or LF_JEWELRY_DECONSTRUCTION entries of these inventorie's .additionalFilters!
You'd only have the refinement .additionalFilters (e.g. SMITHING.refinementPanel.inventory.additionalFilters).
So make sure to show the approrpiate UI in order to call the updaters like SMITHING:OnChangeFilter and apply the filter functions of LibFilters to the inventory.additionalFilters properly.


LibFilters API functions:
More API functions not listed below can be found at the Wiki (see link below).
-> Read the WIKI for examples!
The importants API functions of this library are:

Code:
function LibFilters3:InitializeLibFilters()
Must be called after you've assigned LibFilters-3.0 to your local variable, to start the initialization of the library, and to make it work.

function LibFilters3:GetMinFilterType()
Returns the minimum filterType available

function LibFilters3:GetMaxFilterType()
Returns the maximum filterType available

function LibFilters3:GetFilterTypes()
Returns the LibFilters LF* filterType connstants table: value = "name"

function LibFilters3:GetFilterTypeName(libFiltersFilterType)
Returns the LibFilters LF* filterType connstant's name

function LibFilters3:GetCurrentFilterTypeForInventory(inventoryType)
Returns the filterType currently affecting the provided inventoryType.

function LibFilters3:GetFilterCallback(filterTag, filterType)
filterTag is the unique string that identifies your filter. filterType is
  the provided "LF_" prefixed constants your filter was registered for.
  Returns the filterCallback registered for the provided filterTag and
  filterType; returns nil otherwise.

function LibFilters3:IsFilterRegistered(filterTag, filterType)
filterTag is the unique string that identifies your filter. filterType is
  the provided "LF_" prefixed constants your filter was registered for.
  Returns true if there is a filter registered with the provided filterTag.
  Returns false if there is not a filter registered with the provided
  filterTag. filterType is optional. If a filterType is provided, will only
  return true if a filter is registered to that filterType under the
  provided filterTag.

function LibFilters3:RegisterFilter(filterTag, filterType, filterCallback, noInUseError)
filterTag is a unique string to identify your filter. filterType is one of
  the provided "LF_" prefixed constants. filterCallback is a function which
  accepts either one or two arguments; this is determined by the filterType.
  filterCallback should return true if an item is to be shown.
  filterCallback should return false if an item should not be shown.
  noInUseError boolean: Do not show an error message if the filterTag was already registered

function LibFilters3:RegisterFilterIfUnregistered(filterTag, filterType, filterCallback, noInUseError)
 Same as RegisterFilter function but only registers the filter if it currently was unregistered

function LibFilters3:UnregisterFilter(filterTag, filterType)
filterTag is the unique string that identifies your filter. filterType the
  provided "LF_" prefixed constants your filter was registered for.
  filterType is optional. If a filterType is not provided, all filters
  registered with the provided filterTag will be unregistered.

function LibFilters3:RequestUpdate(filterType, delay)
filterType is one of the provided "LF_" prefixed constants. Runs the updater
  appropriate for the provided filter type to pick up any filtering changes.

function LibFilters3:RequestUpdateForResearchFilters(delay)
 Request an update for the carfting table research panel, including normal LF_*_RESEARCH filters and the horizontal scrollBar filters registered 
 with the functions RegisterResearchHorizontalScrollbarFilter

function LibFilters3:RegisterResearchHorizontalScrollbarFilter(filterTag, craftingType, skipTable, fromResearchLineIndex, toResearchLineIndex, noInUseError)
Register a filter by help of a researchLineIndex "skipTable" for a craftingType
Parameter tyble skipTable contains key = researchLineIndex and value = boolean where "true" means: filter/skip (hide) this researchLineIndex at the horizontal scroll list.
Parameter number fromResearchLineIndex sets the researchLineIndex to start the output of the horizontal scrollbar: It filters (hides) the possibe entries "in total".
Parameter number toResearchLineIndex sets the researchLineIndex to stop the output of the horizontal scrollbar: It filters (hides) the possible entries "in total".
Parameter boolean noInUseError: if set to true there will be no error message if the filterTag+filterType was registered already -> Silent fail. Return value will be false then!
Returns true if filter table skipTable was registered, else nil in case of parameter errors, or false if same tag+type was already registered
If different addons register skipTables for the same crafting type, these skipTables will be combined!
->The combined entries of the skipTable are added, directly upon registering such filter, to they researchPanel table, with entry LibFilters3_HorizontalScrollbarFilters
->You need to manually call libFilters:RequestUpdateForResearchFilters(delay) to update the horizontal scrollbar (and the normal research filters) via researchPanel:Refresh()


function LibFilters3:UnregisterResearchHorizontalScrollbarFilter(filterTag, craftingType)
Unregister a filter by help of a researchLineIndex "skipTable" for a craftingType, which will show the entries at the horizontal scroll list again.
If different addons have registered skipTables for the same crafting type, these skipTables will be combined, and thus unregistering 1 filterTag might
still have any other registered which hides the entry at the horizontal scrollbar
->The combined entries of the skipTable are added, directly upon unregistering such filter, to they researchPanel table, with entry LibFilters3_HorizontalScrollbarFilters
->You need to manually call libFilters:RequestUpdateForResearchFilters(delay) to update the horizontal scrollbar (and the normal research filters) via researchPanel:Refresh()


function LibFilters3:ApplyCraftingResearchHorizontalScrollbarFilters(craftingType, noRefresh)
Use API function libFilters.ApplyCraftingResearchHorizontalScrollbarFilters(craftingType, noRefresh) to apply the combined
skiptables to the researchPanel table LibFilters3_HorizontalScrollbarFilters

LibFilters panel open/close "callback" API functions:
You create a callback identifier (name) for your addon and a LibFilters LF* filterType constant (related to a "panel"). if this panel shows/hides the callback will be raised.
You register your own callback function to that callback name via CALLBACK_MANAGER:RegisterCallback(callbackNameCreatedByLibFiltersAPIFunction_libFilters RegisterCallbackName, yourCallbackFunction).
yourCallbackFunction got the following parameters then:
Code:
callbackName String The callbackName of the callback just raised,
			filterType LF* constant,
			stateStr SCENE_SHOWN or SCENE_HIDDEN,
			isInGamepadMode true (gamepad or false (keyboard),
			fragmentOrSceneOrControl fragmentOrSceneOrControlOrUserdata reference variable,
			lReferencesToFilterType table with all references to that filterType,
			universalDeconSelectedTabNow nilable:String currently selected universal deconstruction tab "all", "armor", "weapons," "jewelry", "enchantments"

-> Read the WIKI for callbacks and examples!
Code:
--Create the callbackname for a libFilters filterPanel shown/hidden callback
----It will add an entry in table LibFilters3.mapping.callbacks.registeredCallbacks[inputType][yourAddonName][universalDeconActiveTab][filterType][isShown]
----number filterType needs to be a valid LF_* filterType constant
----boolean isShown true means SCENE_SHOWN will be used, and false means SCENE_HIDDEN will be used for the callbackname
----boolean inputType true = Gamepad, false= keyboard callback, leave empty for both!
----nilable:String universalDeconActiveTab The active tab at the universal deconstruction panel that this callback should be raised for, e.g. "all", "armor", "weapons", "jewelry" or "enchanting"
----nilable:String raiseBeforeOtherAddonsCallbackName If this callbackName (of another addon) is given the callback should be raised after this callback was raised. The callbackName provided here must match the
----> other parameters like filterType, isShown, inputType, universalDeconActiveTab!
----Returns String callbackNameGenerated
---->e.g. "LibFilters3-<yourAddonName>-shown-1" for SCENE_SHOWN and filterType LF_INVENTORY of addon <yourAddonName>
function libFilters:RegisterCallbackName(yourAddonName, filterType, isShown, inputType, universalDeconActiveTab, raiseBeforeOtherAddonsCallbackName)

function libFilters:UnregisterCallbackName(yourAddonName, filterType, isShown, inputType, universalDeconActiveTab)

Test UI for the filters
If you need the test UI please uncomment (remove the ##) the entries of the test.lua and .xml files in the LibFilters-3.0.txt manifest file!
Use the slash command
Code:
/lftestfilters
to open the Test UI of LibFilters.

A description how the test UI works and how you are able to regisetr your custom filterFunction and run the filters can be found here:
LibFilters WIKI



GitHub
LibFilters 3.0 at GitHub
LibFilters 3.0 for the PTS, or "Beta version"!
[v3.0 r3.9] 2023-01-02
-Added API functions for smithing research horizontal scrollbar filters
-->See API documentation at the WIKI:
function libFilters:RegisterResearchHorizontalScrollbarFilter(filterTag, craftingType, skipTable, fromResearchLineIndex, toResearchLineIndex, noInUseError)
function libFilters:UnregisterResearchHorizontalScrollbarFilter(filterTag, craftingType)
function libFilters:ApplyCraftingResearchHorizontalScrollbarFilters(craftingType, noRefresh)
function libFilters:RequestUpdateForResearchFilters(delay)

-Added more Is*Shown API functions (refinement, creation, deconstruction, improvement, research)
-->See API documentation -> IsShown* at the WIKI:
-Fixed research refresh function to update currently researched items properly, even if filtered (to prevent a start of a 4th research where not possible)
-Updated API Documentation/LibFilters-3.0_WIKI_API.md

-IMPORTANT - API functions removed:
function LibFilters3:SetResearchLineLoopValues(fromResearchLineIndex, toResearchLineIndex, skipTable)
-> Please use he new API functions libFilters:RegisterResearchHorizontalScrollbarFilter and libFilters:UnregisterResearchHorizontalScrollbarFilter instead so that many addons can work combined togeher!

[v3.0 r3.8] 2022-11-06
-Fixed callback 1st param = callbackName
-Working on API function CreateCallbackName. Added parameters and fixing CallbackRaise API function to raise internally LibFilters callback for each panel once AND then raise custom registered addon callbacks for the panels afterwards too
-Renamed API libFilters:CreateCallbackName to RegisterCallbackName
-Changed API function libFilters:RegisterCallbackName(yourAddonName, filterType, isShown, inputType, universalDeconActiveTab, raiseBeforeOtherAddonsCallbackName)
-Added API function libFilters:UnregisterCallbackName(yourAddonName, filterType, isShown, inputType, universalDeconActiveTab)

[v3.0 r3.7] 2022-11-01
-Fixed API function LibFilters3:GetFilterTypeReferences(filterType, isInGamepadMode) to always return a reference variable as first parameter so you can get the controls/scenes/fragments for a LF* filterType constants properly.
Only unimplemented LF* costants won't return a value now.
If gamepad re-uses keyboard controls it will return the relevant controls now.
-Added new API function LibFilters:IsUniversalDeconstructionSupportedFilterType(LF_filterType). Returns boolean true if the filter type passed in e.g. LF_SMITHING_DECONSTRUCT is supported at UniversalDeconstruction, or false if not (e.g. LF_SMITHING_REFINE)
-Added API functions
LibFilters3.CheckIfRefVarIsShown(refVarSceneFragmentOrControl) returns the boolean true if the refVar is currently shown
LibFilters3.GetCtrl(refVar) returns the control of the refVar (if available)
-Added prefix "|UD> " to debug messages that got to do with UniversalDeconstruction
-Fixed table filterTypeToCallbackRef for control callbacks (keyboard mode)
-Fixed LF_SMITHING_RESEARCH callbacks not firing due to a typo

[v3.0 r3.6] 2022-11-01
-Updated the WIKI
-Fixed global leaking test variable refreshNeeded
-Removed isUniversalDeconstructionGiven checks as it always is provided by the game meanwhile
-Added UniversalDecon detection and callbacks for keyboard and gamepad mode
Attention: The callback functions for the SCENE_SHOWN/SCENE_HIDDEN callbacks will provide an additional nilable parameter
at the end: String universalDeconstructionTab: If this is not nil the callback raised was raised at teh universal deconstruction panel and the the currently active tab there is the one provided at this parameter. Possible values are "all", "armor", "weapons","jewelry" or "enchantments"!
-> See function LibFilters3:CallbackRaise at the end -> CM:FireCallback
See global accessible table LibFilters3.mapping.universalDeconTabKeyToLibFiltersFilterType for the possible Strings -> LF_* filterType constants
-Fixed API function libfilters:CreateCallbackName to use the 1st new parameter yourAddonName
-Updated API functions so you can pass in the "currently used UNIVERSAL DECONSTRUCTION" tab as parameter "universalDeconTab"
API Functions changed are:
LibFilters3:RaiseFilterTypeCallback
-Updated API functions to return the "currently used UNIVERSAL DECONSTRUCTION" tab as return parameter "universalDeconSelectedTabKey"
See global accessible table's keys LibFilters3.mapping.universalDeconTabKeyToLibFiltersFilterType for the possible Strings returned.
API Functions changed are:
LibFilters3:GetCurrentFilterType()
LibFilters3:GetCurrentFilterTypeReference(filterType, isInGamepadMode)
-Updated API functions to return the "UNIVERSAL DECONSTRUCTION" reference variable as a new return parameter "universalDeconRef" for the passed in supported LF* filterTypes which universal decon re-uses (see global accessible table LibFilters3.mapping.universalDeconLibFiltersFilterTypeSupported for the possible filterType constants of Universal Deconstruction)
API Functions changed are:
LibFilters:GetFilterTypeReferences(filterType, isInGamepadMode)

[v3.0 r3.5] 2022-06-19
-removed old pre-HighIsle compatibility code
-Fixed keyboard quickslots text search at "all" and "consumables" tabs

[v3.0 r3.4] 2022-05-22
Fixed research keyboard dialog refresh & deselect nil error of items via ZO_ScrollList_SelectData (with nil data) -> ZOs function does no nil check and just tries to call the selectedCallback

[v3.0 r3.3] 2022-05-09
-Updated API
-Added PTS High Isle support
-Fixed gamepad universal deconstruction -> Missing ZOs function. Should be compatible too if ZOs adds it in the future

[v3.0 r3.2] 2022-03-16
-Fixed proper hooks into classes of ZO* instead of the objects (e.g. ZO_Enchanting instead of ENCHANTING). This should fix other addons which used similar hooks

[v3.0 r3.1] 2022-03-13
-Removed optional dependency to CraftBagExtended due to a circular dependency with AwesomeGuildStore and CBE
-Moved CBE code to event_player_activated, called once
-Commented the test.lua and xml file in the manifest txt again. If you need the test UI please uncomment the ## entries!

[v3.0 r3.0] 2022-03-12
Total recode of all code lines, helpers and updater functions
Supports Gamepad mode now! Special thanks to IsJustaGhost!!!
Provides callbacks that fire as the LF* filterTypes change.
Use the slash command /lftestfilters to show the test UI and test the default or your custom filterFunction
-Updated the WIKI with examples and API functions-


Supports Universal Deconstruction at PTS (this is a special case as it does not provide any dedicated LF_UNIVERSAL_DECONSTRUCT filterType but reuses LF_SMIHING_DECONSTRUCT, LF_JEWELRY_DECONSTRUCT and LF_ENCHANTING_EXTRACTION at the UniversalDecon UI, depending on the selected UI Tab).
-> Gamepad mode filters is not yet supported here and will be patched later! Callabcks for UniversalDecon will be added later tpo. For now please simply use ZOs callbacks fired by CALLBACK_MANAGER for e.g. UNIVERSAL_DECONSTRUCTION.deconstructionPanel.inventory "OnFilterChanged" or according gamepad variables.

[v3.0 r2.2]
-Updated API for Waking flame
-Fixed alchemy quest markers

[v3.0 r2.1]
-Updated API for Blackwood
-Fixed CraftBag filters as Blackwood will always apply the layoutData.additionalFilters to the craftbag
-Added support for the Companion inventory: LF_INVENTORY_COMPANION

[v3.0 r2.0]
-Compatible with live and PTS
-Fixed buyback window
-Added buyback window text search
-Added repair window text search
-Fixed quickslots search
-Fixed enchanting quest items checkbox
-Fixed enchanting panel detection

[v3.0 r1.9]
-Reverted back to 3.0 r1.7 as 1.8 somehow got broken in the inventory filters (not always, sometimes after opening a bank)

[v3.0 r1.8]
-Updated APIversion
-Fixed quickslots search (thanks to Scootworks)
-Fixed enchanting filterType detection, and thus also fixed the quest checkbox at enchanting creation

[v3.0 r1.7]
-Updated APIversion
-Fixed inventory filters to be compatible with ZOs vanilla inventory UI changes
-Added new filter panel LF_INVENTORY_QUEST
-Fixed constant LF_FILTER_MAX

[v3.0 r1.6]
-Updated APIversion
-Fixed new ZOs checkbox "Include banked items" at crafting panels (deconstruction, research) filtering correctly
-Added optional LibDebugLogger support
-Added API function LibFilters3:GetMinFilter()
-Added global LF_FILTER_MIN

[v3.0 r1.5]
Fixed jewelry research & jewelry research dialog filter updater names

[v3.0 r1.4]
Added: Function to filter (skip) researchLine indices at the research panel
LibFilters:SetResearchLineLoopValues(fromResearchLineIndex, toResearchLineIndex, skipTable)
number fromResearchLineIndex: Start the loop here
number toResearchLineIndex: End the loop here
table skipTable: A table containing the researchLine indices to skip in the loop (theyx won't be added to the horizontal scroll list)

[v3.0 r1.3]
Fixed/Updated: helper functions for the smithing & jewelry research panels

[v3.0 r1.2]
Fixed: Removed LibFilters2_filterType and exchanged them with LibFilters3_filterType in the inventory/layout data

[v3.0 r1.1]
-Removed optional dependency and chat message to inform about LibFilters-2.0 removal
-Fixed helper
Optional Files (0)


Archived Files (22)
File Name
Version
Size
Uploader
Date
3.0r3.8
111kB
Baertram
11/11/22 06:42 AM
3.0r3.7
102kB
Baertram
11/01/22 01:03 PM
3.0r3.6
101kB
Baertram
11/01/22 07:26 AM
3.0r3.5
96kB
Baertram
06/18/22 04:36 PM
3.0r3.4
96kB
Baertram
05/22/22 09:52 AM
3.0r3.3
96kB
Baertram
05/09/22 01:44 AM
3.0r3.2
96kB
Baertram
03/16/22 11:06 AM
3.0r3.1
95kB
Baertram
03/12/22 07:34 PM
3.0r3.0
95kB
Baertram
03/12/22 11:27 AM
3.0r2.2
13kB
Baertram
08/13/21 06:29 AM
3.0r2.1
13kB
Baertram
06/01/21 05:58 AM
3.0r2.0
13kB
Baertram
02/18/21 06:55 PM
3.0r1.9
11kB
Baertram
01/25/21 04:05 PM
3.0r1.8
11kB
Baertram
01/25/21 02:05 PM
3.0r1.7
11kB
Baertram
11/02/20 06:39 AM
3.0r1.6
10kB
Baertram
08/24/20 07:09 PM
3.0r1.5
9kB
Baertram
08/31/19 12:50 PM
3.0r1.4
9kB
Baertram
08/30/19 11:08 PM
3.0r1.3
8kB
Baertram
08/30/19 03:12 PM
3.0r1.2
8kB
Baertram
05/26/19 01:50 PM
3.0r1.1
8kB
Baertram
05/11/19 04:51 PM
3.0r1.0
8kB
05/04/19 08:28 AM


Post A Reply Comment Options
Unread 11/06/22, 09:40 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4345
File comments: 5454
Uploads: 74
Still got a bug in 3.8 too.
The callback fires BUT the return parameters in the functions are somehow wrong, see screenshots below.
I'll try to fix this in 3.8 beta
I think I passed in the callback name to fire as 1st param to CALLBACK_MANAGER:FireCallback but I forgot to add it a second time (as 2nd param = 1st param of your callback func) again!

Edit:
Fixed in v3.8 GitHub PTS now!

Originally Posted by remosito
Howdie Baertram,

my Addon that is using them is not yet released. And I might not actually release it. Just an accumulation of auto sell, bank, withdraw, destroy rules that I started implementing after I stopped having eso+... not sure they would work very well for anybody else.

So no wonder you didn't know somebody was using it :-)

And with it not being released, not really important to get it working with 3.7...

Let me hop onto your 3.8 PTS branch and see how things work with that one...

cheers

remosito
Last edited by Baertram : 11/06/22 at 09:46 AM.
Report comment to moderator  
Reply With Quote
Unread 11/06/22, 09:33 AM  
remosito
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 258
Uploads: 3
Howdie Baertram,

my Addon that is using them is not yet released. And I might not actually release it. Just an accumulation of auto sell, bank, withdraw, destroy rules that I started implementing after I stopped having eso+... not sure they would work very well for anybody else.

So no wonder you didn't know somebody was using it :-)

And with it not being released, not really important to get it working with 3.7...

Let me hop onto your 3.8 PTS branch and see how things work with that one...

cheers

remosito
Report comment to moderator  
Reply With Quote
Unread 11/06/22, 08:56 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4345
File comments: 5454
Uploads: 74
Re: U36 : functions not firing anymore :-/

Hey remosito,

sorry I did not know any addon is using the callbacks actively so I have worked on fixes and changes and suppot for multiple addons raising callbacks, and trying to call them after another. The version 3.7 still uses CreateCallbackName, but with v 3.8 it's RegisterCallbackName. I'll add a compatibility function there, for sure.

The params for LibFilters v3.7 are:
Code:
--Create the callbackname for a libFilters filterPanel shown/hidden callback
--number filterType needs to be a valid LF_* filterType constant
--boolean isShown true means SCENE_SHOWN will be used, and false means SCENE_HIDDEN will be used for the callbackname
--Returns String callbackNameGenerated
-->e.g. "LibFilters3-<yourAddonName>-shown-1" for SCENE_SHOWN and filterType LF_INVENTORY of addon <yourAddonName>
function libFilters:CreateCallbackName(yourAddonName, filterType, isShown)
Edit - After testing:
Lua Code:
  1. local function doTestStuff()
  2. libFilters._callbackData = {}
  3. libFilters._callbackData[LF_INVENTORY] = {}
  4.  
  5.     local function callbackFunctionForInvShown(callbackName, filterType, stateStr, isInGamepadMode, fragmentOrSceneOrControl, lReferencesToFilterType, universalDeconSelectedTabNow)
  6. libFilters._callbackData[LF_INVENTORY][stateStr] = {
  7.     callbackName = callbackName,
  8.     filterType = filterType,
  9.     stateStr = stateStr,
  10.     isInGamepadMode = isInGamepadMode,
  11.     fragmentOrSceneOrControl = fragmentOrSceneOrControl,
  12.     lReferencesToFilterType = lReferencesToFilterType,
  13.     universalDeconSelectedTabNow = universalDeconSelectedTabNow,
  14. }
  15.  
  16.     d("callbackinvshown")
  17.         if filterType == LF_INVENTORY then
  18.             d("Inventory - " ..tos(stateStr))
  19.         end
  20.     end
  21.  
  22.     local function callbackFunctionForInvHidden(callbackName, filterType, stateStr, isInGamepadMode, fragmentOrSceneOrControl, lReferencesToFilterType, universalDeconSelectedTabNow)
  23.     d("callbackinvhidden")
  24. libFilters._callbackData[LF_INVENTORY][stateStr] = {
  25.     callbackName = callbackName,
  26.     filterType = filterType,
  27.     stateStr = stateStr,
  28.     isInGamepadMode = isInGamepadMode,
  29.     fragmentOrSceneOrControl = fragmentOrSceneOrControl,
  30.     lReferencesToFilterType = lReferencesToFilterType,
  31.     universalDeconSelectedTabNow = universalDeconSelectedTabNow,
  32. }
  33.         if filterType == LF_INVENTORY then
  34.             d("Inventory - " ..tos(stateStr))
  35.         end
  36.     end
  37.  
  38.     local callbackNameInvShown = libFilters:CreateCallbackName("ASOD", LF_INVENTORY, true)
  39.     d("Callback created: " ..callbackNameInvShown)
  40.     CALLBACK_MANAGER:RegisterCallback(callbackNameInvShown, callbackFunctionForInvShown)
  41.     local callbackNameInvHidden = libFilters:CreateCallbackName("ASOD", LF_INVENTORY, false)
  42.     d("Callback created: " ..callbackNameInvHidden)
  43.     CALLBACK_MANAGER:RegisterCallback(callbackNameInvHidden, callbackFunctionForInvHidden)
  44. end


The callbacks show and hide fires for me but the param filterType is not LF_INVENTORY there.

It's somehting else
-> I'll have a look how to fix this.
Edit2:

It seems the 1st param should be 2nd, and 2nd = 3rd and so on Somehow I have an issue with the return values there due to internal usage
of libFilters. and libFilters: calls!
I'll fix this.


For UniversalDeconstruction they fire properly, with LF v3.8 beta.
Try to enable /lfdebug with the slash command and enable LibDebugLOgger and DebugLogViewer and see if the LF internal calback fro inventory open/close fires there! If so the callback is fine, just v3.7 is somehow bugged then.


The params for LibFilters v3.8 in near future are btw:
-> Attention: Function will be renamed to libFilters:RegisterCallbackName and a libFilters:UnregisterCallbackName func will be added too
Code:
--Create the callbackname for a libFilters filterPanel shown/hidden callback
----It will add an entry in table LibFilters3.mapping.callbacks.registeredCallbacks[inputType][yourAddonName][universalDeconActiveTab][filterType][isShown]
----number filterType needs to be a valid LF_* filterType constant
----boolean isShown true means SCENE_SHOWN will be used, and false means SCENE_HIDDEN will be used for the callbackname
----boolean inputType true = Gamepad, false= keyboard callback, leave empty for both!
----nilable:String universalDeconActiveTab The active tab at the universal deconstruction panel that this callback should be raised for, e.g. "all", "armor", "weapons", "jewelry" or "enchanting"
----nilable:String raiseBeforeOtherAddonsCallbackName If this callbackName (of another addon) is given the callback should be raised after this callback was raised. The callbackName provided here must match the
----> other parameters like filterType, isShown, inputType, universalDeconActiveTab!
----Returns String callbackNameGenerated
---->e.g. "LibFilters3-<yourAddonName>-shown-1" for SCENE_SHOWN and filterType LF_INVENTORY of addon <yourAddonName>
function libFilters:RegisterCallbackName(yourAddonName, filterType, isShown, inputType, universalDeconActiveTab, raiseBeforeOtherAddonsCallbackName)
Originally Posted by remosito
Howdie Baertram,

since U36 dropped all my inventory, bank, seller functions are no longer firing...

Code:
local function callbackFunctionForInvShown(callbackName, filterType, stateStr, isInGamepadMode, fragmentOrSceneOrControl, lReferencesToFilterType, universalDeconSelectedTabNow)

d("callbackinvshown")
	if filterType == LF_INVENTORY then
... more code
end

local function callbackFunctionForInvHidden(callbackName, filterType, stateStr, isInGamepadMode, fragmentOrSceneOrControl, lReferencesToFilterType, universalDeconSelectedTabNow)

d("invhidden")
	if filterType == LF_INVENTORY then
.. more code

end

if libFilters then
		d("libfilt2")
		libFilters:InitializeLibFilters()
		local callbackNameInvShown = libFilters:CreateCallbackName("ASOD", LF_INVENTORY, true)
		local callbackNameInvHidden = libFilters:CreateCallbackName("ASOD", LF_INVENTORY, false)
		d(callbackNameInvShown)
		d(callbackNameInvHidden)
		CALLBACK_MANAGER:RegisterCallback(callbackNameInvShown, callbackFunctionForInvShown)
		CALLBACK_MANAGER:RegisterCallback(callbackNameInvHidden, callbackFunctionForInvHidden)
...more code
end
in the debug out I get

libfilt2 <- so I know the setup stuff gets called
LibFilters3-ASOD-shown-1 (1st string returned by your library looks good)
LibFilters3-ASOD-hidden-1 (2nd string returned by your library looks good)


but I never get the "callbackinvshown" and "invhidden" debug printouts that should be printed when I open/close the inventory. Looks like the functions I registered never fire....

As you can see I changed my code to your new format with new parameters.. did I miss something else?

quite at a loss here


cheers

remosito
Last edited by Baertram : 11/06/22 at 09:39 AM.
Report comment to moderator  
Reply With Quote
Unread 11/06/22, 04:16 AM  
remosito
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 258
Uploads: 3
U36 : functions not firing anymore :-/

Howdie Baertram,

since U36 dropped all my inventory, bank, seller functions are no longer firing...

Code:
local function callbackFunctionForInvShown(callbackName, filterType, stateStr, isInGamepadMode, fragmentOrSceneOrControl, lReferencesToFilterType, universalDeconSelectedTabNow)

d("callbackinvshown")
	if filterType == LF_INVENTORY then
... more code
end

local function callbackFunctionForInvHidden(callbackName, filterType, stateStr, isInGamepadMode, fragmentOrSceneOrControl, lReferencesToFilterType, universalDeconSelectedTabNow)

d("invhidden")
	if filterType == LF_INVENTORY then
.. more code

end

if libFilters then
		d("libfilt2")
		libFilters:InitializeLibFilters()
		local callbackNameInvShown = libFilters:CreateCallbackName("ASOD", LF_INVENTORY, true)
		local callbackNameInvHidden = libFilters:CreateCallbackName("ASOD", LF_INVENTORY, false)
		d(callbackNameInvShown)
		d(callbackNameInvHidden)
		CALLBACK_MANAGER:RegisterCallback(callbackNameInvShown, callbackFunctionForInvShown)
		CALLBACK_MANAGER:RegisterCallback(callbackNameInvHidden, callbackFunctionForInvHidden)
...more code
end
in the debug out I get

libfilt2 <- so I know the setup stuff gets called
LibFilters3-ASOD-shown-1 (1st string returned by your library looks good)
LibFilters3-ASOD-hidden-1 (2nd string returned by your library looks good)


but I never get the "callbackinvshown" and "invhidden" debug printouts that should be printed when I open/close the inventory. Looks like the functions I registered never fire....

As you can see I changed my code to your new format with new parameters.. did I miss something else?

quite at a loss here


cheers

remosito
Report comment to moderator  
Reply With Quote
Unread 04/25/22, 06:35 AM  
remosito
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 258
Uploads: 3
Re: Re: PTS

Originally Posted by Baertram
Originally Posted by remosito
Howdie,

LibFilter3 throws errors on pts. Looks like they are related to the quickslot workover ZOS is putting in...

cheers
Already fixed, was working on it, FCOIS, AdvancedFilters today.
Download the most current github beta file(s) please.
Did that this morning and works perfectly on PTS

thanks a lot :-)
Report comment to moderator  
Reply With Quote
Unread 04/24/22, 03:51 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4345
File comments: 5454
Uploads: 74
Re: PTS

Originally Posted by remosito
Howdie,

LibFilter3 throws errors on pts. Looks like they are related to the quickslot workover ZOS is putting in...

cheers
Already fixed, was working on it, FCOIS, AdvancedFilters today.
Download the most current github beta file(s) please.
Report comment to moderator  
Reply With Quote
Unread 04/24/22, 02:43 PM  
remosito
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 258
Uploads: 3
PTS

Howdie,

LibFilter3 throws errors on pts. Looks like they are related to the quickslot workover ZOS is putting in...

cheers
Report comment to moderator  
Reply With Quote
Unread 04/01/22, 10:17 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4345
File comments: 5454
Uploads: 74
Yes, it's not supported officially as the Changelog says and thus will throw error messages.
Last edited by Baertram : 04/01/22 at 10:17 AM.
Report comment to moderator  
Reply With Quote
Unread 04/01/22, 12:44 AM  
Lucxius

Forum posts: 0
File comments: 1
Uploads: 0
gamepad

Hello I have an error when I use the new Giladil the Ragpicker, in mode gamepad:

user:/Addons/Libfilters-3.0/helper.lua:859: function expected instead of nil stack traceback:
user:/Addons/Libfilters-3.0/helper.lua:859: in function 'filterFuction'/EsoUI/Ingame/Crafting/Gamepad/GamepadCraftingInventory.lua:173:infuction'ZO_GamepadCraftingInventory:GetIndividualInventorySlotsAddToScrollData'/EsoUI/Ingame/Crafting/Gamepad/UniversalDeconstructionPanel_Gamepad.lua:550 etc.....

Sorry it is my first post and I don't know how to attach an image
Report comment to moderator  
Reply With Quote
Unread 03/16/22, 05:52 PM  
Zulunia
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 28
Uploads: 1
Thanks for the update! Enchant Maker works again thankyou!
Report comment to moderator  
Reply With Quote
Unread 03/12/22, 08:34 PM  
[Daniel]

Forum posts: 1
File comments: 133
Uploads: 0
Thank you Baertram! installed the latest updates and all is well
Report comment to moderator  
Reply With Quote
Unread 03/12/22, 07:30 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4345
File comments: 5454
Uploads: 74
CBE -> Optional AGS -> Optional LibFilters -> Optional CBE.
If AF is also used it will jump in there too:
CBE -> Optional AGS -> Optional LibFilters -> AdvancedFilters -> Optional CBE
So I need to fix the optional dependency at LibFilters as it seems.
Last edited by Baertram : 03/12/22 at 07:31 PM.
Report comment to moderator  
Reply With Quote
Unread 03/12/22, 07:26 PM  
[Daniel]

Forum posts: 1
File comments: 133
Uploads: 0
Originally Posted by Baertram
Try to remove from AdvancedFilters.txt -> ## OptionalDependsOn: AwesomeGuldStore
Unfortunately for me, making this edit yielded the same error... so I reverted the change and tried just @karmapharmacy's edit as I too am using CBE...
Originally Posted by karmapharmacy
Removed LibFilters3.0.txt -> ## OptionalDependsOn: CraftBagExtended
.. and surprisingly the error (which mentioned AwesomeGuildStore) vanished?!

This got me curious... what if I left the AGS optional depends inside AF.txt and instead removed its CBE reference (knowing LF3.txt still contained it; after I reverted the earlier change)? and the circular message remains...
AddOnLoad: Circular dependency detected between [LibFilters-3.0] and [AwesomeGuildStore]
And for clarity, this is the condition of the two files optional depends in this scenario:
  • AdvancedFilters.txt - ## OptionalDependsOn: AwesomeGuildStore LibMotifCategories>=2
  • LibFilters3.0.txt - ## OptionalDependsOn: LibDebugLogger>=220 CraftBagExtended
So for right now, I think I'm going to leave the edits as I believe @karmapharmacy has them:
  • AdvancedFilters.txt (unchanged) - ## OptionalDependsOn: AwesomeGuildStore CraftBagExtended LibMotifCategories>=2
  • LibFilters3.0.txt (CBE removed) - ## OptionalDependsOn: LibDebugLogger>=220
Like this I have no errors pre-login, post-login, or while launching AGS.... and the filters appear to be working correctly inside AGS.
Last edited by [Daniel] : 03/12/22 at 07:32 PM.
Report comment to moderator  
Reply With Quote
Unread 03/12/22, 06:53 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4345
File comments: 5454
Uploads: 74
Originally Posted by karmapharmacy
Had a similar issue, along with a few other users for AwesomeGuildStore and Craft Bag Extended.
This circular dependency was caused by AGS and CraftBagExtended - following your logic for this recent bug with LF and AGS :

Removed LibFilters3.0.txt -> ## OptionalDependsOn: CraftBagExtended

No more dependency loop. Likely cause AF calls on CBE, and is already using LF3.0.

Confirmed all filter menus working.
Ah, okay. thanks for that info. CBE was added on purpose to LibFilters as there is dependent code and checks.
I'll check the files of LibFilters and AF again.
Last edited by Baertram : 03/12/22 at 07:02 PM.
Report comment to moderator  
Reply With Quote
Unread 03/12/22, 06:26 PM  
karmapharmacy
 
karmapharmacy's Avatar

Forum posts: 0
File comments: 3
Uploads: 0
Had a similar issue, along with a few other users for AwesomeGuildStore and Craft Bag Extended.
This circular dependency was caused by AGS and CraftBagExtended - following your logic for this recent bug with LF and AGS :

Removed LibFilters3.0.txt -> ## OptionalDependsOn: CraftBagExtended

No more dependency loop. Likely cause AF calls on CBE, and is already using LF3.0.

Confirmed all filter menus working.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: