mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
- Added proper handling of pistol mags and regular mags in gear to prevent magazine overflow - Added pre-check if return change will overflow gear + backpack free space. If change will not fit in gear + backpack free space then buy is prevented with a message notifying the player. In the case of a sale it proceeds anyway, but notifies player if overflow occurs (see comments in returnChange) - Consolidated duplicate code for calculating free space and returning cargo of an object into new calcFreeSpace - Old calculateFreeSpace renamed to displayFreeSpace - Added Weps/Mags/Bags icons to free slot numbers display
28 lines
771 B
Plaintext
28 lines
771 B
Plaintext
/**
|
|
* call Z_getGearItems
|
|
*
|
|
* Gets all your items stored in your gear and innitiates the selling list.
|
|
**/
|
|
private ["_mags","_weaps","_skin","_formattedText","_bag","_bags","_pic"];
|
|
#include "defines.hpp"
|
|
|
|
call Z_clearLists;
|
|
Z_SellArray = [];
|
|
Z_SellableArray = [];
|
|
_mags = magazines player;
|
|
_weaps = weapons player;
|
|
_bag = unitBackpack player;
|
|
_bags = if (isNull _bag) then {[]} else {[typeOf _bag]};
|
|
|
|
_skin = typeOf player;
|
|
_pic = getText (configFile >> 'CfgVehicles' >> _skin >> 'portrait');
|
|
|
|
_formattedText = format [
|
|
"<img image='%1' size='3' align='center'/>"
|
|
, _pic
|
|
];
|
|
|
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
|
|
|
|
[_weaps,_mags,toLower (localize "STR_UI_GEAR"),_bags] call Z_checkArrayInConfig;
|