Files
DayZ-Epoch/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcPrice.sqf
ebaydayz 3f3f1a32ed Use BIS_fnc_numberText for SC number displays
See:

https://github.com/EpochModTeam/DayZ-Epoch/issues/1712#issuecomment-239647854

That should be all of them @ndavalos let me know if I missed any.
2016-08-16 16:28:06 -04:00

49 lines
1.9 KiB
Plaintext

/**
* call Z_calcPrice
*
* Calculate the total price for single currency.
**/
private ["_sellPrice","_ctrlText","_bTotal"];
#include "defines.hpp"
_bTotal = 0;
_sellPrice = 0;
if (Z_SingleCurrency) then {
_ctrlText = "";
if (Z_Selling) then {
{
_sellPrice = _sellPrice + (_x select 2);
} count Z_SellArray;
_ctrlText = format["%1 %2",[_sellPrice] call BIS_fnc_numberText,CurrencyName];
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
} else {
{
_sellPrice = _sellPrice + ((_x select 2) * (_x select 9));
_bTotal = _bTotal + (_x select 9);
} count Z_BuyingArray;
_ctrlText = format["%1 %2",[_sellPrice] call BIS_fnc_numberText,CurrencyName];
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_BUYING", _bTotal];
};
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;
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
} else {
{
_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;
};