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:
Kelsi 2026-03-17 14:43:22 -07:00
parent 03397ec23c
commit 020ba134cd

View file

@ -1510,6 +1510,22 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
ImGui::TextColored(green, "+%d %s", es.statValue, nm); 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 // Required level
if (info->requiredLevel > 1) if (info->requiredLevel > 1)
ImGui::TextDisabled("Requires Level %u", info->requiredLevel); ImGui::TextDisabled("Requires Level %u", info->requiredLevel);