Fix scroll bar in server control votes when search bar is used

This commit is contained in:
def 2015-07-25 18:43:54 +02:00
parent 50a6c30e46
commit e6db197183

View file

@ -461,11 +461,19 @@ void CMenus::RenderServerControlServer(CUIRect MainView)
int NumVoteOptions = 0;
int aIndices[MAX_VOTE_OPTIONS];
static int s_CurVoteOption = 0;
int TotalShown = 0;
for(CVoteOptionClient *pOption = m_pClient->m_pVoting->m_pFirst; pOption; pOption = pOption->m_pNext)
{
if(m_aFilterString[0] != '\0' && !str_find_nocase(pOption->m_aDescription, m_aFilterString))
continue;
TotalShown++;
}
#if defined(__ANDROID__)
UiDoListboxStart(&s_VoteList, &List, 50.0f, "", "", Total, 1, s_CurVoteOption, s_ScrollValue);
UiDoListboxStart(&s_VoteList, &List, 50.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue);
#else
UiDoListboxStart(&s_VoteList, &List, 24.0f, "", "", Total, 1, s_CurVoteOption, s_ScrollValue);
UiDoListboxStart(&s_VoteList, &List, 24.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue);
#endif
int i = -1;