onGroupIconClick: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(([^=\| ]+)('''|\[\[)([^=\| ]+)) * +\|p1=" to " |s1= $1 |p1=")
m (Some wiki formatting)
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma2
|game1= arma2
|1.00
|version1= 1.00


|game2= arma2oa
|game2= arma2oa
Line 17: Line 17:
|gr2= Event Handlers
|gr2= Event Handlers


| Defines an action performed when player clicked on group marker (3D or in a map). The code executed once. This EH, unlike [[onGroupIconOverEnter]] and [[onGroupIconOverLeave]], has one more param which returns 1 if RMB was pressed, 0 otherwise. {{Feature|Informative|Since '''Arma 3''' ''v1.57'' a stackable version of this EH is available: [[Arma_3:_Event_Handlers/addMissionEventHandler#GroupIconClick|GroupIconClick]]}}
|descr= Defines an action performed when player clicked on group marker (3D or in a map). The code executed once.
This EH, unlike [[onGroupIconOverEnter]] and [[onGroupIconOverLeave]], has one more param which returns 1 if RMB was pressed, 0 otherwise.
{{Feature|arma3|Since {{arma3}} v1.58 a [[Arma 3: Mission Event Handlers#GroupIconClick|Mission Event Handler]] exists and should be used.}}


|s1= '''onGroupIconClick''' command
|s1= [[onGroupIconClick]] command


|p1= command: [[String]] or [[Code]] - script
|p1= command: [[String]] or [[Code]] - script
Line 25: Line 27:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>[[onGroupIconClick]]
|x1= <sqf>
onGroupIconClick
{
{
    // Passed values for _this are:
// passed values for _this are:
    _is3D = _this [[select]] 0;
params ["_is3D", "_group", "_wpID", "_posX", "_posY", "_shift", "_ctrl", "_alt"];
    _group = _this [[select]] 1;
    _wpID = _this [[select]] 2;
    _RMB = _this [[select]] 3;
    _posx = _this [[select]] 4;
    _posy = _this [[select]] 5;
    _shift = _this [[select]] 6;
    _ctrl = _this [[select]] 7;
    _alt = _this [[select]] 8;


    _message = [[format]] ["____ Info ____"];
// before Arma 3
    {_message = _message + [[format]] ["\n %1",_x]} [[forEach]] _this;
_is3D = _this select 0;
    [[hint]] _message;
_group = _this select 1;
}</code>
_wpID = _this select 2;
_RMB = _this select 3;
_posx = _this select 4;
_posy = _this select 5;
_shift = _this select 6;
_ctrl = _this select 7;
_alt = _this select 8;


|seealso= [[addGroupIcon]], [[clearGroupIcons]], [[getGroupIcon]], [[getGroupIconParams]], [[groupIconSelectable]], [[groupIconsVisible]], [[removeGroupIcon]], [[setGroupIcon]], [[setGroupIconParams]], [[setGroupIconsSelectable]], [[setGroupIconsVisible]], [[onGroupIconOverEnter]], [[onGroupIconOverLeave]]
_message = format ["____ Info ____"];
{_message = _message + format ["\n %1", _x]} forEach _this;
hint _message;
};
</sqf>
 
|seealso= [[addGroupIcon]] [[clearGroupIcons]] [[getGroupIcon]] [[getGroupIconParams]] [[groupIconSelectable]] [[groupIconsVisible]] [[removeGroupIcon]] [[setGroupIcon]] [[setGroupIconParams]] [[setGroupIconsSelectable]] [[setGroupIconsVisible]] [[onGroupIconOverEnter]] [[onGroupIconOverLeave]]
}}
}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 19:19, 13 May 2022

Hover & click on the images for description

Description

Description:
Defines an action performed when player clicked on group marker (3D or in a map). The code executed once. This EH, unlike onGroupIconOverEnter and onGroupIconOverLeave, has one more param which returns 1 if RMB was pressed, 0 otherwise.
Arma 3
Since Arma 3 v1.58 a Mission Event Handler exists and should be used.
Groups:
High CommandEvent Handlers

Syntax

Syntax:
onGroupIconClick command
Parameters:
command: String or Code - script
Return Value:
Nothing

Examples

Example 1:
onGroupIconClick { // passed values for _this are: params ["_is3D", "_group", "_wpID", "_posX", "_posY", "_shift", "_ctrl", "_alt"]; // before Arma 3 _is3D = _this select 0; _group = _this select 1; _wpID = _this select 2; _RMB = _this select 3; _posx = _this select 4; _posy = _this select 5; _shift = _this select 6; _ctrl = _this select 7; _alt = _this select 8; _message = format ["____ Info ____"]; {_message = _message + format ["\n %1", _x]} forEach _this; hint _message; };

Additional Information

See also:
addGroupIcon clearGroupIcons getGroupIcon getGroupIconParams groupIconSelectable groupIconsVisible removeGroupIcon setGroupIcon setGroupIconParams setGroupIconsSelectable setGroupIconsVisible onGroupIconOverEnter onGroupIconOverLeave

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