From 612586684dcb700fbf61aaf6001dcee988766748 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 2 Oct 2023 10:21:12 +0200 Subject: Add shift zooming on counters. --- play.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'play.js') 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) -- cgit v1.2.3