diff --git a/addons/common/functions/fnc_getName.sqf b/addons/common/functions/fnc_getName.sqf index a7facd2c6d..8857fb306b 100644 --- a/addons/common/functions/fnc_getName.sqf +++ b/addons/common/functions/fnc_getName.sqf @@ -5,24 +5,27 @@ * Arguments: * 0: Object * 1: Use effective commander name when used on vehicles (default: false) + * 1: Get Raw Name (Don't sanatize HTML tags ``) (default: false) * * Return Value: * Object Name * + * Example: + * [player, false, true] call ace_common_fnc_getName; + * * Public: Yes */ #include "script_component.hpp" -params ["_unit", ["_showEffective", false]]; +params ["_unit", ["_showEffective", false], ["_useRaw", false]]; -private "_name"; -_name = ""; +private _name = ""; if (_unit isKindOf "CAManBase") then { - _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; + _name = _unit getVariable [(["ACE_Name", "ACE_NameRaw"] select _useRaw), localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; } else { if (_showEffective) then { - _name = [effectiveCommander _unit] call FUNC(getName); + _name = [effectiveCommander _unit, false, _useRaw] call FUNC(getName); } else { _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); }; diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index 1377f4ec35..0f0ede52b8 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -19,9 +19,9 @@ _requestID = ("ace_recieveRequest_f_id_"+_requestID); _target setVariable [_requestID, _this]; if (isLocalized _requestMessage) then { - _requestMessage = format [localize _requestMessage, [_caller] call FUNC(getName)]; + _requestMessage = format [localize _requestMessage, [_caller, false, true] call FUNC(getName)]; } else { - _requestMessage = format [_requestMessage, [_caller] call FUNC(getName)]; + _requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)]; }; hint format ["%1", _requestMessage]; // @todo ? diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index 749b36ded7..2450ba5be5 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -25,14 +25,14 @@ _array = []; switch _x do { case 60 : { // less than symbol: `<` if (_removeTags) then { - _array append toArray "["; + _array append toArray "<"; } else { _array pushBack _x; }; }; case 62 : { // greater than symbol: `>` if (_removeTags) then { - _array append toArray "]"; + _array append toArray ">"; } else { _array pushBack _x; }; diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index 117445b561..b9ecbdc3a6 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -17,9 +17,15 @@ params ["_unit"]; if (isNull _unit || {!alive _unit}) exitWith {}; if (_unit isKindOf "CAManBase") then { - _name = [name _unit, true] call FUNC(sanitizeString); - + private _sanitizedName = [name _unit, true] call FUNC(sanitizeString); + private _rawName = [name _unit, false] call FUNC(sanitizeString); + + //Debug Testing Code (with html tags): + // private _sanitizedName = ["Name", true] call FUNC(sanitizeString); + // private _rawName = ["Name", false] call FUNC(sanitizeString); + //if (_name != _unit getVariable ["ACE_Name", ""]) then { - _unit setVariable ["ACE_Name", _name, true]; + _unit setVariable ["ACE_Name", _sanitizedName, true]; + _unit setVariable ["ACE_NameRaw", _rawName, true]; //}; }; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index c2a3a6396e..213aa85c61 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -72,7 +72,7 @@ GVAR(disarmTarget) = _target; _icon = format [DEFUALTPATH, toLower (rank _target)]; if (_icon isEqualTo DEFUALTPATH) then {_icon = ""}; _rankPicture ctrlSetText _icon; - _playerName ctrlSetText ([GVAR(disarmTarget)] call EFUNC(common,getName)); + _playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName)); //Clear both inventory lists: lbClear _groundContainer; diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index 5a1e23a278..02c870a519 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -27,7 +27,7 @@ _fingerPos = if (_sourceUnit == ACE_player) then { _fingerPosPrecise vectorAdd [random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y] }; -_data = [ACE_diagTime, _fingerPos, ([_sourceUnit] call EFUNC(common,getName))]; +_data = [ACE_diagTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName))]; HASH_SET(GVAR(fingersHash), _sourceUnit, _data); if (GVAR(pfeh_id) == -1) then { diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 24b5bf4c6e..0fd9394f92 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -60,6 +60,6 @@ if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC( ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); - [_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 6910545a9d..d69fa90c86 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -21,5 +21,5 @@ _output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsi ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); -[_target,"activity",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target,"quick_view",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target,"activity",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target,"quick_view",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index 9024489a3b..b787376166 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -30,7 +30,7 @@ if (GVAR(level) > 1 && {(random 1) >= 0.6}) then { _target setvariable [QGVAR(bloodPressure), [50,70]]; }; -[_target, "activity", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index cf18475866..2bb237cc34 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -19,8 +19,8 @@ #include "script_component.hpp" params ["_caller", "_target", "_selectionName", "_className", "_items", "", ["_specificSpot", -1]]; -[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message if !([_target] call FUNC(hasMedicalEnabled)) exitwith { _this call FUNC(treatmentBasic_bandage); diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index ed5eb0858d..853f071195 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -68,6 +68,6 @@ if (alive _target) exitwith { // Resetting damage _target setDamage 0; - [_target, "activity", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); - [_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message + [_target, "activity", LSTRING(Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + [_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index b5b0af1401..5cd64a75b6 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -24,8 +24,8 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"]; { if (_x != "") then { [_target, _x] call FUNC(addToTriageCard); - [_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); - [_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); + [_target, "activity", LSTRING(Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); + [_target, "activity_view", LSTRING(Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); }; } foreach _items; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 2a7bbc6adf..e0225d243d 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -24,7 +24,7 @@ if (count _items == 0) exitwith {false}; _removeItem = _items select 0; [[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 5d3ba6e1d4..3a4dd5b50a 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -43,8 +43,8 @@ _removeItem = _items select 0; [[_target, _removeItem, _selectionName], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index ebe97e879d..80953b9969 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -14,7 +14,7 @@ if (!hasInterface) exitWith {}; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; + _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player, false, true] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index 8294a8db06..ac28a427d5 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -44,7 +44,7 @@ if (_alpha < 0) exitWith {}; //Don't waste time if not visable //Set Text: _name = if (_iconType in [ICON_NAME, ICON_NAME_RANK, ICON_NAME_SPEAK]) then { - [_target, true] call EFUNC(common,getName) + [_target, true, true] call EFUNC(common,getName) } else { "" }; diff --git a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf index 1c5a7b7cc2..1079ef6e6d 100644 --- a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf +++ b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf @@ -19,7 +19,7 @@ params ["_unit", "_killer"]; if (_unit != _killer && {side group _unit in [side group ACE_player, civilian]} && {side group _killer == side group ACE_player}) then { - systemChat format ["%1 was killed by %2", [_unit] call EFUNC(common,getName), [_killer] call EFUNC(common,getName)]; + systemChat format ["%1 was killed by %2", [_unit, false, true] call EFUNC(common,getName), [_killer, false, true] call EFUNC(common,getName)]; // Raise ACE globalEvent ["killedByFriendly", [_unit, _killer]] call EFUNC(common,globalEvent);