Watching games and deck/hand/discard/dead pile sizes and making them possible to see.
This commit is contained in:
@@ -28,11 +28,25 @@
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.player {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.player.current {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.playerStats {
|
||||
font-size: 70%;
|
||||
}
|
||||
|
||||
.playerStats .clickable {
|
||||
color: #7f7fff;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.phase {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ var GempLotrGameUI = Class.extend({
|
||||
|
||||
this.gameStateElem.append("<b>Players:</b><br>");
|
||||
for (var i = 0; i < this.allPlayerIds.length; i++) {
|
||||
this.gameStateElem.append("<div class='player'>" + this.allPlayerIds[i] + "<div id='clock" + i + "' class='clock'></div></div>");
|
||||
this.gameStateElem.append("<div id='deck" + i + "' style='display: inline;'></div><div id='hand" + i + "' style='display: inline;'></div><div id='discard" + i + "' style='display: inline;'></div><div id='deadPile" + i + "' style='display: inline;'></div>");
|
||||
this.gameStateElem.append("<div class='player'>" + this.allPlayerIds[i] + "<div id='clock" + i + "' class='clock'></div>"
|
||||
+ "<div class='playerStats'><div id='deck" + i + "' style='display: inline;'></div> <div id='hand" + i + "' style='display: inline;'></div> <div id='discard" + i + "' style='display: inline;'></div> <div id='deadPile" + i + "' style='display: inline;'></div></div></div>");
|
||||
}
|
||||
|
||||
this.gameStateElem.append("<br>");
|
||||
@@ -146,14 +146,15 @@ var GempLotrGameUI = Class.extend({
|
||||
|
||||
$("#main").append(this.gameStateElem);
|
||||
|
||||
if (!this.spectatorMode)
|
||||
$("#discard" + this.getPlayerIndex(this.bottomPlayerId)).addClass("clickable").click(
|
||||
(function(index) {
|
||||
return function() {
|
||||
that.discardPileDialogs[that.bottomPlayerId].dialog("open");
|
||||
};
|
||||
})(i));
|
||||
|
||||
for (var i = 0; i < this.allPlayerIds.length; i++) {
|
||||
if (!this.spectatorMode)
|
||||
$("#discard" + i).addClass("clickable").click(
|
||||
(function(index) {
|
||||
return function() {
|
||||
that.discardPileDialogs[that.allPlayerIds[index]].dialog("open");
|
||||
};
|
||||
})(i));
|
||||
$("#deadPile" + i).addClass("clickable").click(
|
||||
(function(index) {
|
||||
return function() {
|
||||
|
||||
@@ -167,17 +167,19 @@ var GempLotrHallUI = Class.extend({
|
||||
});
|
||||
tableDiv.append(but);
|
||||
}
|
||||
if (status == "Playing") {
|
||||
var but = $("<button>Watch game</button>");
|
||||
$(but).button().click(
|
||||
function(event) {
|
||||
var participantId = getUrlParam("participantId");
|
||||
var participantIdAppend = "";
|
||||
if (participantId != null)
|
||||
participantIdAppend = "&participantId=" + participantId;
|
||||
location.href = "/gemp-lotr/game.html?gameId=" + id + participantIdAppend;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (status == "Playing") {
|
||||
var but = $("<button>Watch game</button>");
|
||||
$(but).button().click(
|
||||
function(event) {
|
||||
var participantId = getUrlParam("participantId");
|
||||
var participantIdAppend = "";
|
||||
if (participantId != null)
|
||||
participantIdAppend = "&participantId=" + participantId;
|
||||
location.href = "/gemp-lotr/game.html?gameId=" + id + participantIdAppend;
|
||||
});
|
||||
tableDiv.append(but);
|
||||
}
|
||||
|
||||
return tableDiv;
|
||||
|
||||
Reference in New Issue
Block a user