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:
Kelsi 2026-03-12 08:59:38 -07:00
parent 8a24638ced
commit 7acaa4d301
3 changed files with 72 additions and 0 deletions

View file

@ -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);