MmUpdate

From the Oblivion ConstructionSet Wiki
Revision as of 11:58, 17 December 2008 by imported>Speedo
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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

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