diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -45,7 +45,6 @@ let ui = { allied_supply: document.getElementById("allied_supply"), turn_info: document.getElementById("turn_info"), hand: document.getElementById("hand"), - battle: document.getElementById("battle"), battle_hits: [ document.getElementById("hits_armor"), @@ -303,6 +302,13 @@ function toggle_units() { let showing_supply = false +function toggle_supply() { + if (!showing_supply) + send_query('supply') + else + hide_supply() +} + function show_supply(reply) { showing_supply = true view.axis_supply = reply.axis_supply @@ -452,6 +458,10 @@ function build_hexes() { } document.getElementById("mapsvg").getElementById("grid").setAttribute("d", path.join(" ")) + + ui.benghazi = document.getElementById("mapsvg").getElementById("fortress_benghazi") + ui.bardia = document.getElementById("mapsvg").getElementById("fortress_bardia") + ui.tobruk = document.getElementById("mapsvg").getElementById("fortress_tobruk") } function build_units() { @@ -503,6 +513,10 @@ for (let i = 0; i < stack.length; ++i) stack[i] = [] function update_map() { + ui.bardia.classList.toggle("axis", (view.fortress & 1) === 0) + ui.benghazi.classList.toggle("axis", (view.fortress & 2) === 0) + ui.tobruk.classList.toggle("axis", (view.fortress & 4) === 0) + for (let i = 0; i < stack.length; ++i) stack[i].length = 0 for (let u = 0; u < units.length; ++u) { @@ -518,7 +532,6 @@ function update_map() { } } - for (let hex = 0; hex < stack.length; ++hex) { let start_x = ui.hex_x[hex] let start_y = ui.hex_y[hex] |