added note about TopMenuAction_DrawOption

Cancel vote option now only appears if a vote is in progress

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401530
This commit is contained in:
David Anderson 2007-10-02 14:42:38 +00:00
parent ee90188103
commit a130fede3a
2 changed files with 13 additions and 1 deletions

View File

@ -22,12 +22,23 @@ public AdminMenu_CancelVote(Handle:topmenu,
if (action == TopMenuAction_DrawOption)
{
Format(buffer, maxlength, "%T", "Cancel vote", param);
if (IsVoteInProgress())
{
return ITEMDRAW_DEFAULT;
}
else
{
return ITEMDRAW_IGNORE;
}
}
else if (action == TopMenuAction_SelectOption)
{
PerformCancelVote(param);
RedisplayAdminMenu(topmenu, param);
}
return 0;
}
public Action:Command_CancelVote(client, args)

View File

@ -47,7 +47,8 @@ enum TopMenuAction
*
* INPUT : TopMenu Handle, object ID, client index in extra parameter.
* OUTPUT: Buffer for rendering, maxlength of buffer.
* OUTPUT: Must return an ITEMDRAW constant.
* OUTPUT: Must return an ITEMDRAW constant. The return value may be ignored
* if the item is simply being sorted into the menu.
*/
TopMenuAction_DrawOption = 0,