Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interaction - Show current team color in Team Management menu (#7650)
* Show current team in interaction menu * Use nametags color for Team Management icon color * Use nametags color in Join team action icons colors * Update addons/interaction/functions/fnc_modifyTeamManagementAction.sqf Co-Authored-By: jonpas <jonpas33@gmail.com> * Apply suggestions from code review Co-authored-by: jonpas <jonpas33@gmail.com>
- Loading branch information
Showing
3 changed files
with
43 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
addons/interaction/functions/fnc_modifyTeamManagementAction.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <STRING> | ||
* 1: Icon to show on action <STRING> | ||
* 2: Action Data to modifiy <ARRAY> | ||
* | ||
* 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 |