1.1 --- a/plugins/include/menus.inc Fri Jun 22 18:44:27 2007 +0000
1.2 +++ b/plugins/include/menus.inc Fri Jun 22 21:04:13 2007 +0000
1.3 @@ -37,7 +37,7 @@
1.4 MenuAction_Display = (1<<1), /**< A menu is about to be displayed (param1=client, param2=MenuPanel Handle) */
1.5 MenuAction_Select = (1<<2), /**< An item was selected (param1=client, param2=item) */
1.6 MenuAction_Cancel = (1<<3), /**< The menu was cancelled (param1=client, param2=reason) */
1.7 - MenuAction_End = (1<<4), /**< A menu display has fully ended (param1=reason) */
1.8 + MenuAction_End = (1<<4), /**< A menu display has fully ended (param1=reason, param2=cancel reason) */
1.9 MenuAction_VoteEnd = (1<<5), /**< (VOTE ONLY): A vote sequence has succeeded (param1=chosen item) */
1.10 MenuAction_VoteStart = (1<<6), /**< (VOTE ONLY): A vote sequence has started (nothing passed) */
1.11 MenuAction_VoteCancel = (1<<7), /**< (VOTE ONLY): A vote sequence has been cancelled (nothing passed) */
1.12 @@ -64,22 +64,25 @@
1.13 */
1.14 enum
1.15 {
1.16 - MenuCancel_Disconnect = -1, /**< Client dropped from the server */
1.17 - MenuCancel_Interrupt = -2, /**< Client was interrupted with another menu */
1.18 - MenuCancel_Exit = -3, /**< Client selected "exit" on a paginated menu */
1.19 - MenuCancel_NoDisplay = -4, /**< Menu could not be displayed to the client */
1.20 + MenuCancel_Disconnected = -1, /**< Client dropped from the server */
1.21 + MenuCancel_Interrupted = -2, /**< Client was interrupted with another menu */
1.22 + MenuCancel_Exit = -3, /**< Client exited via "exit" */
1.23 + MenuCancel_NoDisplay = -4, /**< Menu could not be displayed to the client */
1.24 + MenuCancel_Timeout = -5, /**< Menu timed out */
1.25 + MenuCancel_ExitBack = -6, /**< Client selected "exit back" on a paginated menu */
1.26 };
1.27
1.28 /**
1.29 * Reasons a menu ended.
1.30 */
1.31 -enum
1.32 +enum MenuEndReason
1.33 {
1.34 - MenuEnd_Cancelled = -1, /**< Menu was cancelled, reason was passed in MenuAction_Cancel */
1.35 - MenuEnd_Exit = -2, /**< Menu was cleanly exited (but cancelled) */
1.36 - MenuEnd_Selected = -3, /**< Menu item was selected and thus the menu is finished */
1.37 - MenuEnd_VotingDone = -4, /**< Voting finished */
1.38 - MenuEnd_VotingCancelled = -5, /**< Voting was cancelled */
1.39 + MenuEnd_Selected = 0, /**< Menu item was selected */
1.40 + MenuEnd_VotingDone = -1, /**< Voting finished */
1.41 + MenuEnd_VotingCancelled = -2, /**< Voting was cancelled */
1.42 + MenuEnd_Cancelled = -3, /**< Menu was cancelled (reason in param2) */
1.43 + MenuEnd_Exit = -4, /**< Menu was cleanly exited via "exit" */
1.44 + MenuEnd_ExitBack = -5, /**< Menu was cleanly exited via "back" */
1.45 };
1.46
1.47 /**
1.48 @@ -274,6 +277,31 @@
1.49 native bool:SetMenuExitButton(Handle:menu, bool:button);
1.50
1.51 /**
1.52 + * Returns whether or not the menu has an "exit back" button.
1.53 + * By default, menus do not have an exit back button.
1.54 + * Exit Back buttons appear as "Back" on page 1 of paginated menus and
1.55 + * have functionality defined by the user in MenuEnd_ExitBack.
1.56 + *
1.57 + * @param menu Menu Handle.
1.58 + * @return True if the menu has an exit back button; false otherwise.
1.59 + * @error Invalid Handle.
1.60 + */
1.61 +native bool:GetMenuExitBackButton(Handle:menu);
1.62 +
1.63 +/**
1.64 + * Sets whether or not the menu has an "exit back" button.
1.65 + * By default, menus do not have an exit back button.
1.66 + * Exit Back buttons appear as "Back" on page 1 of paginated menus and
1.67 + * have functionality defined by the user in MenuEnd_ExitBack.
1.68 + *
1.69 + * @param menu Menu Handle.
1.70 + * @param button True to enable the button, false to remove it.
1.71 + * @error Invalid Handle.
1.72 + */
1.73 +native SetMenuExitBackButton(Handle:menu, bool:button);
1.74 +
1.75 +
1.76 +/**
1.77 * Cancels a menu from displaying on all clients. While the
1.78 * cancellation is in progress, this menu cannot be re-displayed
1.79 * to any clients.