Tracking currency updates
So, I am trying to track couple of currencies (money, order resources, etc.) when there is an update (either gain or loss).
I guess money could be easily tracked via PLAYER_MONEY event, but still ain't sure of other currencies. According to the description on Wowpedia, CURRENCY_DISPLAY_UPDATE event fires 'every time the UI need to draw the currencies list' and I'm not quite sure of which UI it is referring to. CHAT_MSG_CURRENCY seems to handle gain, but not too sure about loss. (Never seen a message on loss) What could be the best possible solution, here? |
Quote:
That said, in my own currency addon I just hook (non-intrusively with hooksecurefunc) "TokenFrame_Update" and "BackpackTokenFrame_Update" to detect currency updates, though I don't remember why I did that instead of listening for some event(s). |
Quote:
Quote:
|
Quote:
If you're asking whether the UI calls TokenFrame_Update in response to CURRENCY_DISPLAY_UPDATE, the answer now appears to be yes, which means I could probably use an event handler instead of hooking functions in my addon if I wanted to bother changing it. Like I said, I don't recall why I used that solution when I wrote my addon 8 years ago. That also means that the answer to your original question is probably that the best solution here is to listen for the CURRENCY_DISPLAY_UPDATE event. If you try that, and are seeing currency numbers changing without the event firing, report back with a description of the circumstances. Lua Code:
|
FYI, I tracked on below events:
Code:
"BAG_UPDATE", |
All times are GMT -6. The time now is 06:51 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI