From: Christian Heller Date: Mon, 2 Nov 2020 13:44:50 +0000 (+0100) Subject: Only count chat input as command if line starts with ":" (not " :"). X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/do_todos?a=commitdiff_plain;h=77f28624afa28d4ab929b8865e1dfc2e441b7747;p=plomrogue2-experiments Only count chat input as command if line starts with ":" (not " :"). --- diff --git a/new2/rogue_chat_nocanvas_monochrome.html b/new2/rogue_chat_nocanvas_monochrome.html index 0708135..bb1ecda 100644 --- a/new2/rogue_chat_nocanvas_monochrome.html +++ b/new2/rogue_chat_nocanvas_monochrome.html @@ -605,7 +605,7 @@ tui.inputEl.addEventListener('keydown', (event) => { } else if (tui.mode == mode_chat && event.key == 'Enter') { let [tokens, token_starts] = parser.tokenize(tui.inputEl.value); if (tokens.length > 0 && tokens[0].length > 0) { - if (tokens[0][0] == command_char_selector.value) { + if (tui.inputEl.value[0][0] == command_char_selector.value) { if (tokens[0].slice(1) == 'play' || tokens[0].slice(1) == 'p') { tui.switch_mode(mode_play); } else if (tokens[0].slice(1) == 'study' || tokens[0].slice(1) == '?') {