summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-23 19:50:03 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:17 +0100
commit9dc6a2ff0e0df6eb863724ca5247703ef9c9497e (patch)
tree74bcc0d355e963b78bcf872aadf021ee932eec3b
parent080e364a2ef15a20ca242bb607cb80caa3ac3648 (diff)
downloadhammer-of-the-scots-9dc6a2ff0e0df6eb863724ca5247703ef9c9497e.tar.gz
hammer: Layout blocks based on ownership for Observers too.
-rw-r--r--ui.js15
1 files 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