Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction - Add remote squad management #10258

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions addons/interaction/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ class CfgVehicles {
modifierFunction = QUOTE([ARR_3(assignedTeam _target,'PATHTOF(UI\team\team_management_ca.paa)',_this select 3)] call FUNC(modifyTeamManagementAction));
showDisabled = 1;

class ACE_Squad {
displayName = CSTRING(Squad);
condition = QUOTE(GVAR(remoteTeamManagement));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have (_unit == leader _unit)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably should.

exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"};
insertChildren = QUOTE(call FUNC(addSquadChildren));
};
class ACE_JoinTeamRed {
displayName = CSTRING(JoinTeamRed);
condition = QUOTE(true);
Expand Down Expand Up @@ -316,12 +322,6 @@ 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 {
Expand Down
3 changes: 1 addition & 2 deletions addons/interaction/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PREP(showMouseHint);
PREP(hideMouseHint);

// interaction with units
PREP(addSquadChildren);
PREP(canInteractWithCivilian);
PREP(canInteractWithVehicleCrew);
PREP(getDown);
Expand All @@ -36,8 +37,6 @@ PREP(pullOutBody);
PREP(canRenameGroup);
PREP(renameGroupUI);
PREP(renameGroup);
PREP(canGroupDropDistantUnits);
PREP(groupDropDistantUnits);

// Weapon Attachments
PREP(getWeaponAttachmentsActions);
Expand Down
51 changes: 51 additions & 0 deletions addons/interaction/functions/fnc_addSquadChildren.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Gets the squad child actions
*
* Arguments:
* 1: Player <OBJECT>
*
* Return Value:
* Children actions <ARRAY>
*
* Example:
* [player, player] call ace_interaction_fnc_addSquadChildren
*
* Public: No
*/

params ["", "_player"];

private _fnc_color = {
(switch (toUpper _this) do {
case "RED": {missionNamespace getVariable [QEGVAR(nametags,nametagColorRed), [221, 0, 0]]};
case "GREEN": {missionNamespace getVariable [QEGVAR(nametags,nametagColorGreen), [0, 221, 0]]};
case "BLUE": {missionNamespace getVariable [QEGVAR(nametags,nametagColorBlue), [0, 0, 221]]};
case "YELLOW": {missionNamespace getVariable [QEGVAR(nametags,nametagColorYellow), [221, 221, 0]]};
default {missionNamespace getVariable [QEGVAR(nametags,nametagColorMain), [255, 255, 255]]};
}) call BIS_fnc_colorRGBtoHTML
};

private _units = (units group _player) - [_player];

private _subActions = [];
_subActions pushBack (["drop", localize "str_a3_endgame_notifications_title_drop", "\a3\ui_f\data\igui\cfg\actions\ico_off_ca.paa",
{[_target] joinSilent grpNull}, {true}] call EFUNC(interact_menu,createAction));

{
private _icon = [QPATHTOF(UI\team\team_white_ca.paa), _x call _fnc_color];
private _name = if (_x != "MAIN") then { localize format [LSTRING(AssignTeam%1), _x] } else { LLSTRING(LeaveTeam) };
_subActions pushBack ([_x, _name, _icon,
{[_target, _this#2] call FUNC(joinTeam)}, {assignedTeam _target != _this#2}, {}, _x] call EFUNC(interact_menu,createAction));
} forEach ["RED", "GREEN", "BLUE", "YELLOW", "MAIN"];

private _actions = _units apply {
private _unit = _x;
private _icon = [QPATHTOF(UI\team\team_white_ca.paa), (assignedTeam _unit) call _fnc_color];
private _actionUnit = [hashValue _x, [_x, true] call EFUNC(common,getName), _icon, {}, {true}] call EFUNC(interact_menu,createAction);

[_actionUnit, _subActions apply { [_x, [], _unit] }, _unit]
};

_actions
20 changes: 0 additions & 20 deletions addons/interaction/functions/fnc_canGroupDropDistantUnits.sqf

This file was deleted.

25 changes: 0 additions & 25 deletions addons/interaction/functions/fnc_groupDropDistantUnits.sqf

This file was deleted.

8 changes: 8 additions & 0 deletions addons/interaction/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
true
] call CBA_fnc_addSetting;

[
QGVAR(remoteTeamManagement), "CHECKBOX",
[LSTRING(remoteTeamManagement_DisplayName), LSTRING(remoteTeamManagement_Description)],
format ["ACE %1", LLSTRING(DisplayName)],
true,
true
] call CBA_fnc_addSetting;

[
QGVAR(enableMagazinePassing), "CHECKBOX",
LSTRING(PassMagazineSetting),
Expand Down
23 changes: 21 additions & 2 deletions addons/interaction/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,27 @@
<Chinese>小隊管理</Chinese>
<Turkish>Takım Yönetimi</Turkish>
</Key>
<Key ID="STR_ACE_Interaction_groupDropDistantUnits">
<English>Drop Distant Members</English>
<Key ID="STR_ACE_Interaction_remoteTeamManagement_DisplayName">
<English>Remote Squad Management</English>
</Key>
<Key ID="STR_ACE_Interaction_remoteTeamManagement_Description">
<English>Allow dropping and changing team colors of any unit in player's squad</English>
</Key>
<Key ID="STR_ACE_Interaction_Squad">
<English>Squad</English>
<Czech>Družstvo</Czech>
<German>Trupp</German>
<Russian>Отряд</Russian>
<Polish>Drużyna</Polish>
<Italian>Squadra</Italian>
<Spanish>Escuadrón</Spanish>
<French>Escouade</French>
<Chinese>分隊</Chinese>
<Japanese>分隊</Japanese>
<Korean>분대</Korean>
<Portuguese>Esquadrão</Portuguese>
<Chinesesimp>小队</Chinesesimp>
<Turkish>Manga</Turkish>
</Key>
<Key ID="STR_ACE_Interaction_TeamRED">
<English>Red</English>
Expand Down