mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Advanced trading tidyness
Optimizes the code for the buyitems item listing (What was I thinking!) Adds item count to buy/sell list (Useful for checking against backpack/vehicle storage space constraints when buying multiple items) Small logging fix.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Calculate the total price for single currency.
|
||||
**/
|
||||
private ["_sellPrice","_ctrltext"];
|
||||
private ["_sellPrice","_ctrltext","_bTotal"];
|
||||
#include "defines.hpp"
|
||||
|
||||
_sellPrice = 0;
|
||||
@@ -30,11 +30,15 @@ if(Z_SingleCurrency) then {
|
||||
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11));
|
||||
}count Z_SellArray;
|
||||
_ctrltext = _sellPrice call Z_calcDefaultCurrency;
|
||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
|
||||
} else {
|
||||
_bTotal = 0;
|
||||
{
|
||||
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11) * (_x select 9));
|
||||
_bTotal = _bTotal + (_x select 9);
|
||||
}count Z_BuyingArray;
|
||||
_ctrltext = _sellPrice call Z_calcDefaultCurrency;
|
||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_BUYING", _bTotal];
|
||||
};
|
||||
ctrlSetText [Z_AT_PRICEDISPLAY, ''];
|
||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText _ctrltext;
|
||||
|
||||
Reference in New Issue
Block a user