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;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.player {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
.player.current {
|
.player.current {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.playerStats {
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.playerStats .clickable {
|
||||||
|
color: #7f7fff;
|
||||||
|
text-decoration: underline;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.phase {
|
.phase {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ var GempLotrGameUI = Class.extend({
|
|||||||
|
|
||||||
this.gameStateElem.append("<b>Players:</b><br>");
|
this.gameStateElem.append("<b>Players:</b><br>");
|
||||||
for (var i = 0; i < this.allPlayerIds.length; i++) {
|
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 class='player'>" + this.allPlayerIds[i] + "<div id='clock" + i + "' class='clock'></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>");
|
+ "<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>");
|
this.gameStateElem.append("<br>");
|
||||||
@@ -146,14 +146,15 @@ var GempLotrGameUI = Class.extend({
|
|||||||
|
|
||||||
$("#main").append(this.gameStateElem);
|
$("#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++) {
|
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(
|
$("#deadPile" + i).addClass("clickable").click(
|
||||||
(function(index) {
|
(function(index) {
|
||||||
return function() {
|
return function() {
|
||||||
|
|||||||
@@ -167,17 +167,19 @@ var GempLotrHallUI = Class.extend({
|
|||||||
});
|
});
|
||||||
tableDiv.append(but);
|
tableDiv.append(but);
|
||||||
}
|
}
|
||||||
if (status == "Playing") {
|
}
|
||||||
var but = $("<button>Watch game</button>");
|
|
||||||
$(but).button().click(
|
if (status == "Playing") {
|
||||||
function(event) {
|
var but = $("<button>Watch game</button>");
|
||||||
var participantId = getUrlParam("participantId");
|
$(but).button().click(
|
||||||
var participantIdAppend = "";
|
function(event) {
|
||||||
if (participantId != null)
|
var participantId = getUrlParam("participantId");
|
||||||
participantIdAppend = "&participantId=" + participantId;
|
var participantIdAppend = "";
|
||||||
location.href = "/gemp-lotr/game.html?gameId=" + id + participantIdAppend;
|
if (participantId != null)
|
||||||
});
|
participantIdAppend = "&participantId=" + participantId;
|
||||||
}
|
location.href = "/gemp-lotr/game.html?gameId=" + id + participantIdAppend;
|
||||||
|
});
|
||||||
|
tableDiv.append(but);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tableDiv;
|
return tableDiv;
|
||||||
|
|||||||
Reference in New Issue
Block a user