Jump to content
Sign in to follow this  
f2k sel

How do you use submenu with CommunicationMenu

Recommended Posts

I was wondering if anyone knows how to add submenus when using the Comms Menu system.

class CfgCommunicationMenu

{

class whatever

{

text = "my things"; // Text displayed in the menu and in a notification

submenu = ""; // Submenu opened upon activation (expression is ignored when submenu is not empty.)

expression = "hint 'test message';"; // Code executed upon activation

icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\artillery_ca.paa"; // Icon displayed permanently next to the command menu

cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected

enable = "1"; // Simple expression condition for enabling the item

removeAfterExpressionCall = 1; // 1 to remove the item after calling

};

};

Would you just add basically all the same as above but between the two quotes?

I'm not at my right PC so can't test right now.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

I did after a while find a way to make it work.

All you need to do is change submenu so it call the correct menu

change to

submenu = "#USER:whatever";

I also have an init.sqf file where preprocess the script

call  compile  preprocessfile "menu.sqf";

save as "menu.sqf"

whatever = [
 ["Your code",true],
 ["header text", [0],"",-2,[["expression", ""]], "1", "0"], // header text 
 ["one"         ,[2],"",-5,[["expression","[]  execVM 'do_things.sqf'"]],"1","0"],
 ["two"         ,[3],"",-5,[["expression","[]  execVM 'do_things.sqf'"]],"1","0"]
];

I can't check for syntax right now but that's the basic way it works.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×