summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-02 10:21:12 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-02 10:21:12 +0200
commit612586684dcb700fbf61aaf6001dcee988766748 (patch)
tree0f8d853d9798db3d691ed21d8323e61d4822af2f /play.js
parent86ab9cebd7cfd6cd76cd438ac8cd537a4191a0a5 (diff)
downloadwaterloo-campaign-1815-612586684dcb700fbf61aaf6001dcee988766748.tar.gz
Add shift zooming on counters.
Diffstat (limited to 'play.js')
-rw-r--r--play.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/play.js b/play.js
index 83a999d..41b8c95 100644
--- a/play.js
+++ b/play.js
@@ -270,6 +270,7 @@ var focused_piece = -1
function on_focus_piece(evt) {
let p = evt.target.my_id
+ evt.target.style.zIndex = 300
document.getElementById("status").textContent = evt.target.my_name
if (data.pieces[p].type === "hq") {
focused_piece = p
@@ -279,6 +280,7 @@ function on_focus_piece(evt) {
function on_blur_piece(evt) {
let p = evt.target.my_id
+ evt.target.style.zIndex = evt.target.my_z
on_blur()
if (data.pieces[p].type === "hq") {
focused_piece = -1
@@ -490,7 +492,6 @@ function on_update() {
}
ui.pieces[id].style.top = y + "px"
ui.pieces[id].style.left = x + "px"
- ui.pieces[id].style.zIndex = z
} else if (hex >= AVAILABLE_P1 && hex <= BLOWN) {
// OFF MAP DETACHMENTS / LEADERS / REINFORCEMENTS
ui.pieces[id].classList.remove("hide")
@@ -500,7 +501,6 @@ function on_update() {
ui.stack[hex] += 1
ui.pieces[id].style.top = y + "px"
ui.pieces[id].style.left = x + "px"
- ui.pieces[id].style.zIndex = 0
} else if (hex >= 1 && hex <= 20) {
// ON TURN TRACK
ui.pieces[id].classList.remove("hide")
@@ -521,9 +521,9 @@ function on_update() {
// ELIMINATED or SWAPPED
ui.pieces[id].classList.add("hide")
}
- //if (is_action("piece", id)) z = 101
if (view.target === id) z = 102
if (view.who === id) z = 103
+ ui.pieces[id].my_z = z
ui.pieces[id].style.zIndex = z
ui.pieces[id].classList.toggle("action", is_action("piece", id))
ui.pieces[id].classList.toggle("selected", view.who === id)