home · contact · privacy
Make popup key available from all window configurations.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 8 Apr 2019 22:16:51 +0000 (00:16 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 8 Apr 2019 22:16:51 +0000 (00:16 +0200)
new/example_client.py

index ee71241110e28d0121a83571c8ddf93ff4118416..4e61c51aaf8679403cbfa34e6837ec7f9bae4413 100755 (executable)
@@ -532,6 +532,16 @@ class TUI:
                         self.socket.send(''.join(self.to_send))
                         self.to_send[:] = []
                         self.to_update['edit'] = True
+                elif key == 't':
+                    if not popup_widget.visible:
+                        self.to_update['popup'] = True
+                        popup_widget.visible = True
+                        popup_widget.reconfigure()
+                        draw_popup_if_visible = True
+                    else:
+                        popup_widget.visible = False
+                        for w in top_widgets:
+                            w.ensure_freshness(True)
                 elif map_widget.visible:
                     if key == 'w':
                         self.socket.send('TASK:MOVE UPLEFT')
@@ -545,16 +555,6 @@ class TUI:
                         self.socket.send('TASK:MOVE DOWNLEFT')
                     elif key == 'c':
                         self.socket.send('TASK:MOVE DOWNRIGHT')
-                    elif key == 't':
-                        if not popup_widget.visible:
-                            self.to_update['popup'] = True
-                            popup_widget.visible = True
-                            popup_widget.reconfigure()
-                            draw_popup_if_visible = True
-                        else:
-                            popup_widget.visible = False
-                            for w in top_widgets:
-                                w.ensure_freshness(True)
                     elif key == 'p':
                         self.socket.send('GET_PICKABLE_ITEMS')
                         self.item_pointer = 0