From ab7254a121fe25d94bfbbe132dc283a061f45ce0 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sat, 30 Apr 2016 21:19:06 -0400 Subject: [PATCH] Add lower volume / earplugs hotkey and status UI icon --- CHANGE LOG 1.0.6.txt | 1 + .../Configs/RscDisplay/RscPlayerUI.hpp | 4 ++-- SQF/dayz_code/compile/keyboard.sqf | 7 ++++++- SQF/dayz_code/compile/player_muteSound.sqf | 18 ++++++++++++++++++ SQF/dayz_code/compile/player_updateGui.sqf | 7 ++++--- .../compile/player_updateGuiDark.sqf | 6 ++++-- .../compile/player_updateGuiEpoch.sqf | 6 ++++-- SQF/dayz_code/compile/vehicle_getOut.sqf | 1 + .../gui/status/status_speaker_muted.paa | Bin 0 -> 5625 bytes SQF/dayz_code/init/compiles.sqf | 1 + SQF/dayz_code/init/variables.sqf | 1 + 11 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 SQF/dayz_code/compile/player_muteSound.sqf create mode 100644 SQF/dayz_code/gui/status/status_speaker_muted.paa 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 0000000000000000000000000000000000000000..b7d1eeb403399d68550ee953f9bf974d0e05afd8 GIT binary patch literal 5625 zcmd5=4Qx|Y6h60oZ8u?~MH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ZVStbDo(|Iv9#G)6L4~T2-l7IGY884r}^P<{?EK^f6T`7^L+D;Ju9&+&+Z zlt=UP$jA@pE8Gb_)EW76_T*{2Tr`C|u=LX(b~lK%yQK@gMv%#@oTaERIjt{fC><=n%&zEN)}| zr2&I~Mn2>IC-OILKBK=<^xtItP4am=dY?rgc~~%Rrholo8?uY*x+Cn`(f+|A^Zg43xvVZlQF1;EdO{!TA*Q{1xmqW> zy8U`~I@&A01jF6azsAt09~HU|=W!D0-N&z=cV$r@k5`n(T{)ll+xND33|m!~V@i&9 zlq@x?nRT%F`3%%;g{b(=patRw>&HExMrouH&D<9Byt1qZ-Hx#EW;HDs%;+<{tr)Of xDrIfcXB-aJ_wjwAEcZ@fJ!*6l+>+{YEBxw|Xx5J{?G;b04srH0e%)wXe*r{gcQ60| literal 0 HcmV?d00001 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;