Thread Tools Display Modes
Prev Previous Post   Next Post Next
08/10/14, 01:19 PM   #1
Maverick827
Join Date: Aug 2014
Posts: 6
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= {}

TestAddon.name = "TestAddon"
	
function TestAddon:Initialize()
  EVENT_MANAGER:RegisterForEvent(self.name, EVENT_OPEN_TRADING_HOUSE, self.TradingHouseOpened)
end

function TestAddon.TradingHouseOpened(eventCode)
	d("Opened")
	SetTradingHouseFilterRange(TRADING_HOUSE_FILTER_TYPE_LEVEL, 11, 12)
	d("Filter set")
end

function TestAddon.OnAddOnLoaded(event, addonName)
	if addonName == TestAddon.name then
		TestAddon:Initialize()
	end
end

EVENT_MANAGER:RegisterForEvent(TestAddon.name, EVENT_ADD_ON_LOADED, TestAddon.OnAddOnLoaded)
"Opened" and "Filter set" both print out, no errors are generated.
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Save Guild Store Filter


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