Description for Trader items

This commit is contained in:
He-Man 2019-09-14 23:43:12 +02:00
parent 9f78b6e0f6
commit 77603e80b6

View File

@ -153,9 +153,26 @@ if !(isNull EPOCH_lastNPCtradeTarget) then {
lnbSetValue [_TraderItemsBox, [_id,0], _rounds]; lnbSetValue [_TraderItemsBox, [_id,0], _rounds];
lnbSetPicture [_TraderItemsBox, [_id,0], _item call EPOCH_itemPicture]; lnbSetPicture [_TraderItemsBox, [_id,0], _item call EPOCH_itemPicture];
if !(_tooltip isequalto "") then { if !(_tooltip isequalto "") then {
lbSetTooltip [_TraderItemsBox, _id*3, _tooltip];
lnbSetColor [_TraderItemsBox,[_id,2],[1,(_rounds/_maxrnd),0,1]]; 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 [["<br />",6],["<br/>",5]];
};
} foreach ["cfgmagazines","cfgweapons","cfgvehicles"];
_tooltip = _tooltip + _description;
lbSetTooltip [_TraderItemsBox, _id*3, _tooltip];
}; };
}; };
}; };