summaryrefslogtreecommitdiff
path: root/web/web_prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'web/web_prompt.c')
-rw-r--r--web/web_prompt.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/web/web_prompt.c b/web/web_prompt.c
index f2aaa68..edb9f99 100644
--- a/web/web_prompt.c
+++ b/web/web_prompt.c
@@ -166,7 +166,7 @@ void prompt_num_darts()
void prompt_end_match()
{
- scoreboard_set_player_active(-1); // sets all inactive
+ scoreboard_set_player_active(-1);
set_prompt_mode(PM_END_MATCH);
prompt_set_msgl(
@@ -346,6 +346,9 @@ void prompt_handle_pre(char *command)
if (pm == PM_END_MATCH && strcmp(command, "submit"))
deactivate_key("submit");
+
+ if (strcmp(command, "exit"))
+ deactivate_key("exit");
}
void prompt_handle_on_change()
@@ -473,6 +476,16 @@ void prompt_handle_undo()
toggle_key("undo");
}
+void prompt_handle_exit()
+{
+ if (key_is_active("exit")) {
+ // FIXME clear scheduled c calls (comp throwing)
+ scoreboard_set_player_active(-1);
+ end_match();
+ }
+ toggle_key("exit");
+}
+
EMSCRIPTEN_KEEPALIVE
void prompt_handle(char *command, char *data)
{
@@ -490,4 +503,6 @@ void prompt_handle(char *command, char *data)
prompt_handle_rem();
else if (!strcmp(command, "undo"))
prompt_handle_undo();
+ else if (!strcmp(command, "exit"))
+ prompt_handle_exit();
}