Files
DayZ-Epoch/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getContainer.sqf
ebaydayz f84140c555 Don't clear buying list on category switch + AdvTrade fixes
The buying list now acts like a shopping cart. It is no longer cleared
when switching between categories or containers. Closing the dialog or
switching to sell mode still clears it.

Also fixed:
- Filter button in sell mode
- Bug where filtering sellable list readded items already moved to
selling list
- Visual price display not clearing when remove all button is used on
buying list
- Gear container picture showing rank instead of portrait in buy mode
- Dialog is no longer closed when trying to sell zero items
- LbCurSel is now reset when the buyable list is cleared
- Category is no longer opened onLbSelChanged. Instead you need to
double click or use the "View" button, so the arrow keys can be used for
selecting too.
2016-07-27 18:40:03 -04:00

68 lines
1.8 KiB
Plaintext

/**
* call Z_getContainer
*
* Switches between selling and buying and the item container (gear/vehicle/bakcpack) and initiates item loading.
**/
private ["_lbIndex","_canBuyInVehicle"];
#include "defines.hpp"
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SLOTSDISPLAY) ctrlSetText format["0 / 0 / 0"];
if (Z_Selling) then {
call Z_clearBuyingList;
Z_BuyingArray = [];
};
call Z_clearLists;
Z_SellableArray = [];
Z_SellArray = [];
_lbIndex = _this select 0;
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText "";
call Z_calcPrice;
if(Z_Selling)then{
switch (_lbIndex) do {
case 0: {
[localize "STR_EPOCH_TRADE_SELLING_BACKPACK"] call Z_filleTradeTitle;
Z_SellingFrom = 0;
call Z_getBackpackItems;
};
case 1: {
[localize "STR_EPOCH_TRADE_SELLING_VEHICLE"] call Z_filleTradeTitle;
Z_SellingFrom = 1;
call Z_getVehicleItems;
};
case 2: {
[localize "STR_EPOCH_TRADE_SELLING_GEAR"] call Z_filleTradeTitle;
Z_SellingFrom = 2;
call Z_getGearItems;
};
};
}else{
ctrlSetText [Z_AT_TRADERLINE2, " "];
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_SELLING_ALL"];
switch (_lbIndex) do {
case 0: {
Z_SellingFrom = 0;
[localize "STR_EPOCH_TRADE_BUYING_BACKPACK"] call Z_filleTradeTitle;
[0] call Z_calculateFreeSpace;
};
case 1: {
Z_SellingFrom = 1;
[localize "STR_EPOCH_TRADE_BUYING_VEHICLE"] call Z_filleTradeTitle;
_canBuyInVehicle = true call Z_checkCloseVehicle;
if(_canBuyInVehicle)then{
[1] call Z_calculateFreeSpace;
}else{
systemChat localize "STR_EPOCH_PLAYER_245";
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SLOTSDISPLAY) ctrlSetText format["%1 / %2 / %3",0,0,0];
};
};
case 2: {
Z_SellingFrom = 2;
[localize "STR_EPOCH_TRADE_BUYING_GEAR"] call Z_filleTradeTitle;
[2] call Z_calculateFreeSpace;
};
};
};