diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-11-26 15:10:34 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:37 +0100 |
commit | 7746a800c6d0402923b4dda3c9939b706716196d (patch) | |
tree | f3b9d9e5cc25b7f3b5daf4c8c442645b709b8b1f /play.js | |
parent | 1eb2d8cd1c5ea7615dde76e7352df1f0a14b71ab (diff) | |
download | nevsky-7746a800c6d0402923b4dda3c9939b706716196d.tar.gz |
Legate location.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -332,6 +332,7 @@ const ui = { lord_capabilities: [], cards: [], boxes: {}, + legate: document.getElementById("legate"), veche: document.getElementById("veche"), plan_dialog: document.getElementById("plan"), plan_list: document.getElementById("plan_list"), @@ -592,7 +593,7 @@ function on_log(text) { return p } -function layout_locale_item(loc, e, is_upper) { +function layout_locale_item(loc, e, is_upper, yofs = 0) { let [x, y] = locale_xy[loc] let z = 0 if (is_upper) { @@ -600,6 +601,7 @@ function layout_locale_item(loc, e, is_upper) { z = 1 } x += locale_layout[loc] * 44 + y += yofs e.classList.toggle("lieutenant", is_upper) e.style.top = (y - 23) + "px" e.style.left = (x - 23) + "px" @@ -782,6 +784,20 @@ function update_lord(ix) { ui.lord_mat[ix].classList.toggle("selected", ix === view.who) } +function update_legate() { + if (view.legate < 0) { + ui.legate.classList.add("hide") + } else { + ui.legate.classList.remove("hide") + if (view.legate === 100) { + ui.legate.style.top = "1580px" + ui.legate.style.left = "170px" + } else { + layout_locale_item(view.legate, ui.legate, 0, -16) + } + } +} + function update_veche() { ui.veche.replaceChildren() @@ -986,6 +1002,7 @@ function on_update() { layout_calendar() + update_legate() update_veche() update_current_card_display() |