Added in-game decision audio.

Added an audio prompt to most in-game decision prompts, which should be low-intrusion enough to not be terribly annoying over the course of the game.  This should probably be gated behind a user setting at some point.
This commit is contained in:
Christian 'ketura' McCarty
2021-03-04 23:44:13 -06:00
parent c76ba3624d
commit 3ca4fb47d4
3 changed files with 25 additions and 0 deletions

View File

@@ -42,6 +42,9 @@
<script type="text/javascript" src="js/gemp-022/gameAnimations.js"></script>
<script type="text/javascript" src="js/gemp-022/merchantUi.js"></script>
<!-- Audio file downloaded from https://material.io/design/sound/sound-resources.html -->
<audio id="awaitAction" src="/gemp-lotr/awaiting_decision.mp3" type="audio/mpeg" preload="metadata"></audio>
<script type="text/javascript">
var ui;

View File

@@ -1536,7 +1536,10 @@ var GempLotrGameUI = Class.extend({
this.smallDialog.append(but);
}
if (!this.replayMode)
{
this.smallDialog.dialog("option", "buttons", {});
this.PlaySound("awaitAction");
}
}
this.smallDialog.dialog("open");
@@ -1798,7 +1801,10 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
openSizeDialog(this.cardActionDialog);
this.arbitraryDialogResize(false);
@@ -1940,11 +1946,19 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
$(':button').blur();
},
PlaySound: function(soundObj) {
var myAudio = document.getElementById(soundObj);
myAudio.play();
},
createActionChoiceContextMenu: function (actions, event, selectActionFunction) {
// Remove context menus that may be showing
$(".contextMenu").remove();
@@ -2071,7 +2085,10 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
openSizeDialog(this.cardActionDialog);
this.arbitraryDialogResize(false);
@@ -2151,7 +2168,10 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
},
assignMinionsDecision: function (decision) {
@@ -2199,6 +2219,8 @@ var GempLotrGameUI = Class.extend({
that.clearSelection();
that.decisionFunction(id, "" + assignmentArray);
this.PlaySound("awaitAction");
});
}