home · contact · privacy
Improve command keys, mode messages.
[plomrogue2-experiments] / new2 / rogue_chat_nocanvas_monochrome.html
index e46daac50721239360c5259d52fad797eb7bb9a9..3694675eeeb1c034f878961c1699d9101e2500d9 100644 (file)
@@ -172,11 +172,11 @@ class Mode {
 }
 let mode_waiting_for_server = new Mode('waiting_for_server', false, false, true);
 let mode_login = new Mode('login', true, false, true);
-let mode_chat = new Mode('chat', true, false);
-let mode_annotate = new Mode('annotate', true, true);
-let mode_play = new Mode('play', false, false);
-let mode_study = new Mode('study', false, true);
-let mode_edit = new Mode('edit', false, false);
+let mode_chat = new Mode('chat / write messages to players', true, false);
+let mode_annotate = new Mode('add message to map tile', true, true);
+let mode_play = new Mode('play / move around', false, false);
+let mode_study = new Mode('check map tiles for messages', false, true);
+let mode_edit = new Mode('write ASCII char to map tile', false, false);
 
 let tui = {
   mode: mode_waiting_for_server,
@@ -264,27 +264,23 @@ let tui = {
   },
   log_help: function() {
     this.log_msg("");
-    this.log_msg("HELP");
-    this.log_msg("");
+    this.log_msg("HELP:");
     this.log_msg("chat mode commands:");
-    this.log_msg(":nick NAME - re-name yourself to NAME");
-    this.log_msg(":msg USER TEXT - send TEXT to USER");
-    this.log_msg(":help - show this help");
-    this.log_msg(":play or :p - switch to play mode");
-    this.log_msg(":study or :s - switch to study mode");
-    this.log_msg("");
-    this.log_msg("play mode commands:");
-    this.log_msg("w, a, s, d - move avatar");
-    this.log_msg("f - flatten surroundings");
-    this.log_msg("e - write following ASCII character");
-    this.log_msg("c - switch to chat mode");
-    this.log_msg("? - switch to study mode");
-    this.log_msg("");
-    this.log_msg("study mode commands:");
-    this.log_msg("w, a, s, d - move question mark");
-    this.log_msg("A - annotate terrain");
-    this.log_msg("c - switch to chat mode");
-    this.log_msg("p - switch to play mode");
+    this.log_msg("  :nick NAME - re-name yourself to NAME");
+    this.log_msg("  :msg USER TEXT - send TEXT to USER");
+    this.log_msg("  :help - show this help");
+    this.log_msg("  :p or :play - switch to play mode");
+    this.log_msg("  :? or :study - switch to study mode");
+    this.log_msg("commands common to study and play mode:");
+    this.log_msg("  w, a, s, d - move");
+    this.log_msg("  c - switch to chat mode");
+    this.log_msg("commands specific to play mode:");
+    this.log_msg("  e - write following ASCII character");
+    this.log_msg("  f - flatten surroundings");
+    this.log_msg("  ? - switch to study mode");
+    this.log_msg("commands specific to study mode:");
+    this.log_msg("  e - annotate terrain");
+    this.log_msg("  p - switch to play mode");
     this.log_msg("");
   },
   draw_map: function() {
@@ -411,8 +407,8 @@ server.websocket.onmessage = function (event) {
      tui.log_msg('@ ' + tokens[1]);
   } else if (tokens[0] === 'LOGIN_OK') {
       server.send(['GET_GAMESTATE']);
-      tui.log_help();
       tui.log_msg('@ ' + tokens[1]);
+      tui.log_help();
       tui.switch_mode(mode_chat);
   } else if (tokens[0] === 'ANNOTATION') {
      let position = parser.parse_yx(tokens[1]);
@@ -504,7 +500,7 @@ document.addEventListener('keydown', (event) => {
             if (tokens[0][0] == ':') {
                 if (tokens[0] == ':play' || tokens[0] == ':p') {
                     tui.switch_mode(mode_play);
-                } else if (tokens[0] == ':study' || tokens[0] == ':s') {
+                } else if (tokens[0] == ':study' || tokens[0] == ':?') {
                     tui.switch_mode(mode_study);
                 } else if (tokens[0] == ':help') {
                     tui.log_help();
@@ -568,7 +564,7 @@ document.addEventListener('keydown', (event) => {
              explorer.move('up');
         } else if (event.key === 's') {
              explorer.move('down');
-        } else if (event.key === 'A') {
+        } else if (event.key === 'e') {
           tui.switch_mode(mode_annotate);
         };
     }