From 9dc6a2ff0e0df6eb863724ca5247703ef9c9497e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Jun 2021 19:50:03 +0200 Subject: hammer: Layout blocks based on ownership for Observers too. --- ui.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ui.js b/ui.js index 506869f..f6dd5b0 100644 --- a/ui.js +++ b/ui.js @@ -481,7 +481,7 @@ function update_map() { document.getElementById("turn").setAttribute("class", "turn year_" + game.year); for (let area in AREAS) - layout[area] = { secret: [], known: [] }; + layout[area] = { Scotland: [], England: [] }; // Move secret blocks to overflow queue if there are too many in a location for (let area in AREAS) { @@ -542,7 +542,7 @@ function update_map() { element.classList.remove("moved"); else element.classList.add("moved"); - layout[area].secret.push(element); + layout[area][color].push(element); } } } @@ -554,8 +554,9 @@ function update_map() { let steps = game.known[b][1]; let moved = game.known[b][2]; let element = ui.known[b]; + let color = BLOCKS[b].owner; - layout[area].known.push(element); + layout[area][color].push(element); show_block(element); update_steps(b, steps, element); @@ -568,12 +569,8 @@ function update_map() { } // Layout blocks on map - for (let area in AREAS) { - if (player == ENGLAND) - layout_blocks(area, layout[area].secret, layout[area].known); - else - layout_blocks(area, layout[area].known, layout[area].secret); - } + for (let area in AREAS) + layout_blocks(area, layout[area].Scotland, layout[area].England); // Mark selections and highlights -- cgit v1.2.3