diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-03 13:21:24 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-03 13:22:43 -0700 |
commit | e297ac65f8f0cde103880c73d0c92ad3cb50f161 (patch) | |
tree | d08677e97ae1a863f1c8eed49dc36560d544d7ca /web/web_control.c | |
parent | 9a0f3d15dfaac41657bb549c7e246d2ac81fdf4c (diff) | |
download | dartboat-e297ac65f8f0cde103880c73d0c92ad3cb50f161.tar.gz dartboat-e297ac65f8f0cde103880c73d0c92ad3cb50f161.tar.xz |
web: more use of generic JS functions
Diffstat (limited to 'web/web_control.c')
-rw-r--r-- | web/web_control.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |