MmUpdate
Jump to navigation
Jump to search
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.
mmUpdate
Updates a loaded menu. Must be called from the same script which called mmLoadMenu.
Every time you display a menu, you should call this function regularly, preferably every frame. This is necessary for several reasons:
- If another script or mod displays a MessageBox, it may overwrite the active dialog being shown my MenuMate. mmUpdate will detect this and redisplay your active dialog.
- counterbuttons which may be inverted by key press will not have thier display updated properly if mmUpdate is not called
- dialogs with more than 10 buttons can not work without mmUpdate
Example[edit | edit source]
Generally, a script which displays a MenuMate menu should look something like:
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 >= 0)
set displayStatus to 0
StopQuest MenuDisplayQuest
endif
end