mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: show item spell effects (Use/Equip/Teaches) in item tooltip
Display Use, Equip, Chance on Hit, and Teaches spell effects from SMSG_ITEM_QUERY_SINGLE_RESPONSE in item tooltips. Looks up spell name from Spell.dbc via SpellbookScreen for readable descriptions.
This commit is contained in:
parent
03397ec23c
commit
020ba134cd
1 changed files with 16 additions and 0 deletions
|
|
@ -1510,6 +1510,22 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
|
|||
ImGui::TextColored(green, "+%d %s", es.statValue, nm);
|
||||
}
|
||||
}
|
||||
// Item spell effects (Use / Equip / Chance on Hit / Teaches)
|
||||
for (const auto& sp : info->spells) {
|
||||
if (sp.spellId == 0) continue;
|
||||
const char* triggerLabel = nullptr;
|
||||
switch (sp.spellTrigger) {
|
||||
case 0: triggerLabel = "Use"; break;
|
||||
case 1: triggerLabel = "Equip"; break;
|
||||
case 2: triggerLabel = "Chance on Hit"; break;
|
||||
case 5: triggerLabel = "Teaches"; break;
|
||||
}
|
||||
if (!triggerLabel) continue;
|
||||
std::string spName = spellbookScreen.lookupSpellName(sp.spellId, assetMgr);
|
||||
if (!spName.empty())
|
||||
ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f),
|
||||
"%s: %s", triggerLabel, spName.c_str());
|
||||
}
|
||||
// Required level
|
||||
if (info->requiredLevel > 1)
|
||||
ImGui::TextDisabled("Requires Level %u", info->requiredLevel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue