Add better sound muted status UI icon and background

Icon contributed by Tugodoomer and AlexAFlorov. See
https://github.com/DayZMod/DayZ/issues/625 for details
This commit is contained in:
ebaydayz
2016-07-20 15:24:31 -04:00
parent d0a2260fb1
commit f314a39e43
11 changed files with 43 additions and 16 deletions

View File

@@ -56,7 +56,7 @@ if (isNil "keyboard_keys") then {
_handled = true;
};
_muteSound = {
call player_muteSound;
call player_toggleSoundMute;
_handled = true;
};
_rifle = {

View File

@@ -1,18 +1,21 @@
private ["_control","_display"];
private ["_background","_icon","_display"];
disableSerialization;
_display = uiNamespace getVariable "DAYZ_GUI_display";
if (!isNil "_display") then {
_control = _display displayCtrl 1204;
_background = _display displayCtrl 1904;
_icon = _display displayCtrl 1204;
if (dayz_soundMuted) then {
dayz_soundMuted = false;
1 fadeSound 1;
_control ctrlShow false;
_background ctrlShow false;
_icon ctrlShow false;
} else {
dayz_soundMuted = true;
1 fadeSound 0.25;
_control ctrlShow true;
_background ctrlShow true;
_icon ctrlShow true;
};
};

View File

@@ -45,10 +45,12 @@ _ctrlTemp = _display displayCtrl 1306;
_ctrlEar = _display displayCtrl 1304;
_ctrlEye = _display displayCtrl 1305;
_ctrlFracture = _display displayCtrl 1203;
_ctrlMuteBackground = _display displayCtrl 1904;
_ctrlMuteIcon = _display displayCtrl 1204;
if (!dayz_soundMuted) then {
_control = _display displayCtrl 1204; //muted speaker icon
_control ctrlShow false;
_ctrlMuteBackground ctrlShow false;
_ctrlMuteIcon ctrlShow false;
};
//Food/Water/Blood

View File

@@ -45,10 +45,12 @@ _ctrlEye = _display displayCtrl 1305;
//_ctrlHumanity = _display displayCtrl 1207;
_ctrlCombat = _display displayCtrl 1307;
_ctrlFracture = _display displayCtrl 1203;
_ctrlMuteBackground = _display displayCtrl 1904;
_ctrlMuteIcon = _display displayCtrl 1204;
if (!dayz_soundMuted) then {
_control = _display displayCtrl 1204; //muted speaker icon
_control ctrlShow false;
_ctrlMuteBackground ctrlShow false;
_ctrlMuteIcon ctrlShow false;
};
//Food/Water/Blood

View File

@@ -36,10 +36,12 @@ _ctrlEye = _display displayCtrl 1305;
//_ctrlHumanity = _display displayCtrl 1207;
_ctrlCombat = _display displayCtrl 1307;
_ctrlFracture = _display displayCtrl 1203;
_ctrlMuteBackground = _display displayCtrl 1904;
_ctrlMuteIcon = _display displayCtrl 1204;
if (!dayz_soundMuted) then {
_control = _display displayCtrl 1204; //muted speaker icon
_control ctrlShow false;
_ctrlMuteBackground ctrlShow false;
_ctrlMuteIcon ctrlShow false;
};
//Food/Water/Blood

View File

@@ -7,7 +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
if (dayz_soundMuted) then {call player_toggleSoundMute;}; // Automatically disable sound mute on vehicle exit
_buildables = count ((getposATL _vehicle) nearObjects ["DZ_buildables", 3]);
if (_buildables > 0) then {