unmuted and muted events

beta.r3js.org
-=yb4f310 2017-11-28 08:21:42 +01:00
parent b5e55136b9
commit fb4a86c016
4 changed files with 39 additions and 18 deletions

27
build/game-lib-min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
// COMPILE TIME DEFINITIONS (Generated via gulp)
var __DATE__ = "Sun Nov 26 2017 22:50:32 GMT+0100 (CET)";
var __DATE__ = "Tue Nov 28 2017 08:21:32 GMT+0100 (CET)";
// END COMPILE TIME DEFINITIONS
/**
@ -184,6 +184,8 @@ GameLib.Event.GAME_STARTED = 0x66;
GameLib.Event.GAME_PAUSED = 0x67;
GameLib.Event.GAME_RESUMED = 0x68;
GameLib.Event.CUSTOM_GAME_START = 0x69;
GameLib.Event.AUDIO_MUTED = 0x6a;
GameLib.Event.AUDIO_UNMUTED = 0x6b;
@ -302,6 +304,8 @@ GameLib.Event.GetEventName = function(number) {
case 0x67 : return 'game_paused';
case 0x68 : return 'game_resumed';
case 0x69 : return 'custom_game_start';
case 0x6a : return 'audio_muted';
case 0x6b : return 'audio_unmuted';
break;
}
@ -25826,14 +25830,20 @@ GameLib.System.Audio.prototype.muteAudio = function() {
return result;
},
[]
)
);
GameLib.Event.Emit(GameLib.Event.AUDIO_MUTED, {audioSystem:this});
} else {
this.audioVolumes.map(
function(audioVolume) {
audioVolume.audio.volume = audioVolume.volume;
audioVolume.audio.updateInstance('volume');
}
)
);
GameLib.Event.Emit(GameLib.Event.AUDIO_UNMUTED, {audioSystem:this});
}
};

View File

@ -120,6 +120,8 @@ GameLib.Event.GAME_STARTED = 0x66;
GameLib.Event.GAME_PAUSED = 0x67;
GameLib.Event.GAME_RESUMED = 0x68;
GameLib.Event.CUSTOM_GAME_START = 0x69;
GameLib.Event.AUDIO_MUTED = 0x6a;
GameLib.Event.AUDIO_UNMUTED = 0x6b;
@ -238,6 +240,8 @@ GameLib.Event.GetEventName = function(number) {
case 0x67 : return 'game_paused';
case 0x68 : return 'game_resumed';
case 0x69 : return 'custom_game_start';
case 0x6a : return 'audio_muted';
case 0x6b : return 'audio_unmuted';
break;
}

View File

@ -243,14 +243,20 @@ GameLib.System.Audio.prototype.muteAudio = function() {
return result;
},
[]
)
);
GameLib.Event.Emit(GameLib.Event.AUDIO_MUTED, {audioSystem:this});
} else {
this.audioVolumes.map(
function(audioVolume) {
audioVolume.audio.volume = audioVolume.volume;
audioVolume.audio.updateInstance('volume');
}
)
);
GameLib.Event.Emit(GameLib.Event.AUDIO_UNMUTED, {audioSystem:this});
}
};