Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arsenal - Show load stat's actual value #9833

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addons/arsenal/ACE_Arsenal_Stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions addons/arsenal/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 26 additions & 0 deletions addons/arsenal/functions/fnc_statTextStatement_load.sqf
Original file line number Diff line number Diff line change
@@ -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]