home · contact · privacy
Only count chat input as command if line starts with ":" (not " :").
[plomrogue2-experiments] / new2 / rogue_chat_nocanvas_monochrome.html
index 0708135759b6d69b5bcec521d65627ac98972b7c..bb1ecdaeedb13de65bb93ff2b2bf9dd950bf40f9 100644 (file)
@@ -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) == '?') {