mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
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.
This commit is contained in:
@@ -92,7 +92,7 @@ class AdvancedTrading
|
|||||||
x = 0.51 * safezoneW + safezoneX;
|
x = 0.51 * safezoneW + safezoneX;
|
||||||
y = 0.26 * safezoneH + safezoneY;
|
y = 0.26 * safezoneH + safezoneY;
|
||||||
w = 0.08 * safezoneW;
|
w = 0.08 * safezoneW;
|
||||||
onButtonClick = "Z_CategoryView = true; call Z_ChangeBuySell;";
|
onButtonClick = "Z_CategoryView = true; Z_ResetContainer = true; call Z_ChangeBuySell;";
|
||||||
colorBackground[] = {1,1,1,1};
|
colorBackground[] = {1,1,1,1};
|
||||||
color[] = {0,0,0,1};
|
color[] = {0,0,0,1};
|
||||||
};
|
};
|
||||||
@@ -123,7 +123,7 @@ class AdvancedTrading
|
|||||||
x = 0.21 * safezoneW + safezoneX;
|
x = 0.21 * safezoneW + safezoneX;
|
||||||
y = 0.33 * safezoneH + safezoneY;
|
y = 0.33 * safezoneH + safezoneY;
|
||||||
w = 0.08 * safezoneW;
|
w = 0.08 * safezoneW;
|
||||||
onButtonClick = "Z_Selling = !Z_Selling; Z_CategoryView = true; call Z_ChangeBuySell;";
|
onButtonClick = "Z_Selling = true; Z_CategoryView = true; call Z_ChangeBuySell;"; //Z_Selling is flipped in ChangeBuySell
|
||||||
colorBackground[] = {1,1,1,1};
|
colorBackground[] = {1,1,1,1};
|
||||||
color[] = {0,0,0,1};
|
color[] = {0,0,0,1};
|
||||||
};
|
};
|
||||||
@@ -232,7 +232,8 @@ class AdvancedTrading
|
|||||||
soundSelect[] = {"",0.1,1};
|
soundSelect[] = {"",0.1,1};
|
||||||
colorBackground[] = {0.1,0.1,0.1,0.8};
|
colorBackground[] = {0.1,0.1,0.1,0.8};
|
||||||
onload = "ctrlShow [_this,false]";
|
onload = "ctrlShow [_this,false]";
|
||||||
onLBSelChanged = "if (Z_CategoryView) then {(lbCurSel 7421) call Z_fillCategoryList} else {['buyable',(lbCurSel 7421)] call Z_getItemInfo};";
|
onLBDblClick = "if (Z_CategoryView) then {(lbCurSel 7421) call Z_fillCategoryList;};";
|
||||||
|
onLBSelChanged = "if (!Z_CategoryView) then {['buyable',(lbCurSel 7421)] call Z_getItemInfo;};";
|
||||||
class ListScrollBar: ZSC_RscScrollBar{};
|
class ListScrollBar: ZSC_RscScrollBar{};
|
||||||
class ScrollBar
|
class ScrollBar
|
||||||
{
|
{
|
||||||
@@ -296,7 +297,7 @@ class AdvancedTrading
|
|||||||
x = 0.21 * safezoneW + safezoneX;
|
x = 0.21 * safezoneW + safezoneX;
|
||||||
y = 0.77 * safezoneH + safezoneY;
|
y = 0.77 * safezoneH + safezoneY;
|
||||||
w = 0.13 * safezoneW;
|
w = 0.13 * safezoneW;
|
||||||
onButtonClick = "if (Z_CategoryView) then {(lbCurSel 7421) call Z_fillCategoryList} else {[(ctrlText 7444)] call Z_filterList};";
|
onButtonClick = "if (Z_CategoryView && !Z_Selling) then {(lbCurSel 7421) call Z_fillCategoryList} else {[(ctrlText 7444)] call Z_filterList};";
|
||||||
colorBackground[] = {1,1,1,1};
|
colorBackground[] = {1,1,1,1};
|
||||||
color[] = {0,0,0,1};
|
color[] = {0,0,0,1};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,76 +1,75 @@
|
|||||||
private ["_arrayOfTraderCat","_counter","_cat","_cfgtraders","_y","_type","_buy","_sell","_pic","_text","_worth","_buyCurrency","_sellCurrency","_ignore","_categoryNumber"];
|
private ["_arrayOfTraderCat","_counter","_cat","_cfgtraders","_y","_type","_buy","_sell","_pic","_text","_worth","_buyCurrency","_sellCurrency","_ignore","_categoryNumber"];
|
||||||
call Z_clearBuyList;
|
call Z_clearBuyList;
|
||||||
call Z_clearBuyingList;
|
|
||||||
Z_BuyableArray = [];
|
Z_BuyableArray = [];
|
||||||
Z_BuyingArray = [];
|
|
||||||
_arrayOfTraderCat = Z_traderData;
|
_arrayOfTraderCat = Z_traderData;
|
||||||
_counter = 0;
|
_counter = 0;
|
||||||
{
|
{
|
||||||
_categoryNumber = if (Z_CategoryView) then {_this} else {(_arrayOfTraderCat select _forEachIndex select 1)};
|
_categoryNumber = _x select 1;
|
||||||
_cat = format["Category_%1",_categoryNumber];
|
if (_categoryNumber == _this) exitWith {
|
||||||
_cfgtraders = missionConfigFile >> "CfgTraderCategory" >> _cat;
|
_cat = format["Category_%1",_categoryNumber];
|
||||||
if (isNumber (_cfgtraders >> "duplicate")) then {
|
_cfgtraders = missionConfigFile >> "CfgTraderCategory" >> _cat;
|
||||||
_cat = format["Category_%1",getNumber (_cfgtraders >> "duplicate")];
|
if (isNumber (_cfgtraders >> "duplicate")) then {
|
||||||
_cfgtraders = missionConfigFile >> "CfgTraderCategory" >> _cat;
|
_cat = format["Category_%1",getNumber (_cfgtraders >> "duplicate")];
|
||||||
};
|
_cfgtraders = missionConfigFile >> "CfgTraderCategory" >> _cat;
|
||||||
for "_i" from 0 to (count _cfgtraders) - 1 do
|
};
|
||||||
{
|
for "_i" from 0 to (count _cfgtraders) - 1 do
|
||||||
_y = _cfgtraders select _i;
|
|
||||||
if (isClass _y) then
|
|
||||||
{
|
{
|
||||||
_y = configName (_y );
|
_y = _cfgtraders select _i;
|
||||||
|
if (isClass _y) then
|
||||||
|
{
|
||||||
|
_y = configName (_y );
|
||||||
|
|
||||||
_type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type");
|
_type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type");
|
||||||
_buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy");
|
_buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy");
|
||||||
_sell = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "sell");
|
_sell = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "sell");
|
||||||
_pic = "";
|
_pic = "";
|
||||||
_text = "";
|
_text = "";
|
||||||
_buyCurrency = "";
|
_buyCurrency = "";
|
||||||
_sellCurrency = "";
|
_sellCurrency = "";
|
||||||
_worth = 0;
|
_worth = 0;
|
||||||
_ignore = false;
|
_ignore = false;
|
||||||
if (dayz_classicBloodBagSystem && _y in dayz_typedBags) then {
|
if (dayz_classicBloodBagSystem && _y in dayz_typedBags) then {
|
||||||
if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;};
|
if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;};
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_type == "trade_items")then{
|
if(_type == "trade_items")then{
|
||||||
_pic = getText (configFile >> 'CfgMagazines' >> _y >> 'picture');
|
_pic = getText (configFile >> 'CfgMagazines' >> _y >> 'picture');
|
||||||
_text = getText (configFile >> 'CfgMagazines' >> _y >> 'displayName');
|
_text = getText (configFile >> 'CfgMagazines' >> _y >> 'displayName');
|
||||||
};
|
};
|
||||||
if(_type == "trade_weapons")then{
|
if(_type == "trade_weapons")then{
|
||||||
_pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture');
|
_pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture');
|
||||||
_text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName');
|
_text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName');
|
||||||
};
|
};
|
||||||
if(_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if(_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
||||||
_pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture');
|
_pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture');
|
||||||
_text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName');
|
_text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName');
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!Z_SingleCurrency) then {
|
if(!Z_SingleCurrency) then {
|
||||||
_buyCurrency = _buy select 1;
|
_buyCurrency = _buy select 1;
|
||||||
_sellCurrency = _sell select 1,
|
_sellCurrency = _sell select 1,
|
||||||
_part = (configFile >> "CfgMagazines" >> _buyCurrency);
|
_part = (configFile >> "CfgMagazines" >> _buyCurrency);
|
||||||
_worth = getNumber(_part >> "worth");
|
_worth = getNumber(_part >> "worth");
|
||||||
if (_worth == 0) then {
|
if (_worth == 0) then {
|
||||||
_worth = DZE_GemWorthList select (DZE_GemList find _buyCurrency);
|
_worth = DZE_GemWorthList select (DZE_GemList find _buyCurrency);
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
_buyCurrency = CurrencyName;
|
||||||
|
_sellCurrency = CurrencyName;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!_ignore) then { // Fill buyable list for one category only
|
||||||
|
Z_BuyableArray set [count Z_BuyableArray, [_y,_type,_buy select 0,_text,_pic,_forEachIndex,_sell select 0, _buyCurrency, _sellCurrency, 0,_cat, _worth]];
|
||||||
};
|
};
|
||||||
}else{
|
|
||||||
_buyCurrency = CurrencyName;
|
|
||||||
_sellCurrency = CurrencyName;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!_ignore) then {
|
|
||||||
Z_BuyableArray set [count(Z_BuyableArray) , [_y,_type,_buy select 0,_text,_pic,_forEachIndex,_sell select 0, _buyCurrency, _sellCurrency, 0,_cat, _worth]];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (Z_CategoryView) exitWith { // Only filling items for one category
|
|
||||||
Z_CategoryView = false;
|
|
||||||
Z_Selling = !Z_Selling;
|
|
||||||
call Z_ChangeBuySell;
|
|
||||||
};
|
|
||||||
}forEach _arrayOfTraderCat;
|
}forEach _arrayOfTraderCat;
|
||||||
|
|
||||||
|
Z_CategoryView = false;
|
||||||
|
Z_Selling = true; // flipped in ChangeBuySell
|
||||||
|
call Z_ChangeBuySell;
|
||||||
|
|
||||||
Z_OriginalBuyableArray = [] + Z_BuyableArray;
|
Z_OriginalBuyableArray = [] + Z_BuyableArray;
|
||||||
call Z_fillBuyableList;
|
call Z_fillBuyableList;
|
||||||
call Z_calcPrice;
|
call Z_calcPrice;
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
* Calculate the total price for single currency.
|
* Calculate the total price for single currency.
|
||||||
**/
|
**/
|
||||||
private ["_sellPrice","_ctrltext"];
|
private ["_sellPrice","_ctrltext"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_sellPrice = 0;
|
_sellPrice = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
private["_selection","_returnArray","_allowedMags","_allowedWeapons","_allowedBackpacks","_allowedTools","_allowedPrimary","_allowedSidearm","_formattedText","_pic"
|
private["_selection","_returnArray","_allowedMags","_allowedWeapons","_allowedBackpacks","_allowedTools","_allowedPrimary","_allowedSidearm","_formattedText","_pic"
|
||||||
,"_backpack","_vehicleWeapons","_vehicleMagazines","_vehicleBackpacks","_tempWeaponsArray","_tempBackpackArray","_tempMagazinesArray","_actualMags"
|
,"_backpack","_vehicleWeapons","_vehicleMagazines","_vehicleBackpacks","_tempWeaponsArray","_tempBackpackArray","_tempMagazinesArray","_actualMags"
|
||||||
,"_normalMags","_normalWeaps","_kinds","_kinds2","_amounts","_amounts2","_counter"];
|
,"_normalMags","_normalWeaps","_kinds","_kinds2","_amounts","_amounts2","_counter"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_selection = _this select 0;
|
_selection = _this select 0;
|
||||||
_returnArray = [0,0,0];
|
_returnArray = [0,0,0];
|
||||||
@@ -11,11 +11,11 @@ if(_selection == 2) then{ //gear
|
|||||||
// 12 toolbelt + 1 Binoculars + 1 NVG + 1 Pistol + 1 Primary (onBack isn't counted in weapons player)
|
// 12 toolbelt + 1 Binoculars + 1 NVG + 1 Pistol + 1 Primary (onBack isn't counted in weapons player)
|
||||||
_allowedWeapons = 16 - count(weapons player);
|
_allowedWeapons = 16 - count(weapons player);
|
||||||
|
|
||||||
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf player) >> 'picture');
|
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf player) >> 'portrait');
|
||||||
|
|
||||||
_formattedText = format [
|
_formattedText = format [
|
||||||
"<img image='%1' size='3' align='center'/>"
|
"<t size='1' align='center' color='#ffffff'>%2</t><br />" +
|
||||||
, _pic
|
"<img image='%1' size='3' align='center'/><br />"
|
||||||
|
, _pic, localize "STR_UI_GEAR"
|
||||||
];
|
];
|
||||||
|
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
Z_Selling = !Z_Selling;
|
Z_Selling = !Z_Selling;
|
||||||
if(Z_Selling)then{
|
if (Z_Selling) then {
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SELLBUYTOGGLE) ctrlSetText localize "STR_EPOCH_PLAYER_291";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SELLBUYTOGGLE) ctrlSetText localize "STR_EPOCH_PLAYER_291";
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText localize "STR_EPOCH_TRADE_SELLING";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText localize "STR_EPOCH_TRADE_SELLING";
|
||||||
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_UI_FILTER";
|
||||||
{ctrlShow [_x,true];} forEach [Z_AT_SELLABLELIST,Z_AT_SELLINGLIST,Z_AT_SELLBUTTON,Z_AT_ADDSELLITEMBUTTON,Z_AT_ADDALLSELLITEMBUTTON,Z_AT_REMOVESELLITEMBUTTON,Z_AT_REMOVEALLSELLITEMBUTTON,Z_AT_FILTERBOX]; // show
|
{ctrlShow [_x,true];} forEach [Z_AT_SELLABLELIST,Z_AT_SELLINGLIST,Z_AT_SELLBUTTON,Z_AT_ADDSELLITEMBUTTON,Z_AT_ADDALLSELLITEMBUTTON,Z_AT_REMOVESELLITEMBUTTON,Z_AT_REMOVEALLSELLITEMBUTTON,Z_AT_FILTERBOX]; // show
|
||||||
{ctrlShow [_x,false];} forEach [Z_AT_BUYABLELIST,Z_AT_BUYINGLIST,Z_AT_BUYBUTTON,Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_SLOTSDISPLAY,Z_AT_BACKBUTTON]; // hide
|
{ctrlShow [_x,false];} forEach [Z_AT_BUYABLELIST,Z_AT_BUYINGLIST,Z_AT_BUYBUTTON,Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_SLOTSDISPLAY,Z_AT_BACKBUTTON]; // hide
|
||||||
}else{
|
}else{
|
||||||
@@ -19,9 +20,18 @@ if(Z_Selling)then{
|
|||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_EPOCH_VIEW";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_EPOCH_VIEW";
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlSetFontHeight 0.026; // Slightly bigger in category view
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlSetFontHeight 0.026; // Slightly bigger in category view
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlCommit 0;
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlCommit 0;
|
||||||
{ctrlShow [_x,false];} forEach [Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_FILTERBOX,Z_AT_BACKBUTTON]; // hide
|
{ctrlShow [_x,false];} forEach [Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_FILTERBOX,Z_AT_BACKBUTTON]; // hide
|
||||||
call Z_fillCategories;
|
call Z_fillCategories;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
[2] call Z_getContainer; // default gear
|
if (Z_ResetContainer) then {
|
||||||
|
//Only reset to gear if dialog was closed or switching between buy and sell modes
|
||||||
|
Z_ResetContainer = false;
|
||||||
|
[2] call Z_getContainer;
|
||||||
|
} else {
|
||||||
|
// Switching between categories
|
||||||
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText "";
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE2, " "];
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_SELLING_ALL"];
|
||||||
|
};
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
* Fills up the sell or buy list if the item has a valid config.
|
* Fills up the sell or buy list if the item has a valid config.
|
||||||
**/
|
**/
|
||||||
private ["_weaps","_mags","_extraText","_all","_total","_arrayOfTraderCat","_totalPrice","_ctrltext","_backUpText","_bags"];
|
private ["_weaps","_mags","_extraText","_all","_total","_arrayOfTraderCat","_totalPrice","_ctrltext","_backUpText","_bags"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_weaps = _this select 0;
|
_weaps = _this select 0;
|
||||||
_mags = _this select 1;
|
_mags = _this select 1;
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
*
|
*
|
||||||
* Clears the visual listbox of items you could buy.
|
* Clears the visual listbox of items you could buy.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
lbClear Z_AT_BUYABLELIST;
|
lbClear Z_AT_BUYABLELIST;
|
||||||
|
lbSetCurSel [Z_AT_BUYABLELIST,-1]; // clear
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
* Clears the visual listbox of items you were going to buy.
|
* Clears the visual listbox of items you were going to buy.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
lbClear Z_AT_BUYINGLIST;
|
lbClear Z_AT_BUYINGLIST;
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
*
|
*
|
||||||
* Clears the visual listbox of items you were going to sell and could be selled.
|
* Clears the visual listbox of items you were going to sell and could be selled.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
lbClear Z_AT_SELLABLELIST;
|
lbClear Z_AT_SELLABLELIST;
|
||||||
lbClear Z_AT_SELLINGLIST;
|
lbClear Z_AT_SELLINGLIST;
|
||||||
@@ -3,5 +3,5 @@
|
|||||||
*
|
*
|
||||||
* Clears the visual listbox of items you were going to sell.
|
* Clears the visual listbox of items you were going to sell.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
lbClear Z_AT_SELLABLELIST;
|
lbClear Z_AT_SELLABLELIST;
|
||||||
@@ -2,7 +2,7 @@ private ["_item","_picture","_class","_display","_transportMaxWeapons","_transpo
|
|||||||
,"_buyCurrency","_sellCurrency","_formattedText","_picBuy","_picSell"
|
,"_buyCurrency","_sellCurrency","_formattedText","_picBuy","_picSell"
|
||||||
];
|
];
|
||||||
|
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
private ['_item','_picture','_class','_display','_buyPrice','_sellPrice','_formattedText','_buyCurrency','_sellCurrency','_compatible','_weapon','_attach','_config','_compatibleText','_type','_text'];
|
private ['_item','_picture','_class','_display','_buyPrice','_sellPrice','_formattedText','_buyCurrency','_sellCurrency','_compatible','_weapon','_attach','_config','_compatibleText','_type','_text'];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
_picture = _item select 4;
|
_picture = _item select 4;
|
||||||
_class = _item select 0;
|
_class = _item select 0;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ private ['_item', '_type','_picture',"_class","_display","_transportMaxWeapons",
|
|||||||
"_weapons2","_config","_wepText","_turret","_text"
|
"_weapons2","_config","_wepText","_turret","_text"
|
||||||
];
|
];
|
||||||
|
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
private ["_item","_picture","_class","_display","_buyPrice","_sellPrice","_magazines","_magText","_formattedText","_buyCurrency","_sellCurrency","_attachments","_attachText","_config","_text","_attach","_type"];
|
private ["_item","_picture","_class","_display","_buyPrice","_sellPrice","_magazines","_magText","_formattedText","_buyCurrency","_sellCurrency","_attachments","_attachText","_config","_text","_attach","_type"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
_picture = _item select 4;
|
_picture = _item select 4;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_BUYABLELIST, _x select 3];
|
_index = lbAdd [Z_AT_BUYABLELIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_BUYABLELIST, _index, _x select 4 ];
|
lbSetPicture [Z_AT_BUYABLELIST, _index, _x select 4 ];
|
||||||
}count Z_BuyableArray;
|
} count Z_BuyableArray;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_BUYINGLIST, _x select 3];
|
_index = lbAdd [Z_AT_BUYINGLIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_BUYINGLIST, _index, _x select 4];
|
lbSetPicture [Z_AT_BUYINGLIST, _index, _x select 4];
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
private "_index";
|
private "_index";
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
call Z_clearBuyList;
|
call Z_clearBuyList;
|
||||||
call Z_clearBuyingList;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_BUYABLELIST,_x select 0];
|
_index = lbAdd [Z_AT_BUYABLELIST,_x select 0];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
private ["_categoryName","_categoryNumber"];
|
private ["_categoryName","_categoryNumber"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
|
|
||||||
_categoryName = lbText [Z_AT_BUYABLELIST,_this];
|
_categoryName = lbText [Z_AT_BUYABLELIST,_this];
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Visualy fills in the listbox of items that can be sold.
|
* Visualy fills in the listbox of items that can be sold.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_SELLABLELIST, _x select 3];
|
_index = lbAdd [Z_AT_SELLABLELIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_SELLABLELIST, _index, _x select 4 ];
|
lbSetPicture [Z_AT_SELLABLELIST, _index, _x select 4 ];
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Visualy fills in the listbox of items currently being sold.
|
* Visualy fills in the listbox of items currently being sold.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_SELLINGLIST, _x select 3];
|
_index = lbAdd [Z_AT_SELLINGLIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_SELLINGLIST, _index, _x select 4];
|
lbSetPicture [Z_AT_SELLINGLIST, _index, _x select 4];
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
*
|
*
|
||||||
* Changes the indication of where you are selling/buying from in the trade window.
|
* Changes the indication of where you are selling/buying from in the trade window.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
_text = _this select 0;
|
_text = _this select 0;
|
||||||
ctrlSetText [Z_AT_CONTAINERINDICATOR, _text];
|
ctrlSetText [Z_AT_CONTAINERINDICATOR, _text];
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
if(count _this > 0) then {
|
if(count _this > 0) then {
|
||||||
_query = _this select 0; // the search string.
|
_query = _this select 0; // the search string.
|
||||||
if(Z_Selling)then {
|
if(Z_Selling)then {
|
||||||
|
if (count Z_SellArray > 0) exitWith {}; //Do not filter if items already in selling list (dupes)
|
||||||
if(isNil '_query' || _query == "") then {
|
if(isNil '_query' || _query == "") then {
|
||||||
_newSellArray = [];
|
_newSellArray = [];
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Gets all your items stored in your backpack and innitiates the selling list.
|
* Gets all your items stored in your backpack and innitiates the selling list.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
private ["_backpack","_pic","_formattedText","_mags","_weaps","_normalMags","_normalWeaps","_kinds","_kinds2","_ammmounts","_ammmounts2","_ctrltext"];
|
private ["_backpack","_pic","_formattedText","_mags","_weaps","_normalMags","_normalWeaps","_kinds","_kinds2","_ammmounts","_ammmounts2","_ctrltext"];
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
*
|
*
|
||||||
* Switches between selling and buying and the item container (gear/vehicle/bakcpack) and initiates item loading.
|
* Switches between selling and buying and the item container (gear/vehicle/bakcpack) and initiates item loading.
|
||||||
**/
|
**/
|
||||||
private ["_lbIndex","_formattedText","_canBuyInVehicle"];
|
private ["_lbIndex","_canBuyInVehicle"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SLOTSDISPLAY) ctrlSetText format["0 / 0 / 0"];
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SLOTSDISPLAY) ctrlSetText format["0 / 0 / 0"];
|
||||||
call Z_clearBuyingList;
|
if (Z_Selling) then {
|
||||||
|
call Z_clearBuyingList;
|
||||||
|
Z_BuyingArray = [];
|
||||||
|
};
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
Z_SellArray = [];
|
Z_SellArray = [];
|
||||||
Z_BuyingArray = [];
|
|
||||||
|
|
||||||
_lbIndex = _this select 0;
|
_lbIndex = _this select 0;
|
||||||
|
|
||||||
_formattedText = format [''];
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText "";
|
||||||
|
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText _formattedText;
|
|
||||||
|
|
||||||
call Z_calcPrice;
|
call Z_calcPrice;
|
||||||
|
|
||||||
@@ -39,13 +39,9 @@ if(Z_Selling)then{
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}else{
|
}else{
|
||||||
_ctrltext = format[" "];
|
ctrlSetText [Z_AT_TRADERLINE2, " "];
|
||||||
ctrlSetText [Z_AT_TRADERLINE2, _ctrltext];
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_SELLING_ALL"];
|
||||||
|
|
||||||
_ctrltext = localize "STR_EPOCH_TRADE_SELLING_ALL";
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE1, _ctrltext];
|
|
||||||
switch (_lbIndex) do {
|
switch (_lbIndex) do {
|
||||||
|
|
||||||
case 0: {
|
case 0: {
|
||||||
Z_SellingFrom = 0;
|
Z_SellingFrom = 0;
|
||||||
[localize "STR_EPOCH_TRADE_BUYING_BACKPACK"] call Z_filleTradeTitle;
|
[localize "STR_EPOCH_TRADE_BUYING_BACKPACK"] call Z_filleTradeTitle;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* Gets all your items stored in your gear and innitiates the selling list.
|
* Gets all your items stored in your gear and innitiates the selling list.
|
||||||
**/
|
**/
|
||||||
private ["_mags","_weaps","_skin","_formattedText","_bag","_bags"];
|
private ["_mags","_weaps","_skin","_formattedText","_bag","_bags"];
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellArray = [];
|
Z_SellArray = [];
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
private ['_item', '_type'];
|
private ['_item', '_type'];
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
_type = _item select 1;
|
_type = _item select 1;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if(_selectedIndex >= 0) then {
|
|||||||
_item = Z_SellArray select _selectedIndex;
|
_item = Z_SellArray select _selectedIndex;
|
||||||
};
|
};
|
||||||
case 'buyable': {
|
case 'buyable': {
|
||||||
_item = Z_BuyableArray select _selectedIndex;
|
_item = Z_BuyableArray select _selectedIndex;
|
||||||
};
|
};
|
||||||
case 'buying': {
|
case 'buying': {
|
||||||
_item = Z_BuyingArray select _selectedIndex;
|
_item = Z_BuyingArray select _selectedIndex;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Gets all your items stored in your vehicle and innitiates the selling list.
|
* Gets all your items stored in your vehicle and innitiates the selling list.
|
||||||
**/
|
**/
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
Z_vehicle = objNull;
|
Z_vehicle = objNull;
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
if(!isNil"_index" && _index > -1)then {
|
if(!isNil"_index" && _index > -1)then {
|
||||||
lbDelete [Z_AT_SELLABLELIST, _index];
|
lbDelete [Z_AT_SELLABLELIST, _index];
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
call Z_clearBuyingList;
|
call Z_clearBuyingList;
|
||||||
Z_BuyingArray = [];
|
Z_BuyingArray = [];
|
||||||
|
call Z_calcPrice;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
if(!isNil"_index" && _index > -1)then {
|
if(!isNil"_index" && _index > -1)then {
|
||||||
lbDelete [Z_AT_BUYINGLIST, _index];
|
lbDelete [Z_AT_BUYINGLIST, _index];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
if(!isNil"_index" && _index > -1)then {
|
if(!isNil"_index" && _index > -1)then {
|
||||||
lbDelete [Z_AT_SELLINGLIST, _index];
|
lbDelete [Z_AT_SELLINGLIST, _index];
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
private ["_tempArray","_outcome","_vehCheckArray","_vehArray","_weaponsArray","_itemsArray","_bpArray","_bpCheckArray","_weaponsCheckArray","_itemsCheckArray","_VehKey","_wA","_mA","_money","_itemData","_success","_bag","_itemsToLog","_tCost","_tSold"];
|
private ["_tempArray","_outcome","_vehCheckArray","_vehArray","_weaponsArray","_itemsArray","_bpArray","_bpCheckArray","_weaponsCheckArray","_itemsCheckArray","_VehKey","_wA","_mA","_money","_itemData","_success","_bag","_itemsToLog","_tCost","_tSold"];
|
||||||
|
|
||||||
|
if (count Z_SellArray < 1) exitWith { systemChat localize "STR_EPOCH_TRADE_SELL_NO_ITEMS"; };
|
||||||
|
|
||||||
_tempArray = Z_SellArray;
|
_tempArray = Z_SellArray;
|
||||||
closeDialog 2;
|
closeDialog 2;
|
||||||
_outcome = [];
|
_outcome = [];
|
||||||
@@ -13,8 +15,6 @@ _weaponsCheckArray = [];
|
|||||||
_itemsCheckArray = [];
|
_itemsCheckArray = [];
|
||||||
_itemsToLog = [[],[],[],"sell"];
|
_itemsToLog = [[],[],[],"sell"];
|
||||||
|
|
||||||
if (count Z_SellArray < 1) exitWith { systemChat localize "STR_EPOCH_TRADE_SELL_NO_ITEMS"; };
|
|
||||||
|
|
||||||
_deleteTradedVehicle = {
|
_deleteTradedVehicle = {
|
||||||
private ["_localResult2","_VehKey2"];
|
private ["_localResult2","_VehKey2"];
|
||||||
_VehKey2 = (_this select 0) select 0;
|
_VehKey2 = (_this select 0) select 0;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
private ["_amount","_index","_index2","_temp"];
|
private ["_amount","_index","_index2","_temp"];
|
||||||
|
|
||||||
#include "defines.sqf";
|
#include "defines.hpp"
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
_amount = parseNumber(_this select 1);
|
_amount = parseNumber(_this select 1);
|
||||||
if(!isNil"_index" && _index > -1 && (typeName _amount == "SCALAR") && _amount > 0 )then {
|
if(!isNil"_index" && _index > -1 && (typeName _amount == "SCALAR") && _amount > 0 )then {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if(DZE_ActionInProgress) exitWith { localize "str_player_actionslimit" call dayz
|
|||||||
if(isNil "Z_AdvancedTradingInit")then{
|
if(isNil "Z_AdvancedTradingInit")then{
|
||||||
|
|
||||||
//#include "config.sqf"; // Moved to dayz_code/configVariables.sqf
|
//#include "config.sqf"; // Moved to dayz_code/configVariables.sqf
|
||||||
#include "\z\addons\dayz_code\actions\AdvancedTrading\functions\defines.sqf";
|
#include "\z\addons\dayz_code\actions\AdvancedTrading\functions\defines.hpp"
|
||||||
|
|
||||||
/* Configs that needs to be defined but not changed in config file */
|
/* Configs that needs to be defined but not changed in config file */
|
||||||
|
|
||||||
@@ -106,6 +106,8 @@ if(isNil "Z_AdvancedTradingInit")then{
|
|||||||
|
|
||||||
Z_Selling = true; // Always start menu in buy mode (flipped in z_at_changeBuySell.sqf on startup)
|
Z_Selling = true; // Always start menu in buy mode (flipped in z_at_changeBuySell.sqf on startup)
|
||||||
Z_CategoryView = true; // Always start in category view
|
Z_CategoryView = true; // Always start in category view
|
||||||
|
Z_BuyingArray = [];
|
||||||
|
Z_ResetContainer = true;
|
||||||
createDialog "AdvancedTrading";
|
createDialog "AdvancedTrading";
|
||||||
|
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_REMOVESELLITEMBUTTON) ctrlSetText " < ";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_REMOVESELLITEMBUTTON) ctrlSetText " < ";
|
||||||
|
|||||||
Reference in New Issue
Block a user