Skip to content

Commit

Permalink
Modify JoinGroup action to show group name (#5287)
Browse files Browse the repository at this point in the history
* Modify JoinGroup action to show group name

* header

* Header
  • Loading branch information
PabstMirror authored Jun 22, 2017
1 parent ace3964 commit 5f779c4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/interaction/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class CfgVehicles {
displayName = CSTRING(JoinGroup);
condition = QUOTE(GVAR(EnableTeamManagement) && {[ARR_2(_player,_target)] call DFUNC(canJoinGroup)});
statement = QUOTE([_player] joinSilent group _target);
modifierFunction = QUOTE(call FUNC(modifyJoinGroupAction));
showDisabled = 0;
priority = 2.6;
icon = QPATHTOF(UI\team\team_management_ca.paa);
Expand Down
1 change: 1 addition & 0 deletions addons/interaction/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ PREP(canInteractWithCivilian);
PREP(getDown);
PREP(sendAway);
PREP(canJoinGroup);
PREP(modifyJoinGroupAction);
PREP(canJoinTeam);
PREP(joinTeam);
PREP(canPassMagazine);
Expand Down
26 changes: 26 additions & 0 deletions addons/interaction/functions/fnc_modifyJoinGroupAction.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Author: PabstMirror
* Modifies the ACE_JoinGroup action to show group name.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
* 2: Args <ANY>
* 3: Action Data <ARRAY>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player, [], []] call ace_interaction_fnc_modifyJoinGroupAction
*
* Public: No
*/
#include "script_component.hpp"

params ["_target", "_player", "", "_actionData"];

private _actionText = format ["%1: %2", localize LSTRING(JoinGroup), groupID group _target];
TRACE_3("",_target,group _target,_actionText);

_actionData set [1, _actionText];

0 comments on commit 5f779c4

Please sign in to comment.