home · contact · privacy
In hat and face edit, use existing value as default input.
[plomrogue2] / rogue_chat.html
index 4285ded541ea1912fd83f36ba37337761407f074..d86eec5ee65d4c3e06f43b55ac351a22cb13f225 100644 (file)
@@ -794,15 +794,15 @@ let tui = {
     }
     this.draw_face = false;
     this.tile_draw = false;
-      if (mode_name == 'command_thing' && (!game.player.carrying
-                                           || !game.player.carrying.commandable)) {
+    if (mode_name == 'command_thing' && (!game.player.carrying
+                                         || !game.player.carrying.commandable)) {
         return fail('not carrying anything commandable', 'play');
-    };
-    if (mode_name == 'take_thing' && game.player.carrying) {
+    } else if (mode_name == 'take_thing' && game.player.carrying) {
         return fail('already carrying something', 'play');
-    };
-    if (mode_name == 'drop_thing' && !game.player.carrying) {
+    } else if (mode_name == 'drop_thing' && !game.player.carrying) {
         return fail('not carrying anything droppable', 'play');
+    } else if (mode_name == 'enter_hat' && !game.player.hat) {
+        return fail('not wearing hat to edit', 'edit');
     }
     if (mode_name == 'admin_enter' && this.is_admin) {
         mode_name = 'admin';
@@ -953,6 +953,10 @@ let tui = {
           if (t && t.protection) {
               this.inputEl.value = t.protection;
           }
+      } else if (this.mode.name == 'enter_face' && game.player.face) {
+          this.inputEl.value = game.player.face;
+      } else if (this.mode.name == 'enter_hat' && game.player.hat) {
+          this.inputEl.value = game.player.hat;
       }
   },
   recalc_input_lines: function() {