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:
Now we have a multitude of scattered fixes:
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? |
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 |
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:
Although now that I'm thinking about it. I might as well add it to FilterIt. |
btw how to filter bound items in your deposit tab when at the guild bank?
you cant deposit em anyway |
Quote:
|
Quote:
|
One thing I just thought of though:
Lua Code:
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:
|
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. |
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:
|
@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. |
Quote:
|
@merlight of course you can add code to watch out for a specific addon, but I always try to achieve compatibility in a generic way that can be reused by new addons in the future
Maybe you can make a small library instead of everyone making their own version? That way you don't have to do anything special to make it work between your addons. |
Quote:
Example Lib:
Warning: Spoiler
Then for an addon like AGS that doesn't want to use those bars you could check to see if the flag is set & if not set it and use your bars. One other problem, if we use a library, it will pretty much be whichever addon loads first wins without giving the user an option to select which bars to use, unless someone has a suggestion on how to handle that part. |
Quote:
|
Quote:
No matter what though there is going to be an unsolvable conflict if the user chooses to show the menu bars for multiple addons...although ??? would it be a good thing to allow it? Yes it would be a mess several menu bars showing, but it would help the user figure out whats wrong rather than wondering why xxx addons menu bars aren't visible and some other menu bars are. How about instead of using a lib function to "block" the default inventory menu bars create a function that must be called to enable the defualt menu bars. This way each addon can handle its own code & not worry about any other addon. Each addon would be required only to have a setting that would allow users to turn the given addons menu bars ON/OFF.
If a user turns on menu bars from multiple addons then they just need to turn some of them off in the settings. |
Actually forget that last post....I have a better idea.
How about we create a settings menu panel just for the menu bars. Register the panel with LibAddonMenu just like its an addon and only have 1 setting, which menu bars to display. Each addon could call something like: Lua Code:
The callback would be nillable and any addon wanting the default menu bars could just pass nill for the callback and then the library could just handle that code on its own. FilterIt does not have filters for the browse category in the trade house. I know AGS does, do any other addons? While were at it we might as well add a register function for that as well. They should be separate registrations so that, for example, A user could choose to display the FilterIt menu bars for the sell tab, but still have the AGS filters on the browse tab. |
I think a dedicated settings menu is over-complicating it a bit.
If I understood it correctly, we currently have two different sell tab bars. My AGS custom bar and the default ingame bar. You are trying to activate the ingame bar through the code posted by merlight in 3 separate addons. If a user has more than one of these the other two do not need to run the same code to activate the ingame bar again, so I said we could put it in a library because it will only load once by design. The only problem left is to handle if a user has the AGS bar running, which I would solve by including the library too and offering a setting in AGS. If it is set to show the my bar, I will call a method on the library to deactivate its functionality and call my own code. If it is set to off, I won't do anything and the library will work normally. Unless you have plans to make a custom sell tab bar this should be all that is necessary. |
Quote:
Quote:
Quote:
Lua Code:
Quote:
|
Ah. Sorry. I was somehow thinking that he had some code in his initial post. :o
|
I'll try to better explain my thought process. I'll post the "libCommonInventoryFilters" later today.
Currently on the SELL tab we either have no filters (because the basic UI hides them), or custom AGS filters. AGS doesn't need to worry about conflicts, it just fills empty space. If another add-on wanted to put its own custom filters there, it would have to talk to AGS, or they would both need a toggle -- similar to how numerous combat add-ons have a toggle for every feature, and people mix them up in the most unimaginable ways. The idea of a centralized "pick one" setting is interesting, but it seems overkill for what we currently have. Perhaps if there were many contestants, but I doubt that will happen. So, I wanted the default filters on the SELL tab, when AGS is not there. With AGS I don't really care, as long as there's exactly one set of filters :) The library says: "If you load me, I'm going to put filters on the SELL tab, unless you intend to put something better in there, in which case you need to explicitly tell me!" (does that make sense?) You may have 3 add-ons wanting to put their controls in there, the library doesn't care how they get along, it just won't interfere if at least one of them tells it not to. AF can include the library and do nothing else, it will just work. FilterIt can include it and it will almost work (I just need to figure out why it's wrongly anchored). AGS can include it, but must also call libCIF:disableGuildStoreSellFilters() in its EVENT_ADD_ON_LOADED, otherwise both sets would show up and overlap. It doesn't need to have a toggle, it can simply prefer its own filters. --- Now the difficult part: the search box. When filters are enabled on the SELL tab, there's no room for it. AF moves the search box to the top, above filters. Which kinda makes sense, since the search persists as you switch filters. Btw, AF shows the search box on startup only, if you open/close the guild store, it won't appear in inventory/bank again. But don't worry, libCIF solves that, too. AGS moves the search box below its filters on EVENT_OPEN_TRADING_HOUSE, and moves it back to the original location on EVENT_CLOSE_TRADING_HOUSE. This will probably need to be changed. I don't know when exactly these events occur, but if the CLOSE happens after SCENE_HIDING, I'd need to find a way to run another move function after that. But as with AF the search persists while switching filters, it'd probably be best to move it to the top. FilterIt enables the search box, but uses it differently. It only works on the generic ALL filter, other top-level filters and sub-filters don't have a search box. Which means in the case of FilterIt, having the search box down there next to sub-filters actually makes sense. So I added libCIF:disableSearchBoxes(), which prevents the lib from showing search boxes and moving them to the top. Now I'm trying to figure out how to make FilterIt look nice on the SELL tab. --- And because adding filters forced me to play with the search box, the lib (by default) also moves search boxes to the AF location, and contains circonian's bug fixes as a bonus. |
I've done some tests combining libCommonInventoryFilters with the following:
Here's what I changed in AwesomeGuildStore: diff Code:
diff Code:
And here's what I changed in FilterIt: diff Code:
Note: changing the divider's parent to ZO_PlayerInventoryTabs prevents it from showing in the guild store sell tab when it shouldn't (i.e. with AGS enabled). |
This code is unnecessary:
Warning: Spoiler
Those columns are already hidden. If your seeing them then some other addon is messing it up:
Warning: Spoiler
Bug? Or are you only counting on me to call this function in FilterIt? Lua Code:
Are we sure these items you left out aren't needed anywhere else? I know that currentFilter = TradingHouseFilter is used in ShouldAddSlotToList(..) to filter out bound items...although we are breaking that by allowing the menu bar to be shown & buttons to be clicked (yes we also fixed it by adding to the additional filter to hide bound items), but are we sure its not also needed somewhere else? What about code we don't have access to?
Warning: Spoiler
This may be trivial, but by leaving those out it prevents code from knowing which btn was previously selected & returning to it. By saving the current filter, then reloading it, & then calling ZO_MenuBar_SelectDescriptor(inventory.filterBar, inventory.currentFilter) It returns the menu bar to its previously selected descriptor. |
Quote:
Lua Code:
|
Hiding those columns is necessary, because this line in inventory.lua
Lua Code:
My override of SetTradingHouseModeEnabled doesn't switch to TradingHouseFilter, it leaves the buttons shown (that's also why I had to add not IsBound to additionalFilter, because that was done by the now-unused TradingHouseFilter). After I did this, those columns showed up, because hiddenColumns are tied to buttons. I wasn't sure about the "statValue" column, but the "age" column really doesn't fit in the SELL tab, that's why I've overridden GetTabFilterInfo. --- libCIF._backpackLayoutShiftY -- since I haven't initialized it explicitly, and calling addBackpackLayoutShiftY is not required, it could be nil. It was a not-so-important choice where to apply laziness. --- ZO_MenuBar_SelectDescriptor -- yes you're right. I too was wondering why swapping previousFilter/currentFilter in the original SetTradingHouseModeEnabled doesn't seem to work, I put some debug output in and found the filter was being reset before it had a hance to be remembered :) --- Anyway, I forgot to add that if you guys decide to use the library, please wait until AGS is ready for it. The search box location must be sorted out first. Perhaps it would suffice if AGS didn't move the search box and just let the lib do it. I'm going to test, but tonight we've got troube with electricity due to a windstorm, can't run ESO on battery :D |
Quote:
Quote:
|
I don't mind if the library handles the searchbox.
The only reason I put it into that place was because some time ago the text filter on the searchtab was also in a similar location. Since I put that one into the filter bar like all the others, there is not really a reason to keep it there. I will try to implement the necessary changes tomorrow. |
Quote:
|
I removed the code that reanchors the search box from AGS, but the library does not move it when I call the disable call. Can you change that, or should I look into it myself?
|
You probably have another add-on moving it then. For me the search box is right beneath the top-most horizontal divider by default, I checked the anchor in Zgoo and it's the one from xml <Anchor point="TOPRIGHT" offsetX="-26" offsetY="68" />
Anyway, don't call libCIF:disableSearchBoxes() from AGS. It's there for FilterIt, which has its own handling. edit: Ah ok, now I'm staring at my instance of your picture. Ok I need to figure out how it got there :D edit2: I think it's the layout offsets. I just need to crunch some numbers. |
I edited the diff for AGS above. The original BACKPACK_TRADING_HOUSE_LAYOUT_FRAGMENT had inventoryTopOffsetY == -20, the default. In libCIF it is set to 45, the value other layouts use. So I added that to your BASIC and ADVANCED layouts, and moved the other two offsets (which are relative to the Top), 65 units up.
There's still an issue with AGS+FilterIt, where the search box remains in "FilterIt location". |
Quote:
Lua Code:
|
Quote:
|
I didn't add it yet. I was waiting for this discussion to finish. Just post here when everything is straightened out & I'll add it to FilterIt.
|
Quote:
It looks like we need something like this to move the search box anchor for AGS and move it back when the trading house (AGS) is done with it:
Warning: Spoiler
Does the search box need to be hidden when AGS is done with it & the trading house closes? Is it supposed to remain visible on other layouts if the user is only using AGS & not FilterIt or Advanced Filters? |
Quote:
FilterIt has added filters to the sell tab after libCIF was conceived, and that might actually solve everything. Basically if the user disables AGS custom sell filters in its settings, and you make the change to FilterIt I posted earlier (addBackpackLayoutShiftY and disableSearchBoxes; edit: and disableGuildStoreSellFilters, because you want FilterIt there, right?), it should be ok. I think you don't even have to include the lib in FilterIt, just try to get it with LibStub.SILENT, and only call those functions if it's there; but perhaps it'll be less error-prone if you include it. |
Here's my current diff against FilterIt 2.9
diff Code:
diff Code:
It works regardless of AGS setting "disable custom selltab filter". Although with that setting OFF, the search box slightly overlaps subfilters or items, because it's at FilterIt position. But once you turn it ON, FilterIt shows up on the sell tab, and it looks good. |
Quote:
Yes it is OK for me, I'm thinking of the problem it is causing AGS when both addons are turned on the search box location is wrong for AGS in the trading house. Quote:
Quote:
Quote:
Then restore the original search box position when the trading house becomes disabled and the disableGuildStoreSellFilters is ON (because that means we previously moved the search box for AGS when the trading house became enabled). That way the search box would be in the correct position at all times for everyone. |
Quote:
Quote:
|
Yet another issue with the search box. I added saving/restoring the anchor, enabled AGS custom filters and FilterIt -- and everytime I click an AGS (sub)filter, the search box is cleared. It's all so intertwined :D
|
Quote:
I'm actually surprised the search box isn't getting hidden when using AGS and switching off of the "ALL" tab because FilterIt hides the searchBox. He must have code somewhere else un-hiding it. |
The only thing I can think of is you could add something like this so I know when AGS has taken over & my filters are not going to be used in the Trading House:
Lua Code:
and then I could add this in FilterIt_MenuBars.lua: Lua Code:
|
It appears that InvTabSwitch in FilterIt_MenuBars.lua gets called twice per click on AGS filter, always with ITEMFILTERTYPE_ALL. How about removing the :Clear from the else (filter==ALL) branch? I think clearing is only necessary when you're hiding the box.
|
Quote:
Quote:
|
I've pushed libCIF version 1.1 on github
Quote:
|
thing is i like AGS search box ar the Trade house
but they must be disabled at the other scenes like inventory, and we will see FilterIt search box there, etc |
Quote:
|
Quote:
ofc i tried there is no way to change AGS search field from inventory/bank etc for search field from FilterIt without disabling AGS completely |
Quote:
|
Quote:
also in the guildbank too, thanks to the Circonian fix addon :) |
All times are GMT -6. The time now is 02:16 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI