mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
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.
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
/**
|
|
* call Z_calcPrice
|
|
*
|
|
* Calculate the total price for single currency.
|
|
**/
|
|
private ["_sellPrice","_ctrltext"];
|
|
#include "defines.hpp"
|
|
|
|
_sellPrice = 0;
|
|
|
|
if(Z_SingleCurrency) then {
|
|
_ctrltext = '';
|
|
if(Z_Selling)then{
|
|
{
|
|
_sellPrice = _sellPrice + (_x select 2);
|
|
}count Z_SellArray;
|
|
_ctrltext = format["%1 %2", _sellPrice , CurrencyName];
|
|
} else {
|
|
{
|
|
_sellPrice = _sellPrice + ((_x select 2) * (_x select 9));
|
|
}count Z_BuyingArray;
|
|
_ctrltext = format["%1 %2", _sellPrice , CurrencyName];
|
|
};
|
|
ctrlSetText [Z_AT_PRICEDISPLAY, _ctrltext];
|
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText '';
|
|
} else {
|
|
if(Z_Selling)then {
|
|
_ctrltext = "";
|
|
{
|
|
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11));
|
|
}count Z_SellArray;
|
|
_ctrltext = _sellPrice call Z_calcDefaultCurrency;
|
|
} else {
|
|
{
|
|
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11) * (_x select 9));
|
|
}count Z_BuyingArray;
|
|
_ctrltext = _sellPrice call Z_calcDefaultCurrency;
|
|
};
|
|
ctrlSetText [Z_AT_PRICEDISPLAY, ''];
|
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText _ctrltext;
|
|
};
|