summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-06-12 00:02:51 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-21 00:28:20 +0200
commit2f454e5f5554ce2350f4ccf2edca04819c8e1e83 (patch)
tree86e8a9d50eba19d56fe774d8b77f21dce4bda2a9 /play.js
parentd590b20d6167972993ee6ce4f0ead6db1e10209a (diff)
downloadwashingtons-war-2f454e5f5554ce2350f4ccf2edca04819c8e1e83.tar.gz
show french navy and continental congress
Diffstat (limited to 'play.js')
-rw-r--r--play.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/play.js b/play.js
index 659a335..d1f0ff4 100644
--- a/play.js
+++ b/play.js
@@ -298,6 +298,8 @@ function on_init() {
ui.b_colony[i] = build_marker("marker small control british", x, y, 45+2, 45+2)
}
+ ui.congress = build_piece("marker large congress", 55+2, 55+2)
+ ui.french_navy = build_piece("marker large french_navy", 55+2, 55+2)
ui.turn_marker = build_piece("marker large turn", 55+2, 55+2)
ui.french_alliance = build_piece("marker large french_alliance", 55+2, 55+2)
}
@@ -380,6 +382,10 @@ function general_total(g) {
function on_update() {
let e
+ remember_position(ui.turn_marker)
+ remember_position(ui.french_alliance)
+ remember_position(ui.french_navy)
+ remember_position(ui.congress)
remember_position(ui.b_mcu)
remember_position(ui.a_mcu)
remember_position(ui.f_mcu)
@@ -396,7 +402,21 @@ function on_update() {
for (let s = 0; s < data.spaces.length; ++s) {
toggle_marker(ui.b_pc[s], has_british_pc(s))
toggle_marker(ui.a_pc[s], has_american_pc(s))
+ }
+
+ if (view.congress === CONTINENTAL_CONGRESS_DISPERSED)
+ show_marker_at(ui.congress, data.spaces[view.congress].x, data.spaces[view.congress].y)
+ else
+ show_marker_at(ui.congress, data.spaces[view.congress].x+20, data.spaces[view.congress].y-10)
+ if (view.french_navy < 0)
+ show_marker_at(ui.french_navy, data.spaces[FRENCH_REINFORCEMENTS].x-65, data.spaces[FRENCH_REINFORCEMENTS].y)
+ else if (view.french_navy > 1700)
+ show_marker_at_xy(ui.french_navy, data.layout.turn[view.french_navy])
+ else
+ show_marker_at(ui.french_navy, data.layout.sea[view.french_navy][0]-15, data.layout.sea[view.french_navy][1]+42)
+
+ for (let s = 0; s < data.spaces.length; ++s) {
if (view.move && view.move.to === s) {
toggle_marker_with_number(ui.a_cu[s], count_american_cu(s) - view.move.carry_american)
toggle_marker_with_number(ui.f_cu[s], count_french_cu(s) - view.move.carry_french)