Fixed the empty adventure deck bug. Fixed cards in discard/dead pile/adventure deck being super tiny the first time the dialog is loaded.

This commit is contained in:
Christian 'ketura' McCarty
2023-05-13 02:27:03 -05:00
parent 01b82852e0
commit 65567e65b1
2 changed files with 21 additions and 8 deletions

View File

@@ -328,27 +328,28 @@ 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) {
$("#discard" + this.getPlayerIndex(this.bottomPlayerId)).addClass("clickable").click(
(function (index) {
return function () {
var dialog = that.discardPileDialogs[that.bottomPlayerId];
var group = that.discardPileGroups[that.allPlayerIds[index]];
var dialog = that.discardPileDialogs[index];
var group = that.discardPileGroups[index];
openSizeDialog(dialog);
that.dialogResize(dialog, group);
group.layoutCards();
};
})(i));
})(that.bottomPlayerId));
$("#adventureDeck" + this.getPlayerIndex(this.bottomPlayerId)).addClass("clickable").click(
(function (index) {
return function () {
var dialog = that.adventureDeckDialogs[that.bottomPlayerId];
var group = that.adventureDeckGroups[that.allPlayerIds[index]];
var dialog = that.adventureDeckDialogs[index];
var group = that.adventureDeckGroups[index];
openSizeDialog(dialog);
that.dialogResize(dialog, group);
group.layoutCards();
};
})(i));
})(that.bottomPlayerId));
}
for (var i = 0; i < this.allPlayerIds.length; i++) {

View File

@@ -96,11 +96,23 @@ public class GameState {
}
}
for (String playerId : playerOrder.getAllPlayers())
for (String playerId : playerOrder.getAllPlayers()) {
_playerThreats.put(playerId, 0);
}
for (GameStateListener listener : getAllGameStateListeners())
for (GameStateListener listener : getAllGameStateListeners()) {
listener.setPlayerOrder(playerOrder.getAllPlayers());
}
//This needs done after the Player Order initialization has been issued, or else the player
// adventure deck areas don't exist.
for (String playerId : playerOrder.getAllPlayers()) {
for(var site : getAdventureDeck(playerId)) {
for (GameStateListener listener : getAllGameStateListeners()) {
listener.cardCreated(site);
}
}
}
}
public boolean isMoving() {