diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-08-06 11:17:37 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | e571f1de33b202c9299915f207fd317dad40120c (patch) | |
tree | e0ac12f22fc4c1e262e9521d46d4222dd7b9a4c2 | |
parent | cea867924ba2971124d43af07cd351b966fef3cf (diff) | |
download | pax-pamir-e571f1de33b202c9299915f207fd317dad40120c.tar.gz |
Use player dials as action spaces for selecting players.
For Tax, Rumor, and Other Persuasive Methods.
-rw-r--r-- | play.css | 4 | ||||
-rw-r--r-- | play.js | 13 |
2 files changed, 16 insertions, 1 deletions
@@ -652,6 +652,10 @@ body.shift #tooltip.focus { display: block; } right: 0px; } +.player_dial.action { + box-shadow: 0 0 0 3px yellow; +} + .player_hand_size { position: absolute; user-select: none; @@ -208,6 +208,12 @@ function is_card_action(action, card) { return false } +function is_player_action(p) { + if (view.actions && view.actions["player_" + p]) + return true + return false +} + function is_place_gift_action(i) { if (view.actions && view.actions.place_gift && view.actions.place_gift.includes(i)) return true @@ -645,7 +651,10 @@ function on_update() { ui.player[p].role.className = "role " + view.players[p].loyalty; ui.player[p].role.classList.toggle("active", p === player_index[view.active]) - ui.player[p].dial.className = "player_dial " + view.players[p].loyalty + " p" + p + let a = "" + if (is_player_action(p)) + a = " action" + ui.player[p].dial.className = "player_dial " + view.players[p].loyalty + " p" + p + a ui.player[p].role_loy_icon.className = "role_loyalty_icon " + view.players[p].loyalty ui.player[p].role_loy_text.textContent = count_influence_points(p) @@ -811,6 +820,8 @@ function build_ui() { for (let p = 0; p < 5; ++p) { ui.player[p] = build_player_ui(p) + ui.player[p].dial.addEventListener("click", () => send_action('player_' + p)) + ui.player[p].hand_size.addEventListener("click", () => toggle_hand(p)) |