mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Interaction - Add action to drop distant units from group (#10228)
Co-authored-by: Dystopian <sddex@ya.ru> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
parent
e798050a00
commit
b4700aeffc
@ -316,6 +316,12 @@ class CfgVehicles {
|
||||
statement = QUOTE(_player call FUNC(renameGroupUI));
|
||||
showDisabled =1;
|
||||
};
|
||||
class ACE_groupDropDistantUnits {
|
||||
displayName = CSTRING(groupDropDistantUnits);
|
||||
condition = QUOTE(call FUNC(canGroupDropDistantUnits));
|
||||
exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"};
|
||||
statement = QUOTE(call FUNC(groupDropDistantUnits));
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Equipment {
|
||||
|
@ -36,6 +36,8 @@ PREP(pullOutBody);
|
||||
PREP(canRenameGroup);
|
||||
PREP(renameGroupUI);
|
||||
PREP(renameGroup);
|
||||
PREP(canGroupDropDistantUnits);
|
||||
PREP(groupDropDistantUnits);
|
||||
|
||||
// Weapon Attachments
|
||||
PREP(getWeaponAttachmentsActions);
|
||||
|
@ -0,0 +1,20 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Checks if the unit can drop distant units from their group
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Unit can drop distant units <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_interaction_fnc_canGroupDropDistantUnits
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
(_unit == leader _unit) && {missionNamespace getVariable [QGVAR(groupDropUnitDistance), 100] > 0}
|
25
addons/interaction/functions/fnc_groupDropDistantUnits.sqf
Normal file
25
addons/interaction/functions/fnc_groupDropDistantUnits.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Drops distant units from their group
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_interaction_fnc_groupDropDistantUnits
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
{
|
||||
if ((_x distance _unit) > (missionNamespace getVariable [QGVAR(groupDropUnitDistance), 100])) then {
|
||||
TRACE_1("drop",_x);
|
||||
[_x] joinSilent grpNull;
|
||||
};
|
||||
} forEach (units group _unit);
|
@ -582,6 +582,9 @@
|
||||
<Chinese>小隊管理</Chinese>
|
||||
<Turkish>Takım Yönetimi</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Interaction_groupDropDistantUnits">
|
||||
<English>Drop Distant Members</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Interaction_TeamRED">
|
||||
<English>Red</English>
|
||||
<German>Rot</German>
|
||||
|
Loading…
Reference in New Issue
Block a user