diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-10-15 23:56:22 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-10-15 23:56:22 +0200 |
commit | 5418158479638ed3a32110c7afbffb0a4d6902de (patch) | |
tree | 972aeae59e6181bc8b0c97ac20b1d64e8cd397d0 /play.js | |
parent | f2174240e62e36574e8ebfe9bfccc25774501d5f (diff) | |
download | maria-5418158479638ed3a32110c7afbffb0a4d6902de.tar.gz |
turn marker
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -538,6 +538,9 @@ function on_init() { ui.tcbreak = document.createElement("div") ui.tcbreak.className = "draw-break" + ui.turn = document.createElement("div") + ui.turn.className = "marker turn_marker" + ui.political = [] for (let fc = 0; fc <= 18; ++fc) ui.political[fc] = make_political_card(fc) @@ -809,6 +812,19 @@ function layout_combat_marker() { ui.combat.style.top = y - 20 + "px" } +function layout_turn_marker() { + if (view.turn > 0) { + let t = view.turn - 1 + let row = (t / 3) | 0 + let col = (t % 3) + let x = 2267 + col * 45 + let y = 79 + row * 52 + ui.turn.style.left = x - 16 + "px" + ui.turn.style.top = y - 16 + "px" + ui.markers_element.appendChild(ui.turn) + } +} + function create_conquest(style, s) { let x = data.cities.x[s] let y = data.cities.y[s] @@ -943,6 +959,8 @@ function on_update() { ui.markers_element.appendChild(ui.retro[s]) */ + layout_turn_marker() + if (view.attacker !== undefined && view.defender !== undefined) { ui.markers_element.appendChild(ui.combat) layout_combat_marker() |