Jump to content

Recommended Posts

Posted (edited)

Hi,
If a menu item is created for clients at birth using: 
 

Menu["Path"] = missionCommands.addCommandForGroup(GroupId, "menuitem", Path, function, variable)

can you then only remove this item from the menu using:

missionCommands.removeItemForGroup("GroupId", Menu["Path"])


It appears using:

 

missionCommands.removeItem(Menu["Path"])

wont work on a command added for the group ?
 

Edited by Chesster
Wrong info in code
Posted

"The string name is the text that will be displayed in the F10 Other menu and is also used in the function to remove the command from the menu."  from https://wiki.hoggitworld.com/view/DCS_func_addCommandForGroup   so "menuitem" is used as unique id.  

 

 i7-10700KF CPU  3.80GHz - 32 GO Ram - - nVidia RTX 2070 -  SSD Samsung EVO with LG  TV screen 40"  in 3840x2150 -  cockpit scale 1:1

- MS FFB2 Joystick  - COUGAR F16 throttle  - Saitek Pro Flight Rudder Pedals

 

Posted

Yes you are right given the info I provided. What i forgot to write in the code, is that the Command resides in a submenu, therefor I don't think you can simply use the string text as an identifier when removing the item, you need the path. And this is where the problem arises. Grimes has answered this before stating that the path is a table, not a string.

"Adds a command to the "F10 Other" radio menu allowing players to run specified scripting functions. Command is added for the specified groupId. The string name is the text that will be displayed in the F10 Other menu and is also used in the function to remove the command from the menu.

Path is an optional value that defines whether or not the command will be in a named submenu."

However when I create an item for Group, I was unable to remove that same command using missionCommands.removeItem, for some reason I had to use removeItemForGroup. Hence my question. 

Im very open to the fact that I messed my code up somehow 😄

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...