BIS fnc addCommMenuItem: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= |p5=" to "|PARAMETER4= |p5=")
m (Some wiki formatting)
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 0.50


|0.50|Game version=
|eff= local
|arg= local


|eff= local |MPEFFECTS=
|gr1= Communication Menu
|arg= local |MPARGUMENTS=
____________________________________________________________________________________________


| Add [[Arma_3_Communication_Menu|communication menu]] to the given unit.
|descr= Add [[Arma 3: Communication Menu|communication menu]] to the given unit.


The item will be available in the Communication menu and visualized in comm menu icon area.|DESCRIPTION=
The item will be available in the Communication menu and visualized in comm menu icon area.
____________________________________________________________________________________________


| [owner,itemClass,textArguments,expressionArguments,notification] call [[BIS_fnc_addCommMenuItem]]; |SYNTAX=
|s1= [owner, itemClass, textArguments, expressionArguments, notification] call [[BIS_fnc_addCommMenuItem]]


|p1= '''owner''': [[Object]] - object to which the item belongs to |Parameter1=
|p1= '''owner''': [[Object]] - object to which the item belongs to
|p2= '''itemClass''': [[String]] - CfgCommunicationMenu class |Parameter2=


|p3= '''textArguments''' (Optional): [[Any]] |=
|p2= '''itemClass''': [[String]] - {{hl|CfgCommunicationMenu}} class
|p4= '''expressionArguments''' (Optional): [[Any]]  |PARAMETER4=


|p5= '''notification''' (Optional): [[String]] - notification class from CfgNotifications. Empty string will disabled the notification. |=
|p3= '''textArguments''': [[Anything]] - (Optional) additional info to display in the {{hl|text}} attribute. {{hl|%1}} will be replaced by the first array element, {{hl|%2}} with the second and so on.


| [[Number]] - item ID, used in [[BIS_fnc_removeCommMenuItem]] |RETURNVALUE=
|p4= '''expressionArguments''': [[Anything]] - (Optional) similar to '''textArguments''', just this time in the {{hl|expression}} attribute.
____________________________________________________________________________________________
 
|x1= <code>_supportHeli = <nowiki>[</nowiki>[[player]],"Support_Request_CAS_Heli"] [[call]] [[BIS_fnc_addCommMenuItem]];
_supportHeli = <nowiki>[</nowiki>[[player]],"Support_Request_CAS_Heli",nil,nil,""] [[call]] [[BIS_fnc_addCommMenuItem]]; {{codecomment|// don't show notification}}</code> |=
____________________________________________________________________________________________


| [[BIS_fnc_removeCommMenuItem]], [[Arma_3_Communication_Menu]] |SEEALSO=
|p5= '''notification''': [[String]] - (Optional) notification class from {{hl|CfgNotifications}}. Empty string will disabled the notification.


}}
|r1= [[Number]] - item ID, used in [[BIS_fnc_removeCommMenuItem]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>
<dl class="command_description">
private _supportHeli = [player,"Support_Request_CAS_Heli"] call BIS_fnc_addCommMenuItem;
<!-- Note Section BEGIN -->
_supportHeli = [player,"Support_Request_CAS_Heli",nil,nil,""] call BIS_fnc_addCommMenuItem; // don't show notification
</sqf>


<!-- Note Section END -->
|seealso= [[BIS_fnc_removeCommMenuItem]] [[Arma 3: Communication Menu]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:addCommMenuItem}}]]
[[Category:Functions|{{uc:addCommMenuItem}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:addCommMenuItem}}]]

Latest revision as of 14:26, 27 July 2022

Hover & click on the images for description

Description

Description:
Add communication menu to the given unit. The item will be available in the Communication menu and visualized in comm menu icon area.
Execution:
call
Groups:
Communication Menu

Syntax

Syntax:
[owner, itemClass, textArguments, expressionArguments, notification] call BIS_fnc_addCommMenuItem
Parameters:
owner: Object - object to which the item belongs to
itemClass: String - CfgCommunicationMenu class
textArguments: Anything - (Optional) additional info to display in the text attribute. %1 will be replaced by the first array element, %2 with the second and so on.
expressionArguments: Anything - (Optional) similar to textArguments, just this time in the expression attribute.
notification: String - (Optional) notification class from CfgNotifications. Empty string will disabled the notification.
Return Value:
Number - item ID, used in BIS_fnc_removeCommMenuItem

Examples

Example 1:
private _supportHeli = [player,"Support_Request_CAS_Heli"] call BIS_fnc_addCommMenuItem; _supportHeli = [player,"Support_Request_CAS_Heli",nil,nil,""] call BIS_fnc_addCommMenuItem; // don't show notification

Additional Information

See also:
BIS_fnc_removeCommMenuItem Arma 3: Communication Menu

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