Advanced trading and safe GUI changes (#1762)

* Advanced trading and safe GUI changes

This adds displaying of item/backpack/weapon/vehicle descriptions
Moves Weapons display on vehicles to a modular type, so if the vehicle
has no weapons it wont display, same with Description

Fixes an issue with safes not sounding keyclicks, at present they are
only active if you have music turned on, since I don't play with music
on (and many others) you will never hear them and when you do, the DTMF
signals they use are really obnoxious.

Replaced the sound with the one from the lockboxes, it's still audible
but very reasonable.

* Advanced trading fixes

Rework for my previous commit @ebaydayz

* Localization additions

Missing from previous commit
This commit is contained in:
oiad
2016-09-11 04:09:27 +12:00
committed by ebaydayz
parent f57e303355
commit fed89a0ed2
30 changed files with 58 additions and 42 deletions

View File

@@ -39,8 +39,7 @@ if (Z_SingleCurrency) then {
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%3</t><br />" +
"<t color='#33BFFF' size='0.7'>%13: </t><t color='#ffffff' size='0.7'>%6 %4</t><br />" +
"<t color='#33BFFF' size='0.7'>%12: </t><t color='#ffffff' size='0.7'>%5 %7</t><br />" +
"<t color='#33BFFF' size='0.7'>%14: </t><t color='#ffffff' size='0.7'>%8</t><br />" +
"<t color='#33BFFF' size='0.7'>%15: </t><t color='#ffffff' size='0.7'>%9</t><br />",
"<t color='#33BFFF' size='0.7'>%16: </t><t color='#ffffff' size='0.7'><img image='%14'/> %8 <img image='%15'/> %9</t><br />",
_picture,
_display,
_class,
@@ -54,8 +53,9 @@ if (Z_SingleCurrency) then {
localize "STR_EPOCH_CLASS",
localize "STR_EPOCH_PLAYER_292",
localize "STR_EPOCH_PLAYER_291",
localize "STR_EPOCH_WEPS",
localize "STR_EPOCH_MAGS"
"\z\addons\dayz_code\gui\gear\gear_ui_slots_weapons_white.paa",
"\z\addons\dayz_code\gui\gear\gear_ui_slots_items_white.paa",
localize "STR_EPOCH_CARGO_SPACE"
];
} else {
_picSell = "";
@@ -75,8 +75,7 @@ if (Z_SingleCurrency) then {
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%3</t><br />" +
"<t color='#33BFFF' size='0.7'>%13: </t><t color='#ffffff' size='0.7'>%6 <img image='%17' /> %4</t><br />" +
"<t color='#33BFFF' size='0.7'>%12: </t><t color='#ffffff' size='0.7'>%5 <img image='%16' /> %7</t><br />" +
"<t color='#33BFFF' size='0.7'>%14: </t><t color='#ffffff' size='0.7'>%8</t><br />" +
"<t color='#33BFFF' size='0.7'>%15: </t><t color='#ffffff' size='0.7'>%9</t><br />",
"<t color='#33BFFF' size='0.7'>%18: </t><t color='#ffffff' size='0.7'><img image='%14'/> %8 <img image='%15'/> %9</t><br />",
_picture,
_display,
_class,
@@ -90,10 +89,11 @@ if (Z_SingleCurrency) then {
localize "STR_EPOCH_CLASS",
localize "STR_EPOCH_PLAYER_292",
localize "STR_EPOCH_PLAYER_291",
localize "STR_EPOCH_WEPS",
localize "STR_EPOCH_MAGS",
"\z\addons\dayz_code\gui\gear\gear_ui_slots_weapons_white.paa",
"\z\addons\dayz_code\gui\gear\gear_ui_slots_items_white.paa",
_picSell,
_picBuy
_picBuy,
localize "STR_EPOCH_CARGO_SPACE"
];
};

View File

@@ -1,4 +1,4 @@
private ['_item','_picture','_class','_display','_buyPrice','_sellPrice','_formattedText','_buyCurrency','_sellCurrency','_compatible','_weapon','_attach','_config','_compatibleText','_type','_text'];
private ["_item","_picture","_class","_display","_buyPrice","_sellPrice","_formattedText","_buyCurrency","_sellCurrency","_compatible","_weapon","_attach","_config","_compatibleText","_type","_text","_displayText"];
#include "defines.hpp"
_item = _this select 0;
@@ -50,6 +50,8 @@ _compatibleText = "";
};
} forEach _compatible;
_displayText = getText(configFile >> "CfgMagazines" >> _class >> "descriptionShort");
if (Z_SingleCurrency) then {
_formattedText = format [
"<img image='%1' size='3' align='center'/><br />" +
@@ -72,13 +74,13 @@ if (Z_SingleCurrency) then {
} else {
_picSell = "";
if (_sellPrice >= 0) then {
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
_picSell = getText (configFile >> "CfgMagazines" >> _sellCurrency >> "picture");
_sellCurrency = getText (configFile >> "CfgMagazines" >> _sellCurrency >> "displayName");
};
_picBuy = "";
if (_buyPrice >= 0) then {
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
_buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName');
_picBuy = getText (configFile >> "CfgMagazines" >> _buyCurrency >> "picture");
_buyCurrency = getText (configFile >> "CfgMagazines" >> _buyCurrency >> "displayName");
};
_formattedText = format [
"<img image='%1' size='3' align='center'/><br />" +
@@ -105,9 +107,16 @@ if (Z_SingleCurrency) then {
if (count _compatible > 0) then {
_formattedText = _formattedText + format [
"<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t>"
"<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br />"
,localize "STR_EPOCH_COMPATIBLE",_compatibleText
];
};
if (_displayText != "") then {
_formattedText = _formattedText + format [
"<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t>"
,localize "STR_EPOCH_DESCRIPTION",_displayText
];
};
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText _formattedText;

View File

@@ -103,8 +103,6 @@ _weapons2 = [];
};
} forEach _weapons;
if (count _weapons2 < 1) then {_weapons2 = [localize "STR_EPOCH_NONE"];};
_wepText = "";
{
if (_forEachIndex > 0) then {
@@ -121,10 +119,9 @@ if (Z_SingleCurrency) then {
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%3</t><br />" +
"<t color='#33BFFF' size='0.7'>%13: </t><t color='#ffffff' size='0.7'>%6 %7</t><br />" +
"<t color='#33BFFF' size='0.7'>%12: </t><t color='#ffffff' size='0.7'>%5 %7</t><br />" +
"<t color='#33BFFF' size='0.7'>%14: </t><t color='#ffffff' size='0.7'><img image='%15'/> %8 <img image='%16'/> %9 <img image='%28'/> %4</t><br />" +
"<t color='#33BFFF' size='0.7'>%14: </t><t color='#ffffff' size='0.7'><img image='%15'/> %8 <img image='%16'/> %9 <img image='%26'/> %4</t><br />" +
"<t color='#33BFFF' size='0.7'>%17: </t><t color='#ffffff' size='0.7'>%18 </t><t color='#33BFFF' size='0.7'>%24: </t><t color='#ffffff' size='0.7'>%25</t><br />" + // Armor / Seats
"<t color='#33BFFF' size='0.7'>%21 %22: </t><t color='#ffffff' size='0.7'>%23 </t><t color='#33BFFF' size='0.7'>%19: </t><t color='#ffffff' size='0.7'>%20</t><br />" + // MaxSpeed / Fuel
"<t color='#33BFFF' size='0.7'>%26: </t><t color='#ffffff' size='0.7'>%27</t>",
"<t color='#33BFFF' size='0.7'>%21 %22: </t><t color='#ffffff' size='0.7'>%23 </t><t color='#33BFFF' size='0.7'>%19: </t><t color='#ffffff' size='0.7'>%20</t><br />", // MaxSpeed / Fuel
_picture,
_display,
_class,
@@ -150,8 +147,6 @@ if (Z_SingleCurrency) then {
_maxSpeed,
localize "STR_EPOCH_SEATS",
_seats,
localize "STR_EPOCH_WEAPONS",
_wepText,
"\z\addons\dayz_code\gui\gear\gear_ui_slots_backpacks_white.paa"
];
} else {
@@ -172,10 +167,9 @@ if (Z_SingleCurrency) then {
"<t color='#33BFFF' size='0.7'>%14: </t><t color='#ffffff' size='0.7'>%3</t><br />" +
"<t color='#33BFFF' size='0.7'>%16: </t><t color='#ffffff' size='0.7'>%6 <img image='%12' /> %7</t><br />" +
"<t color='#33BFFF' size='0.7'>%15: </t><t color='#ffffff' size='0.7'>%5 <img image='%11' /> %10</t><br />" +
"<t color='#33BFFF' size='0.7'>%17: </t><t color='#ffffff' size='0.7'><img image='%18'/> %8 <img image='%19'/> %9 <img image='%31'/> %4</t><br />" +
"<t color='#33BFFF' size='0.7'>%17: </t><t color='#ffffff' size='0.7'><img image='%18'/> %8 <img image='%19'/> %9 <img image='%29'/> %4</t><br />" +
"<t color='#33BFFF' size='0.7'>%20: </t><t color='#ffffff' size='0.7'>%21 </t><t color='#33BFFF' size='0.7'>%27: </t><t color='#ffffff' size='0.7'>%28</t><br />" + // Armor / Seats
"<t color='#33BFFF' size='0.7'>%24 %25: </t><t color='#ffffff' size='0.7'>%26 </t><t color='#33BFFF' size='0.7'>%22: </t><t color='#ffffff' size='0.7'>%23</t><br />" + // MaxSpeed / Fuel
"<t color='#33BFFF' size='0.7'>%29: </t><t color='#ffffff' size='0.7'>%30</t>",
"<t color='#33BFFF' size='0.7'>%24 %25: </t><t color='#ffffff' size='0.7'>%26 </t><t color='#33BFFF' size='0.7'>%22: </t><t color='#ffffff' size='0.7'>%23</t><br />", // MaxSpeed / Fuel
_picture,
_display,
_class,
@@ -204,10 +198,15 @@ if (Z_SingleCurrency) then {
_maxSpeed,
localize "STR_EPOCH_SEATS",
_seats,
localize "STR_EPOCH_WEAPONS",
_wepText,
"\z\addons\dayz_code\gui\gear\gear_ui_slots_backpacks_white.paa"
];
};
if (count _weapons2 > 0) then {
_formattedText = _formattedText + format [
"<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br />",
localize "STR_EPOCH_WEAPONS",_wepText
];
};
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText _formattedText;

View File

@@ -119,7 +119,7 @@ _parentClasses = [(configFile >> "CfgWeapons" >> _class),true] call BIS_fnc_retu
if !("ItemCore" in _parentClasses or "Binocular" in _parentClasses) then {
_formattedText = _formattedText + format [
"<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br />" +
"<t color='#33BFFF' size='0.7'>%3: </t><t color='#ffffff' size='0.7'>%4</t>"
"<t color='#33BFFF' size='0.7'>%3: </t><t color='#ffffff' size='0.7'>%4</t><br />"
,localize "STR_EPOCH_ATTACHMENTS",_attachText,localize "STR_EPOCH_MAGS",_magText
];
};