added request amb404
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40966
This commit is contained in:
@@ -126,6 +126,7 @@ void VoteMenuHandler::EndVoting()
|
||||
*/
|
||||
unsigned int dup_array[256];
|
||||
|
||||
unsigned int total = m_Votes[0];
|
||||
for (size_t i=1; i<m_Items; i++)
|
||||
{
|
||||
if (m_Votes[i] > m_Votes[highest])
|
||||
@@ -141,6 +142,7 @@ void VoteMenuHandler::EndVoting()
|
||||
*/
|
||||
dup_array[dup_count++] = i;
|
||||
}
|
||||
total += m_Votes[i];
|
||||
}
|
||||
|
||||
/* Check if we need to pick from the duplicate list */
|
||||
@@ -160,7 +162,7 @@ void VoteMenuHandler::EndVoting()
|
||||
}
|
||||
|
||||
picked_item:
|
||||
m_pHandler->OnMenuVoteEnd(m_pCurMenu, chosen);
|
||||
m_pHandler->OnMenuVoteEnd(m_pCurMenu, chosen, m_Votes[highest], total);
|
||||
m_pHandler->OnMenuEnd(m_pCurMenu);
|
||||
InternalReset();
|
||||
}
|
||||
|
||||
+9
-3
@@ -69,7 +69,10 @@ public:
|
||||
void OnMenuEnd(IBaseMenu *menu);
|
||||
void OnMenuDestroy(IBaseMenu *menu);
|
||||
void OnMenuVoteStart(IBaseMenu *menu);
|
||||
void OnMenuVoteEnd(IBaseMenu *menu, unsigned int item);
|
||||
void OnMenuVoteEnd(IBaseMenu *menu,
|
||||
unsigned int item,
|
||||
unsigned int winningVotes,
|
||||
unsigned int totalVotes);
|
||||
void OnMenuVoteCancel(IBaseMenu *menu);
|
||||
#if 0
|
||||
void OnMenuDrawItem(IBaseMenu *menu, int client, unsigned int item, unsigned int &style);
|
||||
@@ -288,9 +291,12 @@ void CMenuHandler::OnMenuVoteStart(IBaseMenu *menu)
|
||||
DoAction(menu, MenuAction_VoteStart, 0, 0);
|
||||
}
|
||||
|
||||
void CMenuHandler::OnMenuVoteEnd(IBaseMenu *menu, unsigned int item)
|
||||
void CMenuHandler::OnMenuVoteEnd(IBaseMenu *menu,
|
||||
unsigned int item,
|
||||
unsigned int winningVotes,
|
||||
unsigned int totalVotes)
|
||||
{
|
||||
DoAction(menu, MenuAction_VoteEnd, item, 0);
|
||||
DoAction(menu, MenuAction_VoteEnd, item, (totalVotes << 16) | (totalVotes & 0xFFFF));
|
||||
}
|
||||
|
||||
void CMenuHandler::OnMenuVoteCancel(IBaseMenu *menu)
|
||||
|
||||
Reference in New Issue
Block a user