Added a fourth UI pile for showing all cards which have been removed from the game. This was supposed to be public information for all sides, but was incorrectly handled as private info.

This commit is contained in:
Christian 'ketura' McCarty
2023-05-13 18:21:07 -05:00
parent e046cf1b8d
commit e77ebb1149
5 changed files with 40 additions and 26 deletions

View File

@@ -68,6 +68,17 @@ body {
background-image: url('/gemp-lotr/images/adventureDeck-42.png');
}
.removedPileSize {
display: none;
text-align: center;
vertical-align: middle;
font-size: 200%;
font-weight: bolder;
width: 42px;
height: 42px;
background-image: url('/gemp-lotr/images/exiled-42.png');
}
.showStats {
display: table-cell;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -226,6 +226,8 @@ var GameAnimations = Class.extend({
that.game.deadPileDialogs[participantId].append(cardDiv);
else if (zone == "ADVENTURE_DECK")
that.game.adventureDeckDialogs[participantId].append(cardDiv);
else if (zone == "REMOVED")
that.game.removedPileDialogs[participantId].append(cardDiv);
else
$("#main").append(cardDiv);
@@ -797,12 +799,14 @@ var GameAnimations = Class.extend({
var adventureDeck = playerZone.getAttribute("ADVENTURE_DECK");
var dead = playerZone.getAttribute("DEAD");
var deck = playerZone.getAttribute("DECK");
var removed = playerZone.getAttribute("REMOVED");
$("#deck" + that.game.getPlayerIndex(playerId)).text(deck);
$("#hand" + that.game.getPlayerIndex(playerId)).text(hand);
$("#discard" + that.game.getPlayerIndex(playerId)).text(discard);
$("#deadPile" + that.game.getPlayerIndex(playerId)).text(dead);
$("#adventureDeck" + that.game.getPlayerIndex(playerId)).text(adventureDeck);
$("#removedPile" + that.game.getPlayerIndex(playerId)).text(removed);
}
var playerThreats = element.getElementsByTagName("threats")

View File

@@ -32,6 +32,8 @@ var GempLotrGameUI = Class.extend({
adventureDeckGroups: null,
deadPileDialogs: null,
deadPileGroups: null,
removedPileDialogs: null,
removedPileGroups: null,
statsDiv: null,
@@ -146,6 +148,8 @@ var GempLotrGameUI = Class.extend({
this.adventureDeckGroups = {};
this.deadPileDialogs = {};
this.deadPileGroups = {};
this.removedPileDialogs = {};
this.removedPileGroups = {};
this.skirmishShadowGroup = new NormalCardGroup($("#main"), function (card) {
return card.zone == "SHADOW_CHARACTERS" && card.skirmish == true;
@@ -294,7 +298,7 @@ var GempLotrGameUI = Class.extend({
for (var i = 0; i < this.allPlayerIds.length; i++) {
this.gameStateElem.append("<div class='player'>" + (i + 1) + ". " + this.allPlayerIds[i] + "<div id='clock" + i + "' class='clock'></div>"
+ "<div class='playerStats'><div id='deck" + i + "' class='deckSize'></div><div id='hand" + i + "' class='handSize'></div><div id='threats" + i + "' class='threatsSize'></div><div id='showStats" + i + "' class='showStats'></div><div id='discard" + i + "' class='discardSize'></div><div id='deadPile" + i + "' class='deadPileSize'></div><div id='adventureDeck" + i + "' class='adventureDeckSize'></div></div></div>");
+ "<div class='playerStats'><div id='deck" + i + "' class='deckSize'></div><div id='hand" + i + "' class='handSize'></div><div id='threats" + i + "' class='threatsSize'></div><div id='showStats" + i + "' class='showStats'></div><div id='discard" + i + "' class='discardSize'></div><div id='deadPile" + i + "' class='deadPileSize'></div><div id='adventureDeck" + i + "' class='adventureDeckSize'></div><div id='removedPile" + i + "' class='removedPileSize'></div></div></div>");
}
this.gameStateElem.append("<div class='twilightPool'>0</div>");
@@ -314,11 +318,13 @@ var GempLotrGameUI = Class.extend({
$("#discard" + playerIndex).css({display: "none"});
$("#deadPile" + playerIndex).css({display: "none"});
$("#adventureDeck" + playerIndex).css({display: "none"});
$("#removedPile" + playerIndex).css({display: "none"});
} else {
$(this).addClass("opened").css({width: 150 - that.padding + 126});
$(this).addClass("opened").css({width: 150 - that.padding + 168});
$("#discard" + playerIndex).css({display: "table-cell"});
$("#deadPile" + playerIndex).css({display: "table-cell"});
$("#adventureDeck" + playerIndex).css({display: "table-cell"});
$("#removedPile" + playerIndex).css({display: "table-cell"});
}
}
});
@@ -328,7 +334,6 @@ var GempLotrGameUI = Class.extend({
$("#showStats" + i).append(showBut);
}
//TODO: This is where we will need to add support for public discard piles
if (!this.spectatorMode) {
if(!discardPublic) {
$("#discard" + this.getPlayerIndex(this.bottomPlayerId)).addClass("clickable").click(
@@ -366,6 +371,17 @@ var GempLotrGameUI = Class.extend({
};
})(i));
$("#removedPile" + i).addClass("clickable").click(
(function (index) {
return function () {
var dialog = that.removedPileDialogs[that.allPlayerIds[index]];
var group = that.removedPileGroups[that.allPlayerIds[index]];
openSizeDialog(dialog);
that.dialogResize(dialog, group);
group.layoutCards();
};
})(i));
if(discardPublic) {
$("#discard" + i).addClass("clickable").click(
(function (index) {
@@ -1028,6 +1044,10 @@ var GempLotrGameUI = Class.extend({
for (var playerId in this.deadPileGroups)
if (this.deadPileGroups.hasOwnProperty(playerId))
this.deadPileGroups[playerId].layoutCards();
for (var playerId in this.removedPileGroups)
if (this.removedPileGroups.hasOwnProperty(playerId))
this.removedPileGroups[playerId].layoutCards();
}
this.tabPane.css({
position: "absolute",
@@ -1399,33 +1419,11 @@ var GempLotrGameUI = Class.extend({
participantId = this.allPlayerIds[i];
this.createPile(participantId, "Dead Pile", "deadPileDialogs", "deadPileGroups");
this.createPile(participantId, "Removed Pile", "removedPileDialogs", "removedPileGroups");
if(discardPublic) {
this.createPile(participantId, "Discard Pile", "discardPileDialogs", "discardPileGroups");
}
// var deadPileDialog = $("<div></div>").dialog({
// autoOpen: false,
// closeOnEscape: true,
// resizable: true,
// title: "Dead pile - " + this.allPlayerIds[i],
// minHeight: 80,
// minWidth: 200,
// width: 600,
// height: 300
// });
// this.deadPileDialogs[this.allPlayerIds[i]] = deadPileDialog;
// this.deadPileGroups[this.allPlayerIds[i]] = new NormalCardGroup(deadPileDialog, function (card) {
// return true;
// }, false);
// this.deadPileGroups[this.allPlayerIds[i]].setBounds(this.padding, this.padding, 580 - 2 * (this.padding), 250 - 2 * (this.padding));
// deadPileDialog.bind("dialogresize", (function (dialog, index) {
// return function () {
// that.dialogResize(dialog, that.deadPileGroups[that.allPlayerIds[index]]);
// }
// })(deadPileDialog, i));
}
this.initializeGameUI(discardPublic);

View File

@@ -135,6 +135,7 @@ public class GameStats {
playerZoneSizes.put(Zone.ADVENTURE_DECK, game.getGameState().getAdventureDeck(player).size());
playerZoneSizes.put(Zone.DISCARD, game.getGameState().getDiscard(player).size());
playerZoneSizes.put(Zone.DEAD, game.getGameState().getDeadPile(player).size());
playerZoneSizes.put(Zone.REMOVED, game.getGameState().getRemoved(player).size());
newZoneSizes.put(player, playerZoneSizes);
}
}