home · contact · privacy
Move socket configuration into command line options.
[plomrogue2] / rogue_chat_curses.py
index 295c04192bda3871ec2057088781299d0d595bd8..2362d99f8dd29a5030f44d62777c78637e8d4a27 100755 (executable)
@@ -3,6 +3,7 @@ import curses
 import queue
 import threading
 import time
+import sys
 from plomrogue.game import GameBase
 from plomrogue.parser import Parser
 from plomrogue.mapping import YX, MapGeometrySquare, MapGeometryHex
@@ -23,11 +24,11 @@ mode_helps = {
         'long': 'This mode allows you to change the map tile you currently stand on (if your map editing password authorizes you so).  Just enter any printable ASCII character to imprint it on the ground below you.'
     },
     'control_pw_type': {
-        'short': 'change tile control password',
+        'short': 'change tiles control password',
         'long': 'This mode is the first of two steps to change the password for a tile control character.  First enter the tile control character for which you want to change the password!'
     },
     'control_pw_pw': {
-        'short': 'change tile control password',
+        'short': 'change tiles control password',
         'long': 'This mode is the second of two steps to change the password for a tile control character.  Enter the new password for the tile control character you chose.'
     },
     'control_tile_type': {
@@ -39,7 +40,7 @@ mode_helps = {
         'long': 'This mode is the second of two steps to change tile control areas on the map.  Move cursor around the map to draw selected tile control character'
     },
     'annotate': {
-        'short': 'annotation',
+        'short': 'annotate tile',
         'long': 'This mode allows you to add/edit a comment on the tile you are currently standing on (provided your map editing password authorizes you so).  Hit Return to leave.'
     },
     'portal': {
@@ -47,7 +48,7 @@ mode_helps = {
         'long': 'This mode allows you to imprint/edit/remove a teleportation target on the ground you are currently standing on (provided your map editing password authorizes you so).  Enter or edit a URL to imprint a teleportation target; enter emptiness to remove a pre-existing teleportation target.  Hit Return to leave.'
     },
     'chat': {
-        'short': 'chat mode',
+        'short': 'chat',
         'long': 'This mode allows you to engage in chit-chat with other users.  Any line you enter into the input prompt that does not start with a "/" will be sent out to nearby players – but barriers and distance will reduce what they can read, so stand close to them to ensure they get your message.  Lines that start with a "/" are used for commands like:'
     },
     'login': {
@@ -63,7 +64,7 @@ mode_helps = {
         'long': 'Waiting for a server response.'
     },
     'password': {
-        'short': 'password input',
+        'short': 'map edit password',
         'long': 'This mode allows you to change the password that you send to authorize yourself for editing password-protected map tiles.  Hit return to confirm and leave.'
     },
     'admin': {
@@ -531,6 +532,8 @@ class TUI:
                     lines += [chunk]
                     chunk = ''
                     x = 0
+                    if msg[i] == "\n":
+                        x -= 1
                 if msg[i] != "\n":
                     chunk += msg[i]
                 x += 1
@@ -898,5 +901,7 @@ class TUI:
                 elif key in self.movement_keys:
                     move_explorer(self.movement_keys[key])
 
-#TUI('localhost:5000')
-TUI('wss://plomlompom.com/rogue_chat/')
+if len(sys.argv) != 2:
+    raise ArgError('wrong number of arguments, need game host')
+host = sys.argv[1]
+TUI(host)