mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
feat: show quality-coloured loot toast when items are received
SMSG_ITEM_PUSH_RESULT now fires a new ItemLootCallback that game_screen.cpp uses to push a compact slide-in toast at the bottom-left of the screen. Each toast: - Shows a quality-tinted left accent bar (grey/white/green/blue/ purple/orange matching WoW quality colours) - Displays "Loot: <item name>" with the name in quality colour - Appends " x<N>" for stacked pickups - Coalesces repeated pickups of the same item (adds count, resets timer) - Stacks up to 5 entries, 3 s lifetime with 0.15 s slide-in and 0.7 s fade-out
This commit is contained in:
parent
129fa84fe3
commit
42d66bc876
4 changed files with 132 additions and 0 deletions
|
|
@ -1701,12 +1701,17 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
queryItemInfo(itemId, 0);
|
||||
if (showInChat) {
|
||||
std::string itemName = "item #" + std::to_string(itemId);
|
||||
uint32_t quality = 1; // white default
|
||||
if (const ItemQueryResponseData* info = getItemInfo(itemId)) {
|
||||
if (!info->name.empty()) itemName = info->name;
|
||||
quality = info->quality;
|
||||
}
|
||||
std::string msg = "Received: " + itemName;
|
||||
if (count > 1) msg += " x" + std::to_string(count);
|
||||
addSystemChatMessage(msg);
|
||||
if (itemLootCallback_) {
|
||||
itemLootCallback_(itemId, count, quality, itemName);
|
||||
}
|
||||
}
|
||||
LOG_INFO("Item push: itemId=", itemId, " count=", count,
|
||||
" showInChat=", static_cast<int>(showInChat));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue