From 888c61a07d9e850b5eccca7036a7b0f2d292554b Mon Sep 17 00:00:00 2001 From: def Date: Fri, 13 Mar 2015 16:15:05 +0100 Subject: [PATCH] Prepare call vote search (but not implemented yet) --- src/game/client/components/menus_ingame.cpp | 33 ++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 3bcc8c9a1..b1b63acf1 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -570,7 +570,38 @@ void CMenus::RenderServerControl(CUIRect MainView) // vote menu { - CUIRect Button; + CUIRect Button, Button2, QuickSearch; + + // render quick search + { + Bottom.VSplitLeft(240.0f, &QuickSearch, &Bottom); + QuickSearch.HSplitTop(5.0f, 0, &QuickSearch); + const char *pSearchLabel = Localize("⚲"); + UI()->DoLabelScaled(&QuickSearch, pSearchLabel, 14.0f, -1); + float wSearch = TextRender()->TextWidth(0, 14.0f, pSearchLabel, -1); + QuickSearch.VSplitLeft(wSearch, 0, &QuickSearch); + QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch); + QuickSearch.VSplitLeft(QuickSearch.w-15.0f, &QuickSearch, &Button2); + static float Offset = 0.0f; + static char aFilterString[25]; + if(DoEditBox(&aFilterString, &QuickSearch, aFilterString, sizeof(aFilterString), 14.0f, &Offset, false, CUI::CORNER_L, Localize("Search"))) { + // TODO: Implement here + } + + // clear button + { + static int s_ClearButton = 0; + RenderTools()->DrawUIRect(&Button2, vec4(1,1,1,0.33f)*ButtonColorMul(&s_ClearButton), CUI::CORNER_R, 3.0f); + UI()->DoLabel(&Button2, "×", Button2.h*ms_FontmodHeight, 0); + if(UI()->DoButtonLogic(&s_ClearButton, "×", 0, &Button2)) + { + aFilterString[0] = 0; + UI()->SetActiveItem(&aFilterString); + Client()->ServerBrowserUpdate(); + } + } + } + Bottom.VSplitRight(120.0f, &Bottom, &Button); static int s_CallVoteButton = 0;