summaryrefslogtreecommitdiff
path: root/web/web_control.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-03 07:54:36 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-03 07:54:36 -0700
commitd9add805c3b556d2fa357713bda577f4dc6f2d49 (patch)
tree2f55e9d07c7e1cdee267a414ccd7c7b302a581ea /web/web_control.c
parent50f5ce01c543ef2e4d780f3aed8a565b142865ea (diff)
downloaddartboat-d9add805c3b556d2fa357713bda577f4dc6f2d49.tar.gz
dartboat-d9add805c3b556d2fa357713bda577f4dc6f2d49.tar.xz
web: buffer and flush prompt
Diffstat (limited to 'web/web_control.c')
-rw-r--r--web/web_control.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/web/web_control.c b/web/web_control.c
index 3891750..25f2ccb 100644
--- a/web/web_control.c
+++ b/web/web_control.c
@@ -43,8 +43,8 @@ void end_boat_visit(int rem, double avg)
EM_ASM(svgClearPoints());
update_player_rem(2, rem);
scoreboard_set_player_avg(2, avg);
- EM_ASM({setPromptInput($0)}, "");
- EM_ASM({promptMsgR($0)}, "");
+ prompt_set_input(NULL);
+ prompt_set_msgr(NULL);
draw_visits();
handle_next();
@@ -62,10 +62,11 @@ void draw_boat_throwing(int pts, char *str, double x, double y)
svg_draw_point(x, y);
update_player_rem(2, rem - pts);
- EM_ASM({setPromptInput($0)}, pts_str);
- EM_ASM({promptMsgR($0)}, str);
+ prompt_set_input(pts_str);
+ prompt_set_msgr(str);
free(str);
+ prompt_flush();
scoreboard_flush_player_info(2); // FIXME bot hard-coded as player 2
}
@@ -136,6 +137,7 @@ void handle_next()
}
}
+ prompt_flush();
scoreboard_flush();
}