Epoch/Sources/epoch_code/compile/traders/EPOCH_startNPCTraderMenu.sqf

25 lines
840 B
Plaintext
Raw Normal View History

2016-09-01 00:29:08 +00:00
//[[[cog import generate_private_arrays ]]]
2017-05-02 13:28:52 +00:00
private ["_MainCategoriearray","_categorie","_config","_ok","_slot","_target"];
2016-09-01 00:29:08 +00:00
//[[[end]]]
2016-12-13 16:12:11 +00:00
_config = 'CfgItemSort' call EPOCH_returnConfig;
_MainCategoriearray = getarray (_config >> "MainCategories" >> "Classes");
2015-09-14 20:55:36 +00:00
_target = cursorTarget;
2016-01-08 04:32:52 +00:00
if (alive _target) then {
_slot = _target getVariable ["AI_SLOT",-1];
if (_slot != -1) then {
EPOCH_lastNPCtradeTarget = _target;
closeDialog 0;
_ok = createdialog "TradeNPCMenu";
if (!_ok) exitWith {};
9992 cutRsc["EpochGameUI2", "PLAIN", 2, false];
((uiNamespace getVariable "EPOCH_EpochGameUI2") displayCtrl 21208) ctrlSetText format["%1", EPOCH_playerCrypto];
2016-12-13 16:12:11 +00:00
{
_categorie = _x select 1;
lbAdd[42100,_categorie];
lbAdd[42101,_categorie]
} forEach _MainCategoriearray;
2016-01-08 04:32:52 +00:00
lbSetCurSel[42100, 0];
lbSetCurSel[42101, 0];
};
};