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 - Show current team color in Team Management menu #7650

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions addons/interaction/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class CfgVehicles {
displayName = CSTRING(TeamManagement);
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)});
statement = "";
modifierFunction = QUOTE(call FUNC(modifyTeamManagementAction));
exceptions[] = {"isNotSwimming"};
showDisabled = 0;
icon = QPATHTOF(UI\team\team_management_ca.paa);

class ACE_AssignTeamRed {
displayName = CSTRING(AssignTeamRed);
Expand Down Expand Up @@ -244,8 +244,8 @@ class CfgVehicles {
condition = QUOTE(GVAR(EnableTeamManagement));
exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"};
statement = "";
modifierFunction = QUOTE(call FUNC(modifyTeamManagementAction));
showDisabled = 1;
icon = QPATHTOF(UI\team\team_management_ca.paa);

class ACE_JoinTeamRed {
displayName = CSTRING(JoinTeamRed);
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 @@ -18,6 +18,7 @@ PREP(getDown);
PREP(sendAway);
PREP(canJoinGroup);
PREP(modifyJoinGroupAction);
PREP(modifyTeamManagementAction);
PREP(canJoinTeam);
PREP(joinTeam);
PREP(canPassMagazine);
Expand Down
31 changes: 31 additions & 0 deletions addons/interaction/functions/fnc_modifyTeamManagementAction.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "script_component.hpp"
/*
* Author: veteran29
* Modifies the ACE_TeamManagement action to show current group color.
veteran29 marked this conversation as resolved.
Show resolved Hide resolved
*
* Arguments:
* 0: Target <OBJECT>
veteran29 marked this conversation as resolved.
Show resolved Hide resolved
* 1: Player <OBJECT>
* 2: Args <ANY>
* 3: Action Data <ARRAY>
veteran29 marked this conversation as resolved.
Show resolved Hide resolved
*
* Return Value:
* None
*
*
* Public: No
*/

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

private _color = switch (assignedTeam _target) do {
case "RED": {"#FF0000"};
case "GREEN": {"#00FF00"};
case "BLUE": {"#0000FF"};
case "YELLOW": {"#FFFF00"};
default {"#FFFFFF"};
jonpas marked this conversation as resolved.
Show resolved Hide resolved
};

_actionData set [2, [QPATHTOF(UI\team\team_management_ca.paa), _color]];

nil
jonpas marked this conversation as resolved.
Show resolved Hide resolved