summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/play.js b/play.js
index 920b31e..ca342df 100644
--- a/play.js
+++ b/play.js
@@ -138,6 +138,7 @@ function show_supply(supply) {
for (let s = 1; s <= last_space; ++s) {
spaces[s].element.classList.toggle("french_supply", supply.french.includes(s))
spaces[s].element.classList.toggle("british_supply", supply.british.includes(s))
+ spaces[s].element.classList.toggle("no_supply", !supply.british.includes(s) && !supply.french.includes(s))
}
}
@@ -147,6 +148,7 @@ function hide_supply() {
for (let s = 1; s <= last_space; ++s) {
spaces[s].element.classList.remove("french_supply")
spaces[s].element.classList.remove("british_supply")
+ spaces[s].element.classList.remove("no_supply")
}
}
}
@@ -884,17 +886,16 @@ function destroy_faction_marker(space_id, faction, what) {
function build_space(id) {
let space = spaces[id]
+
/* Make space for border */
let x = space.x
let y = space.y
let w = space.w
let h = space.h
- if (space.type === 'box') { x -= 1; y -= 1; w -= 9; h -= 9; }
- if (space.type === 'militia-box') { x -= 1; y -= 1; w -= 9; h -= 9; }
- if (space.type === 'cultivated') { x -= 1; y -= 1; w -= 9; h -= 9; }
- if (space.type === 'wilderness') { x -= 1; y -= 1; w -= 9; h -= 9; }
- if (space.type === 'leader-box') { x -= 1; y -= 1; w -= 9; h -= 9; }
+ if (space.type !== 'mountain') {
+ x -= 1; y -= 1; w += 2; h += 2;
+ }
space.fstack = []
space.fstack.name = spaces[id].name + "/french"
@@ -1014,17 +1015,17 @@ function is_different_piece(a, b) {
const style_dims = {
flat: {
width: 47,
- gap: 2,
+ gap: 3,
thresh: [ 24, 16, 10, 8, 6, 0 ],
offset: [ 1, 2, 3, 4, 5, 6 ],
- focus_margin: 5,
+ focus_margin: 6,
},
bevel: {
width: 49,
- gap: 4,
+ gap: 5,
thresh: [ 24, 16, 10, 8, 6, 0 ],
offset: [ 1, 2, 3, 4, 5, 6 ],
- focus_margin: 6,
+ focus_margin: 7,
},
}
@@ -1049,7 +1050,7 @@ function layout_stack(stack, x, y, dx) {
if (stack === focus && is_small_stack(stack))
focus = null
- if (stack === focus) {
+ if (stack === focus && layout < 2) {
let w, h
if (layout === 0) {
h = (dim.width + dim.gap) * (n-1)
@@ -1304,6 +1305,11 @@ function update_space(s) {
else
space.element.classList.remove("highlight")
+ if (view.danger && view.danger.includes(s))
+ space.element.classList.add("danger")
+ else
+ space.element.classList.remove("danger")
+
if (view.where === s)
space.element.classList.add("selected")
else