summaryrefslogtreecommitdiff
path: root/web/dartboat_wasm.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-27 13:09:52 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-27 13:09:52 -0700
commitbee6e71f2e0af29f846f61646311850a0256463a (patch)
treea0f3c71f23246422239998068108a1869f4e8d71 /web/dartboat_wasm.c
parent04592cc177289cfbc4f596f3f51da83d33688227 (diff)
downloaddartboat-bee6e71f2e0af29f846f61646311850a0256463a.tar.gz
dartboat-bee6e71f2e0af29f846f61646311850a0256463a.tar.xz
web: use short alias for selectors; make key label function generic
Diffstat (limited to 'web/dartboat_wasm.c')
-rw-r--r--web/dartboat_wasm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/dartboat_wasm.c b/web/dartboat_wasm.c
index 8c871f1..83e2a42 100644
--- a/web/dartboat_wasm.c
+++ b/web/dartboat_wasm.c
@@ -60,13 +60,13 @@ void set_active_player(int pn)
if (state->mode == M_PVC && pn == 2) {
EM_ASM({promptMsgL($0)}, "Bot is throwing…");
- EM_ASM({setKeyLabelSubmit($0)}, "OK");
- EM_ASM({setKeyLabelRem($0)}, "REMAINING");
+ EM_ASM({setKeyLabel($0, $1)}, "submit", "OK");
+ EM_ASM({setKeyLabel($0, $1)}, "rem", "REMAINING");
set_prompt_mode(PM_NONE);
} else {
EM_ASM({promptMsgL($0)}, "Enter points:");
- EM_ASM({setKeyLabelSubmit($0)}, "OK");
- EM_ASM({setKeyLabelRem($0)}, "REMAINING");
+ EM_ASM({setKeyLabel($0, $1)}, "submit", "OK");
+ EM_ASM({setKeyLabel($0, $1)}, "rem", "REMAINING");
set_prompt_mode(PM_VISIT);
}
EM_ASM({promptMsgR($0)}, "");
@@ -238,8 +238,8 @@ void prompt_num_darts()
set_prompt_mode(PM_NUM_DARTS);
EM_ASM({promptMsgL($0)}, "Darts needed?");
EM_ASM({promptMsgR($0)}, "");
- EM_ASM({setKeyLabelSubmit($0)}, "OK");
- EM_ASM({setKeyLabelRem($0)}, "REMAINING");
+ EM_ASM({setKeyLabel($0, $1)}, "submit", "OK");
+ EM_ASM({setKeyLabel($0, $1)}, "rem", "REMAINING");
}
void prompt_end_match()
@@ -250,8 +250,8 @@ void prompt_end_match()
state->mode == M_PVC && state->legs[1]->rem <= 0 ? "Bot wins. :(" :
"You win! :)");
EM_ASM({promptMsgR($0)}, "");
- EM_ASM({setKeyLabelSubmit($0)}, "END MATCH");
- EM_ASM({setKeyLabelRem($0)}, "REMATCH");
+ EM_ASM({setKeyLabel($0, $1)}, "submit", "END MATCH");
+ EM_ASM({setKeyLabel($0, $1)}, "rem", "REMATCH");
}
void prompt_select_mode()