From fd7a5004f08ff267cd0a47748182702b7c4d9ad7 Mon Sep 17 00:00:00 2001 From: Sotirios Pupakis Date: Tue, 20 Feb 2024 00:53:47 +0100 Subject: [PATCH] KillTracker - Add option to filter out AI unit kills (#9800) * Add option to disable AI kills tracking in Kill Tracker Add an option to disable tracking of kills of AI units when using ACE Kill Tracker. Configurable through Addon Settings * Made setting global * Requested changes * Omitted optional default params Co-authored-by: Filip Maciejewski * Added missing dot Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Added missing dot in Czech translation * Update addons/killtracker/XEH_preInit.sqf * Update addons/killtracker/XEH_preInit.sqf --------- Co-authored-by: Filip Maciejewski Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/killtracker/CfgEventHandlers.hpp | 6 ++++++ addons/killtracker/XEH_postInit.sqf | 6 ++++-- addons/killtracker/XEH_preInit.sqf | 7 +++++++ addons/killtracker/initSettings.inc.sqf | 8 ++++++++ addons/killtracker/stringtable.xml | 12 ++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 addons/killtracker/XEH_preInit.sqf create mode 100644 addons/killtracker/initSettings.inc.sqf diff --git a/addons/killtracker/CfgEventHandlers.hpp b/addons/killtracker/CfgEventHandlers.hpp index 9cc1b0427b..4300a157b9 100644 --- a/addons/killtracker/CfgEventHandlers.hpp +++ b/addons/killtracker/CfgEventHandlers.hpp @@ -1,3 +1,9 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index 9cef418ece..c5adc26692 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -136,7 +136,9 @@ GVAR(killCount) = 0; _unitName = format ["*AI* - %1", getText ((configOf _unit) >> "displayName")]; }; }; - TRACE_3("send kill event",_killer,_unitName,_killInfo); - [QGVAR(kill), [_unitName, _killInfo], _killer] call CBA_fnc_targetEvent; + if (_unitIsPlayer || GVAR(trackAI)) then { + TRACE_3("send kill event",_killer,_unitName,_killInfo); + [QGVAR(kill), [_unitName, _killInfo], _killer] call CBA_fnc_targetEvent; + }; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/killtracker/XEH_preInit.sqf b/addons/killtracker/XEH_preInit.sqf new file mode 100644 index 0000000000..7c7b764686 --- /dev/null +++ b/addons/killtracker/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +#include "initSettings.inc.sqf" + +ADDON = true; diff --git a/addons/killtracker/initSettings.inc.sqf b/addons/killtracker/initSettings.inc.sqf new file mode 100644 index 0000000000..ebe1e55ccb --- /dev/null +++ b/addons/killtracker/initSettings.inc.sqf @@ -0,0 +1,8 @@ +[ + QGVAR(trackAI), + "CHECKBOX", + [LSTRING(TrackAI_DisplayName), LSTRING(TrackAI_Description)], + LSTRING(Category), + true, + 1 +] call CBA_fnc_addSetting; diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 4aa7308924..b4b1f5c2f5 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -1,6 +1,10 @@ + + ACE Kill Tracker + ACE Kill Tracker + ACE Killed Events ACE キルトラッカー @@ -86,5 +90,13 @@ 同士討ち Dost Atışı + + Track AI units killed by player + Sledovat AI zabité hráči + + + Defines if killed AIs will be shown in the kill tracker during mission debriefing. + Udává zdali se zabité AI budou ukazovat v kill trackeru v průběhu debriefingu po misi. +