From 71c0e5bc691ce148515ebf4d6e2fba96c85c2ccb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 5 Mar 2023 20:34:23 +0100 Subject: Extend operation states with common SA actions using Object.assign --- play.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'play.js') 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) -- cgit v1.2.3