Difference between revisions of "DCS func addSubMenu"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
|fName= addSubMenu
 
|fName= addSubMenu
  
|vNum= 1.2.0
+
|vNum= 1.2.4
  
 
|par1= [[DCS_singleton_missionCommands|missionCommands]]
 
|par1= [[DCS_singleton_missionCommands|missionCommands]]
Line 46: Line 46:
  
 
   local requestM = missionCommands.addSubMenu('Request Asset')
 
   local requestM = missionCommands.addSubMenu('Request Asset')
   local rSead = missionCommands.addCommand('SEAD', requestM, doRequestFunction, {type = 'SEAD"})
+
   local rSead = missionCommands.addCommand('SEAD', requestM, doRequestFunction, {type = "SEAD"})
   local rCAS = missionCommands.addCommand('CAS', requestM, doRequestFunction, {type = 'CAS"})
+
   local rCAS = missionCommands.addCommand('CAS', requestM, doRequestFunction, {type = "CAS"})
   local rCAP= missionCommands.addCommand('CAP', requestM, doRequestFunction, {type = 'CAP"})
+
   local rCAP= missionCommands.addCommand('CAP', requestM, doRequestFunction, {type = "CAP"})
  
 
An example of how to create nested submenus...
 
An example of how to create nested submenus...
Line 62: Line 62:
 
}}
 
}}
 
[[Category:Singleton Functions|addSubMenu]]
 
[[Category:Singleton Functions|addSubMenu]]
 +
[[Category:Game Patch 1.2.4|addSubMenu]]

Latest revision as of 21:39, 11 January 2024

Scripting Root

Envrioment: Mission Scripting
Function: addSubMenu Added with: 1.2.4
Member Of: missionCommands
Syntax: table missionCommands.addSubMenu(string name , table path)
Description: Creates a submenu of a specified name for all players. Can be used to create nested sub menues. If the path is not specified, submenu is added to the root menu.


Return Value: table
Return Example: The following is a submenu named "SubMenuInRoot" that resides in the root of the F10 menu.
 {
   [1] = "SubMenuInRoot",
 }
Examples: The following creates a submenu named "Request Asset" and fills it with 3 options "SEAD", "CAS", and "CAP".
 local requestM = missionCommands.addSubMenu('Request Asset')
 local rSead = missionCommands.addCommand('SEAD', requestM, doRequestFunction, {type = "SEAD"})
 local rCAS = missionCommands.addCommand('CAS', requestM, doRequestFunction, {type = "CAS"})
 local rCAP= missionCommands.addCommand('CAP', requestM, doRequestFunction, {type = "CAP"})

An example of how to create nested submenus...

 local subR = missionCommands.addSubMenu('Root SubMenu')
 local subN1 = missionCommands.addSubMenu('SubMenu within RootSubmenu', subR)
 local subN2 = missionCommands.addSubMenu('we must go deeper', subN1)
 local subN3 = missionCommands.addSubMenu('Go take a UX class', subN2)
Related Functions: missionCommands Functions: addCommand, addSubMenu, removeItem, addCommandForCoalition, addSubMenuForCoalition, removeItemForCoalition, addCommandForGroup, addSubMenuForGroup, removeItemForGroup
Notes: