diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index b302706bc..17eab0f05 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -13,6 +13,7 @@ [NEW] Added "RedRyder" and "350Rnd_BB_Magazine" to loot pile. #1456 #1457 @Namindu [NEW] Added action to lock and unlock vehicles from inside #1103 @pj999 @ebaydayz [NEW] Autorun hotkey (0 = Toggle auto run) @ebaydayz +[NEW] Earplugs hotkey and status UI icon (F1 = Lower volume). Automatically disabled when exiting a vehicle. @ebaydayz [NEW] Snap building, use DZE_modularBuild = true; in init.sqf to enable. @raymix [NEW] Auto login when a player joins the server, default 10 seconds, requires description.ext update in the mission (disable in description.ext by setting defValueParam1 = 31;) @icomrade [NEW] Blood types system is disabled by default. Set dayz_classicBloodBagSystem = false; in init.sqf to enable diff --git a/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp b/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp index 6f20a4a2f..cb479df61 100644 --- a/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp +++ b/SQF/dayz_code/Configs/RscDisplay/RscPlayerUI.hpp @@ -219,7 +219,7 @@ class RscTitles class RscPicture_1204: RscPictureGUI { idc = 1204; - text = "\z\addons\dayz_code\gui\status\status_connection_ca.paa"; + text = "\z\addons\dayz_code\gui\status\status_speaker_muted.paa"; // was previously status_connection_ca, not used x = 0.955313 * safezoneW + safezoneX; y = 0.51 * safezoneH + safezoneY; w = 0.075; @@ -430,7 +430,7 @@ class RscTitles class RscPicture_1204: RscPictureGUI { idc = 1204; - text = "\z\addons\dayz_code\gui\status_epoch\status_connection_ca.paa"; + text = "\z\addons\dayz_code\gui\status\status_speaker_muted.paa"; // was previously status_connection_ca, not used x = 0.955313 * safezoneW + safezoneX; y = 0.51 * safezoneH + safezoneY; w = 0.075; diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index 6090384cd..e56c35832 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -55,6 +55,10 @@ if (isNil "keyboard_keys") then { }; _handled = true; }; + _muteSound = { + call player_muteSound; + _handled = true; + }; _rifle = { 2 call dz_fn_switchWeapon; _handled = true; @@ -326,6 +330,7 @@ if (isNil "keyboard_keys") then { [actionKeys "Diary", _journal] call _addArray; [actionKeys "NetworkStats", _journal] call _addArray; //[actionKeys "Turbo", _turbo] call _addArray; + [[DIK_F1], _muteSound] call _addArray; [[DIK_F4, DIK_TAB, DIK_DELETE], _forcesave] call _addArray; //[[DIK_F4, DIK_RMENU, DIK_LMENU,DIK_LSHIFT,DIK_RSHIFT,DIK_ESCAPE], _forcesave2] call _addArray; [actionKeys "LeanLeft", _build_left ] call _addArray; @@ -337,7 +342,7 @@ if (isNil "keyboard_keys") then { [actionKeys "ForceCommandingMode", {DZE_5 = true;_handled = true;}] call _addArray; [[ DIK_F9, DIK_F10, DIK_F11, DIK_F8,DIK_F7,DIK_F6,DIK_F5,DIK_F4, - DIK_F3,DIK_F2,DIK_F1,DIK_9, + DIK_F3,DIK_F2,DIK_9, DIK_8,DIK_7,DIK_6,DIK_5,DIK_4], _block] call _addArray; if (serverCommandAvailable "#kick") then { [[DIK_F12], gcam_onoff] call _addArray; // GCAM: F12 to start (for admins only) diff --git a/SQF/dayz_code/compile/player_muteSound.sqf b/SQF/dayz_code/compile/player_muteSound.sqf new file mode 100644 index 000000000..1fe52401e --- /dev/null +++ b/SQF/dayz_code/compile/player_muteSound.sqf @@ -0,0 +1,18 @@ +private ["_control","_display"]; + +disableSerialization; +_display = uiNamespace getVariable "DAYZ_GUI_display"; + +if (!isNil "_display") then { + _control = _display displayCtrl 1204; + + if (dayz_soundMuted) then { + dayz_soundMuted = false; + 1 fadeSound 1; + _control ctrlShow false; + } else { + dayz_soundMuted = true; + 1 fadeSound 0.25; + _control ctrlShow true; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_updateGui.sqf b/SQF/dayz_code/compile/player_updateGui.sqf index 710b096b6..ece87be35 100644 --- a/SQF/dayz_code/compile/player_updateGui.sqf +++ b/SQF/dayz_code/compile/player_updateGui.sqf @@ -45,9 +45,10 @@ _ctrlEar = _display displayCtrl 1304; _ctrlEye = _display displayCtrl 1305; _ctrlFracture = _display displayCtrl 1203; -_control = _display displayCtrl 1204; //status_connection_ca.paa ??? -_control ctrlShow false; - +if (!dayz_soundMuted) then { + _control = _display displayCtrl 1204; //muted speaker icon + _control ctrlShow false; +}; //Food/Water/Blood /* diff --git a/SQF/dayz_code/compile/player_updateGuiDark.sqf b/SQF/dayz_code/compile/player_updateGuiDark.sqf index 36066a834..26a1457d9 100644 --- a/SQF/dayz_code/compile/player_updateGuiDark.sqf +++ b/SQF/dayz_code/compile/player_updateGuiDark.sqf @@ -46,8 +46,10 @@ _ctrlEye = _display displayCtrl 1305; _ctrlCombat = _display displayCtrl 1307; _ctrlFracture = _display displayCtrl 1203; -_control = _display displayCtrl 1204; //status_connection_ca.paa ??? -_control ctrlShow false; +if (!dayz_soundMuted) then { + _control = _display displayCtrl 1204; //muted speaker icon + _control ctrlShow false; +}; //Food/Water/Blood _ctrlBlood ctrlSetTextColor [(1 - _bloodVal),(1 - _bloodVal),(1 - _bloodVal), 0.5]; diff --git a/SQF/dayz_code/compile/player_updateGuiEpoch.sqf b/SQF/dayz_code/compile/player_updateGuiEpoch.sqf index 78de4d77f..df5edb3a4 100644 --- a/SQF/dayz_code/compile/player_updateGuiEpoch.sqf +++ b/SQF/dayz_code/compile/player_updateGuiEpoch.sqf @@ -37,8 +37,10 @@ _ctrlEye = _display displayCtrl 1305; _ctrlCombat = _display displayCtrl 1307; _ctrlFracture = _display displayCtrl 1203; -_control = _display displayCtrl 1204; //status_connection_ca.paa ??? -_control ctrlShow false; +if (!dayz_soundMuted) then { + _control = _display displayCtrl 1204; //muted speaker icon + _control ctrlShow false; +}; //Food/Water/Blood _ctrlBlood ctrlSetTextColor [(Dayz_GUI_R + (0.3 * (1-_bloodVal))),(Dayz_GUI_G * _bloodVal),(Dayz_GUI_B * _bloodVal), 0.5]; diff --git a/SQF/dayz_code/compile/vehicle_getOut.sqf b/SQF/dayz_code/compile/vehicle_getOut.sqf index e1cda5488..2cf31df40 100644 --- a/SQF/dayz_code/compile/vehicle_getOut.sqf +++ b/SQF/dayz_code/compile/vehicle_getOut.sqf @@ -7,6 +7,7 @@ _position = _this select 1; _unit = _this select 2; if (_unit == player) then { + if (dayz_soundMuted) then {call player_muteSound;}; // Automatically disable sound mute on vehicle exit _buildables = count ((getposATL _vehicle) nearObjects ["DZ_buildables", 3]); if (_buildables > 0) then { diff --git a/SQF/dayz_code/gui/status/status_speaker_muted.paa b/SQF/dayz_code/gui/status/status_speaker_muted.paa new file mode 100644 index 000000000..b7d1eeb40 Binary files /dev/null and b/SQF/dayz_code/gui/status/status_speaker_muted.paa differ diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 5fce379e1..49bda7ec5 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -116,6 +116,7 @@ if (!isDedicated) then { player_sharpen = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sharpen.sqf"; //ui + player_muteSound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_muteSound.sqf"; player_selectSlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf"; player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf"; ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf"; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index dd7a20c50..14b7d2a3b 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -569,6 +569,7 @@ if (!isDedicated) then { dayz_thirst = 0; dayz_nutrition = 0; dayz_preloadFinished = true; + dayz_soundMuted = false; dayz_statusArray = [1,1]; dayz_disAudial = 0; dayz_disVisual = 0;