summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-05-18 00:38:35 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:23 +0200
commitbb756e1f3d0014cc8d4eb3666849264daf108bdb (patch)
tree7f6d8544965169b6d880140cf21daaa3f624d180 /play.js
parent18de9c65450661610d29f151e6ef31ab05905ac3 (diff)
downloadtime-of-crisis-bb756e1f3d0014cc8d4eb3666849264daf108bdb.tar.gz
Add Solo play.
Diffstat (limited to 'play.js')
-rw-r--r--play.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/play.js b/play.js
index 3d0782f..3559f92 100644
--- a/play.js
+++ b/play.js
@@ -87,6 +87,7 @@ let ui = {
barbarian_leaders: [],
rival_emperors: [],
body: document.querySelector("body"),
+ header: document.querySelector("header"),
available_generals: document.getElementById("available_generals"),
available_governors: document.getElementById("available_governors"),
hand: document.getElementById("hand"),
@@ -416,8 +417,15 @@ function layout_stack(id, list, region, in_capital) {
function on_update() {
stack_cache = {}
+ ui.body.classList.toggle("p1", view.solo === 1)
ui.body.classList.toggle("p2", view.players.length === 2)
ui.body.classList.toggle("p3", view.players.length === 3)
+ ui.body.classList.toggle("p4", view.players.length === 4)
+
+ ui.header.classList.toggle("player_red", view.current === 0)
+ ui.header.classList.toggle("player_blue", view.current === 1)
+ ui.header.classList.toggle("player_yellow", view.current === 2)
+ ui.header.classList.toggle("player_green", view.current === 3)
if (view.players.length < 4)
hide(document.getElementById("role_Green"))
@@ -670,6 +678,11 @@ function on_update() {
for (let e of action_register)
e.classList.toggle("action", is_action(e.my_action, e.my_id))
+
+ action_button("end_actions", "End Actions")
+
+ action_button("done", "Done")
+ action_button("undo", "Undo")
}
on_init()