Fix Player Options for 64 players

This commit is contained in:
def 2013-12-31 22:14:59 +01:00
parent 08eb38230f
commit 7a9631ce19

View file

@ -151,21 +151,52 @@ void CMenus::RenderPlayers(CUIRect MainView)
Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
int TotalPlayers = 0;
for(int i = 0; i < MAX_CLIENTS; ++i)
{
if(!m_pClient->m_Snap.m_paInfoByTeam[i])
continue;
int Index = m_pClient->m_Snap.m_paInfoByTeam[i]->m_ClientID;
if(Index == m_pClient->m_Snap.m_LocalClientID)
continue;
TotalPlayers++;
}
static int s_VoteList = 0;
static float s_ScrollValue = 0;
CUIRect List = Options;
//List.HSplitTop(28.0f, 0, &List);
UiDoListboxStart(&s_VoteList, &List, 24.0f, "", "", TotalPlayers, 1, -1, s_ScrollValue);
m_CallvoteSelectedOption = UiDoListboxEnd(&s_ScrollValue, 0);
// options // options
static int s_aPlayerIDs[MAX_CLIENTS][2] = {{0}}; static int s_aPlayerIDs[MAX_CLIENTS][2] = {{0}};
for(int i = 0, Count = 0; i < MAX_CLIENTS; ++i) for(int i = 0, Count = 0; i < MAX_CLIENTS; ++i)
{ {
if(!m_pClient->m_Snap.m_paInfoByTeam[i]) if(!m_pClient->m_Snap.m_paInfoByTeam[i])
continue; continue;
int Index = m_pClient->m_Snap.m_paInfoByTeam[i]->m_ClientID; int Index = m_pClient->m_Snap.m_paInfoByTeam[i]->m_ClientID;
CListboxItem Item = UiDoListboxNextItem(&m_pClient->m_aClients[Index]);
if(Index == m_pClient->m_Snap.m_LocalClientID) if(Index == m_pClient->m_Snap.m_LocalClientID)
continue; continue;
Options.HSplitTop(28.0f, &ButtonBar, &Options); Count++;
if(Count++%2 == 0)
if(!Item.m_Visible)
continue;
Item.m_Rect.HSplitTop(24.0f, &ButtonBar, &Item.m_Rect);
if(Count%2 == 1)
RenderTools()->DrawUIRect(&ButtonBar, vec4(1.0f, 1.0f, 1.0f, 0.25f), CUI::CORNER_ALL, 10.0f); RenderTools()->DrawUIRect(&ButtonBar, vec4(1.0f, 1.0f, 1.0f, 0.25f), CUI::CORNER_ALL, 10.0f);
ButtonBar.VSplitRight(220.0f, &Player, &ButtonBar); ButtonBar.VSplitRight(200.0f, &Player, &ButtonBar);
// player info // player info
Player.VSplitLeft(28.0f, &Button, &Player); Player.VSplitLeft(28.0f, &Button, &Player);