From e297ac65f8f0cde103880c73d0c92ad3cb50f161 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 3 May 2022 13:21:24 -0700 Subject: web: more use of generic JS functions --- web/web_control.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/web_control.c') diff --git a/web/web_control.c b/web/web_control.c index f44315f..94e58b7 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -17,7 +17,7 @@ void set_active_player(int pn) { state->active_player = pn; state->active_leg = state->legs[pn-1]; - EM_ASM({setPlayerActive($0)}, pn); + scoreboard_set_player_active(pn); if (state->mode == M_PVC && pn == 2) prompt_bot_visit(); @@ -186,7 +186,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); + scoreboard_set_player_active(state->active_player); handle_next(); return; } @@ -253,13 +253,13 @@ void start_match(int mode) state->legs[0] = leg_init(501, mode == M_PVP ? "Player 1" : "User"); state->legs[1] = leg_init(501, mode == M_PVC ? "Bot" : "Player 2"); - EM_ASM({showPlayerInfo($0)}, 1); + show_player_info(1); update_player_name(1, state->legs[0]->name); update_player_rem(1, state->legs[0]->rem); update_player_avg(1, 0); if (mode != M_P) { - EM_ASM({showPlayerInfo($0)}, 2); + show_player_info(2); update_player_name(2, state->legs[1]->name); update_player_rem(2, state->legs[1]->rem); update_player_avg(2, 0); -- cgit v1.2.3-70-g09d2