diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-22 23:02:35 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:19:38 +0100 |
commit | d868bb1185b7800bf1f2b7f739d7061bfd9d9b60 (patch) | |
tree | 0079f51aa634345dfb8cb27f47881e89e1028568 /ui.js | |
parent | 060e9d08262573823692f5d8714099b69c75c6e3 (diff) | |
download | crusader-rex-d868bb1185b7800bf1f2b7f739d7061bfd9d9b60.tar.gz |
crusader: Deployment and nicer Assassin event handling.
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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" |