Save Guild Store Filter
I'm looking into making a small addon that saves your search filter between guild store kiosks if possible (unless something already does this, please let me know).
Ideally all that it would need to do would be to save the filter values when you close a guild store and then load them when you open a guild store. Looking at the list of functions, I see that SetTradingHouseFilter and SetTradingHouseFilterRange might be what I need to set the values, but I see no Getter for the current filters. Did they just not provide a Getter? Why would they leave this out? If it doesn't exist, can I accomplish getting the values another way? It wouldn't be as great of a UX, but if I can't get the values, I could always provide a GUI for the user to save sets of filters and load them. But that brings me to the next point... I can't even seem to get either of the setters to work. I have an event set up that calls those methods on the EVENT_OPEN_TRADING_HOUSE, but the GUI does not register the values in the drop downs/text boxes/etc. Is it "too late" to try to set them on that event, e.g. the window is already opened so I can't change the component values? If so, when can I set them? I'm not getting any errors, there's just no result to the method call. Code:
TestAddon= {} |
Asuming you cannot get the current filters (wich seems likely), there is an alternative:
Make extra UI elements (a small window plus Elements mirroring the search Filter). At any time the user can choose to apply those settings to the search store filters. This would also allow you to save different "sets" of parameters and persist them in saved variables between sessions. Just getting all those traits (and thier localised names) could be tricky. I look if libCosntantMapper could get you the data you need for the filters. Edit: Seems to be one straightfoward enumeration at least for the types of filter to be used: TRADING_HOUSE_FILTER_TYPE_ARMOR = 3 TRADING_HOUSE_FILTER_TYPE_ENCHANTMENT = 9 TRADING_HOUSE_FILTER_TYPE_EQUIP = 0 TRADING_HOUSE_FILTER_TYPE_ITEM = 1 TRADING_HOUSE_FILTER_TYPE_LEVEL = 6 TRADING_HOUSE_FILTER_TYPE_PRICE = 7 TRADING_HOUSE_FILTER_TYPE_QUALITY = 5 TRADING_HOUSE_FILTER_TYPE_TRAIT = 4 TRADING_HOUSE_FILTER_TYPE_VETERAN_LEVEL = 8 TRADING_HOUSE_FILTER_TYPE_WEAPON = 2 |
Quote:
Lua Code:
Their SceneStateChange resets all controls on SCENE_HIDDEN, so you'd probably need to save their state on SCENE_HIDING, and restore on SCENE_SHOWING. Here are the controls that get reset. I'd start with price, level and quality, and if it works, dig into categories. Lua Code:
|
Just an untested idea - when you close trading house window, all filters gets reset using the TRADING_HOUSE:ResetAllSearchData() function.
As you want to keep old filters, what about hooking this function that it will not reset filters? Something like: Lua Code:
|
Quote:
Thanks to everyone for the help. |
So is this going to be a downloadable addon? Woud love it!
If not can anyone post the final code now so I can use it too? |
I started making an addon that will provide exactly that functionality and much more as I use the guild store a lot more often since 1.3 and am very disappointed with the default interface.
I'll see if I can upload something today. |
Quote:
|
Here it is: AwesomeGuildStore
I do have plans to add more advanced stuff, but I don't plan to turn it into something unmanageable... |
All times are GMT -6. The time now is 09:00 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI