mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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.
This commit is contained in:
parent
367390a852
commit
36d40905e1
1 changed files with 16 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue