Added a restriction to the in-game audio cue restricting play to only occur if the window is minimized and/or does not have focus.

This commit is contained in:
Christian 'ketura' McCarty
2021-03-05 21:54:24 -06:00
parent 3ca4fb47d4
commit 7094e78963

View File

@@ -1956,7 +1956,10 @@ var GempLotrGameUI = Class.extend({
PlaySound: function(soundObj) {
var myAudio = document.getElementById(soundObj);
myAudio.play();
if(!document.hasFocus() || document.hidden || document.msHidden || document.webkitHidden)
{
myAudio.play();
}
},
createActionChoiceContextMenu: function (actions, event, selectActionFunction) {