From 09c23f60189223db58d98e49ee94df947667662d Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 2 May 2022 08:18:23 -0700 Subject: web: minor cleanup of prompt code --- web/web_control.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'web/web_control.c') diff --git a/web/web_control.c b/web/web_control.c index b1e20bc..13e37ec 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -18,16 +18,10 @@ void set_active_player(int pn) state->active_leg = state->legs[pn-1]; EM_ASM({setPlayerActive($0)}, pn); - if (state->mode == M_PVC && pn == 2) { - EM_ASM({promptMsgL($0)}, "Bot is throwing…"); - set_prompt_mode(PM_DARTBOARD); - } else { - EM_ASM({promptMsgL($0)}, "Enter points:"); - EM_ASM({setKeyLabel($0, $1)}, "submit", "OK"); - EM_ASM({setKeyLabel($0, $1)}, "rem", "REMAINING"); - set_prompt_mode(PM_VISIT); - } - EM_ASM({promptMsgR($0)}, ""); + if (state->mode == M_PVC && pn == 2) + prompt_bot_visit(); + else + prompt_visit(); } void toggle_active_player() @@ -167,6 +161,7 @@ void user_undo() state->active_leg->visits[ state->active_leg->n_visits-2].rem) / (state->active_leg->n_visits-1))); + EM_ASM({setPlayerActive($0)}, state->active_player); handle_next(); return; } -- cgit v1.2.3-70-g09d2