summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/play.js b/play.js
index ce98e12..087f307 100644
--- a/play.js
+++ b/play.js
@@ -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()