Files
DayZ-Epoch/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getItemInfo.sqf
AirwavesMan e5af93b50b Add weight to items at traders
If the weight system is active all weights of the items will be displayed on the trader infos.

Also update the trading files and replace switch with call and exitwith which is faster.
2020-09-12 03:10:31 +02:00

33 lines
827 B
Plaintext

/**
* [_selectedList, _selectedIndex ]call Z_clearBuyingList
*
* Innitiates the item info to be displayed by getting the right item out of the corresponding list based on your sellection.
**/
private ['_item','_selectedList','_selectedIndex'];
_selectedList = _this select 0;
_selectedIndex = _this select 1;
_item = [];
if (_selectedIndex >= 0) then {
call {
if (_selectedList == 'sellable') exitwith {
_item = Z_SellableArray select _selectedIndex;
};
if (_selectedList == 'selling') exitwith {
_item = Z_SellArray select _selectedIndex;
};
if (_selectedList == 'buyable') exitwith {
_item = Z_BuyableArray select _selectedIndex;
};
if (_selectedList == 'buying') exitwith {
_item = Z_BuyingArray select _selectedIndex;
};
};
};
if (count _item > 0) then {
[_item] call Z_getItemConfig;
};