From d9add805c3b556d2fa357713bda577f4dc6f2d49 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 3 May 2022 07:54:36 -0700 Subject: web: buffer and flush prompt --- web/web_control.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'web/web_control.c') 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(); } -- cgit v1.2.3-70-g09d2