mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
* Advanced trading tidying, spelling fixes, private fixes and string fixes. Fixes snap building issue with metal floors Fixed spelling mistakes in various scripts Fixed formatting uglyness in various scripts Fixed invalid private lines in various scripts Changed Advanced trading so buying worked more like selling, You can't select backpack if you don't have a pack nor can you select a vehicle if you don't have a vehicle. Removed some redundant strings from Advanced trading and changed a few of the strings to be more englishy Removed the ability to buy a backpack into your backpack (You cant do this anyway) Fixed a bug where if you had nothing in your backpack it would break the checkArrayInConfig script so the titlebar would not refresh correctly Removed slot counts on no backpack and no vehicle (No need for it, just clutter) Moved backpack/vehicle checking to z_at_getContainer.sqf * Last part of tidyness fixes Last part of tidyness fixes * Actual backpack fix Lets actually fix the buying backpack into backpack or backpack when you already have one. * Missing from commit Missing from commit
49 lines
1.9 KiB
Plaintext
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 , 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 , 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;
|
|
};
|