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.
This commit is contained in:
AirwavesMan
2020-09-12 03:10:31 +02:00
parent 9ad86a84a3
commit e5af93b50b
16 changed files with 141 additions and 115 deletions

View File

@@ -1,4 +1,4 @@
private ["_item","_picture","_class","_display","_buyPrice","_sellPrice","_magazines","_magText","_formattedText","_buyCurrency","_sellCurrency","_attachments","_attachText","_config","_text","_attach","_type"];
private ["_parentClasses","_picBuy","_picSell","_item","_picture","_class","_display","_buyPrice","_sellPrice","_magazines","_magText","_formattedText","_buyCurrency","_sellCurrency","_attachments","_attachText","_config","_text","_attach","_type"];
#include "defines.hpp"
_item = _this select 0;
@@ -124,4 +124,14 @@ if !("ItemCore" in _parentClasses or "Binocular" in _parentClasses) then {
];
};
if (DZE_R3F_WEIGHT) then {
private "_weight";
_weight = getNumber(configFile >> "CfgWeight" >> "Weapons" >> _class >> "weight");
_formattedText = _formattedText + format [
"<t color='#bcbcbc' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2 %3</t>"
,localize "STR_EPOCH_WEIGHT",_weight,localize "STR_R3F_WEIGHT_English"
];
};
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText _formattedText;