mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Working call vote search (fixes #126)
This commit is contained in:
parent
aa4453da40
commit
81cb8fd32d
|
@ -146,6 +146,7 @@ class CMenus : public CComponent
|
|||
int m_CallvoteSelectedOption;
|
||||
int m_CallvoteSelectedPlayer;
|
||||
char m_aCallvoteReason[VOTE_REASON_LENGTH];
|
||||
char m_aFilterString[25];
|
||||
|
||||
// demo
|
||||
struct CDemoItem
|
||||
|
|
|
@ -460,6 +460,9 @@ void CMenus::RenderServerControlServer(CUIRect MainView)
|
|||
|
||||
for(CVoteOptionClient *pOption = m_pClient->m_pVoting->m_pFirst; pOption; pOption = pOption->m_pNext)
|
||||
{
|
||||
if(!str_find_nocase(pOption->m_aDescription, m_aFilterString))
|
||||
continue;
|
||||
|
||||
CListboxItem Item = UiDoListboxNextItem(pOption);
|
||||
|
||||
if(Item.m_Visible)
|
||||
|
@ -583,8 +586,8 @@ void CMenus::RenderServerControl(CUIRect MainView)
|
|||
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"))) {
|
||||
//static char aFilterString[25];
|
||||
if(DoEditBox(&m_aFilterString, &QuickSearch, m_aFilterString, sizeof(m_aFilterString), 14.0f, &Offset, false, CUI::CORNER_L, Localize("Search"))) {
|
||||
// TODO: Implement here
|
||||
}
|
||||
|
||||
|
@ -595,8 +598,8 @@ void CMenus::RenderServerControl(CUIRect MainView)
|
|||
UI()->DoLabel(&Button2, "×", Button2.h*ms_FontmodHeight, 0);
|
||||
if(UI()->DoButtonLogic(&s_ClearButton, "×", 0, &Button2))
|
||||
{
|
||||
aFilterString[0] = 0;
|
||||
UI()->SetActiveItem(&aFilterString);
|
||||
m_aFilterString[0] = 0;
|
||||
UI()->SetActiveItem(&m_aFilterString);
|
||||
Client()->ServerBrowserUpdate();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue