Skip to content

Commit 64fb5cd

Browse files
authored
Inventory - Use maxLoad command (#673)
1 parent 3473e81 commit 64fb5cd

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

addons/context_actions/functions/fnc_canEditInventory.sqf

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@
1717

1818
params ["_entity"];
1919

20-
_entity isEqualType objNull
21-
&& {alive _entity}
22-
&& {getNumber (configOf _entity >> "maximumLoad") > 0}
20+
_entity isEqualType objNull && {alive _entity} && {maxLoad _entity > 0}

addons/inventory/XEH_preInit.sqf

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PREP_RECOMPILE_END;
1414
[_entity] call FUNC(configure);
1515
},
1616
{
17-
alive _entity && {getNumber (configOf _entity >> "maximumLoad") > 0}
17+
alive _entity && {maxLoad _entity > 0}
1818
}
1919
] call EFUNC(attributes,addButton);
2020

addons/inventory/functions/fnc_configure.sqf

+2-6
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@ params ["_object"];
1919

2020
if (!createDialog QGVAR(display)) exitWith {};
2121

22-
private _config = configOf _object;
23-
private _displayName = getText (_config >> "displayName");
24-
private _maximumLoad = getNumber (_config >> "maximumLoad");
25-
2622
// Get the object's current cargo and calculate its load
2723
private _cargo = [getItemCargo _object, getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object];
2824
private _currentLoad = [_cargo] call FUNC(calculateLoad);
2925

3026
private _display = uiNamespace getVariable QEGVAR(common,display);
3127
_display setVariable [QGVAR(currentLoad), _currentLoad];
32-
_display setVariable [QGVAR(maximumLoad), _maximumLoad];
28+
_display setVariable [QGVAR(maximumLoad), maxLoad _object];
3329
_display setVariable [QGVAR(object), _object];
3430
_display setVariable [QGVAR(cargo), _cargo];
3531

@@ -38,7 +34,7 @@ _display setVariable [QGVAR(cargo), _cargo];
3834

3935
// Set the display's title to the object name
4036
private _ctrlTitle = _display displayCtrl IDC_TITLE;
41-
_ctrlTitle ctrlSetText toUpper format [localize LSTRING(EditInventory), _displayName];
37+
_ctrlTitle ctrlSetText toUpper format [LLSTRING(EditInventory), getText (configOf _object >> "displayName")];
4238

4339
// Refresh the items list when category is changed
4440
private _ctrlCategory = _display displayCtrl IDC_CATEGORY;

addons/main/script_mod.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
1111

1212
// MINIMAL required version for the Mod. Components can specify others..
13-
#define REQUIRED_VERSION 2.06
13+
#define REQUIRED_VERSION 2.08
1414
#define REQUIRED_CBA_VERSION {3,15,5}
1515

1616
#ifdef COMPONENT_BEAUTIFIED

0 commit comments

Comments
 (0)