Advanced trading modifications, maintain_area modifications (#1780)

* Advanced trading modifications, maintain_area modifications

This lot of changes brings forth the following:

Sets up a "default" set of compiles that are the minimum needed for
maintain_area.sqf and custom scripts to utilize the gem based currency
that @icomrade added.

maintain_area.sqf: This will now utilize the gem based currency system.

Removed the redundant Z_Vehicle and replaced it with the Epoch built in
DZE_myVehicle

z_at_buyItems: Code tidying and optimization

z_at_checkCloseVehicle: Tidied up the code since removing Z_Vehicle
allowed us to remove some now useless code.

z_at_getVehicleItems: Removed the nearestObjects check for your vehicle
since we now do z_checkCloseVehicle on Advanced trading start up.

* Advanced trading missed redundant variables

As per description

* Advanced trading rework

We don't need to check for close vehicle anymore now for backpack money
since we've made z_vehicle redundant.

* Revert "Advanced trading rework"

This reverts commit a589bd19b9.

* Advanced trading rework

We don't need to check for close vehicle anymore now for backpack money
since we've made z_vehicle redundant.

* Advanced trading rework

More rework

* Remove single currency add/remove coins functions

at request of @ebaydayz.
This commit is contained in:
oiad
2016-10-29 12:29:04 +13:00
committed by ebaydayz
parent aa267bda2c
commit 1c7e96a0ff
18 changed files with 226 additions and 272 deletions

View File

@@ -3,24 +3,15 @@
*
* Gets all your items stored in your vehicle and initiates the selling list.
**/
private ["_vehicle","_pos","_list","_formattedText","_pic","_normalMags","_normalWeaps","_freeSpace"];
private ["_formattedText","_pic","_normalMags","_normalWeaps","_freeSpace"];
#include "defines.hpp"
Z_vehicle = objNull;
call Z_clearLists;
Z_SellableArray = [];
Z_SellArray = [];
_vehicle = objNull;
_pos = [player] call FNC_GetPos;
_list = nearestObjects [_pos, ["Air","LandVehicle","Ship"], Z_VehicleDistance];
if (!isNull DZE_myVehicle && local DZE_myVehicle && alive DZE_myVehicle && DZE_myVehicle in _list) then {
_vehicle = DZE_myVehicle;
};
if (!isNull _vehicle) then {
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf _vehicle) >> 'picture');
if (!isNull DZE_myVehicle) then {
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf DZE_myVehicle) >> 'picture');
_formattedText = format [
"<img image='%1' size='3' align='center'/>"
@@ -28,13 +19,12 @@ if (!isNull _vehicle) then {
];
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
Z_vehicle = _vehicle;
_freeSpace = [_vehicle,0,0,0,0] call Z_calcFreeSpace;
_freeSpace = [DZE_myVehicle,0,0,0,0] call Z_calcFreeSpace;
_normalMags = _freeSpace select 5;
_normalWeaps = _freeSpace select 6;
//_normalBags = _freeSpace select 7;
// Don't allow selling backpacks from vehicles because we can not get backpack contents.
// We can only remove all backpacks with clearBackpackCargo and then add back new empty backpacks for ones that weren't sold.
[_normalWeaps,_normalMags,typeOf _vehicle,[]] call Z_checkArrayInConfig;
[_normalWeaps,_normalMags,typeOf DZE_myVehicle,[]] call Z_checkArrayInConfig;
};