From bee6e71f2e0af29f846f61646311850a0256463a Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 27 Apr 2022 13:09:52 -0700 Subject: web: use short alias for selectors; make key label function generic --- web/dartboat_wasm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'web/dartboat_wasm.c') 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() -- cgit v1.2.3-70-g09d2