Merge pull request #96 from PlayersCouncil/gemp-improvements

Gemp improvements
This commit is contained in:
Marcin Sciesinski
2021-03-09 04:22:41 -08:00
committed by GitHub
9 changed files with 53 additions and 7 deletions

3
.gitignore vendored
View File

@@ -17,4 +17,5 @@ logs/*
**/logs
.idea/
*.iml
remote-sync
remote-sync
replay

Binary file not shown.

View File

@@ -41,6 +41,9 @@
<script type="text/javascript" src="js/gemp-022/gameUi.js"></script>
<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">

View File

@@ -42,6 +42,8 @@
<script type="text/javascript" src="js/gemp-022/gameAnimations.js"></script>
<script type="text/javascript" src="js/gemp-022/merchantUi.js"></script>
<audio id="gamestart" src="/gemp-lotr/fanfare_x.mp3" type="audio/mpeg" preload="metadata"></audio>
<script type="text/javascript">
var chat;
var hall;
@@ -144,6 +146,8 @@
chat.setBounds(2, 2, innerWidth - 4, middleHeight - 4);
hall.hallResized(innerWidth, middleHeight);
}
</script>
</head>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

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,10 +1946,21 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
$(':button').blur();
},
PlaySound: function(soundObj) {
var myAudio = document.getElementById(soundObj);
if(!document.hasFocus() || document.hidden || document.msHidden || document.webkitHidden)
{
myAudio.play();
}
},
createActionChoiceContextMenu: function (actions, event, selectActionFunction) {
// Remove context menus that may be showing
@@ -2071,7 +2088,10 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
openSizeDialog(this.cardActionDialog);
this.arbitraryDialogResize(false);
@@ -2151,7 +2171,10 @@ var GempLotrGameUI = Class.extend({
allowSelection();
if (!this.replayMode)
{
processButtons();
this.PlaySound("awaitAction");
}
},
assignMinionsDecision: function (decision) {
@@ -2199,6 +2222,8 @@ var GempLotrGameUI = Class.extend({
that.clearSelection();
that.decisionFunction(id, "" + assignmentArray);
this.PlaySound("awaitAction");
});
}

View File

@@ -397,6 +397,11 @@ var GempLotrHallUI = Class.extend({
.css({borderTopColor:"#000000", borderLeftColor:"#000000", borderBottomColor:"#000000", borderRightColor:"#000000"})
.animate({borderTopColor:"#ffffff", borderLeftColor:"#ffffff", borderBottomColor:"#ffffff", borderRightColor:"#ffffff"}, "fast");
},
PlaySound: function(soundObj) {
var myAudio = document.getElementById(soundObj);
myAudio.play();
},
processHall:function (xml) {
var that = this;
@@ -678,12 +683,14 @@ var GempLotrHallUI = Class.extend({
window.open("/gemp-lotr/game.html?gameId=" + waitingGameId + participantIdAppend, "_blank");
}
if (games.length > 0) {
var soundPlay = $("<embed src='/gemp-lotr/fanfare_x.wav' hidden='true' autostart='true' loop='false'>");
this.tablesDiv.append(soundPlay);
setTimeout(
function() {
soundPlay.remove();
}, 5000);
// var soundPlay = $("<embed src='/gemp-lotr/fanfare_x.mp3' hidden='true' autostart='true' loop='false'>");
// this.tablesDiv.append(soundPlay);
// setTimeout(
// function() {
// soundPlay.remove();
// }, 5000);
this.PlaySound("gamestart");
}
if (!this.supportedFormatsInitialized) {

View File

@@ -228,6 +228,12 @@ var Card = Class.extend({
},
hasErrata: function () {
var separator = this.blueprintId.indexOf("_");
var setNo = parseInt(this.blueprintId.substr(0, separator));
if(setNo >= 50 && setNo <= 69)
return true;
return this.errata;
},