From 36d40905e1ed857ad43ee7ef8c5f554f4926c458 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 10:45:31 -0700 Subject: [PATCH] feat: add in-window search bar to who results window Add a search field with "Search" button directly in the who results window so players can query without using the chat box. Pressing Enter in the search field also triggers a new /who query. --- src/ui/game_screen.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 29838f3d..85fc7824 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -16862,8 +16862,23 @@ void GameScreen::renderWhoWindow(game::GameHandler& gameHandler) { return; } + // Search bar with Send button + static char whoSearchBuf[64] = {}; + bool doSearch = false; + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - 60.0f); + if (ImGui::InputTextWithHint("##whosearch", "Search players...", whoSearchBuf, sizeof(whoSearchBuf), + ImGuiInputTextFlags_EnterReturnsTrue)) + doSearch = true; + ImGui::SameLine(); + if (ImGui::Button("Search", ImVec2(-1, 0))) + doSearch = true; + if (doSearch) { + gameHandler.queryWho(std::string(whoSearchBuf)); + } + ImGui::Separator(); + if (results.empty()) { - ImGui::TextDisabled("No results. Use /who [filter] to search."); + ImGui::TextDisabled("No results. Type a filter above or use /who [filter]."); ImGui::End(); return; }