From 54eae9bffc842757efea8e23185c6f0fac13e8b3 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 21:37:15 -0700 Subject: [PATCH] Add shift-click links and Take All to mail attachments Mail attachment icons and names now support shift-click to insert item links. Item names also show rich tooltips on hover. Adds a "Take All" button when a mail has multiple attachments. --- src/ui/game_screen.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 5236b477..ae2f6c3b 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -10944,8 +10944,30 @@ void GameScreen::renderMailWindow(game::GameHandler& gameHandler) { ImGui::InvisibleButton("##mailatt", ImVec2(MAIL_SLOT, MAIL_SLOT)); if (ImGui::IsItemHovered() && info && info->valid) inventoryScreen.renderItemTooltip(*info); + 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; + } + } ImGui::SameLine(); ImGui::TextColored(qc, "%s", name.c_str()); + if (ImGui::IsItemHovered() && info && info->valid) + inventoryScreen.renderItemTooltip(*info); + 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; + } + } ImGui::SameLine(); if (ImGui::SmallButton("Take")) { gameHandler.mailTakeItem(mail.messageId, att.slot); @@ -10953,6 +10975,14 @@ void GameScreen::renderMailWindow(game::GameHandler& gameHandler) { ImGui::PopID(); } + // "Take All" button when there are multiple attachments + if (mail.attachments.size() > 1) { + if (ImGui::SmallButton("Take All")) { + for (const auto& att2 : mail.attachments) { + gameHandler.mailTakeItem(mail.messageId, att2.slot); + } + } + } } ImGui::Spacing();