mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
feat: capture and display all item stat types in tooltips
Previously only the 5 primary stats (Str/Agi/Sta/Int/Spi) were stored, discarding hit rating, crit, haste, attack power, spell power, resilience, expertise, armor penetration, MP5, and many others. Changes: - Add ItemDef::ExtraStat and ItemQueryResponseData::ExtraStat arrays - All three expansion parsers (WotLK/TBC/Classic) now capture non-primary stat type/value pairs into extraStats instead of silently dropping them - All 5 rebuildOnlineInventory paths propagate extraStats to ItemDef - Tooltip now renders each extra stat on its own line with a name lookup covering all common WotLK stat types (hit, crit, haste, AP, SP, etc.) - Also fix Classic/TBC bag-content and bank-bag paths that were missing bindType, description propagation from previous commits
This commit is contained in:
parent
6075207d94
commit
321aaeae54
7 changed files with 84 additions and 3 deletions
|
|
@ -10763,6 +10763,9 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
} else {
|
||||
def.name = "Item " + std::to_string(def.itemId);
|
||||
queryItemInfo(def.itemId, guid);
|
||||
|
|
@ -10808,6 +10811,9 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
} else {
|
||||
def.name = "Item " + std::to_string(def.itemId);
|
||||
queryItemInfo(def.itemId, guid);
|
||||
|
|
@ -10886,6 +10892,11 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.sellPrice = infoIt->second.sellPrice;
|
||||
def.itemLevel = infoIt->second.itemLevel;
|
||||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
def.bagSlots = infoIt->second.containerSlots;
|
||||
} else {
|
||||
def.name = "Item " + std::to_string(def.itemId);
|
||||
|
|
@ -10932,6 +10943,9 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
def.sellPrice = infoIt->second.sellPrice;
|
||||
def.bagSlots = infoIt->second.containerSlots;
|
||||
} else {
|
||||
|
|
@ -11018,6 +11032,11 @@ void GameHandler::rebuildOnlineInventory() {
|
|||
def.itemLevel = infoIt->second.itemLevel;
|
||||
def.requiredLevel = infoIt->second.requiredLevel;
|
||||
def.sellPrice = infoIt->second.sellPrice;
|
||||
def.bindType = infoIt->second.bindType;
|
||||
def.description = infoIt->second.description;
|
||||
def.extraStats.clear();
|
||||
for (const auto& es : infoIt->second.extraStats)
|
||||
def.extraStats.push_back({es.statType, es.statValue});
|
||||
def.bagSlots = infoIt->second.containerSlots;
|
||||
} else {
|
||||
def.name = "Item " + std::to_string(def.itemId);
|
||||
|
|
|
|||
|
|
@ -1266,7 +1266,10 @@ bool ClassicPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQ
|
|||
case 5: data.intellect = statValue; break;
|
||||
case 6: data.spirit = statValue; break;
|
||||
case 7: data.stamina = statValue; break;
|
||||
default: break;
|
||||
default:
|
||||
if (statValue != 0)
|
||||
data.extraStats.push_back({statType, statValue});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -931,7 +931,10 @@ bool TbcPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQuery
|
|||
case 5: data.intellect = statValue; break;
|
||||
case 6: data.spirit = statValue; break;
|
||||
case 7: data.stamina = statValue; break;
|
||||
default: break;
|
||||
default:
|
||||
if (statValue != 0)
|
||||
data.extraStats.push_back({statType, statValue});
|
||||
break;
|
||||
}
|
||||
}
|
||||
// TBC: NO ScalingStatDistribution, NO ScalingStatValue (WotLK-only)
|
||||
|
|
|
|||
|
|
@ -2474,7 +2474,10 @@ bool ItemQueryResponseParser::parse(network::Packet& packet, ItemQueryResponseDa
|
|||
case 5: data.intellect = statValue; break;
|
||||
case 6: data.spirit = statValue; break;
|
||||
case 7: data.stamina = statValue; break;
|
||||
default: break;
|
||||
default:
|
||||
if (statValue != 0)
|
||||
data.extraStats.push_back({statType, statValue});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue