From a3782cd051b4a5c10c3a41062c7b4d6063bc6a60 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 18 Dec 2022 16:56:07 +0100 Subject: Black and Baltic Sea Trade. --- play.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'play.js') diff --git a/play.js b/play.js index 3d959a7..b616156 100644 --- a/play.js +++ b/play.js @@ -74,6 +74,11 @@ function on_click_veche_coin(evt) { send_action('veche_coin') } +function on_click_veche(evt) { + if (evt.button === 0) + send_action('veche') +} + const SUMMER = 0 const EARLY_WINTER = 1 const LATE_WINTER = 2 @@ -156,6 +161,10 @@ function pack4_get(word, n) { return (word >>> n) & 15 } +function is_veche_action() { + return !!(view.actions && view.actions.veche === 1) +} + function is_lord_action(lord) { return !!(view.actions && view.actions.lord && set_has(view.actions.lord, lord)) } @@ -1259,6 +1268,8 @@ function on_update() { update_plan() update_cards() + ui.veche.classList.toggle("action", is_veche_action()) + action_button("use_legate", "Legate") action_button("stonemasons", "Stonemasons") @@ -1487,6 +1498,7 @@ function build_map() { }) document.getElementById("legate").addEventListener("mousedown", on_click_legate) + ui.veche.addEventListener("mousedown", on_click_veche) for (let name in original_boxes) { let x = round(original_boxes[name][0] * MAP_DPI / 300) -- cgit v1.2.3