diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-05-18 00:38:35 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:23 +0200 |
commit | bb756e1f3d0014cc8d4eb3666849264daf108bdb (patch) | |
tree | 7f6d8544965169b6d880140cf21daaa3f624d180 /play.js | |
parent | 18de9c65450661610d29f151e6ef31ab05905ac3 (diff) | |
download | time-of-crisis-bb756e1f3d0014cc8d4eb3666849264daf108bdb.tar.gz |
Add Solo play.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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() |