Peddler (Junk seller)

Peddler (Junk seller)

196k Downloads

API event for updated junk status (to support any bag addon wanting to add support)

plusmouse opened this issue ยท 3 comments

commented

I work on Baganator, and have attempted to add Peddler support based on the exposed APIs on classic.

This works, mostly, except when a user toggles the junk status of an item the junk icon doesn't update, Baganator/Baganator#75 - this is because I couldn't find an event/hook for when the junk status updates to cause the Baganator view to refresh with the updated data.

Can you add an event/callback/exposed function to hook so that Baganator can detect when the junk status of an item is updated?

Alternatively adding support for Baganator inside Peddler would work too (I can provide documentation of the APIs. My current implementation of support is found here: https://github.com/Baganator/Baganator/blob/main/API/Junk.lua#L5-L15

commented

Also, can you expose the same API on retail (or implement Baganator support) so that Peddler support works there too?

commented

Hi old chap!

Apologies for the delay - not subbed to WoW for quite some time. I did actually just add Baganator support to Peddler (in Retail, as I can freely play til lvl 20!). Is that good enough, do you think?

Not sure that my Lua & WoW API skills are up to the task for adding an externally accessible API - or do you think that's easy enough to add?

commented

With your implementation its vulnerable to Baganator re-rendering the display and rearranging the item buttons in the categories view. Baganator has an API for adding corner widgets: https://github.com/Baganator/Baganator/wiki/RegisterCornerWidget-API-Documentation - which will handle the refreshing correctly for you.

Adding an external API isn't too difficult. You need to make 2 functions available globally, one that takes a callback to be called when Peddler has a new item marked as junk by a user, and another to check if a given item location is junk.