Thread Tools Display Modes
10/09/22, 06:18 AM   #1
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
Perform Trading House Search

Hi there,

I am trying to start a tradinghouse search after I "setText" the searchtext. As you can see below (the screenshot) the setText part is allready working. Now I just want to trigger the function "behind" the Start Search button.
I studied the tradinghouse lua files (and the xmls). The tradinghouse_shared.lua seams not to be easy But thats more for addons who want to be a new tradinghouse

Is there a possiblity to just start the search?

Thanks in advance!

  Reply With Quote
10/09/22, 10:23 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,973
Maybe this is the one function that the keybind calls? Check for the "Search" keybind what it does and what function it calls!
A good way to find it is to check the SI_* string constants via e.g. merTrochbug updated addon, type /tbug and switch to the Strings tab, the search for trading house or anything like the text shown at the trading house search starter keybind (e.g. "search" or "Start search") and in the results for anything like SI_TRADING_HOUSE* or similar.

Some of the SI constants can be found here
https://raw.githubusercontent.com/es...tedstrings.lua
too.

-> "Start Search", -- SI_TRADING_HOUSE_DO_SEARCH
looks promising!

If you have found the SI_* string constant you can search the esoui source code for it
https://github.com/esoui/esoui/searc...OUSE_DO_SEARCH
to find where the keybind might be defined, and that way you will find the callback function called by that keybind, which should be the "start the search now" function.

https://github.com/esoui/esoui/blob/...board.lua#L113

Code:
TRADING_HOUSE_SEARCH:DoSearch()

Last edited by Baertram : 10/09/22 at 10:34 AM.
  Reply With Quote
10/09/22, 11:05 AM   #3
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
Thanks, i tried to search for the text before too and just found some places where the global var was used.
I did it again and I also found:

self.browseKeybindStripDescriptor =
{
alignment = KEYBIND_STRIP_ALIGN_CENTER,

-- Do Search
{
keybind = "UI_SHORTCUT_SECONDARY",
name = GetString(SI_TRADING_HOUSE_DO_SEARCH),

callback = function()
TRADING_HOUSE_SEARCHoSearch()
end,
},

the TRADING_HOUSE_SEARCHoSearch() did it. I not really good familar with callbacks. Thats why I did not found it in the first place

Thanks!
  Reply With Quote
10/09/22, 11:10 AM   #4
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
oh and good tip for the addon... have zgoo allready but this one was missind.. very helpful
  Reply With Quote
10/09/22, 12:12 PM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,973
The callback is the function called as you do something. At a keybind there is only one callback for "pressing the keybind".
At a dialog there could be a cancelCallback if you cancel the dialog and the other callback is for each dialog button (e.g. yes, no, etc.).
Event got a callback function too as the event fires, e.g. you loot an item -> register event to INVENTORY_SINGLE_SLOT_UPDATE -> your callback func registered for that event is called. Same for your starter event of the addon: EVENT_ADD_ON_LOADED -> your registered callback func fires -> your check if it was your addon that was loaded -> unregister the event callback again and call the needed code for your addon.
  Reply With Quote
10/09/22, 02:36 PM   #6
rp12439_3
AddOn Author - Click to view addons
Join Date: Jun 2021
Posts: 45
just for the search:

TRADING_HOUSE:SearchForItemLink(itemLink)

did the trick. With all filters set correctly and so on
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Perform Trading House Search


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