Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
plusmouse opened this issue Apr 28, 2024 · 3 comments

Comments

@plusmouse
Copy link

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

@plusmouse
Copy link
Author

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

@Cartas
Copy link
Owner

Cartas commented Jul 30, 2024

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?

@plusmouse
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants