Closed SafeteeWoW closed 6 years ago
Haven't fully tested this yet, but the code structure should be finalized. comment?
The most significant change is that ML:Award now has a callback
which is called as soon as the award result is known. This is convenient than message because I can do stuff as if the function is a synchronized call.
I clean up a lot of duplicate code.
Should we disable award items for awarded session in direct mode? Consider the case where every item is identical.
Haven't fully tested this yet, but the code structure should be finalized. comment?
Seems nice.
We should really use some of the reasons from :CanGiveLoot()
as responses in the votingFrame (instead of the current "Offline/not installed"). This will break backwards compability though.
Should we disable award items for awarded session in direct mode? Consider the case where every item is identical.
I'm not sure what you mean. Are you talking about awarding an item that has already been awarded? That should be handled in the voting frame (which I thought it already was) so it isn't an option for the ML. Edit: It is now ecc69f10d0284914957f2202459884b3395a2747.
There's no need to complicate functions with things they shouldn't handle. I.e. ML:Award()
should attempt to award items, and while it could deny already awarded items, it's better to just not give the user the option to award already awarded options. This helps to keep the coupling low, which in turn makes for better readability and better debugging.
baggedItems
Several commands need to be added to support the new award later feature and I haven't added yet. I'm bugfixing the current features.
I should have cleared most of the bugs by far. I just need to add several more commands
ML:GetLootTableForTransmit
. I know you said it is weird to have sth added but removed later, but I think it's okay. There can be sth in the loottable only useful for the ML. And the main reason I added that because I added lootTable[session].baggedEntry
and this is used to properly modifying the entry without worrying about the index of the addon.baggedItems
changes. If I store baggedIndex
instead, then I have to make sure no entries are removed from addon.baggedItems
during the session. lootTable[session].baggedEntry
should not be transmitted.I just need to do some locale clean up and more testing right now.
I changed these 9b63e8c8312ebdb971bdab4e319138c2d6cfe6f3
Can you confirm I covered all the changes of this PR? 4a47718927bb131bf1fcb3e9dc62e6a3d8672ed6
@SafeteeWoW
Mostly done. Award checking is done by LOOT_SLOT_CLEARED event.
ML:Award normally returns nil when award success. Now use a callback solution to communicate between ML:Award and PopupOnClickYes. I think this solution is very clean.