home · contact · privacy
Add TERRAIN and PLAYER lines to curses client study view.
[plomrogue2-experiments] / new2 / rogue_chat_curses.py
index 94c808b44093723832c17a6b3c63e16bd201bc40..ee2cae8f5abad5682ef5fa7e17a7cf15e8cfdf4a 100755 (executable)
@@ -394,10 +394,15 @@ class TUI:
         def draw_info():
             if not self.game.turn_complete:
                 return
+            pos_i = self.explorer.y * self.game.map_geometry.size.x + self.explorer.x
+            info = 'TERRAIN: %s\n' % self.game.map_content[pos_i]
+            for t in self.game.things:
+                if t.position == self.explorer:
+                    info += 'PLAYER @: %s\n' % t.name
             if self.explorer in self.game.portals:
-                info = 'PORTAL: ' + self.game.portals[self.explorer] + '\n'
+                info += 'PORTAL: ' + self.game.portals[self.explorer] + '\n'
             else:
-                info = 'PORTAL: (none)\n'
+                info += 'PORTAL: (none)\n'
             if self.explorer in self.game.info_db:
                 info += 'ANNOTATION: ' + self.game.info_db[self.explorer]
             else:
@@ -480,6 +485,7 @@ class TUI:
                 draw_map()
 
         curses.curs_set(False)  # hide cursor
+        curses.use_default_colors();
         stdscr.timeout(10)
         reset_screen_size()
         self.explorer = YX(0, 0)
@@ -516,9 +522,9 @@ class TUI:
                 self.input_ = ""
             elif self.mode == self.mode_chat and key == '\n':
                 if self.input_[0] == '/':
-                    if self.input_ in {'/P', '/play'}:
+                    if self.input_ in {'/' + self.keys['switch_to_play'], '/play'}:
                         self.switch_mode('play')
-                    elif self.input_ in {'/?', '/study'}:
+                    elif self.input_ in {'/' + self.keys['switch_to_study'], '/study'}:
                         self.switch_mode('study')
                     elif self.input_ == '/help':
                         self.help()
@@ -584,9 +590,6 @@ class TUI:
                     self.send('TASK:FLATTEN_SURROUNDINGS')
                 elif key in self.movement_keys:
                     self.send('TASK:MOVE ' + self.movement_keys[key])
-                elif key == 'q':
-                    self.log_msg('quitting')
-                    self.send('QUIT')
             elif self.mode == self.mode_edit:
                 self.send('TASK:WRITE ' + key)
                 self.switch_mode('play')