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

@@ -128,7 +128,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(1);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_1.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b4: RscButton
{
@@ -144,7 +144,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(4);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_4.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b7: RscButton
{
@@ -160,7 +160,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(7);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_7.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b2: RscButton
{
@@ -176,7 +176,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(2);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_2.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b8: RscButton
{
@@ -192,7 +192,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(8);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_8.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b5: RscButton
{
@@ -208,7 +208,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(5);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_5.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b3: RscButton
{
@@ -224,7 +224,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(3);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_3.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b6: RscButton
{
@@ -240,7 +240,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(6);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_6.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b9: RscButton
{
@@ -256,7 +256,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(9);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_9.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class b0: RscButton
{
@@ -272,7 +272,7 @@ class SafeKeyPad
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
action = "dayz_combination = dayz_combination + str(0);";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_9.ogg",0.5,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak";
};
class bcancel: RscButton
@@ -288,8 +288,7 @@ class SafeKeyPad
colorText[] = {1,0.1,0.1,1};
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
soundClick[] = {"\dayz_sfx\action\cell\dtmf_star.ogg",0.6,1};
onButtonClick = "keypadCancel = true; ((ctrlParent (_this select 0)) closeDisplay 3000);";
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak; keypadCancel = true; ((ctrlParent (_this select 0)) closeDisplay 3000);";
};
class benter: RscButton
{
@@ -304,8 +303,7 @@ class SafeKeyPad
colorText[] = {0,1,0,1};
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
onButtonClick = "keypadCancel = false; ((ctrlParent (_this select 0)) closeDisplay 3000); if(!isNull dayz_selectedVault and (typeOf dayz_selectedVault) in DZE_LockedStorage) then {dayz_selectedVault spawn player_unlockVault;};";
soundClick[] = {"\dayz_sfx\action\cell\dtmf_hash.ogg",0.6,1};
onButtonClick = "[player,""keypad_tick"",0,false] call dayz_zombieSpeak; keypadCancel = false; ((ctrlParent (_this select 0)) closeDisplay 3000); if(!isNull dayz_selectedVault and (typeOf dayz_selectedVault) in DZE_LockedStorage) then {dayz_selectedVault spawn player_unlockVault;};";
};
};
};

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
];
};

View File

@@ -15904,6 +15904,16 @@
<Russian>совместимый</Russian>
<Czech>Kompatibilní</Czech>
</Key>
<Key ID="STR_EPOCH_DESCRIPTION">
<English>Description</English>
<Spanish>Descripción</Spanish>
<Italian>Descrizione</Italian>
<Hungarian>Leírás</Hungarian>
<Polish>Opis</Polish>
<Russian>Описание</Russian>
<German>Beschreibung</German>
<Czech>Popis</Czech>
</Key>
<Key ID="STR_EPOCH_PLAYER">
<English>Player</English>
<French>Joueur</French>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.