diff --git a/addons/ballistics/ACE_Arsenal_Stats.hpp b/addons/ballistics/ACE_Arsenal_Stats.hpp index 1a731b08b6..c3a1de2bce 100644 --- a/addons/ballistics/ACE_Arsenal_Stats.hpp +++ b/addons/ballistics/ACE_Arsenal_Stats.hpp @@ -67,4 +67,14 @@ class EGVAR(arsenal,stats) { textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_weaponMuzzleVelocity)); tabs[] = {{0,1}, {}}; }; + class ACE_magazineAiUsage: statBase { + scope = 2; + priority = 0; + stats[] = {"aiAmmoUsageFlags"}; + displayName= CSTRING(ammoUsage_ai); + showText= 1; + textStatement = QUOTE(call FUNC(statTextStatement_magazineAiUsage)); + condition = QUOTE(is3DEN || {!isNull getAssignedCuratorLogic player} || {missionNamespace getVariable [ARR_2(QQGVAR(showAIMagazineUse), missionName == 'Arsenal')]}); + tabs[] = {{}, {4}}; + }; }; diff --git a/addons/ballistics/XEH_PREP.hpp b/addons/ballistics/XEH_PREP.hpp index c370b5fe1f..03a5055fcb 100644 --- a/addons/ballistics/XEH_PREP.hpp +++ b/addons/ballistics/XEH_PREP.hpp @@ -1,2 +1,3 @@ -PREP(statTextStatement_weaponMuzzleVelocity); +PREP(statTextStatement_magazineAiUsage); PREP(statTextStatement_magazineMuzzleVelocity); +PREP(statTextStatement_weaponMuzzleVelocity); diff --git a/addons/ballistics/functions/fnc_statTextStatement_magazineAiUsage.sqf b/addons/ballistics/functions/fnc_statTextStatement_magazineAiUsage.sqf new file mode 100644 index 0000000000..fa3e602440 --- /dev/null +++ b/addons/ballistics/functions/fnc_statTextStatement_magazineAiUsage.sqf @@ -0,0 +1,32 @@ +#include "script_component.hpp" +/* + * Author: PabstMirror + * Text statement for the magazine's AI Usage. + * + * Arguments: + * 0: not used + * 1: item config path (CONFIG) + * + * Return Value: + * String to display + * + * Public: No + */ + +params ["", "_config"]; +TRACE_1("statTextStatement_magazineAiUsage",_config); + +private _ammo = getText (_config >> "ammo"); +private _aiAmmoUsageFlags = getNumber (configFile >> "CfgAmmo" >> _ammo >> "aiAmmoUsageFlags"); +private _cost = getNumber (configFile >> "CfgAmmo" >> _ammo >> "cost"); + +private _output = []; + +if ([_aiAmmoUsageFlags, 1] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_illumination) }; +if ([_aiAmmoUsageFlags, 4] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_concealment) }; +if ([_aiAmmoUsageFlags, 64] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_infantry) }; +if ([_aiAmmoUsageFlags, 128] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_lightVehicle) }; +if ([_aiAmmoUsageFlags, 256] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_armor) }; +if ([_aiAmmoUsageFlags, 512] call BIS_fnc_bitflagsCheck) then { _output pushBack LLSTRING(ammoUsageShort_aircraft) }; + +(_output joinString ", ") + format [" [%1 %2]", localize "str_a3_cfgvehicles_modulecuratorsetobjectcost_f_arguments_cost", _cost] diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 576e239f2f..f9cd051d90 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -3511,5 +3511,26 @@ Namlu çıkış hızı 총구 속도 + + AI Usage + + + Illum + + + Smoke + + + Inf + + + Veh + + + Armor + + + Air +