mirror of
https://github.com/evennia/evennia.git
synced 2026-04-01 21:47:17 +02:00
Made client_options inputfunc recognize RAW/NOMARKUP and also fixed some other minor errors.
This commit is contained in:
parent
df74380155
commit
fcfe87d24f
2 changed files with 13 additions and 4 deletions
|
|
@ -380,7 +380,7 @@ class CmdUnconnectedLook(COMMAND_DEFAULT_CLASS):
|
|||
|
||||
def func(self):
|
||||
"Show the connect screen."
|
||||
connection_screen = ansi.parse_ansi(utils.random_string_from_module(CONNECTION_SCREEN_MODULE))
|
||||
connection_screen = utils.random_string_from_module(CONNECTION_SCREEN_MODULE)
|
||||
if not connection_screen:
|
||||
connection_screen = "No connection screen found. Please contact an admin."
|
||||
self.caller.msg(connection_screen)
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ def client_options(session, *args, **kwargs):
|
|||
screenheight (int): Screen height in lines
|
||||
screenwidth (int): Screen width in characters
|
||||
inputdebug (bool): Debug input functions
|
||||
nomarkup (bool): Strip markup
|
||||
raw (bool): Turn off parsing
|
||||
|
||||
"""
|
||||
flags = session.protocol_flags
|
||||
|
|
@ -127,7 +129,8 @@ def client_options(session, *args, **kwargs):
|
|||
if key.upper() in ("ANSI", "XTERM256", "MXP",
|
||||
"UTF-8", "SCREENREADER", "ENCODING",
|
||||
"MCCP", "SCREENHEIGHT",
|
||||
"SCREENWIDTH", "INPUTDEBUG"))
|
||||
"SCREENWIDTH", "INPUTDEBUG",
|
||||
"RAW", "NOMARKUP"))
|
||||
session.msg(client_options=options)
|
||||
return
|
||||
|
||||
|
|
@ -143,7 +146,9 @@ def client_options(session, *args, **kwargs):
|
|||
return {0: int(val)}
|
||||
|
||||
def validate_bool(val):
|
||||
return True if val.lower() in ("true", "on", "1") else False
|
||||
if isinstance(val, basestring):
|
||||
return True if val.lower() in ("true", "on", "1") else False
|
||||
return bool(val)
|
||||
|
||||
for key, value in kwargs.iteritems():
|
||||
key = key.lower()
|
||||
|
|
@ -172,11 +177,15 @@ def client_options(session, *args, **kwargs):
|
|||
flags["SCREENWIDTH"] = validate_size(value)
|
||||
elif key == "inputdebug":
|
||||
flags["INPUTDEBUG"] = validate_bool(value)
|
||||
elif key == "nomarkup":
|
||||
flags["NOMARKUP"] = validate_bool(value)
|
||||
elif key == "raw":
|
||||
flags["RAW"] = validate_bool(value)
|
||||
elif key in ('Char 1', 'Char.Skills 1', 'Char.Items 1',
|
||||
'Room 1', 'IRE.Rift 1', 'IRE.Composer 1'):
|
||||
# ignore mudlet's default send (aimed at IRE games)
|
||||
pass
|
||||
elif not key == "options":
|
||||
elif not key in ("options", "cmdid"):
|
||||
err = _ERROR_INPUT.format(
|
||||
name="client_settings", session=session, inp=key)
|
||||
session.msg(text=err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue