gribbleshnibit8

MCM Submenu as a Function Example

Aug 28th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. scn DarnMCMScript
  2.  
  3. int iMaster
  4. int iOption
  5. int iSubMenu
  6. float fValue
  7. reference rList
  8.  
  9. begin GameMode
  10. if GetGameRestarted
  11. if IsModLoaded "The Mod Configuration Menu.esp"
  12. set iMaster to GetModIndex "The Mod Configuration Menu.esp"
  13. set rList to BuildRef iMaster 2790
  14. ListAddForm rList [Your item from Step 4 above]
  15. endif
  16. endif
  17. end
  18.  
  19. begin MenuMode 1013
  20. if IsModLoaded "The Mod Configuration Menu.esp"
  21. else
  22. Return
  23. endif
  24.  
  25. if GetUIFloat "StartMenu/MCM/_ActiveMod" == GetModIndex "[Your Mod]"
  26. set iOption to GetUIFloat "StartMenu/MCM/_ActiveOption"
  27. set fValue to GetUIFloat "StartMenu/MCM/_Value"
  28.  
  29.  
  30. if GetUIFloat "StartMenu/MCM/*:5/SubMenu1/_enable" == 0
  31. SetUIFloat "StartMenu/MCM/_ActiveSubMenu" [number]
  32. SetUIFloat "StartMenu/MCM/*:5/SubMenu1/_enable" 1
  33. SetUIString "StartMenu/MCM/*:5/SubMenu1/text/string" "Sub Menu 1"
  34. SetUIString "StartMenu/MCM/*:8/SubTitle1/string" "Example Sub Menu 1"
  35.  
  36. SetUIFloat "StartMenu/MCM/*:5/SubMenu2/_enable" 1
  37. SetUIString "StartMenu/MCM/*:5/SubMenu2/text/string" "Sub Menu 2"
  38. SetUIString "StartMenu/MCM/*:8/SubTitle2/string" "Example Sub Menu 2"
  39. endif
  40.  
  41. set iSubMenu to GetUIFloat "StartMenu/MCM/_ActiveSubMenu"
  42.  
  43. if iSubMenu == 1
  44. Call SubMenu1Function iOption fValue
  45. elseif iSubMenu == 2
  46. Call SubMenu2Function iOption fValue
  47. elseif iSubMenu == 3
  48. Call SubMenu3Function iOption fValue
  49. elseif iSubMenu == 4
  50. Call SubMenu4Function iOption fValue
  51. endif
  52.  
  53. endif
  54. end
  55.  
  56.  
  57.  
  58.  
  59. scn SubMenu1Function
  60.  
  61. int iOption
  62. int iTemp
  63. int iMouseover
  64. float fValue
  65. float fTemp
  66.  
  67. BEGIN Function {iOption fValue}
  68.  
  69. if GetUIFloat "StartMenu/MCM/_Reset" ;1 - RESET
  70. SetUIFloat "StartMenu/MCM/_Reset" 0
  71.  
  72. SetUIFloat "StartMenu/MCM/*:1/_columns" [number]
  73.  
  74. elseif GetUIFloat "StartMenu/MCM/_Default" ;2 - DEFAULT
  75. SetUIFloat "StartMenu/MCM/_Default" 0
  76. SetUIFloat "StartMenu/MCM/_Reset" 1
  77.  
  78. elseif GetUIFloat "StartMenu/MCM/_NewValue" ;3 - NEW VALUE
  79. SetUIFloat "StartMenu/MCM/_NewValue" 0
  80. SetUIFloat "StartMenu/MCM/_Reset" 1
  81.  
  82. elseif GetUIFloat "StartMenu/MCM/_ShowList" == 1 ;4 - SHOW LIST
  83. SetUIFloat "StartMenu/MCM/_ShowList" 2
  84.  
  85. elseif GetUIFloat "StartMenu/MCM/_ShowScale" == 1 ;5 - SHOW SCALE
  86. SetUIFloat "StartMenu/MCM/_ShowScale" 2
  87.  
  88. elseif GetUIFloat "StartMenu/MCM/_DefaultScale" ;6 - DEFAULT SCALE
  89. SetUIFloat "StartMenu/MCM/_DefaultScale" 0
  90. SetUIFloat "StartMenu/MCM/_ShowScale" 2
  91.  
  92. endif
  93.  
  94. if iMouseover != GetUIFloat "StartMenu/MCM/*:1/_optionID" ;7 - MOUSE-OVER
  95. set iMouseover to GetUIFloat "StartMenu/MCM/*:1/_optionID"
  96. if iMouseover
  97. SetUIFloat "StartMenu/MCM/MCM_Info/visible" 1
  98.  
  99. if iMouseover == 1
  100. else
  101. SetUIFloat "StartMenu/MCM/MCM_Info/visible" 0
  102. endif
  103. else
  104. SetUIFloat "StartMenu/MCM/MCM_Info/visible" 0
  105. endif
  106. endif
  107.  
  108. END
Advertisement
Add Comment
Please, Sign In to add comment