From 99d1f5778c45645f94d2a960c49e8c6bae353884 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 21:32:54 -0700 Subject: [PATCH] Fix trade window peer tooltips; add shift-click links in trade and loot roll Trade window now shows rich item tooltips for both sides (peer items were missing tooltips). Both trade sides and the loot roll popup now support shift-click to insert item links into the chat input. --- src/ui/game_screen.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 4614bef9..86ff9184 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -6156,9 +6156,19 @@ void GameScreen::renderTradeWindow(game::GameHandler& gameHandler) { if (isMine && ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) { gameHandler.clearTradeItem(static_cast(i)); } - if (isMine && ImGui::IsItemHovered()) { + if (ImGui::IsItemHovered()) { if (info && info->valid) inventoryScreen.renderItemTooltip(*info); - else ImGui::SetTooltip("Double-click to remove"); + else if (isMine) ImGui::SetTooltip("Double-click to remove"); + } + if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(ImGuiMouseButton_Left) && + ImGui::GetIO().KeyShift && info && info->valid && !info->name.empty()) { + std::string link = buildItemChatLink(info->entry, info->quality, info->name); + size_t curLen = strlen(chatInputBuffer); + if (curLen + link.size() + 1 < sizeof(chatInputBuffer)) { + strncat(chatInputBuffer, link.c_str(), sizeof(chatInputBuffer) - curLen - 1); + chatInputMoveCursorToEnd = true; + refocusChatInput = true; + } } } else { ImGui::TextDisabled(" %d. (empty)", i + 1); @@ -6285,6 +6295,16 @@ void GameScreen::renderLootRollPopup(game::GameHandler& gameHandler) { if (ImGui::IsItemHovered() && rollInfo && rollInfo->valid) { inventoryScreen.renderItemTooltip(*rollInfo); } + if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(ImGuiMouseButton_Left) && + ImGui::GetIO().KeyShift && rollInfo && rollInfo->valid && !rollInfo->name.empty()) { + std::string link = buildItemChatLink(rollInfo->entry, rollInfo->quality, rollInfo->name); + size_t curLen = strlen(chatInputBuffer); + if (curLen + link.size() + 1 < sizeof(chatInputBuffer)) { + strncat(chatInputBuffer, link.c_str(), sizeof(chatInputBuffer) - curLen - 1); + chatInputMoveCursorToEnd = true; + refocusChatInput = true; + } + } ImGui::Spacing(); if (ImGui::Button("Need", ImVec2(80, 30))) {