show virtual load in inventory menu

This commit is contained in:
commy2 2016-05-10 22:32:40 +02:00
parent be99d4b3d7
commit f738b17db7
3 changed files with 14 additions and 1 deletions

View File

@ -17,6 +17,7 @@
params [["_unit", objNull, [objNull]], ["_container", objNull, [objNull]], ["_virtualLoadToAdd", 0, [0]]]; params [["_unit", objNull, [objNull]], ["_container", objNull, [objNull]], ["_virtualLoadToAdd", 0, [0]]];
if !(_container in [ if !(_container in [
_unit,
uniformContainer _unit, uniformContainer _unit,
vestContainer _unit, vestContainer _unit,
backpackContainer _unit backpackContainer _unit

View File

@ -17,7 +17,18 @@
params ["_unit"]; params ["_unit"];
private _weight = loadAbs _unit * 0.1; private _virtualLoad = 0;
{
_virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]);
} forEach [
_unit,
uniformContainer _unit,
vestContainer _unit,
backpackContainer _unit
];
private _weight = (loadAbs _unit + _virtualLoad) * 0.1;
if (GVAR(useImperial)) then { if (GVAR(useImperial)) then {
_weight = format ["%1lb", (round (_weight * 100)) / 100]; _weight = format ["%1lb", (round (_weight * 100)) / 100];

View File

@ -20,6 +20,7 @@ private _virtualLoad = 0;
{ {
_virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]); _virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]);
} forEach [ } forEach [
_unit,
uniformContainer _unit, uniformContainer _unit,
vestContainer _unit, vestContainer _unit,
backpackContainer _unit backpackContainer _unit