From 02616ebbb2ffc88626d499df68371c59ecd85166 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Thu, 3 Mar 2016 19:43:26 -0300 Subject: [PATCH 1/3] Throw a globalEvent when a tag is created. Close #3521. --- addons/tagging/functions/fnc_createTag.sqf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index fdb2cd08b0..a1a7a89002 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -7,6 +7,7 @@ * 1: Vector dir and up * 2: Colour of the tag (valid colours are black, red, green and blue) * 3: Object it should be tied too + * 4: Unit that created the tag * * Return Value: * None @@ -19,8 +20,8 @@ #include "script_component.hpp" -params ["_tagPosASL", "_vectorDirAndUp", "_color", "_object"]; -TRACE_4("createTag:", _tagPosASL, _vectorDirAndUp, _color, _object); +params ["_tagPosASL", "_vectorDirAndUp", "_color", "_object", "_unit"]; +TRACE_5("createTag:", _tagPosASL, _vectorDirAndUp, _color, _object, _unit); if !((toLower _color) in ["black", "red", "green", "blue"]) exitWith { ACE_LOGERROR_1("%1 is not a valid tag colour.", _color); @@ -31,6 +32,9 @@ _tag setObjectTextureGlobal [0, '\z\ace\addons\tagging\UI\tags\' + _color + '\' _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; +// Throw a global event for mision makers +["tagCreated", [_tag, _color, _object, _unit]] call EFUNC(common,globalEvent); + if (isNull _object) exitWith {}; // If the tag is applied to an object, handle its destruction From 5450954fc2f3875beb3c53582677057f50d4f978 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Fri, 4 Mar 2016 09:16:42 -0300 Subject: [PATCH 2/3] Rename the event as "ace_tagging_tagCreated" --- addons/tagging/functions/fnc_createTag.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index a1a7a89002..812decbbb9 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -24,7 +24,7 @@ params ["_tagPosASL", "_vectorDirAndUp", "_color", "_object", "_unit"]; TRACE_5("createTag:", _tagPosASL, _vectorDirAndUp, _color, _object, _unit); if !((toLower _color) in ["black", "red", "green", "blue"]) exitWith { - ACE_LOGERROR_1("%1 is not a valid tag colour.", _color); + ACE_LOGERROR_1("%1 is not a valid tag color.", _color); }; private _tag = "UserTexture1m_F" createVehicle [0,0,0]; @@ -33,7 +33,7 @@ _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; // Throw a global event for mision makers -["tagCreated", [_tag, _color, _object, _unit]] call EFUNC(common,globalEvent); +[QGVAR(tagCreated), [_tag, _color, _object, _unit]] call EFUNC(common,globalEvent); if (isNull _object) exitWith {}; From e15d534fd106867baf76874bdf6f524f84d8c3b9 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sat, 5 Mar 2016 21:11:53 -0300 Subject: [PATCH 3/3] Rename event, removing prefix. Back to square one. --- addons/tagging/functions/fnc_createTag.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 812decbbb9..fb966b5b64 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -33,7 +33,7 @@ _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; // Throw a global event for mision makers -[QGVAR(tagCreated), [_tag, _color, _object, _unit]] call EFUNC(common,globalEvent); +["tagCreated", [_tag, _color, _object, _unit]] call EFUNC(common,globalEvent); if (isNull _object) exitWith {};