summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-19 17:00:16 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-19 17:00:16 +0100
commit109a346abcfe6afe44b0efa925595e0417bc6719 (patch)
tree09e109c8bded715197b22136351b6e49e0d4772f /play.js
parent4a336c5e9ce03adef8b6bcd6efa7481f8bea62ff (diff)
downloadvotes-for-women-109a346abcfe6afe44b0efa925595e0417bc6719.tar.gz
campaigning action, WIP
Diffstat (limited to 'play.js')
-rw-r--r--play.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/play.js b/play.js
index c452b54..3e9156b 100644
--- a/play.js
+++ b/play.js
@@ -269,6 +269,12 @@ function is_red_cube_action(i) {
return false
}
+function is_campaigner_action(i) {
+ if (view.actions && view.actions.campaigner && view.actions.campaigner.includes(i))
+ return true
+ return false
+}
+
function is_space_action(i) {
if (view.actions && view.actions.space && view.actions.space.includes(i))
return true
@@ -428,8 +434,8 @@ function build_user_interface() {
create_campaigner('yellow2', 4)
]
ui.opposition_campaigner = [
- create_campaigner('red1', 1),
- create_campaigner('red2', 2),
+ create_campaigner('red1', 5),
+ create_campaigner('red2', 6),
]
for (let i = 0; i < 190; ++i) {
@@ -612,6 +618,7 @@ function on_update() { // eslint-disable-line no-unused-vars
let [x, y] = REGIONS_LAYOUT[campaigner_region]
ui.support_campaigner[i].style.left = x - 30 + (15 * i) + "px"
ui.support_campaigner[i].style.top = y - 40 + "px"
+ ui.support_campaigner[i].classList.toggle("action", is_campaigner_action(i))
} else {
ui.support_campaigner[i].remove()
}
@@ -624,6 +631,7 @@ function on_update() { // eslint-disable-line no-unused-vars
let [x, y] = REGIONS_LAYOUT[campaigner_region]
ui.opposition_campaigner[i].style.left = x - 30 + (15 * i) + "px"
ui.opposition_campaigner[i].style.top = y - 10 + "px"
+ ui.opposition_campaigner[i].classList.toggle("action", is_campaigner_action(5 + i))
} else {
ui.opposition_campaigner[i].remove()
}
@@ -685,6 +693,7 @@ function on_update() { // eslint-disable-line no-unused-vars
action_button("draw", "Draw")
action_button("next", "Next")
+ action_button("move", "Move")
action_button("purple", "Purple")
action_button("yellow", "Yellow")
action_button("roll", "Roll")