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):
|
def func(self):
|
||||||
"Show the connect screen."
|
"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:
|
if not connection_screen:
|
||||||
connection_screen = "No connection screen found. Please contact an admin."
|
connection_screen = "No connection screen found. Please contact an admin."
|
||||||
self.caller.msg(connection_screen)
|
self.caller.msg(connection_screen)
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ def client_options(session, *args, **kwargs):
|
||||||
screenheight (int): Screen height in lines
|
screenheight (int): Screen height in lines
|
||||||
screenwidth (int): Screen width in characters
|
screenwidth (int): Screen width in characters
|
||||||
inputdebug (bool): Debug input functions
|
inputdebug (bool): Debug input functions
|
||||||
|
nomarkup (bool): Strip markup
|
||||||
|
raw (bool): Turn off parsing
|
||||||
|
|
||||||
"""
|
"""
|
||||||
flags = session.protocol_flags
|
flags = session.protocol_flags
|
||||||
|
|
@ -127,7 +129,8 @@ def client_options(session, *args, **kwargs):
|
||||||
if key.upper() in ("ANSI", "XTERM256", "MXP",
|
if key.upper() in ("ANSI", "XTERM256", "MXP",
|
||||||
"UTF-8", "SCREENREADER", "ENCODING",
|
"UTF-8", "SCREENREADER", "ENCODING",
|
||||||
"MCCP", "SCREENHEIGHT",
|
"MCCP", "SCREENHEIGHT",
|
||||||
"SCREENWIDTH", "INPUTDEBUG"))
|
"SCREENWIDTH", "INPUTDEBUG",
|
||||||
|
"RAW", "NOMARKUP"))
|
||||||
session.msg(client_options=options)
|
session.msg(client_options=options)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -143,7 +146,9 @@ def client_options(session, *args, **kwargs):
|
||||||
return {0: int(val)}
|
return {0: int(val)}
|
||||||
|
|
||||||
def validate_bool(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():
|
for key, value in kwargs.iteritems():
|
||||||
key = key.lower()
|
key = key.lower()
|
||||||
|
|
@ -172,11 +177,15 @@ def client_options(session, *args, **kwargs):
|
||||||
flags["SCREENWIDTH"] = validate_size(value)
|
flags["SCREENWIDTH"] = validate_size(value)
|
||||||
elif key == "inputdebug":
|
elif key == "inputdebug":
|
||||||
flags["INPUTDEBUG"] = validate_bool(value)
|
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',
|
elif key in ('Char 1', 'Char.Skills 1', 'Char.Items 1',
|
||||||
'Room 1', 'IRE.Rift 1', 'IRE.Composer 1'):
|
'Room 1', 'IRE.Rift 1', 'IRE.Composer 1'):
|
||||||
# ignore mudlet's default send (aimed at IRE games)
|
# ignore mudlet's default send (aimed at IRE games)
|
||||||
pass
|
pass
|
||||||
elif not key == "options":
|
elif not key in ("options", "cmdid"):
|
||||||
err = _ERROR_INPUT.format(
|
err = _ERROR_INPUT.format(
|
||||||
name="client_settings", session=session, inp=key)
|
name="client_settings", session=session, inp=key)
|
||||||
session.msg(text=err)
|
session.msg(text=err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue