Arsenal - Show load stat's actual value (#9833)

* Arsenal - Show load stat's actual value

* Update addons/arsenal/functions/fnc_statTextStatement_load.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
PabstMirror 2024-03-09 17:17:13 -06:00 committed by GitHub
parent a3b9c53fd8
commit 9bb9fae85c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 0 deletions

View File

@ -123,7 +123,9 @@ class GVAR(stats) {
stats[] = {"maximumLoad"};
displayName = "$STR_a3_rscdisplayarsenal_stat_load";
showBar = 1;
showText = 1;
barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_3([ARR_2(0,500)],[ARR_2(0.01,1)],false)])] call FUNC(statBarStatement_default));
textStatement = QUOTE(call FUNC(statTextStatement_load));
tabs[] = {{3,4,5}, {}};
};
class ACE_smokeChemTTL: statBase {

View File

@ -98,6 +98,7 @@ PREP(statBarStatement_rateOfFIre);
PREP(statTextStatement_accuracy);
PREP(statTextStatement_explosionTime);
PREP(statTextStatement_illuminators);
PREP(statTextStatement_load);
PREP(statTextStatement_magCount);
PREP(statTextStatement_mass);
PREP(statTextStatement_rateOfFire);

View File

@ -0,0 +1,26 @@
#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Text statement for the load stat.
*
* Arguments:
* 0: Stats <ARRAY>
* 1: Item config path <CONFIG>
*
* Return Value:
* Stat Text <STRING>
*
* Public: No
*/
params ["_stats", "_config"];
TRACE_2("statTextStatement_load",_stats,_config);
if (!isNull (_config >> "ItemInfo" >> "containerClass")) then { // Uniform/Vest
_config = configfile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass");
};
private _load = getNumber (_config >> (_stats # 0));
if (_load <= 0) exitWith { LELSTRING(common,none) };
format ["%1kg (%2lb)", (_load * 0.1 * (1 / 2.2046)) toFixed 2, (_load * 0.1) toFixed 2]