diff --git a/SQF/dayz_code/Configs/RscDisplay/advancedTrading.hpp b/SQF/dayz_code/Configs/RscDisplay/advancedTrading.hpp index 8d68a2641..22d5b3540 100644 --- a/SQF/dayz_code/Configs/RscDisplay/advancedTrading.hpp +++ b/SQF/dayz_code/Configs/RscDisplay/advancedTrading.hpp @@ -92,7 +92,7 @@ class AdvancedTrading x = 0.51 * safezoneW + safezoneX; y = 0.26 * safezoneH + safezoneY; w = 0.08 * safezoneW; - onButtonClick = "call Z_ChangeBuySell;"; + onButtonClick = "Z_CategoryView = true; call Z_ChangeBuySell;"; colorBackground[] = {1,1,1,1}; color[] = {0,0,0,1}; }; @@ -116,6 +116,17 @@ class AdvancedTrading h = 0.03 * safezoneH; colorText[] = {1,1,1,1}; }; + class ZSC_RscButtonMenu_BACK: AT_Zupa_BlueButton + { + idc = 7449; + text = $STR_EPOCH_BACK; + x = 0.21 * safezoneW + safezoneX; + y = 0.33 * safezoneH + safezoneY; + w = 0.08 * safezoneW; + onButtonClick = "Z_Selling = !Z_Selling; Z_CategoryView = true; call Z_ChangeBuySell;"; + colorBackground[] = {1,1,1,1}; + color[] = {0,0,0,1}; + }; class RscText_AT8: ZSC_RscText { idc = -1; @@ -221,7 +232,7 @@ class AdvancedTrading soundSelect[] = {"",0.1,1}; colorBackground[] = {0.1,0.1,0.1,0.8}; onload = "ctrlShow [_this,false]"; - onLBSelChanged = "['buyable',(lbCurSel 7421)] call Z_getItemInfo"; + onLBSelChanged = "if (Z_CategoryView) then {(lbCurSel 7421) call Z_fillCategoryList} else {['buyable',(lbCurSel 7421)] call Z_getItemInfo};"; class ListScrollBar: ZSC_RscScrollBar{}; class ScrollBar { @@ -280,12 +291,12 @@ class AdvancedTrading }; class ZSC_RscButtonMenu_ATTFilter: AT_Zupa_BlueButton { - idc = -1; + idc = 7498; text = $STR_UI_FILTER; x = 0.21 * safezoneW + safezoneX; y = 0.77 * safezoneH + safezoneY; w = 0.13 * safezoneW; - onButtonClick = "[(ctrlText 7444)] call Z_filterList;"; + onButtonClick = "if (Z_CategoryView) then {(lbCurSel 7421) call Z_fillCategoryList} else {[(ctrlText 7444)] call Z_filterList};"; colorBackground[] = {1,1,1,1}; color[] = {0,0,0,1}; }; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/defines.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/defines.sqf index 69ac61eef..734aa0b47 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/defines.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/defines.sqf @@ -76,4 +76,12 @@ // #define Z_AT_PRICEINFO 7451 #define Z_AT_PRICEINFO 7451 +#define Z_AT_FILTERBOX 7444 + +#define Z_AT_FILTERBUTTON 7498 + +#define Z_AT_DETAILSTEXT 7488 + +#define Z_AT_BACKBUTTON 7449 + // diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf index ebb623f53..bf0c50e07 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf @@ -1,4 +1,4 @@ -private ["_arrayOfTraderCat","_counter","_cat","_cfgtraders","_y","_type","_buy","_sell","_pic","_text","_worth","_buyCurrency","_sellCurrency","_ignore"]; +private ["_arrayOfTraderCat","_counter","_cat","_cfgtraders","_y","_type","_buy","_sell","_pic","_text","_worth","_buyCurrency","_sellCurrency","_ignore","_categoryNumber"]; call Z_clearBuyList; call Z_clearBuyingList; Z_BuyableArray = []; @@ -6,7 +6,8 @@ Z_BuyingArray = []; _arrayOfTraderCat = Z_traderData; _counter = 0; { - _cat = format["Category_%1",(_arrayOfTraderCat select _forEachIndex select 1)]; + _categoryNumber = if (Z_CategoryView) then {_this} else {(_arrayOfTraderCat select _forEachIndex select 1)}; + _cat = format["Category_%1",_categoryNumber]; _cfgtraders = missionConfigFile >> "CfgTraderCategory" >> _cat; if (isNumber (_cfgtraders >> "duplicate")) then { _cat = format["Category_%1",getNumber (_cfgtraders >> "duplicate")]; @@ -63,6 +64,11 @@ _counter = 0; }; }; }; + if (Z_CategoryView) exitWith { // Only filling items for one category + Z_CategoryView = false; + Z_Selling = !Z_Selling; + call Z_ChangeBuySell; + }; }forEach _arrayOfTraderCat; Z_OriginalBuyableArray = [] + Z_BuyableArray; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_changeBuySell.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_changeBuySell.sqf index 56b4d1d93..beaec60d6 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_changeBuySell.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_changeBuySell.sqf @@ -4,13 +4,26 @@ Z_Selling = !Z_Selling; 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_RIGHTLISTTITLE) ctrlSetText localize "STR_EPOCH_TRADE_SELLING"; - {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]; // 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]; // hide + {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 }else{ (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SELLBUYTOGGLE) ctrlSetText localize "STR_EPOCH_PLAYER_292"; (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText localize "STR_EPOCH_TRADE_BUYING"; - {ctrlShow [_x,true];} 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]; // show - {ctrlShow [_x,false];} forEach [Z_AT_SELLABLELIST,Z_AT_SELLINGLIST,Z_AT_SELLBUTTON,Z_AT_ADDSELLITEMBUTTON,Z_AT_ADDALLSELLITEMBUTTON,Z_AT_REMOVESELLITEMBUTTON,Z_AT_REMOVEALLSELLITEMBUTTON]; // hide - call Z_calcBuyableList; -}; + (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_UI_FILTER"; + {ctrlShow [_x,true];} 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_FILTERBOX,Z_AT_BACKBUTTON]; // show + {ctrlShow [_x,false];} forEach [Z_AT_SELLABLELIST,Z_AT_SELLINGLIST,Z_AT_SELLBUTTON,Z_AT_ADDSELLITEMBUTTON,Z_AT_ADDALLSELLITEMBUTTON,Z_AT_REMOVESELLITEMBUTTON,Z_AT_REMOVEALLSELLITEMBUTTON]; // hide + (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlSetFontHeight 0.023; // reset + (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlSetPosition [(0.21* safezoneW + safezoneX),(0.41 * safezoneH + safezoneY),(0.13 * safezoneW),(0.30 * safezoneH)]; //reset + (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_BUYABLELIST) ctrlCommit 0; + + if (Z_CategoryView) then { + (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) ctrlSetPosition [(0.21* safezoneW + safezoneX),(0.43 * safezoneH + safezoneY),(0.13 * safezoneW),(0.30 * safezoneH)]; + (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 + call Z_fillCategories; + }; +}; + [2] call Z_getContainer; // default gear \ No newline at end of file diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillCategories.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillCategories.sqf new file mode 100644 index 000000000..bb9061d22 --- /dev/null +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillCategories.sqf @@ -0,0 +1,9 @@ +private "_index"; +#include "defines.sqf"; +call Z_clearBuyList; +call Z_clearBuyingList; + +{ + _index = lbAdd [Z_AT_BUYABLELIST,_x select 0]; + lbSetPicture [Z_AT_BUYABLELIST,_index,"\z\addons\dayz_code\gui\epoch\arrow_right.paa"]; +} forEach Z_traderData; \ No newline at end of file diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillCategoryList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillCategoryList.sqf new file mode 100644 index 000000000..2bc5908ee --- /dev/null +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillCategoryList.sqf @@ -0,0 +1,11 @@ +private ["_categoryName","_categoryNumber"]; +#include "defines.sqf"; + +_categoryName = lbText [Z_AT_BUYABLELIST,_this]; +{ + if (_x select 0 == _categoryName) exitWith { + _categoryNumber = _x select 1; + }; +} forEach Z_traderData; + +_categoryNumber call Z_calcBuyableList; \ No newline at end of file diff --git a/SQF/dayz_code/actions/AdvancedTrading/init.sqf b/SQF/dayz_code/actions/AdvancedTrading/init.sqf index 0c3e181af..553c3231e 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/init.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/init.sqf @@ -61,6 +61,7 @@ if(isNil "Z_AdvancedTradingInit")then{ Z_clearSellableList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearSellableList.sqf"); Z_clearBuyList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearBuyList.sqf"); Z_clearBuyingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_clearBuyingList.sqf"); + Z_fillCategories = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillCategories.sqf"); Z_getItemInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getItemInfo.sqf"); Z_getItemConfig = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_getItemConfig.sqf"); Z_displayItemInfo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_displayItemInfo.sqf"); @@ -75,6 +76,7 @@ if(isNil "Z_AdvancedTradingInit")then{ Z_filterList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_filterList.sqf"); Z_checkArrayInConfig = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_checkArrayInConfig.sqf"); Z_calcPrice = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_calcPrice.sqf"); + Z_fillCategoryList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillCategoryList.sqf"); Z_fillSellList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillSellList.sqf"); Z_fillSellingList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_fillSellingList.sqf"); Z_pushItemToList = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_pushItemToList.sqf"); @@ -102,12 +104,13 @@ if(isNil "Z_AdvancedTradingInit")then{ }; 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 createDialog "AdvancedTrading"; (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_REMOVESELLITEMBUTTON) ctrlSetText " < "; (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_REMOVEALLSELLITEMBUTTON) ctrlSetText " << "; (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_REMOVEBUYITEMBUTTON) ctrlSetText " < "; (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_REMOVEALLBUYITEMBUTTON) ctrlSetText " << "; -(findDisplay Z_AT_DIALOGWINDOW displayCtrl 7488) ctrlSetText " " + localize "STR_EPOCH_TRADE_DETAILS"; +(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_DETAILSTEXT) ctrlSetText " " + localize "STR_EPOCH_TRADE_DETAILS"; call Z_ChangeBuySell; diff --git a/SQF/dayz_code/gui/epoch/arrow_right.paa b/SQF/dayz_code/gui/epoch/arrow_right.paa new file mode 100644 index 000000000..a53dfbb08 Binary files /dev/null and b/SQF/dayz_code/gui/epoch/arrow_right.paa differ diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index b406bd6da..ba9190b95 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -17356,5 +17356,28 @@ KI AI + + View + Voir + Vista + Vista + Nézet + Widok + Вид + Ansicht + Pohled + + + Back + Retour + Atrás + Indietro + Vissza + Powrót + Назад + Zurück + Zpět + 戻る +