ForgeUI

ForgeUI

228k Downloads

NeedGreed - Show which people rolled

adamjedlicka opened this issue ยท 2 comments

commented
commented

I have this working at this point, and will test more rigorously in dungeons/adventures in the next day or two. But due to how the addon is currently structured, the minor UI bug where a piece of loot is briefly shown again after hitting N/G/P now also results in the counters resetting for that piece of loot, potentially causing confusion. This occurs when DrawAllLoot() is called again before the loot is removed from the GameLib:GetLootRolls() call.

The heart of this is that the tKnownLoot table is completely rewritten every second, so we aren't really tracking loot as an entity. This means that the only place we can track loot rolls is on the frame itself - using GetData() to verify the loot we're reviewing, and then using whatever saved data is on that frame as the starting point for changes.

I believe a better approach would be to rely on the event calls themselves more to manage the loot table, without rebuilding the table on the timer. This should save a good bit of overhead, as well as allow for tracking rolls as part of the loot itself.

I've been working on this rewrite, though it's taking me a lot of time (mostly because I find this very difficult to test on my own). Let me know what your thoughts are, though - such as if you tried this approach previously but found that it wasn't a good one for some reason.

commented

No I haven't look much into API for need/greed. I just wrote it as fast as possible with some tweaks I personally wanted (when loot is added or removed, I don't destroy all roll windows, only the one that were added/removed. It's because when you destroy all items of the list you will lose tooltip (this can be seen a lot in master loot window, where your tooltip always disappear and whole window content resets).

So if you can get need/greed events of other people with some info (who rolled, exacly which item, ...) I think you could store all NeedGreed items in table and just edit their need/greed tooltip based on these events. If you have to use GameLib:GetLootRolls() to get rolls again instead of destroying all NeedGreed items just try to update them. I know it will be harder to do, but I think it will be worth it.

Also about re-appearing items. If you want to look into it too, you can try creating blacklist of items you already rolled on. Dunno if this would be possible, because sometimes there is item multiple times in roll window.

But as I already said, I don't know much about this problem, so at the end just do it how you want to.