From 5043fafae4a38c430dfccf99613ebb39eca97ed2 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Wed, 4 May 2016 12:54:36 -0400 Subject: [PATCH] Fix default currency display in Adv. Trading bag item info Fixes currency display name and picture not showing when looking at backpack item info. Also fixed localized string for weps and mags order reversed in item info for backpacks and vehicles. --- .../functions/z_at_displayBackpackInfo.sqf | 39 +++++++++++++------ .../functions/z_at_displayVehicleInfo.sqf | 2 +- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf index a1f37309b..37386ed15 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf @@ -1,5 +1,5 @@ private ["_item","_picture","_class","_display","_transportMaxWeapons","_transportMaxMagazines","_transportmaxBackpacks","_buyPrice","_sellPrice" -,"_buyCurrency","_sellCurrency","_formattedText" +,"_buyCurrency","_sellCurrency","_formattedText","_picBuy","_picSell" ]; #include "defines.sqf"; @@ -38,17 +38,34 @@ if ( isNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxMagazines') if ( Z_SingleCurrency ) then { _buyCurrency = CurrencyName; _sellCurrency = CurrencyName; + _formattedText = format [ + "
" + + "%10: %2
" + + "%11: %3
" + + "%12: %5 %7
" + + "%13: %6 %4
" + + "%14: %8
" + + "%15: %9
" + , _picture, _display, _class, _buyCurrency , _sellPrice, _buyPrice, _sellCurrency, _transportMaxWeapons,_transportMaxMagazines, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_WEPS", localize "STR_EPOCH_MAGS" + ]; +} else { + _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); + _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); + _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); + _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + + _formattedText = format [ + "
" + + "%10: %2
" + + "%11: %3
" + + "%12: %5 %7
" + + "%13: %6 %4
" + + "%14: %8
" + + "%15: %9
" + , _picture, _display, _class, _buyCurrency , _sellPrice, _buyPrice, _sellCurrency, _transportMaxWeapons,_transportMaxMagazines, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_WEPS", localize "STR_EPOCH_MAGS", _picSell, _picBuy + ]; }; -_formattedText = format [ -"
" + -"%10: %2
" + -"%11: %3
" + -"%12: %5 %7
" + -"%13: %6 %4
" + -"%14: %8
" + -"%15: %9
" -, _picture, _display, _class, _buyCurrency , _sellPrice, _buyPrice, _sellCurrency, _transportMaxWeapons,_transportMaxMagazines, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_MAGS", localize "STR_EPOCH_WEPS" -]; + (findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText _formattedText; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf index e00d83319..2c2780a98 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf @@ -76,7 +76,7 @@ if (Z_SingleCurrency) then { "%17: %8
" + "%18: %9
" + "%19: %4
" - , _picture, _display, _class, _transportmaxBackpacks, _sellPrice, _buyPrice, _buyCurrency, _transportMaxWeapons,_transportMaxMagazines, _sellCurrency, _picSell,_picBuy, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_MAGS", localize "STR_EPOCH_WEPS", localize "STR_EPOCH_BAGS" + , _picture, _display, _class, _transportmaxBackpacks, _sellPrice, _buyPrice, _buyCurrency, _transportMaxWeapons,_transportMaxMagazines, _sellCurrency, _picSell,_picBuy, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_WEPS", localize "STR_EPOCH_MAGS", localize "STR_EPOCH_BAGS" ];