diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index b654b7020e6..5aa708ab300 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -72,9 +72,9 @@ class CfgVehicles { displayName = CSTRING(TeamManagement); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); statement = ""; + modifierFunction = QUOTE([ARR_3(assignedTeam _target, 'PATHTOF(UI\team\team_management_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); exceptions[] = {"isNotSwimming"}; showDisabled = 0; - icon = QPATHTOF(UI\team\team_management_ca.paa); class ACE_AssignTeamRed { displayName = CSTRING(AssignTeamRed); @@ -82,7 +82,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target,'RED',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; - icon = QPATHTOF(UI\team\team_red_ca.paa); + modifierFunction = QUOTE([ARR_3('RED', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_AssignTeamGreen { displayName = CSTRING(AssignTeamGreen); @@ -90,7 +90,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target,'GREEN',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; - icon = QPATHTOF(UI\team\team_green_ca.paa); + modifierFunction = QUOTE([ARR_3('GREEN', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_AssignTeamBlue { displayName = CSTRING(AssignTeamBlue); @@ -98,7 +98,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target,'BLUE',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; - icon = QPATHTOF(UI\team\team_blue_ca.paa); + modifierFunction = QUOTE([ARR_3('BLUE', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_AssignTeamYellow { displayName = CSTRING(AssignTeamYellow); @@ -106,7 +106,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target,'YELLOW',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; - icon = QPATHTOF(UI\team\team_yellow_ca.paa); + modifierFunction = QUOTE([ARR_3('YELLOW', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_UnassignTeam { displayName = CSTRING(LeaveTeam); @@ -114,7 +114,7 @@ class CfgVehicles { statement = QUOTE([ARR_3(_target,'MAIN',true)] call DFUNC(joinTeam)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; - icon = QPATHTOF(UI\team\team_white_ca.paa); + modifierFunction = QUOTE([ARR_3('MAIN', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; }; @@ -244,8 +244,8 @@ class CfgVehicles { condition = QUOTE(GVAR(EnableTeamManagement)); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = ""; + modifierFunction = QUOTE([ARR_3(assignedTeam _target, 'PATHTOF(UI\team\team_management_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); showDisabled = 1; - icon = QPATHTOF(UI\team\team_management_ca.paa); class ACE_JoinTeamRed { displayName = CSTRING(JoinTeamRed); @@ -253,7 +253,7 @@ class CfgVehicles { exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'RED',true)] call DFUNC(joinTeam)); showDisabled = 1; - icon = QPATHTOF(UI\team\team_red_ca.paa); + modifierFunction = QUOTE([ARR_3('RED', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_JoinTeamGreen { displayName = CSTRING(JoinTeamGreen); @@ -261,7 +261,7 @@ class CfgVehicles { exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'GREEN',true)] call DFUNC(joinTeam)); showDisabled = 1; - icon = QPATHTOF(UI\team\team_green_ca.paa); + modifierFunction = QUOTE([ARR_3('GREEN', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_JoinTeamBlue { displayName = CSTRING(JoinTeamBlue); @@ -269,7 +269,7 @@ class CfgVehicles { exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'BLUE',true)] call DFUNC(joinTeam)); showDisabled = 1; - icon = QPATHTOF(UI\team\team_blue_ca.paa); + modifierFunction = QUOTE([ARR_3('BLUE', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_JoinTeamYellow { displayName = CSTRING(JoinTeamYellow); @@ -277,7 +277,7 @@ class CfgVehicles { exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'YELLOW',true)] call DFUNC(joinTeam)); showDisabled = 1; - icon = QPATHTOF(UI\team\team_yellow_ca.paa); + modifierFunction = QUOTE([ARR_3('YELLOW', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_LeaveTeam { displayName = CSTRING(LeaveTeam); @@ -285,7 +285,7 @@ class CfgVehicles { exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"}; statement = QUOTE([ARR_3(_player,'MAIN',true)] call DFUNC(joinTeam)); showDisabled = 1; - icon = QPATHTOF(UI\team\team_white_ca.paa); + modifierFunction = QUOTE([ARR_3('MAIN', 'PATHTOF(UI\team\team_white_ca.paa)', _this select 3)] call FUNC(modifyTeamManagementAction)); }; class ACE_BecomeLeader { displayName = CSTRING(BecomeLeader); diff --git a/addons/interaction/XEH_PREP.hpp b/addons/interaction/XEH_PREP.hpp index ea6c275f365..5fb57ce6df3 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -18,6 +18,7 @@ PREP(getDown); PREP(sendAway); PREP(canJoinGroup); PREP(modifyJoinGroupAction); +PREP(modifyTeamManagementAction); PREP(canJoinTeam); PREP(joinTeam); PREP(canPassMagazine); diff --git a/addons/interaction/functions/fnc_modifyTeamManagementAction.sqf b/addons/interaction/functions/fnc_modifyTeamManagementAction.sqf new file mode 100644 index 00000000000..f7f82f2453e --- /dev/null +++ b/addons/interaction/functions/fnc_modifyTeamManagementAction.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" +/* + * Author: veteran29 + * Modifies the ACE_TeamManagement or join team action with given group color and icon. + * + * Arguments: + * 0: Team color + * 1: Icon to show on action + * 2: Action Data to modifiy + * + * Return Value: + * None + * + * + * Public: No + */ + +params ["_teamColor", "_icon", "_actionData"]; + +private _color = switch (toUpper _teamColor) 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]]}; +}; + +_actionData set [2, [_icon, _color call BIS_fnc_colorRGBtoHTML]]; + +nil