diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-10 16:39:03 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-10 16:39:03 +0100 |
commit | 0d09d30e9d34100c60b54e7a264b7430cf756347 (patch) | |
tree | d596ad1f871152ef74d88b366334291994c427aa | |
parent | e43c00ffe5a00483da67898fb8abcf87cce5d419 (diff) | |
download | 1989-dawn-of-freedom-0d09d30e9d34100c60b54e7a264b7430cf756347.tar.gz |
Added permanently removed view
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.html | 9 | ||||
-rw-r--r-- | play.js | 14 | ||||
-rw-r--r-- | rules.js | 2 |
4 files changed, 26 insertions, 3 deletions
@@ -141,7 +141,7 @@ header.your_turn { background-color: orange; } display: flex;
}
-#discard_panel {
+#discard_panel, #removed_panel {
min-width: 200px;
width: auto;
display: inline-block;
@@ -149,7 +149,7 @@ header.your_turn { background-color: orange; } border-radius: 5px;
}
-#discard_panel.hide {
+#discard_panel.hide, #removed_panel.hide {
display: none;
}
@@ -93,6 +93,7 @@ </details>
<button onclick="toggle_pieces()"><img src="images/earth-africa-europe.svg"></button>
<button onclick="toggle_discard()"><img src="images/bin.png"></button>
+ <button onclick="toggle_removed()"><img src="images/remove.png"></button>
</div>
</header>
@@ -208,6 +209,14 @@ </div>
</section>
+<!-- PERMANENTLY REMOVED -->
+<section id = "sec_removed">
+ <div id="removed_panel" class="panel hide">
+ <div id="removed_header" class="panel_header">Permanently Removed Events</div>
+ <div id="removed" class="panel_body"></div>
+ </div>
+</section>
+
<!-- POWERSTRUGGLE -->
<section id = "sec_power">
<div id="ceausescu_panel" class="panel hide">
@@ -557,6 +557,16 @@ if(view.discard) { }
}
+// UPDATE PERMANENTLY REMOVED CARDS
+document.getElementById("removed").replaceChildren()
+for (let c of view.strategy_removed) {
+ let discard_card = ui.cards[c]
+ document.getElementById("removed").appendChild(discard_card)
+ discard_card.classList.add('discard_card')
+ discard_card.classList.remove('selected')
+}
+
+
// PLAYED CARD PANEL
if (view.played_card > 0) {
document.getElementById("played_card_panel").classList.remove("hide")
@@ -841,6 +851,10 @@ function toggle_discard() { document.getElementById("discard_panel").classList.toggle("hide")
}
+function toggle_removed() {
+ document.getElementById("removed_panel").classList.toggle("hide")
+}
+
function check_dem_control(demInfl, comInfl, space) {
if ((demInfl - comInfl) >= space.stability) {
return true
@@ -170,7 +170,7 @@ exports.view = function(state, player) { the_tyrant_is_gone: game.the_tyrant_is_gone,
strategy_deck: game.strategy_deck.length,
- //strategy_discard: game.strategy_discard,
+ strategy_removed: game.strategy_removed,
discard: game.discard,
show_opp_hand: game.view_opp_hand,
|