summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css5
-rw-r--r--play.js3
-rw-r--r--rules.js17
3 files changed, 11 insertions, 14 deletions
diff --git a/play.css b/play.css
index f2113ed..dc801f8 100644
--- a/play.css
+++ b/play.css
@@ -90,6 +90,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); }
.space.Romania.action { border-color: peachpuff; }
.space.Bulgaria.action { border-color: palegreen; }
+.space.selected {
+ border-color: aqua;
+ box-shadow: 0 0 0 1px black, inset 0 0 0 1px black;
+}
+
.space.tip {
border-color: lime;
box-shadow: 0 0 0 1px black, inset 0 0 0 1px black;
diff --git a/play.js b/play.js
index aa7a8b6..a201e8a 100644
--- a/play.js
+++ b/play.js
@@ -715,6 +715,9 @@ function on_update() {
for (let e of action_register)
e.classList.toggle("action", is_action(e.my_action, e.my_id))
+ for (let s = 0; s <= last_space; ++s)
+ ui.spaces[s].classList.toggle("selected", view.selected_space === s)
+
action_button("yes", "Yes")
action_button("no", "No")
action_button("start", "Start")
diff --git a/rules.js b/rules.js
index dff42c5..3e4a867 100644
--- a/rules.js
+++ b/rules.js
@@ -387,19 +387,8 @@ exports.view = function(state, player) {
view.drawn = game.vm.draw
if (player === game.active) {
- if (game.selected_space) {
- view.valid_spaces = [game.selected_space]
- } else {
- view.valid_spaces = game.valid_spaces
- }
- } else {
- view.valid_spaces = []
- }
-
- if (player === game.active) {
- view.valid_cards = game.valid_cards
- } else {
- view.valid_cards = []
+ if (game.selected_space >= 0)
+ view.selected_space = game.selected_space
}
if (player === DEM) {
@@ -422,7 +411,7 @@ exports.view = function(state, player) {
if (game.state === "game_over") {
view.prompt = game.victory
- } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) {
+ } else if (game.active !== player) {
if (states[game.state]) {
let inactive = states[game.state].inactive
if (typeof inactive === "function")