summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-18 16:56:07 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commita3782cd051b4a5c10c3a41062c7b4d6063bc6a60 (patch)
treeee90d4412b4f4a12df00347aa5b02fee86fd9a06 /play.js
parent38831a6bc8ba83bd09fa09ba3a16da5cdfcac5c0 (diff)
downloadnevsky-a3782cd051b4a5c10c3a41062c7b4d6063bc6a60.tar.gz
Black and Baltic Sea Trade.
Diffstat (limited to 'play.js')
-rw-r--r--play.js12
1 files changed, 12 insertions, 0 deletions
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)