Added support for screen readers via the new option command (which merges the ability to set the screenreader mode with the encoding command). The new setting.SCREENREADER_REGEX_STRIP allows to customize what the screenreader mode strips.

This commit is contained in:
Griatch 2015-03-16 23:30:23 +01:00
parent 10dbae9849
commit 4f384dc514
7 changed files with 85 additions and 55 deletions

View file

@ -361,6 +361,7 @@ You are not yet logged into the game. Commands available at this point:
{wlook{n - re-show the connection screen
{whelp{n - show this help
{wencoding{n - change the text encoding to match your client
{wscreenreader{n - make the server more suitable for use with screen readers
{wquit{n - abort the connection
First create an account e.g. with {wcreate Anna c67jHL8p{n
@ -397,7 +398,7 @@ class CmdUnconnectedEncoding(MuxCommand):
"""
key = "encoding"
aliases = "@encoding, @encode"
aliases = ("@encoding", "@encode")
locks = "cmd:all()"
def func(self):
@ -435,6 +436,25 @@ class CmdUnconnectedEncoding(MuxCommand):
string = "Your custom text encoding was changed from '%s' to '%s'." % (old_encoding, encoding)
self.caller.msg(string.strip())
class CmdUnconnectedScreenreader(MuxCommand):
"""
Activate screenreader mode.
Usage:
screenreader
Used to flip screenreader mode on and off before logging in (when
logged in, use @option screenreader on).
"""
key = "screenreader"
aliases = "@screenreader"
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")
self.caller.msg(string)
def _create_player(session, playername, password, permissions, typeclass=None):
"""