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:
PabstMirror 2024-08-21 20:13:29 -05:00 committed by GitHub
parent e798050a00
commit b4700aeffc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 56 additions and 0 deletions

View File

@ -316,6 +316,12 @@ class CfgVehicles {
statement = QUOTE(_player call FUNC(renameGroupUI)); statement = QUOTE(_player call FUNC(renameGroupUI));
showDisabled =1; 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 { class ACE_Equipment {

View File

@ -36,6 +36,8 @@ PREP(pullOutBody);
PREP(canRenameGroup); PREP(canRenameGroup);
PREP(renameGroupUI); PREP(renameGroupUI);
PREP(renameGroup); PREP(renameGroup);
PREP(canGroupDropDistantUnits);
PREP(groupDropDistantUnits);
// Weapon Attachments // Weapon Attachments
PREP(getWeaponAttachmentsActions); PREP(getWeaponAttachmentsActions);

View File

@ -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}

View 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);

View File

@ -582,6 +582,9 @@
<Chinese>小隊管理</Chinese> <Chinese>小隊管理</Chinese>
<Turkish>Takım Yönetimi</Turkish> <Turkish>Takım Yönetimi</Turkish>
</Key> </Key>
<Key ID="STR_ACE_Interaction_groupDropDistantUnits">
<English>Drop Distant Members</English>
</Key>
<Key ID="STR_ACE_Interaction_TeamRED"> <Key ID="STR_ACE_Interaction_TeamRED">
<English>Red</English> <English>Red</English>
<German>Rot</German> <German>Rot</German>