Allow.menu

From AGI Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The allow.menu command enables or disables display of the menu.

Syntax

allow.menu(byt A);

Remarks

This command allows for additional control over the display of the menu. Calling the allow.menu command with A = 0 resets an internal menu control value to FALSE; using a non-zero argument sets the internal value to TRUE. This internal value is TRUE by default when AGI starts.

When AGI attempts to display a menu (after a call to the menu.input command with reserved flag f14 (menu enabled) set to TRUE), it checks the value of the internal 'allow.menu' flag; if it is FALSE, then the menu is not displayed.

Possible Errors

Keep in mind that once menu.input successfully triggers the menu, AGI will continue attempting to display the menu in every interpreter cycle until is succeeds. So once menus are 're-allowed' by the allow.menu command the menu will immediately be displayed at the start of the next cycle.

Example

Code:
[ assume a menu has been created and submitted
[ and f14 is set
allow.menu(0);  [ menu is disabled
menu.input();   [ this menu input command tells AGI to show the menu
                [ but with menu disabled, it will not display the menu
...
allow.menu(1);  [ menu is re-enabled; at the start of the next 
                [ cycle, the menu will be displayed

Technical Information

Required Interpreter Version: 3.002.086 and above
Byte-Code Value: 177 (0xB1 hex)

See Also

Player Input Commands
AGI Menus