Difference between revisions of "DCS func addSubMenu"

From DCS World Wiki - Hoggitworld.com
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]]

Revision as of 22:20, 17 March 2022

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: