Difference between revisions of "MmUpdate"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Speedo
m
imported>Speedo
(updated)
Line 5: Line 5:
  mmGetStatus
  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.
Updates a loaded menu.  Must be called from the same script which called [[mmLoadMenu]].   


This function is necessary to update two aspects of menus:
Every time you display a menu, you should call this function regularly, preferably every frame.  This is necessary for several reasons:
*Button scrollingA dialog which has more than 10 buttons '''must''' use mmUpdate to allow the player to scroll through the buttons.
*If another script or mod displays a MessageBox, it may overwrite the active dialog being shown my MenuMatemmUpdate will detect this and redisplay your active dialog.
*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.
*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==
==Example==
Generally, a script which displays a menu which needs to use mmUpdate will look something like the following example quest script example:
Generally, a script which displays a MenuMate menu should look something like:


<pre>
<pre>
Line 39: Line 40:
     endif
     endif
      
      
   elseif (mmGetStatus == 1)
   elseif (mmGetStatus >= 0)
     set displayStatus to 0
     set displayStatus to 0
     StopQuest MenuDisplayQuest
     StopQuest MenuDisplayQuest

Revision as of 11:58, 17 December 2008


A command for MenuMate.

mmGetStatus

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