Client won't vote on comments by Sushi Tee

This commit is contained in:
GreYFoXGTi 2010-12-06 00:28:35 +02:00
parent 2d581789e1
commit ed7a1d5bcd
2 changed files with 13 additions and 2 deletions

View file

@ -129,7 +129,7 @@ int CMenus::DoButton_Icon(int ImageId, int SpriteId, const CUIRect *pRect)
int CMenus::DoButton_Menu(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
{
RenderTools()->DrawUIRect(pRect, vec4(1,1,1,0.5f)*ButtonColorMul(pID), CUI::CORNER_ALL, 5.0f);
RenderTools()->DrawUIRect(pRect, (Checked<0)?vec4(0,0,0,0.5f):vec4(1,1,1,0.5f)*ButtonColorMul(pID), CUI::CORNER_ALL, 5.0f);
UI()->DoLabel(pRect, pText, pRect->h*ms_FontmodHeight, 0);
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
}

View file

@ -400,8 +400,19 @@ void CMenus::RenderServerControl(CUIRect MainView)
CUIRect Button;
Bottom.VSplitRight(120.0f, &Bottom, &Button);
int Vote = m_CallvoteSelectedOption;
CVoting::CVoteOption *pOption = m_pClient->m_pVoting->m_pFirst;
while(pOption && Vote >= 0)
{
if(!Vote)
break;
Vote--;
pOption = pOption->m_pNext;
}
static int s_CallVoteButton = 0;
if(DoButton_Menu(&s_CallVoteButton, Localize("Call vote"), 0, &Button))
if(DoButton_Menu(&s_CallVoteButton, Localize("Call vote"), (pOption->m_aCommand[0] < 97 || pOption->m_aCommand[0] > 122)?-1:0, &Button))
{
if(s_ControlPage == 0)
{