summaryrefslogtreecommitdiff
path: root/ui.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-22 23:02:35 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:38 +0100
commitd868bb1185b7800bf1f2b7f739d7061bfd9d9b60 (patch)
tree0079f51aa634345dfb8cb27f47881e89e1028568 /ui.js
parent060e9d08262573823692f5d8714099b69c75c6e3 (diff)
downloadcrusader-rex-d868bb1185b7800bf1f2b7f739d7061bfd9d9b60.tar.gz
crusader: Deployment and nicer Assassin event handling.
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui.js b/ui.js
index c93a9b8..dffb958 100644
--- a/ui.js
+++ b/ui.js
@@ -335,8 +335,10 @@ function build_town(t, town) {
function update_map_layout() {
for (let t in TOWNS) {
let element = ui.towns[t];
- element.style.left = (town_x(t) - 35) + "px";
- element.style.top = (town_y(t) - 35) + "px";
+ let xo = Math.round(element.offsetWidth/2)
+ let yo = Math.round(element.offsetHeight/2)
+ element.style.left = (town_x(t) - xo) + "px";
+ element.style.top = (town_y(t) - yo) + "px";
}
}
@@ -562,7 +564,7 @@ function update_map() {
let moved = game.moved[b] ? " moved" : "";
if (town == DEAD)
moved = " moved";
- if (info.owner == player || info.owner == ASSASSINS) {
+ if (info.owner == player || info.owner == ASSASSINS || b == game.assassinate) {
let image = " block_" + info.image;
let steps = " r" + (info.steps - game.steps[b]);
let known = " known"