added a menu parameter to the vote callback
authorDavid Anderson <dvander@alliedmods.net>
Wed Aug 08 02:44:36 2007 +0000 (2007-08-08)
changeset 127122f1534f2a61
parent 1270 a6e3a3b8b7f3
child 1272 95787f8d2b77
added a menu parameter to the vote callback
core/smn_menus.cpp
plugins/include/menus.inc
     1.1 --- a/core/smn_menus.cpp	Wed Aug 08 02:30:03 2007 +0000
     1.2 +++ b/core/smn_menus.cpp	Wed Aug 08 02:44:36 2007 +0000
     1.3 @@ -507,6 +507,7 @@
     1.4  		/* Finally, push everything */
     1.5  		if (!no_call)
     1.6  		{
     1.7 +			m_pVoteResults->PushCell(menu->GetHandle());
     1.8  			m_pVoteResults->PushCell(results->num_votes);
     1.9  			m_pVoteResults->PushCell(results->num_clients);
    1.10  			m_pVoteResults->PushCell(client_array_address);
     2.1 --- a/plugins/include/menus.inc	Wed Aug 08 02:30:03 2007 +0000
     2.2 +++ b/plugins/include/menus.inc	Wed Aug 08 02:44:36 2007 +0000
     2.3 @@ -38,7 +38,8 @@
     2.4  	MenuAction_Select = (1<<2),		/**< An item was selected (param1=client, param2=item) */
     2.5  	MenuAction_Cancel = (1<<3),		/**< The menu was cancelled (param1=client, param2=reason) */
     2.6  	MenuAction_End = (1<<4),		/**< A menu display has fully ended (param1=reason, param2=cancel reason) */
     2.7 -	MenuAction_VoteEnd = (1<<5),	/**< (VOTE ONLY): A vote sequence has succeeded (param1=chosen item) */
     2.8 +	MenuAction_VoteEnd = (1<<5),	/**< (VOTE ONLY): A vote sequence has succeeded (param1=chosen item) 
     2.9 +										 This is not called if SetVoteResultCallback has been used on the menu. */
    2.10  	MenuAction_VoteStart = (1<<6), 	/**< (VOTE ONLY): A vote sequence has started (nothing passed) */
    2.11  	MenuAction_VoteCancel = (1<<7),	/**< (VOTE ONLY): A vote sequence has been cancelled (nothing passed) */
    2.12  	MenuAction_DrawItem = (1<<8),	/**< An item is being drawn; return the new style (param1=client, param2=item) */
    2.13 @@ -97,6 +98,7 @@
    2.14  	MenuEnd_Cancelled = -3,			/**< Menu was cancelled (reason in param2) */
    2.15  	MenuEnd_Exit = -4,				/**< Menu was cleanly exited via "exit" */
    2.16  	MenuEnd_ExitBack = -5,			/**< Menu was cleanly exited via "back" */
    2.17 +	MenuEnd_NoVotes = -6,			/**< A menu received no votes */
    2.18  };
    2.19  
    2.20  /**
    2.21 @@ -418,6 +420,7 @@
    2.22  /**
    2.23   * Callback for when a vote has ended and results are available.
    2.24   *
    2.25 + * @param menu				The menu being voted on.
    2.26   * @param num_votes			Number of votes tallied in total.
    2.27   * @param num_clients		Number of clients who could vote.
    2.28   * @param client_info		Array of clients.  Use VOTEINFO_CLIENT_ defines.
    2.29 @@ -426,7 +429,8 @@
    2.30   *							defines.
    2.31   * @noreturn
    2.32   */
    2.33 -functag VoteHandler public(num_votes, 
    2.34 +functag VoteHandler public(Handle:menu,
    2.35 +						   num_votes, 
    2.36  						   num_clients,
    2.37  						   const client_info[][2], 
    2.38  						   num_items,