From 8956650dccfe1707005ef8be3655a4d986805312 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 18 May 2022 21:36:12 -0700 Subject: web: display comp name in throwing prompt --- web/web_control.c | 4 ++-- web/web_prompt.c | 9 ++++++--- web/web_prompt.h | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web/web_control.c b/web/web_control.c index e89cc8f..74d42e2 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -21,9 +21,9 @@ void set_active_player(int pn) scoreboard_set_player_active(pn); if (match_player_is_comp(pn)) - prompt_bot_visit(); + prompt_comp_visit(); else - prompt_visit(); + prompt_user_visit(); } void update_user_rem_from_pts(int pts) diff --git a/web/web_prompt.c b/web/web_prompt.c index 9213ca0..c9e4f55 100644 --- a/web/web_prompt.c +++ b/web/web_prompt.c @@ -138,7 +138,7 @@ void set_prompt_mode(enum prompt_mode mode) "visible", ".keypad"); } -void prompt_visit() +void prompt_user_visit() { set_prompt_mode(PM_VISIT); prompt_set_msgl("Enter points:"); @@ -148,10 +148,13 @@ void prompt_visit() dom_set_content("#key-rem", "REMAINING"); } -void prompt_bot_visit() +void prompt_comp_visit() { set_prompt_mode(PM_DARTBOARD); - prompt_set_msgl("Computer is throwing…"); + + char buf[64]; + sprintf(buf, "%s is throwing…", state_active_leg()->name); + prompt_set_msgl(buf); prompt_set_msgr(NULL); } diff --git a/web/web_prompt.h b/web/web_prompt.h index 2e4430b..d3facf9 100644 --- a/web/web_prompt.h +++ b/web/web_prompt.h @@ -8,8 +8,8 @@ void prompt_set_msgr(char *str); void prompt_set_input(char *str); void prompt_flush(); -void prompt_visit(); -void prompt_bot_visit(); +void prompt_user_visit(); +void prompt_comp_visit(); void prompt_num_darts(); void prompt_end_match(); void prompt_select_mode(); -- cgit v1.2.3-70-g09d2