MmUpdate
Revision as of 17:42, 6 December 2008 by imported>Speedo
Beta Function
This function has not been fully tested yet, and is not ready to be used in a released mod. It may not have the same function in later versions, may require the script to be recompiled, or simply may be removed. Use for testing purposes only until the author of the function says otherwise.
A command for MenuMate.
mmGetStatus
Updates a loaded menu. Must be called from the same script which called mmLoadMenu. When used, it should be called from a script which will run as often as possible, preferably every frame.
This function is necessary to update two aspects of menus:
- Button scrolling. A dialog which has more than 10 buttons must use mmUpdate to allow the player to scroll through the buttons.
- Counterbutton updating. If any of your counterbuttons use key inversion, their state text will not update when the invert key is pressed unless mmUpdate is used.
Example
Generally, a script which displays a menu which needs to use mmUpdate will look something like the following example quest script example:
scn MenuDisplayScript int displayStatus float fQuestDelayTime begin MenuMode if (displayStatus) mmUpdate endif end begin GameMode set fQuestDelayTime to 0.0001 if (displayStatus == 0) ; any setup here if (mmLoadMenu "menu.xml") set displayStatus to 1 else PrintC "menu failed to load" StopQuest MenuDisplayQuest endif elseif (mmGetStatus == 1) set displayStatus to 0 StopQuest MenuDisplayQuest endif end