diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-02 08:18:23 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-02 08:18:23 -0700 |
commit | 09c23f60189223db58d98e49ee94df947667662d (patch) | |
tree | 3667f7639ab257e407cad689cbd4054dcc315e76 /web/web_control.c | |
parent | 6a4dd8790c5c98466087a5374611f72131eff958 (diff) | |
download | dartboat-09c23f60189223db58d98e49ee94df947667662d.tar.gz dartboat-09c23f60189223db58d98e49ee94df947667662d.tar.xz |
web: minor cleanup of prompt code
Diffstat (limited to 'web/web_control.c')
-rw-r--r-- | web/web_control.c | 15 |
1 files changed, 5 insertions, 10 deletions
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; } |