From 77603e80b64db9e65b82de6d664effeaee2d04b4 Mon Sep 17 00:00:00 2001 From: He-Man Date: Sat, 14 Sep 2019 23:43:12 +0200 Subject: [PATCH] Description for Trader items --- .../traders/EPOCH_NPCTraderMenuFilter.sqf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf b/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf index f80d7b8b..9730b4c2 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf @@ -153,9 +153,26 @@ if !(isNull EPOCH_lastNPCtradeTarget) then { lnbSetValue [_TraderItemsBox, [_id,0], _rounds]; lnbSetPicture [_TraderItemsBox, [_id,0], _item call EPOCH_itemPicture]; if !(_tooltip isequalto "") then { - lbSetTooltip [_TraderItemsBox, _id*3, _tooltip]; lnbSetColor [_TraderItemsBox,[_id,2],[1,(_rounds/_maxrnd),0,1]]; }; + _description = ""; + { + _description = gettext (configfile >> _x >> _item >> "descriptionShort"); + if !(_description isEqualTo "") exitwith { + { + while {_description find (_x select 0) > -1} do { + _remove = _description find (_x select 0); + _description = (_description select [0,_remove]) + "\n" + (_description select [(_remove+(_x select 1))]); + }; + if !(_tooltip isEqualTo "") then { + _tooltip = _tooltip + "\n"; + }; + } foreach [["
",6],["
",5]]; + + }; + } foreach ["cfgmagazines","cfgweapons","cfgvehicles"]; + _tooltip = _tooltip + _description; + lbSetTooltip [_TraderItemsBox, _id*3, _tooltip]; }; }; };