Difference between revisions of "MmUpdate"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Speedo
(created)
 
imported>Speedo
m
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
A command for [[:Category:MenuMate|MenuMate]].
A command for [[:Category:MenuMate|MenuMate]].


  mmGetStatus
  mmUpdate


Updates a loaded menu.  Must be called from the same script which called [[mmLoadMenu]].  When used, it should be used on 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

Latest revision as of 11:58, 17 December 2008


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