From 02591e34c384be9e0785eb5f1d1482ac8310b66a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 16 Sep 2022 00:13:20 +0200 Subject: Show eliminated/out-of-game blocks in separate row. --- play.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/play.js b/play.js index fbc462b..f5483a6 100644 --- a/play.js +++ b/play.js @@ -448,24 +448,40 @@ function update_map() { for (let area in AREAS) layout[area] = { north: [], south: [] } + for (let b in view.location) { + if (view.location[b] === null && BLOCKS[b].mortal) { + let element = ui.blocks[b] + if (BLOCKS[b].owner === SCOTLAND) + layout[SCOTLAND_BAG].north.push(element) + else + layout[ENGLAND_BAG].south.push(element) + } + } + for (let b in view.location) { let info = BLOCKS[b] let element = ui.blocks[b] let area = view.location[b] - if (area in AREAS) { + if (area in AREAS || BLOCKS[b].mortal) { let moved = view.moved[b] ? " moved" : "" - if (is_known_block(b)) { + if (is_known_block(b) || area === null) { let image = " block_" + info.image let steps = " r" + (info.steps - view.steps[b]) let known = " known" + if (area === null) { + moved = " moved" + steps = " r0" + } element.classList = info.owner + known + " block" + image + steps + moved } else { element.classList = info.owner + " block" + moved } - if (info.owner === SCOTLAND) - layout[area].north.push(element) - else - layout[area].south.push(element) + if (area !== null) { + if (info.owner === SCOTLAND) + layout[area].north.push(element) + else + layout[area].south.push(element) + } show_block(element) } else { hide_block(element) -- cgit v1.2.3