home · contact · privacy
On name thing prohibition, switch back to edit mode; disappear help in curses client...
authorChristian Heller <c.heller@plomlompom.de>
Thu, 10 Dec 2020 23:51:47 +0000 (00:51 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 10 Dec 2020 23:51:47 +0000 (00:51 +0100)
rogue_chat.html
rogue_chat_curses.py

index fe78f6b7118571666775d0f15df731ec3b710193..51e8078611bf510f5c4656f7724f3dfecaf643a0 100644 (file)
@@ -764,10 +764,10 @@ let tui = {
   },
   switch_mode: function(mode_name) {
 
-    function fail(msg) {
+    function fail(msg, return_mode) {
         tui.log_msg('? ' + msg);
         terminal.blink_screen();
-        this.switch_mode('play');
+        this.switch_mode(return_mode);
     }
 
     if (this.mode && this.mode.name == 'control_tile_draw') {
@@ -776,13 +776,13 @@ let tui = {
     this.tile_draw = false;
       if (mode_name == 'command_thing' && (!game.player.carrying
                                            || !game.player.carrying.commandable)) {
-        return fail('not carrying anything commandable');
+        return fail('not carrying anything commandable', 'play');
     };
     if (mode_name == 'take_thing' && game.player.carrying) {
-        return fail('already carrying something');
+        return fail('already carrying something', 'play');
     };
     if (mode_name == 'drop_thing' && !game.player.carrying) {
-        return fail('not carrying anything droppable');
+        return fail('not carrying anything droppable', 'play');
     }
     if (mode_name == 'admin_enter' && this.is_admin) {
         mode_name = 'admin';
@@ -800,7 +800,7 @@ let tui = {
             }
         }
         if (!thing_id) {
-            return fail('not standing over thing');
+            return fail('not standing over thing', 'fail');
         } else {
             this.selected_thing_id = thing_id;
         }
index f75877aff1af88ca76cdf0e228c58cac01a69f1c..8eb70d65e7ced5f998e2f681c550e4e3ca07df41 100755 (executable)
@@ -629,10 +629,10 @@ class TUI:
 
     def switch_mode(self, mode_name):
 
-        def fail(msg):
+        def fail(msg, return_mode='play'):
             self.log_msg('? ' + msg)
             self.flash = True
-            self.switch_mode('play')
+            self.switch_mode(return_mode)
 
         if self.mode and self.mode.name == 'control_tile_draw':
             self.log_msg('@ finished tile protection drawing.')
@@ -655,7 +655,7 @@ class TUI:
                 thing = t
                 break
             if not thing:
-                return fail('not standing over thing')
+                return fail('not standing over thing', 'edit')
             else:
                 self.thing_selected = thing
         self.mode = getattr(self, 'mode_' + mode_name)
@@ -1087,6 +1087,7 @@ class TUI:
             keycode = None
             if len(key) == 1:
                 keycode = ord(key)
+            self.show_help = False
             if key == 'KEY_RESIZE':
                 reset_screen_size()
             elif self.mode.has_input_prompt and key == 'KEY_BACKSPACE':