summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-03-05 20:34:23 +0100
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:15 +0200
commit71c0e5bc691ce148515ebf4d6e2fba96c85c2ccb (patch)
tree0aa72b83070ea2b6eb870ff2c52da5d5c2ff3f10 /play.js
parent1397f7f5ac4e93cc7e01c3bf9505932722bfc6ef (diff)
downloadandean-abyss-71c0e5bc691ce148515ebf4d6e2fba96c85c2ccb.tar.gz
Extend operation states with common SA actions using Object.assign
Diffstat (limited to 'play.js')
-rw-r--r--play.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/play.js b/play.js
index fda7b3b..f7aff9f 100644
--- a/play.js
+++ b/play.js
@@ -231,6 +231,11 @@ function get_layout_radius(s) {
}
function init_ui() {
+ register_action(ui.resources[GOVT], "pay", GOVT)
+ register_action(ui.resources[FARC], "pay", FARC)
+ register_action(ui.resources[AUC], "pay", AUC)
+ register_action(ui.resources[CARTELS], "pay", CARTELS)
+
for (let i = 0; i < data.spaces.length; ++i) {
let id = data.spaces[i].id
let type = data.spaces[i].type
@@ -649,6 +654,11 @@ function on_update() {
ui.header.classList.toggle("cartels", view.current === CARTELS)
ui.header.classList.toggle("farc", view.current === FARC)
+ ui.resources[GOVT].classList.toggle("action", is_action("pay", GOVT))
+ ui.resources[FARC].classList.toggle("action", is_action("pay", FARC))
+ ui.resources[AUC].classList.toggle("action", is_action("pay", AUC))
+ ui.resources[CARTELS].classList.toggle("action", is_action("pay", CARTELS))
+
ui.player[GOVT].classList.toggle("hide", view.scenario < 3)
ui.player[AUC].classList.toggle("hide", view.scenario < 4)
ui.player[CARTELS].classList.toggle("hide", view.scenario < 4)