Download
(15 Kb)
Download
Updated: 07/16/24 01:54 PM
Pictures
File Info
Compatibility:
Update 43 (10.1.0)
Gold Road (10.0.0)
Scions of Ithelia (9.3.0)
Endless Archive (9.2.5)
base-game patch (9.1.5)
Necrom (9.0.0)
Scribes of Fate (8.3.5)
Updated:07/16/24 01:54 PM
Created:08/21/20 11:16 AM
Monthly downloads:1,160
Total downloads:11,215
Favorites:16
MD5:
Categories:TradeSkill Mods, Game Controller
10.0.0
IsJusta Decon Carried Items List  Updated less than 3 days ago!  Popular! (More than 5000 hits)
Version: 3.3.2
by: IsJustaGhost [More]
Requires LibAddonMenu-2.0

Works in Gamepad Mode and Keyboard/Mouse Mode

NEW:
3
  • added option to auto "Add All". This option will add all filtered items to be deconstructed on opening the station or assistant.

Features
  1. Refine
    1. Adds the option to only show raw materials there are enough to refine. (10 or more)
  2. Deconstruct
    1. Adds the "Carried" tab
      • this tab only show items carried in the "Backpack"
      • all items are sorted the same as originally.
    2. Changes the original tabs ( Jewelry, Weapons, Apparel )
      • now only shows banked items
    3. Disables and removes the option to show banked items in keyboard mode since it becomes redundant.
  3. Deconstruction Assistant
    1. Adds the "Carried" tab
      • this tab only show items carried in the "Backpack"
      • all items are sorted the same as originally.
    2. Changes the original tabs ( All, Jewelry, Weapons, Apparel, Glyphs)
      • now only shows banked items
    3. Disables and removes the option to show banked items in keyboard mode since it becomes redundant.
  4. "Automation"
    1. "Add All"
      • this button is used to quickly add all deconstructable items in the curent tab in one click, based on filters, up to 100 items.
      • if all posible items that can be added using "Add All" hae been selected, it will become "Clear Selections".
      • by cefualt it is only added to Refine and the "Carried" tab and can be added to the other tabs be setting "Use Add All for others".
    2. "Open to Deconstruct" {requested by K1nor}
      • auto-opens to Deconstruct and slects the "Carried" tab if you are carying items that pass the filters.
      • use with caution. Some addons require opening the station to a specific tab. Using this option could cause issues with those addons.
    3. "Auto open Assistant."
      • skips the dialogue and slects the "Carried" tab if you are carying items that pass the filters.
    4. "Auto Add All"
      • this option will auto "Add All" filtered items to be deconstructed on opening the station or assistant.
    5. "Filters"
      • include Default -- Items not covered by the other filters
      • include Set Items
      • include Ornate
      • include Intricate
      • include Retraited
      • include Reconstructed
      • include Researchable

Each filter has it's own:
  • include only items at or above the Min Quality set.
  • include only items at or below the Max Quality set.
If a filter is not enabled, anything that would be included in that filter will be excluded from "Add All"

"Clean refinement tab" option in settings.


! May conflict with other inventory filtering addons !
If using FCO CraftFilter, when not viewing "Carried" tab, selecting to hide banked items will result in an empty list. The original tabs* only show banked items.

* "original tabs" = the original deconstruct tabs for the current station ( Jewelry, Weapons, Apparel )
- - - 3.3.2
○ patched filtering to prioritize enabled filters

- - - 3.3.1
○ patched filtering to not always include the default filter

- - - 3.3
○ changed how initializing per system object is handled
○ added option to prevent stolen items from being added with "Add All".
○ added, allow stolen by quality, filter

- - - 3.2.6
○ removed debug output

- - - 3.2.5
○ compatibility update

- - - 3.2.4
○ stepping up the version to make sure it does not conflict with being updated by clients

- - - 3.2.3
○ removed debug messages
○ changed when the setting for include banked items is set
○ hid the include bank check box in keyboard mode
○ fixed resetting to show banked

- - - 3.2.2
○ fixed BOP and trad-able dialogue not showing when warn is active.
○ fixed keyboard mode not refreshing keybind when changing inventories
○ improved compatibility with Advanced Filters

- - - 3.2.1
○ fixed filtering so now filters are check in priority from top to bottom in the settings.
-- If a filter is enabled and, that item falls under a filter below it, the last filter will be the one used even if it's disabled.
-- If a researchable item falls under any other filter, it will be ignored if the filter researchable is disabled.
○ again, hoping that the Add All Keybind updates properly. Changed a variable in the check.

- - - 3.2
○ updated default filters to work with libFilters
○ added libFilters universalDeconTabKeyToLibFiltersFilterType for "carried" tab
○ added limited compatibility with Advanced Filters

- - - 3.1
○ fixed gamepad mode not letting category change in clothier station
○ fixed keyboard crafting stations causing error
○ Add All keybind now checks if extraction slot has items if un-added item would exceed max
-- this will properly change the keybind from Add All to Clear Selections.

- - - 3
○ simplified functionality to allow easier management
○ added option to allow filtered Add All to happen on open

- - 2.7
○ change how filtering is done
- each "trait" has it's own filter settings

- - - 2.6
○ added minimum quality to filters
○ updated API version

- - - 2.5.5
○ HOTFIX update for gamepad mode. No longer relying on the initial GetCurrentFilter check since it will cause errors for gamepad mode.
Now IsCustomTab will handle discrepancies.

- - - 2.5.4
○ HOTFIX for gamepad mode. Implemented an overwrite to the newly added function to gamepad mode GetCurrentFilter
this function was requested in order to make functionality match keyboard mode. However the function is incomplete.

- - - 2.5.3
○ HOTFIX for gamepad mode. Implemented an overwrite to the newly added function to gamepad mode GetCurrentFilter
this function was requested in order to make functionality match keyboard mode. However the function is incomplete.

- - - 2.5.2
○ attempt to fix Advanced Filters conflict by removing some unused experimental lib functions.

- - - 2.5.1
○ attempt to fix conflict with Advanced Filters.

- - - 2.5
○ completely rewrote the entire addon.
○ added support for the deconstruction assistant
-- the deconstruction assistant will now have a "Carried" tab.
○ automation improvement. If "Open to decon" is enabled, it will only do so if there are deconstruct-able items on you.
○ If "Auto open Assistant." is enabled, interacting with the decon assistant will auto enter deconstruct.
-- if deconstruct-able carried items are present, it will auto select the "Carried" tab.
○ added max item quality to requirements for automation, select-able in the settings.

- - - 2.4.2
○ compatibility update.
removed requirement for the experimental library

- - - 2.4.1
○ compatibility update.

- - - 2.4
○ implemented support for LibHaF
○ added support for FCO_ItemSaver for deconstruction
○ added function to prevent items being added to crafting slot if it would exceed the limit.
○ updated for API 101034.

- - - 2.3
○ replaced filter function used from ZO_SharedSmithingExtraction_DoesItemPassFilter

- - - 2.2.7
○ added French translation courtesy of fzr6n7
○ added Intricate to Include in add all
○ changed where EVENT_ADD_ON_LOADED is

- - - 2.2.6
○ commented out "show name and version" on load
○ updated api version

- - - 2.2.5
○ fixed filtering for carried tab. will now be filtered with libFilters

- - - 2.2.4
○ fixed error in Gamepad mode from trying to open the options menu for Deconstruct

- - - 2.2.3
○ changed how keybinds are made
○ added option to enable add all for others
○ additional minor improvements

- - - 2.2.2
○ some minor improvements
○ in keyboard mode, will also auto select carried tab

- - - 2.2.1
○ fixed bug caused from switching game modes while using a smithing station

- - - 2.2
○ add option to enter station to Deconstruction tab.

- - - 2.1.4
○ fixed DoesItemPassFilter. Carried items will now show up

- - - 2.1.3
○ added LibFilters-3.0 as optional dependency
○ list will now be filtered, if filtering is available

- - - 2.1.2
○ added Add All to refine
○ fixed some issues

- - - 2.1.1
○ attempt to fix slot stack issue


- - - 2.1
○ added keybind for "Add All"
○ added options to include in "Add All"

- - - 2.0.1
○ api update

- - - 2
○ some code changes and added gamepad support
○ disabled the show in bank option from base game

- - - 1.5.3
○ version update

- - - 1.5.1
Created unique functions for sorting carried decon smithing list

- - - 1.5
Changed how the objects are registered.

- - - 1.4.1
Changed the way a function is hooked.


- - - 1.4
Updated game version


- - - 1.3
Added
○ texture to empty deconstruction slot if in Carried list


- - - 1.2
Added
○ option to enable auto-hiding of the carried list if list is empty

○ implemented a cleaner method of creating the carried tab. no longer uses PostHook


- - - 1.1.1
Added
○ no item text to Carried decon lists


1.1
ADDED:
○ optional setting to only show the raw materials you have at least 10 of for Refinement.
Optional Files (0)


Archived Files (50)
File Name
Version
Size
Uploader
Date
3.3.1
15kB
IsJustaGhost
07/10/24 06:56 AM
3.3
15kB
IsJustaGhost
07/09/24 07:45 AM
3.2.6
16kB
IsJustaGhost
06/15/23 03:59 PM
3.2.5
16kB
IsJustaGhost
06/15/23 03:53 PM
3.2.4
16kB
IsJustaGhost
06/15/23 07:18 AM
3.2.3
16kB
IsJustaGhost
06/14/23 05:36 PM
3.2.1
16kB
IsJustaGhost
06/07/23 07:45 PM
3.2
15kB
IsJustaGhost
06/06/23 06:17 PM
3.1
15kB
IsJustaGhost
06/06/23 12:47 AM
3
14kB
IsJustaGhost
06/05/23 06:47 PM
2.7
16kB
IsJustaGhost
10/11/22 06:14 PM
2.6
15kB
IsJustaGhost
10/09/22 06:18 PM
2.5.5
15kB
IsJustaGhost
06/20/22 08:04 PM
2.5.4
15kB
IsJustaGhost
06/20/22 04:44 PM
2.5.3
15kB
IsJustaGhost
06/20/22 04:18 PM
2.5.2
15kB
IsJustaGhost
05/07/22 10:50 AM
2.5.1
17kB
IsJustaGhost
04/22/22 11:00 AM
2.5
17kB
IsJustaGhost
04/21/22 08:48 PM
2.4.2
13kB
IsJustaGhost
03/17/22 06:49 PM
2.4.1
19kB
IsJustaGhost
03/17/22 05:26 AM
2.4
19kB
IsJustaGhost
03/16/22 10:37 PM
2.3
12kB
IsJustaGhost
03/13/22 03:03 PM
2.2.7
12kB
IsJustaGhost
02/21/22 04:32 PM
2.2.6
11kB
IsJustaGhost
12/08/21 03:37 PM
2.2.6
11kB
IsJustaGhost
12/08/21 03:29 PM
2.2.5
11kB
IsJustaGhost
11/16/21 08:50 PM
2.2.4
12kB
IsJustaGhost
11/14/21 10:38 PM
2.2.3
11kB
IsJustaGhost
11/10/21 06:07 PM
2.2.2
10kB
IsJustaGhost
11/08/21 04:12 PM
2.2.1
8kB
IsJustaGhost
10/26/21 02:23 PM
2.2
8kB
IsJustaGhost
10/26/21 02:10 PM
2.1.4
7kB
IsJustaGhost
10/25/21 03:21 PM
2.1.4
7kB
IsJustaGhost
10/25/21 03:07 PM
2.1.3
7kB
IsJustaGhost
10/25/21 02:19 PM
2.1.2
7kB
IsJustaGhost
10/24/21 12:39 PM
2.1.1
7kB
IsJustaGhost
10/04/21 02:03 AM
2.1
7kB
IsJustaGhost
10/03/21 09:05 PM
2.0.1
6kB
IsJustaGhost
08/25/21 12:44 PM
2
5kB
IsJustaGhost
06/13/21 07:24 AM
1.5.3
5kB
IsJustaGhost
06/03/21 12:21 PM
1.5.1
5kB
IsJustaGhost
03/16/21 11:55 PM
1.5
4kB
IsJustaGhost
03/03/21 09:25 PM
1.4.1
4kB
IsJustaGhost
02/19/21 08:38 AM
1.4
4kB
IsJustaGhost
11/17/20 06:34 PM
1.3
6kB
IsJustaGhost
09/09/20 06:35 AM
1.2
3kB
IsJustaGhost
09/07/20 08:23 AM
1.1.1
3kB
IsJustaGhost
09/07/20 05:48 AM
1.1.1
11kB
IsJustaGhost
08/28/20 01:06 AM
1.1
3kB
IsJustaGhost
08/27/20 12:32 AM
1
2kB
IsJustaGhost
08/21/20 11:16 AM


Post A Reply Comment Options
Unread 07/13/24, 07:13 AM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Originally Posted by IsJustaGhost
I may have implemented this change incorrectly
No. I think you're right and I made a mistake somewhere.

Today I reinstalled 3.3.1 from scratch and only changed shouldAddItem to:

Lua Code:
  1. local function shouldAddItem(bagId, slotIndex)
  2.     local filters = {}
  3.    
  4.     -- only need to run this onse per item
  5.     if IsItemBoPAndTradeable(bagId, slotIndex) then
  6.         return savedVars.ignoreTradeable
  7.     end
  8.    
  9.     -- Add relevent filters in order
  10.     if IsItemStolen(bagId, slotIndex) then
  11.         if savedVars.ignoreStolen then
  12.             return false
  13.         else
  14.             table.insert(filters, qualityFilters['stolen'])
  15.         end
  16.     end
  17.  
  18.     -- Quality filters.
  19.     local hasSet = GetItemLinkSetInfo(GetItemLink(bagId, slotIndex))
  20.     if hasSet then
  21.         table.insert(filters, qualityFilters['setItems'])
  22.     end
  23.    
  24.     local traitInformation = GetItemTraitInformation(bagId, slotIndex)
  25.     if qualityFilters[traitInformation] then
  26.         table.insert(filters, qualityFilters[traitInformation])
  27.     end
  28.    
  29.     if ZO_IsTableEmpty(filters) then
  30.         table.insert(filters, qualityFilters['default'])
  31.     end
  32.    
  33.     local displayQuality = GetItemDisplayQuality(bagId, slotIndex)
  34.    
  35.     for _, filter in ipairs(filters) do
  36.         -- first filter, in order of added, returns true, stop and add item.
  37.         if not filterItem(filter, displayQuality) then
  38.             return false
  39.         end
  40.     end
  41.     return true
  42. end


And it appears to be working as expected...

After collecting more set pieces to test with, it's all fine using 3.3.1 and the modified shouldAddItem. It looks like any weirdness with the filterTable must have been a mistake on my part.
Last edited by Tiath : 07/13/24 at 09:20 AM.
Report comment to moderator  
Reply With Quote
Unread 07/11/24, 08:42 AM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
Originally Posted by Tiath
Originally Posted by IsJustaGhost
This is the true order of the qualityFilters. But, the order does not matter for this table.
Yes. Sorry, I agree with you: I can see that it shouldn't depend on how filterTable is ordered, because shouldAddItem is constructing its own local filters table.

But it does work if you change the filterTable order - and doesn't work if you don't

I can't see why that is at the moment (it's weird), and I need to go away for work so can't tinker with it any more until the weekend.
Everything in that statemen should be true, except for "filterTable order"
There are often things that occur with addons that make no sense.

How I changed this part

Lua Code:
  1. for _, filter in ipairs(filters) do
  2.         if not qualityFilter(filter, displayQuality) then
  3. -- if this returns false then break and do not add the item, else check next filter. If the filter is added but disabled, it returns false and dose not add item.
  4. -- in other words if qualityFilter(filter, displayQuality) == false then
  5.             return false
  6.         end
  7.     end
If no filter returns false, then return true and add item.
return true

The idea behind this change is , if a filter passes but another is disabled or does not, then the item is not added. So, only false flitters will prevent an item from being added. Instead of checking for a single match as it did before.

I may have implemented this change incorrectly. The above is how it should work in theory.

Any disabled filter should return false and not add the item. if quality is not in range then it should return false and not add the item. I mean, a return is absolute. everything in shouldAddItem is stopped and the value is returned. At that point. do what it must for the reason shouldAddItem was called, and move on to next item.

Oh, I do ipairs the filterTable but, since I do not use the index I just hash it out.
for _, info in ipairs(filterTable) do
Report comment to moderator  
Reply With Quote
Unread 07/11/24, 08:02 AM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Originally Posted by IsJustaGhost
This is the true order of the qualityFilters. But, the order does not matter for this table.
Yes. Sorry, I agree with you: I can see that it shouldn't depend on how filterTable is ordered, because shouldAddItem is constructing its own local filters table.

But it does work if you change the filterTable order - and doesn't work if you don't

I can't see why that is at the moment (it's weird), and I need to go away for work so can't tinker with it any more until the weekend.
Last edited by Tiath : 07/11/24 at 08:19 AM.
Report comment to moderator  
Reply With Quote
Unread 07/11/24, 07:45 AM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
only one of these can be used per item
ornate, intricate, retraited and reconstructed
as it depends on what trait the item has.

If the trait exists on the item then, it adds that filter to the table.


Lua Code:
  1. local traitInformation = GetItemTraitInformation(bagId, slotIndex)
  2.     if qualityFilters[traitInformation] then
  3.         table.insert(filters, qualityFilters[traitInformation])
  4.     end

With that said..
As you can see, filterTable is not what is used to get the filter. That table is used to build the filters by "id" in
self.savedVars.traitOptions[info.id] = traitOption
and
qualityFilters[info.id]

Example qualityFilters["stolen"]
The only thing effected by table order...

This "ipairs"
Lua Code:
  1. for _, filter in ipairs(filters) do
  2.         if not qualityFilter(filter, displayQuality) then
  3.             return false
  4.         end
  5.     end
and that order is based no this order

Lua Code:
  1. if IsItemStolen(bagId, slotIndex) then
  2.         if savedVars.ignoreStolen then
  3.             return false
  4.         else
  5.             table.insert(filters, qualityFilters['stolen']) -- 1
  6.         end
  7.     end
  8.  
  9.     -- Quality filters.
  10.     local hasSet = GetItemLinkSetInfo(GetItemLink(bagId, slotIndex))
  11.     if hasSet then
  12.         table.insert(filters, qualityFilters['setItems']) -- 2
  13.     end
  14.    
  15.     local traitInformation = GetItemTraitInformation(bagId, slotIndex)
  16.     if qualityFilters[traitInformation] then
  17.         table.insert(filters, qualityFilters[traitInformation]) -- 3
  18.     end
  19.    
  20.     if ZO_IsTableEmpty(filters) then
  21.         table.insert(filters, qualityFilters['default']) -- 5
  22.     end
  23.     -- Depending on what ones are actually added.
  24.     -- if it's not stolen then 1 is setItems

This is the true order of the qualityFilters. But, the order does not matter for this table.
Lua Code:
  1. qualityFilters[1] = { -- ITEM_TRAIT_INFORMATION_INTRICATE == 1
  2.     name = GetString(SI_ITEMTRAITTYPE9),
  3.     id = ITEM_TRAIT_INFORMATION_INTRICATE,
  4. }
  5. qualityFilters[2] = { -- ITEM_TRAIT_INFORMATION_ORNATE == 2
  6.     name = GetString(SI_ITEMTRAITTYPE10),
  7.     id = ITEM_TRAIT_INFORMATION_ORNATE,
  8. }
  9. qualityFilters[3] = { -- ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED == 3
  10.     name = GetString('SI_ITEMTRAITINFORMATION', ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED),
  11.     id = ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED,
  12. }
  13. qualityFilters[4] = {-- ITEM_TRAIT_INFORMATION_RETRAITED == 4
  14.     name = GetString('SI_ITEMTRAITINFORMATION', ITEM_TRAIT_INFORMATION_RETRAITED),
  15.     id = ITEM_TRAIT_INFORMATION_RETRAITED,
  16. }
  17. qualityFilters[5] = { -- ITEM_TRAIT_INFORMATION_RECONSTRUCTED == 5
  18.     name = GetString('SI_ITEMTRAITINFORMATION', ITEM_TRAIT_INFORMATION_RECONSTRUCTED),
  19.     id = ITEM_TRAIT_INFORMATION_RECONSTRUCTED,
  20. }
  21. qualityFilters['default'] = { -- default
  22.     name = VAR_DEFAULT_STRING,
  23.     id = 'default',
  24. }
  25. qualityFilters['setItems'] = { -- setItems
  26.     name = GetString(SI_ITEM_SETS_BOOK_TITLE),
  27.     id = 'setItems',
  28. }
  29. qualityFilters['stolen'] = { -- stolen
  30.     name = GetString(SI_GAMEPAD_ITEM_STOLEN_LABEL),
  31.     id = 'stolen',
  32.     disabledCondition = function() return savedVars.ignoreStolen end,
  33. }
Those numbers, 1-5, can't be changed. As they mean something to the game.
Last edited by IsJustaGhost : 07/11/24 at 08:13 AM.
Report comment to moderator  
Reply With Quote
Unread 07/11/24, 06:01 AM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Originally Posted by IsJustaGhost
If you would like to test that.
This version of shouldAddItem works as expected (so far), if you also change filterTable to be in order of specificity:

i.e. ornate, intricate, retraited and reconstructed are mutually exclusive so their order isn't important, but the "bigger" filters that can have members that are also in other filters (e.g. a stolen set item that can be researched) should be ordered by increasing size at the bottom of the table: This allows shouldAddItem to make an exclusion decision based on the smaller, more specific, filter sets first.

Lua Code:
  1. local filterTable = {
  2.     { -- ITEM_TRAIT_INFORMATION_ORNATE
  3.         name = GetString(SI_ITEMTRAITTYPE10),
  4.         id = ITEM_TRAIT_INFORMATION_ORNATE,
  5.     },
  6.     { -- ITEM_TRAIT_INFORMATION_INTRICATE
  7.         name = GetString(SI_ITEMTRAITTYPE9),
  8.         id = ITEM_TRAIT_INFORMATION_INTRICATE,
  9.     },
  10.     { -- ITEM_TRAIT_INFORMATION_RETRAITED
  11.         name = GetString('SI_ITEMTRAITINFORMATION', ITEM_TRAIT_INFORMATION_RETRAITED),
  12.         id = ITEM_TRAIT_INFORMATION_RETRAITED,
  13.     },
  14.     { -- ITEM_TRAIT_INFORMATION_RECONSTRUCTED
  15.         name = GetString('SI_ITEMTRAITINFORMATION', ITEM_TRAIT_INFORMATION_RECONSTRUCTED),
  16.         id = ITEM_TRAIT_INFORMATION_RECONSTRUCTED,
  17.     },
  18.     { -- ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED
  19.         name = GetString('SI_ITEMTRAITINFORMATION', ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED),
  20.         id = ITEM_TRAIT_INFORMATION_CAN_BE_RESEARCHED,
  21.     },
  22.     { -- setItems
  23.         name = GetString(SI_ITEM_SETS_BOOK_TITLE),
  24.         id = 'setItems',
  25.     },
  26.     { -- stolen
  27.         name = GetString(SI_GAMEPAD_ITEM_STOLEN_LABEL),
  28.         id = 'stolen',
  29.         disabledCondition = function() return savedVars.ignoreStolen end,
  30.     },
  31.     { -- default
  32.         name = VAR_DEFAULT_STRING,
  33.         id = 'default',
  34.     },
  35. }
Report comment to moderator  
Reply With Quote
Unread 07/10/24, 11:18 PM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
Perhaps if I invert it and return false for first failed filter and return true by default

A disabled fitter would instantly return false. true false is add to list or not.

That may be just what's needed. I made the changes and tested it against my meager items and it's functionality had not changed. This means that inverting it did not seam to break it.

If you would like to test that.
Lua Code:
  1. local function shouldAddItem(bagId, slotIndex)
  2.     local filters = {}
  3.    
  4.     -- only need to run this onse per item
  5.     if IsItemBoPAndTradeable(bagId, slotIndex) then
  6.         return savedVars.ignoreTradeable
  7.     end
  8.    
  9.     -- Add relevent filters in order
  10.     if IsItemStolen(bagId, slotIndex) then
  11.         if savedVars.ignoreStolen then
  12.             return false
  13.         else
  14.             table.insert(filters, qualityFilters['stolen'])
  15.         end
  16.     end
  17.  
  18.     -- Quality filters.
  19.     local hasSet = GetItemLinkSetInfo(GetItemLink(bagId, slotIndex))
  20.     if hasSet then
  21.         table.insert(filters, qualityFilters['setItems'])
  22.     end
  23.    
  24.     local traitInformation = GetItemTraitInformation(bagId, slotIndex)
  25.     if qualityFilters[traitInformation] then
  26.         table.insert(filters, qualityFilters[traitInformation])
  27.     end
  28.    
  29.     if ZO_IsTableEmpty(filters) then
  30.         table.insert(filters, qualityFilters['default'])
  31.     end
  32.    
  33.     local displayQuality = GetItemDisplayQuality(bagId, slotIndex)
  34.    
  35.     for _, filter in ipairs(filters) do
  36.         -- first filter, in order of added, returns true, stop and add item.
  37.         if not filterItem(filter, displayQuality) then
  38.             return false
  39.         end
  40.     end
  41.     return true
  42. end
Last edited by IsJustaGhost : 07/10/24 at 11:36 PM.
Report comment to moderator  
Reply With Quote
Unread 07/10/24, 04:30 PM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Thanks for the patch


I've just spotted something else that seems counter-intuitive with 3.3.1 (and is probably a filter precedence issue).

If you have "Set items" ON but "Can research" OFF, set items that have traits which can be researched are included in Add All.

My expectation with those filter settings is that "Can research" takes precedence and set items which can also be researched would be excluded.
Report comment to moderator  
Reply With Quote
Unread 07/09/24, 07:56 PM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
Originally Posted by Tiath
Yes, that looks like it.

I replaced shouldAddItem with your new version and it's working as expected, both with the "Ignore stolen" toggle and the stolen quality filter.
If that's confirmed, then I'll go ahead and patch this.

Thank you for the assistance in improving this add-on.
Report comment to moderator  
Reply With Quote
Unread 07/09/24, 04:22 PM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Originally Posted by IsJustaGhost
The issue is likely because of this.
Lua Code:
  1. if ZO_IsTableEmpty(filters) then
  2.     table.insert(filters, qualityFilters['default'])
  3. end
Yes, that looks like it.

I replaced shouldAddItem with your new version and it's working as expected, both with the "Ignore stolen" toggle and the stolen quality filter.
Report comment to moderator  
Reply With Quote
Unread 07/09/24, 01:37 PM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
The issue is likely because of this.
Lua Code:
  1. local function shouldAddItem(bagId, slotIndex)
  2.     local filters = {}
  3.    
  4.     -- Add relevent filters in order
  5.     if IsItemStolen(bagId, slotIndex) then
  6. -- Changing the flat stolen check like this then.  If it's enabled, then stop here and deny the item.
  7.         if savedVars.ignoreStolen then
  8.             return false
  9.         end
  10.         table.insert(filters, qualityFilters['stolen'])
  11.     end
  12.  
  13.     local hasSet = GetItemLinkSetInfo(GetItemLink(bagId, slotIndex))
  14.     if hasSet then
  15.         table.insert(filters, qualityFilters['setItems'])
  16.     end
  17.    
  18.     local traitInformation = GetItemTraitInformation(bagId, slotIndex)
  19.     if qualityFilters[traitInformation] then
  20.         table.insert(filters, qualityFilters[traitInformation])
  21.     end
  22.    
  23.     table.insert(filters, qualityFilters['default'])

It's adding default with no conditions.
I'll try with
Lua Code:
  1. if ZO_IsTableEmpty(filters) then
  2.     table.insert(filters, qualityFilters['default'])
  3. end
That way it only adds it if no other filter is added.
Id default is not added with other filters, it should stop disabled filters from returning false positives.

The complete function

Lua Code:
  1. local function shouldAddItem(bagId, slotIndex)
  2.     local filters = {}
  3.    
  4.     -- Add relevent filters in order
  5.     if IsItemStolen(bagId, slotIndex) then
  6.         if savedVars.ignoreStolen then return false end
  7.         table.insert(filters, qualityFilters['stolen'])
  8.     end
  9.  
  10.     local hasSet = GetItemLinkSetInfo(GetItemLink(bagId, slotIndex))
  11.     if hasSet then
  12.         table.insert(filters, qualityFilters['setItems'])
  13.     end
  14.    
  15.     local traitInformation = GetItemTraitInformation(bagId, slotIndex)
  16.     if qualityFilters[traitInformation] then
  17.         table.insert(filters, qualityFilters[traitInformation])
  18.     end
  19.    
  20.     if ZO_IsTableEmpty(filters) then
  21.         table.insert(filters, qualityFilters['default'])
  22.     end
  23.    
  24.     local displayQuality = GetItemDisplayQuality(bagId, slotIndex)
  25.    
  26.     for _, filter in ipairs(filters) do
  27.         if filter:IsEnabled() and not filter:IgnoreTradeable(bagId, slotIndex) and defaultQualityFilter(filter, displayQuality) then
  28.             return true
  29.         end
  30.     end
  31.     return false
  32. end
Can just be coppied and pasted in under the current one. Everything is read from top down and, since the function already exists, it is replaced by the lower one.

"default" should only work on things that are crafted for decon. No traits, no set item. Just plain axe or whatever..
Report comment to moderator  
Reply With Quote
Unread 07/09/24, 11:16 AM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Originally Posted by IsJustaGhost
I added those options.
I was not able to fully test it, however. The ability to have every deconstruct able item in every quality and in every trait and, now, stolen and not, is way beyond me.
But, I tested it for general errors and basic functionality. If anything else comes up, just let me know and I'll do what I can.
I understand it's a massive undertaking to extensively test all combinations.

Something weird is happening with the filters, though... maybe a boolean double-negative somewhere (I'd offer to help poke around under the hood but don't know the API and haven't written any Lua in ~20 years )

I've submitted a bug report for you.

It's not the end of the world if you need to revert, though: The downside is only having to be more selective when out in the field or going to visit a fence first.
Report comment to moderator  
Reply With Quote
Unread 07/09/24, 07:48 AM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
Originally Posted by Tiath
Generally, if you're optimising, you want to launder stolen items before deconstructing: You get less materials and inspiration back from deconstructing items while they're still flagged as stolen.

My preference would be to add a general "Ignore stolen items" like you already have for group tradeable items.
I added those options.
I was not able to fully test it, however. The ability to have every deconstruct able item in every quality and in every trait and, now, stolen and not, is way beyond me.
But, I tested it for general errors and basic functionality. If anything else comes up, just let me know and I'll do what I can.
Last edited by IsJustaGhost : 07/09/24 at 07:49 AM.
Report comment to moderator  
Reply With Quote
Unread 07/09/24, 04:27 AM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
Originally Posted by Tiath
Generally, if you're optimising, you want to launder stolen items before deconstructing: You get less materials and inspiration back from deconstructing items while they're still flagged as stolen.

My preference would be to add a general "Ignore stolen items" like you already have for group tradeable items.
I'm back to it.
For now, what I'm going to do is include the 2 options.
The 1 will cancel out the other.
If ignoreStolen is enabled. the stolen quality filter will be disabled. If the stolen quality filter is enabled...
At least, that is my intent for now.
Report comment to moderator  
Reply With Quote
Unread 07/07/24, 07:29 AM  
Tiath

Forum posts: 0
File comments: 8
Uploads: 0
Generally, if you're optimising, you want to launder stolen items before deconstructing: You get less materials and inspiration back from deconstructing items while they're still flagged as stolen.

My preference would be to add a general "Ignore stolen items" like you already have for group tradeable items.
Report comment to moderator  
Reply With Quote
Unread 07/07/24, 04:49 AM  
IsJustaGhost
AddOn Author - Click to view AddOns

Forum posts: 39
File comments: 327
Uploads: 23
Re: Can we have a filter for Stolen Items?

Originally Posted by Tiath
Can we have a filter that ignores stolen items from "Add All"?

I'd prefer to launder or sell them to a fence, rather than have them swept up in deconstruction.
Right. I'll look into adding that.
On that note, any other suggestions?

One way I can do this is, add a filter for stolen to all filters. With a single check box option to ignore stolen.

Or, I can work on adding an ignore stolen per quality filter.

Or, it can be add as a quality filter for stolen. If the item is between this level and that level then allow it to be added.
Last edited by IsJustaGhost : 07/07/24 at 05:43 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: