From cb99dbaea4048fa37bb0ccbb3791cfad1464e4ba Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Mar 2026 16:54:40 -0700 Subject: [PATCH] feat: add elemental resistances and full spell descriptions to chat link tooltips Chat item link tooltips now show per-school elemental resistances (Holy/Fire/Nature/Frost/Shadow/Arcane) when non-zero, matching the inventory tooltip. Spell effect text (Use/Equip/Chance on Hit) now shows the full spell description instead of just the spell name, consistent with InventoryScreen::renderItemTooltip. --- src/ui/game_screen.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 32edd51c..bed50def 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -1482,6 +1482,19 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) { if (info->armor > 0) { ImGui::Text("%d Armor", info->armor); } + // Elemental resistances (fire resist gear, nature resist gear, etc.) + { + const int32_t resVals[6] = { + info->holyRes, info->fireRes, info->natureRes, + info->frostRes, info->shadowRes, info->arcaneRes + }; + static const char* resLabels[6] = { + "Holy Resistance", "Fire Resistance", "Nature Resistance", + "Frost Resistance", "Shadow Resistance", "Arcane Resistance" + }; + for (int ri = 0; ri < 6; ++ri) + if (resVals[ri] > 0) ImGui::Text("+%d %s", resVals[ri], resLabels[ri]); + } // Extra stats (hit/crit/haste/sp/ap/expertise/resilience/etc.) if (!info->extraStats.empty()) { auto statName = [](uint32_t t) -> const char* { @@ -1641,10 +1654,16 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) { 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()); + // Use full spell description if available (matches inventory tooltip style) + const std::string& spDesc = gameHandler.getSpellDescription(sp.spellId); + const std::string& spText = !spDesc.empty() ? spDesc + : gameHandler.getSpellName(sp.spellId); + if (!spText.empty()) { + ImGui::PushTextWrapPos(ImGui::GetCursorPosX() + 300.0f); + ImGui::TextColored(ImVec4(0.0f, 0.8f, 1.0f, 1.0f), + "%s: %s", triggerLabel, spText.c_str()); + ImGui::PopTextWrapPos(); + } } // Required level if (info->requiredLevel > 1)