From 020ba134cd06052ab24f86aac75d71b3c968465f Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Mar 2026 14:43:22 -0700 Subject: [PATCH] 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. --- src/ui/game_screen.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index c9079987..629dba96 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -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);