BIS fnc createMenu: Difference between revisions
m (Text replacement - "\[\[[cC]ategory:[fF]unctions\|\{\{uc:[a-z A-Z_]*\}\}\]\]" to "")  | 
				Lou Montana (talk | contribs)  m (Some wiki formatting)  | 
				||
| (18 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{RV|type=function  | {{RV|type=function  | ||
| arma2  | |game1= arma2  | ||
|version1= 1.00  | |||
|1.  | |game2= arma2oa  | ||
|version2= 1.50  | |||
|  | |game3= tkoh  | ||
|version3= 1.00  | |||
|   | |game4= arma3  | ||
|version4= 0.50  | |||
|gr1= Communication Menu  | |||
|descr= Create custom commanding menu (with multiple pages if necessary).  | |||
|s1= [namePath, variable, itemDetails, subMenu, codeStr, parameters, showKey] call [[BIS_fnc_createMenu]]  | |||
|   | |p1= namePath: [[String]] or [[Array]] - can be one of:  | ||
* [[String]] - menu name  | |||
* [[Array]] - format [menuName, context]  | |||
|  | |p2= variable: [[String]] - variable in which will be menu params stored (as {{hl|''variable''_0}}, {{hl|''variable''_1}} etc)  | ||
|  | |p3= itemDetails: [[Array]] - menu items, format can be one of:  | ||
}}  | * [items]  | ||
* [<nowiki/>[items], [itemNames], [itemEnable]] if custom parameters are to be set (names, enable values)  | |||
|p4= subMenu: [[String]] - name of the submenu which will open when item is activated. Name of the selected item is passed to string as {{hl|%1}}  | |||
|p5= codeStr: [[String]] - expression which is executed when ''item'' is activated; item's name is passed to string as {{hl|%1}}, ID as {{hl|%2}}, ''parameters'' (below) as {{hl|%3}}  | |||
|p6= parameters: [[Anything]] - (Optional) passed to ''codeStr'' as {{hl|%3}}  | |||
|p7= showKey: [[Boolean]] - (Optional, default [[true]]) [[false]] to hide number shortcuts  | |||
|r1= [[Boolean]] - always [[true]]  | |||
|x1= <sqf>  | |||
["Menu", "b", ["first", "second"], "","hint 'ahoj'"] call BIS_fnc_createMenu;  | |||
showCommandingMenu "#USER:b_0";  | |||
</sqf>  | |||
|x2= <sqf>  | |||
private _itemDetails = [["firstData", "secondData"], ["First", "Second"]];  | |||
["Menu", "b", _itemDetails, "", "hint (str '%1' + str '%2' + str '%3')"] call BIS_fnc_createMenu;  | |||
showCommandingMenu "#USER:b_0";  | |||
</sqf>  | |||
|seealso= [[Conversations]]  | |||
[[  | }}  | ||
Latest revision as of 23:37, 23 October 2025
Description
- Description:
 - Create custom commanding menu (with multiple pages if necessary).
 - Execution:
 - call
 - Groups:
 - Communication Menu
 
Syntax
- Syntax:
 - [namePath, variable, itemDetails, subMenu, codeStr, parameters, showKey] call BIS_fnc_createMenu
 - Parameters:
 - namePath: String or Array - can be one of:
 - variable: String - variable in which will be menu params stored (as variable_0, variable_1 etc)
 - itemDetails: Array - menu items, format can be one of:
- [items]
 - [[items], [itemNames], [itemEnable]] if custom parameters are to be set (names, enable values)
 
 - subMenu: String - name of the submenu which will open when item is activated. Name of the selected item is passed to string as %1
 - codeStr: String - expression which is executed when item is activated; item's name is passed to string as %1, ID as %2, parameters (below) as %3
 - parameters: Anything - (Optional) passed to codeStr as %3
 - showKey: Boolean - (Optional, default true) false to hide number shortcuts
 - Return Value:
 - Boolean - always true
 
Examples
- Example 1:
 - ["Menu", "b", ["first", "second"], "","hint 'ahoj'"] call BIS_fnc_createMenu; showCommandingMenu "#USER:b_0";
 - Example 2:
 - private _itemDetails = [["firstData", "secondData"], ["First", "Second"]]; ["Menu", "b", _itemDetails, "", "hint (str '%1' + str '%2' + str '%3')"] call BIS_fnc_createMenu; showCommandingMenu "#USER:b_0";
 
Additional Information
- See also:
 - Conversations
 
Notes
- 
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note