diff options
author | teisuru <31881306+teisuru@users.noreply.github.com> | 2023-08-27 20:46:08 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-10 18:16:55 +0100 |
commit | 2d5354214cfb05ba88cc3d36ac08c3ed75048a10 (patch) | |
tree | 67b95404a0716f0ccb5fd61f1fdecef7552a3efe /play.js | |
parent | e7152b3990ec32f773545d0bfb3193a5cfe62978 (diff) | |
download | plantagenet-2d5354214cfb05ba88cc3d36ac08c3ed75048a10.tar.gz |
update vassal graphic
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -523,6 +523,7 @@ const ui = { calendar: [], track: [], seat: [], + vassalbox:[], plan_panel: document.getElementById("plan_panel"), plan: document.getElementById("plan"), @@ -711,20 +712,22 @@ function build_map() { let { x, y, w, h } = seat.box let xc = Math.round(x + w / 2) let yc = Math.round(y + h / 2) - let small = 45 + let small = 46 locale_xy[ix] = [ xc, yc ] - e.className = "marker " + seat.name e.style.position = "absolute" e.style.top = y + "px" e.style.left = x + "px" - e.style.width = 45 + "px" - e.style.height = 45 + "px" + e.style.width = 46 + "px" + e.style.height = 46 + "px" e.style.backgroundSize = small + "px" e.style.transform = "rotate(315deg)" + register_tooltip(e, data.seat[ix].name) document.getElementById("pieces").appendChild(e) }) + + data.lords.forEach((lord, ix) => { let e = ui.lord_cylinder[ix] = document.createElement("div") let side = lord.side.toLowerCase() @@ -735,11 +738,22 @@ function build_map() { build_lord_mat(lord, ix, side, lord.id) }) - data.vassals.forEach((vassal, ix) => { - let e = ui.vassal_service[ix] = document.createElement("div") - e.className = "vassal v" + ix + data.vassalbox.forEach((vassal, ix) => { + let e = ui.vassalbox[ix] = document.createElement("div") + let { x, y, w, h } = vassal.box + let xc = Math.round(x + w / 2) + let yc = Math.round(y + h / 2) + let small = 46 + locale_xy[ix] = [ xc, yc ] + e.className = "marker " + vassal.name + e.style.position = "absolute" + e.style.top = y + "px" + e.style.left = x + "px" + e.style.width = 46 + "px" + e.style.height = 46 + "px" + e.style.backgroundSize = small + "px" register_action(e, "vassal", ix) - register_tooltip(e, data.vassals[ix].name) + register_tooltip(e, data.vassalbox[ix].name) document.getElementById("pieces").appendChild(e) }) |