mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
feat: show live roll results from group members in loot roll popup
Track each player's roll (need/greed/disenchant/pass + value) as SMSG_LOOT_ROLL packets arrive while our roll window is open. Display a color-coded table in the popup: green=need, blue=greed, purple=disenchant, gray=pass. Roll value hidden for pass.
This commit is contained in:
parent
8a24638ced
commit
7acaa4d301
3 changed files with 72 additions and 0 deletions
|
|
@ -19993,6 +19993,7 @@ void GameHandler::handleLootRoll(network::Packet& packet) {
|
|||
pendingLootRoll_.objectGuid = objectGuid;
|
||||
pendingLootRoll_.slot = slot;
|
||||
pendingLootRoll_.itemId = itemId;
|
||||
pendingLootRoll_.playerRolls.clear();
|
||||
// Ensure item info is in cache; query if not
|
||||
queryItemInfo(itemId, 0);
|
||||
// Look up item name from cache
|
||||
|
|
@ -20017,6 +20018,28 @@ void GameHandler::handleLootRoll(network::Packet& packet) {
|
|||
}
|
||||
if (rollerName.empty()) rollerName = "Someone";
|
||||
|
||||
// Track in the live roll list while our popup is open for the same item
|
||||
if (pendingLootRollActive_ &&
|
||||
pendingLootRoll_.objectGuid == objectGuid &&
|
||||
pendingLootRoll_.slot == slot) {
|
||||
bool found = false;
|
||||
for (auto& r : pendingLootRoll_.playerRolls) {
|
||||
if (r.playerName == rollerName) {
|
||||
r.rollNum = rollNum;
|
||||
r.rollType = rollType;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
LootRollEntry::PlayerRollResult prr;
|
||||
prr.playerName = rollerName;
|
||||
prr.rollNum = rollNum;
|
||||
prr.rollType = rollType;
|
||||
pendingLootRoll_.playerRolls.push_back(std::move(prr));
|
||||
}
|
||||
}
|
||||
|
||||
auto* info = getItemInfo(itemId);
|
||||
std::string iName = info ? info->name : std::to_string(itemId);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue