diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-10 07:34:49 +0200 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-10 07:34:49 +0200 |
commit | 7dba9f1fc1823f017168948f817a9bc76971b5a4 (patch) | |
tree | 1ca24c521454fb25a127ca36fc61435e47399e71 /play.js | |
parent | 1b25d35cdf3b13b04107a3cc96df19f63e6db039 (diff) | |
download | algeria-7dba9f1fc1823f017168948f817a9bc76971b5a4.tar.gz |
status line
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -206,6 +206,14 @@ function is_action(action, arg) { let on_init_once = false +function on_focus_unit(evt) { + document.getElementById("status").textContent = data.units[evt.target.unit].name +} + +function on_blur(evt) { + document.getElementById("status").textContent = "" +} + function build_units() { function build_unit(u) { let side = is_gov_unit(u) ? "gov" : "fln" @@ -213,8 +221,8 @@ function build_units() { let klass = data.units[u].class elt.className = `counter unit ${side} u${u} ${klass}` elt.addEventListener("mousedown", on_click_unit) - // elt.addEventListener("mouseenter", on_focus_unit) - // elt.addEventListener("mouseleave", on_blur) + elt.addEventListener("mouseenter", on_focus_unit) + elt.addEventListener("mouseleave", on_blur) elt.unit = u } for (let u = 0; u < unit_count; ++u) { |