diff options
Diffstat (limited to 'web/web_scoreboard.c')
-rw-r--r-- | web/web_scoreboard.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/web_scoreboard.c b/web/web_scoreboard.c index 34ee4c5..b9b4688 100644 --- a/web/web_scoreboard.c +++ b/web/web_scoreboard.c @@ -17,6 +17,18 @@ struct player_info { struct player_info buffered_info[2], flushed_info[2]; +void scoreboard_set_player_active(int pn) +{ + char sel[64], *psel = sel; + + if (pn == -1) + psel = NULL; + else + sprintf(sel, "#p%d-info", pn); + + EM_ASM({elemSetUniqClass($0, $1, $2)}, psel, "active", "[id$=-info]"); +} + static inline void buffer_str(char *str, char **buffer, char *flushed) { if (str == *buffer || (str && *buffer && !strcmp(str, *buffer))) @@ -149,6 +161,13 @@ void update_player_rem(int pn, int rem) update_player_sugg(pn, rem); } +void show_player_info(int pn) +{ + char sel[64]; + sprintf(sel, "#p%d-info-inner", pn); + EM_ASM({elemAddClass($0, $1)}, sel, "visible"); +} + void clear_player_info(int pn) { scoreboard_set_player_name(pn, NULL); |