Thread Tools Display Modes
07/20/15, 10:23 AM   #1
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Inventory search boxes & guild store sell tab filters

The basic UI deliberately hides either the filters (guild store sell tab), or the search box (everywhere else). It's not a bug, it's just a feature that doesn't make any sense.

Then there are search box bugs circonian discovered. I guess #2 and #3 are normally hidden because the search box is hidden.

Fun comment from ingame/inventory/inventory.xml
Lua Code:
  1. <!-- not dead, but dreaming... -->
  2. <EditBox name="$(parent)SearchBox"

Now we have a multitude of scattered fixes:
  • AdvancedFilters -- shows+moves search boxes and fixes bug #2
  • AwesomeGuildStore -- adds its own filters to guild store sell tab
  • Circonian's FilterIt -- shows search boxes and fixes bugs
  • Votan's Search Box -- shows+moves+decorates search boxes

Please fill in what I got wrong or missing, out of these add-ons I only use AdvancedFilters, and am so used to it that I sometimes can't tell what's the default behavior.

For me the most annoying part is missing filters at the guild store sell tab. And that's coming from someone who only sells common racial motifs when he finds some, or small stacks of green improvement mats. Like twice a month. It's been even more frustrating since (many months ago) I somehow bugged it in such a way that sometimes the filters were there.

Yesterday I managed to make the default filters show up on the sell tab with very little code, and AdvancedFilters simply work there with no additional changes.

Now I have a dilemma: to fix or not to fix. It's not a bug, but so inherently broken that I want it fixed But I will have to check the presence of AwesomeGuildStore at least, as I don't want to screw other add-ons. Are there any other?
  Reply With Quote
07/20/15, 01:34 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
The last time I tried to activate the default sell tab filters for the guild store, I got consistent crashes. It was easier to roll my own version in AGS than to debug the ingame ui code because I already had them made for the search tab.
I won't remove them from AGS, but I can add a setting to disable them if you want to offer a different addon that allows AF to work on the sell tab. Keep in mind that the AGS version of the filters hides items that cannot be sold on the store in addition to filtering categories and uses the same icons as on the search tab though so I don't see any reason to not use them. :P
  Reply With Quote
07/20/15, 02:25 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
That was something I said I was going to add to FilterIt a long time ago, but never did.
As you said it takes very little code:
EDIT 1: I forgot to hide the quest filter, added.
EDIT 2: Heres one for you...I just realized the trading house additional filter does NOT filter out bound items? Might as well fix that too.
Removed EDIT 2. I just realized it will mess up the filtering libraries for the trading house.
Lua Code:
  1. local function InitTradingHouseLayout()
  2.     BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData.inventoryTopOffsetY = 43  
  3.     BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData.hiddenFilters = { [ITEMFILTERTYPE_QUEST] = true }
  4. end
  5.  
  6. local origSetTradingHouseMode = ZO_InventoryManager.SetTradingHouseModeEnabled
  7. function ZO_InventoryManager:SetTradingHouseModeEnabled(enabled)
  8.     origSetTradingHouseMode(self, enabled)
  9.     ZO_PlayerInventoryTabs:SetHidden(false)
  10. end

Although now that I'm thinking about it. I might as well add it to FilterIt.

Last edited by circonian : 07/20/15 at 05:31 PM.
  Reply With Quote
07/20/15, 02:43 PM   #4
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
btw how to filter bound items in your deposit tab when at the guild bank?
you cant deposit em anyway
  Reply With Quote
07/20/15, 02:51 PM   #5
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by QuadroTony View Post
btw how to filter bound items in your deposit tab when at the guild bank?
you cant deposit em anyway
https://github.com/Randactyl/HideBoundItems
  Reply With Quote
07/20/15, 03:09 PM   #6
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Originally Posted by sirinsidiator View Post
Keep in mind that the AGS version of the filters hides items that cannot be sold on the store in addition to filtering categories and uses the same icons as on the search tab though so I don't see any reason to not use them. :P
Neither do I. I've been putting off fixing up AF to make guild selling behave because I always just recommend downloading AGS. However, now that circonian has shown how easy it is to make it work, I may go ahead and do something just for completeness.
  Reply With Quote
07/20/15, 03:26 PM   #7
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
One thing I just thought of though:
Lua Code:
  1. BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData.additionalFilter = function (slot)
  2.             return (slot.quality ~= ITEM_QUALITY_TRASH) and (not slot.stolen) and (not IsItemBound(slot.bagId, slot.slotIndex))
  3.         end
That was a bad idea, don't use it.
It will mess up addons using either of the filtering libraries for the trading house if the library gets loaded first & sets the additional filter and then some other addon changes it. That could of course be fixed, by saving the original additional filter & calling it with the new function, but you'de never be able to remove the changes. Although would that be necessary? Do you ever need to see bound items...well I guess it would be ok.
Lua Code:
  1. local origAdditionalFilter = BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData.additionalFilter
  2. BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData.additionalFilter = function (slot)
  3.             return origAdditionalFilter(slot) and (not IsItemBound(slot.bagId, slot.slotIndex))
  4.         end

Last edited by circonian : 07/20/15 at 05:15 PM.
  Reply With Quote
07/20/15, 03:29 PM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
Okay. In this case I suggest everyone adds a setting to disable it and on updating the addon checks if there is already another addon running that offers this feature.
Instead of checking for specific addons we could set a flag on BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData. The first to set it stays active, all the others deactivate themselves until the user activates them again and reloads the UI. That way there should not be any conflicts and the user can decide which version he prefers.
  Reply With Quote
07/20/15, 04:59 PM   #9
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
How about sellFiltersEnabled
I would also recommend then no one hooks SetTradingHouseModeEnabled like I suggested. No reason for every addon to be hooking into that if their not even going to use it.
Switched to prehook the HandleTabSwitch(...) that way only the addon who is handling the sell filters will need to set a hook.
Lua Code:
  1. local function InitTradingHouseLayout()
  2.     local layoutData = BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT.layoutData
  3.     local sellFiltersEnabled = layoutData.sellFiltersEnabled
  4.     -- Check if someone has already enabled it:
  5.     if sellFiltersEnabled then return end
  6.    
  7.     -- Check if its turned on in my addon:
  8.     if not MY_ADDON_SETTING_ON then return end
  9.    
  10.     -- Set flag:
  11.     layoutData.sellFiltersEnabled = true
  12.    
  13.     -- Set the new layoutData:
  14.     layoutData.inventoryTopOffsetY = 43
  15.     layoutData.hiddenFilters = { [ITEMFILTERTYPE_QUEST] = true }  
  16.     local origAdditionalFilter = layoutData.additionalFilter
  17.     layoutData.additionalFilter = function (slot)
  18.                 return origAdditionalFilter(slot) and (not IsItemBound(slot.bagId, slot.slotIndex))
  19.             end
  20.    
  21.     -- Prehook HandleTabSwitch for sell mode:
  22.     local function OnHandleTabSwitch(self, tabData)
  23.         local mode = tabData.descriptor
  24.        
  25.         if mode == ZO_TRADING_HOUSE_MODE_SELL then
  26.             ZO_PlayerInventoryTabs:SetHidden(false)
  27.         end
  28.         return false
  29.     end
  30.     ZO_PreHook(TRADING_HOUSE, "HandleTabSwitch", OnHandleTabSwitch)
  31. end

Last edited by circonian : 07/20/15 at 05:15 PM.
  Reply With Quote
07/20/15, 05:08 PM   #10
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
@circonian: I have the code, including bound items filtering and hiding statValue column, I just need to make sure it doesn't break other add-ons. I'm a little off-focus now, hopefully I can test later this week.

@sirinsidiator: I'm not a fan of unnecessary toggles, keep it simple for users. And yourself as well. Guild store scene seems to be AwesomeGuildStore's domain, I can easily check for its presence and skip tackling with it.
  Reply With Quote
07/20/15, 05:31 PM   #11
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
Guild store scene seems to be AwesomeGuildStore's domain, I can easily check for its presence and skip tackling with it.
I agree, that would be the best method. If they want to use AGS they might as well use those filters and as you said it will keep it simple. AGS is actually the reason I never added this feature, but now I figure it might as well for those that dont use it.
  Reply With Quote
07/28/15, 07:40 PM   #12
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
Fun comment from ingame/inventory/inventory.xml
Lua Code:
  1. <!-- not dead, but dreaming... -->
  2. <EditBox name="$(parent)SearchBox"
lol hadn't seen this one before: libraries/globals/debugutils.lua
Lua Code:
  1. -- Because typing is painful.
  2. e = ZO_Debug_EventNotification
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Inventory search boxes & guild store sell tab filters


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off