Added GMCP-to-inputfunc name conversion as Module.Cmdname -> Module_CmdName. Also made Session.protocol_flags into a flat dict, by putting all TTYPE properties in the top level (the TTYPE key now only indicates if TTYPE has finished or not). Also started to convert the screenreader/enconding properties of the session into protocol_flags. (not fully working yet)
This commit is contained in:
parent
f3512971e3
commit
df674f687a
9 changed files with 52 additions and 46 deletions
|
|
@ -405,7 +405,7 @@ class CmdOption(MuxPlayerCommand):
|
|||
pencoding = self.session.encoding or "None"
|
||||
sencodings = settings.ENCODINGS
|
||||
string += " Custom: %s\n Server: %s" % (pencoding, ", ".join(sencodings))
|
||||
string += "\n{wScreen Reader mode:{n %s" % self.session.screenreader
|
||||
string += "\n{wScreen Reader mode:{n %s" % self.session.protocol_flags.get("SCREENREADER", False)
|
||||
self.msg(string)
|
||||
return
|
||||
|
||||
|
|
@ -413,6 +413,8 @@ class CmdOption(MuxPlayerCommand):
|
|||
self.msg("Usage: @option [name = [value]]")
|
||||
return
|
||||
|
||||
sync = False
|
||||
|
||||
if self.lhs == "encoding":
|
||||
# change encoding
|
||||
old_encoding = self.session.encoding
|
||||
|
|
@ -429,9 +431,12 @@ class CmdOption(MuxPlayerCommand):
|
|||
|
||||
if self.lhs == "screenreader":
|
||||
onoff = self.rhs.lower() == "on"
|
||||
self.session.screenreader = onoff
|
||||
self.session.protocol_flags["SCREENREADER"] = onoff
|
||||
self.msg("Screen reader mode was turned {w%s{n." % ("on" if onoff else "off"))
|
||||
|
||||
if sync:
|
||||
self.session.sessionhandler.session_portal_sync(self.session)
|
||||
|
||||
|
||||
class CmdPassword(MuxPlayerCommand):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -506,8 +506,9 @@ class CmdUnconnectedScreenreader(MuxCommand):
|
|||
|
||||
def func(self):
|
||||
"Flips screenreader setting."
|
||||
self.session.screenreader = not self.session.screenreader
|
||||
string = "Screenreader mode turned {w%s{n." % ("on" if self.session.screenreader else "off")
|
||||
new_setting = not self.session.protocol_flags.get("SCREENREADER", False)
|
||||
self.session.protocol_flags["SCREENREADER"] = new_setting
|
||||
string = "Screenreader mode turned {w%s{n." % ("on" if new_setting else "off")
|
||||
self.caller.msg(string)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue