From 0a01ab0a65fc28d490fc0eff39dc67bc58a2b300 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Mon, 4 Nov 2024 01:45:52 +0100 Subject: [PATCH 1/3] Tagging - Improve marker creation --- addons/common/functions/fnc_createPlayerMarker.sqf | 4 ++-- addons/tagging/XEH_postInit.sqf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_createPlayerMarker.sqf b/addons/common/functions/fnc_createPlayerMarker.sqf index ca552f23..4337ff56 100644 --- a/addons/common/functions/fnc_createPlayerMarker.sqf +++ b/addons/common/functions/fnc_createPlayerMarker.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" /* * Author: veteran29 - * Create player owned marker. + * Create player owned marker locally. * * Arguments: * 0: Marker position @@ -43,4 +43,4 @@ GVAR(playerMarkerIdx) = GVAR(playerMarkerIdx) + 1; private _markerId = format ["_USER_DEFINED #%1/%2/%3", getPlayerID _player, _id, _channel]; -createMarker [_markerId, _position, _channel, _player] // return +createMarkerLocal [_markerId, _position, _channel, _player] // return diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index f56adfb0..2fb8d8ae 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -18,8 +18,8 @@ if (hasInterface) then { if (_colorIndex == -1) exitWith {}; private _marker = [_object, "side", _unit] call EFUNC(common,createPlayerMarker); - _marker setMarkerShape "ICON"; - _marker setMarkerType "hd_dot"; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; _marker setMarkerColor (MARKER_COLORS select _colorIndex); }] call CBA_fnc_addEventHandler; From 5867508c8397cb0597d0064fc30300e58e7e7c6c Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Mon, 4 Nov 2024 02:05:40 +0100 Subject: [PATCH 2/3] Tagging - Improve color check performance --- addons/tagging/XEH_postInit.sqf | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index 2fb8d8ae..0eae99f2 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -9,13 +9,12 @@ if (hasInterface) then { // Check if tag created on building by local player if (!(_object isKindOf "Building") || {_unit isNotEqualTo player}) exitWith {}; - private _colorIndex = { - if (_texture find _x != -1) exitWith {_forEachIndex}; - -1 - } forEach TEXTURE_COLORS; + private _colorIndex = TEXTURE_COLORS findIf {toLower _texture find _x != -1}; // no matching color, do not create marker - if (_colorIndex == -1) exitWith {}; + if (_colorIndex == -1) exitWith { + WARNING_1("Unsupported tag color %1",_texture); + }; private _marker = [_object, "side", _unit] call EFUNC(common,createPlayerMarker); _marker setMarkerShapeLocal "ICON"; From 06653c35fad4e52fed86f33641e70a552233a751 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Mon, 4 Nov 2024 02:06:00 +0100 Subject: [PATCH 3/3] Tagging - Add support for yellow and white colors --- addons/tagging/script_component.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/tagging/script_component.hpp b/addons/tagging/script_component.hpp index e57576dc..2dfd1bb2 100644 --- a/addons/tagging/script_component.hpp +++ b/addons/tagging/script_component.hpp @@ -13,5 +13,5 @@ #include "\z\afm\addons\main\script_macros.hpp" -#define MARKER_COLORS ["ColorRed", "ColorGreen", "ColorBlue", "ColorBlack"] -#define TEXTURE_COLORS ["red", "green", "blue", "black"] +#define MARKER_COLORS ["ColorRed", "ColorGreen", "ColorBlue", "ColorBlack", "ColorYellow", "ColorWhite"] +#define TEXTURE_COLORS ["red", "green", "blue", "black", "yellow", "white"]