Skip to content

Commit c789eff

Browse files
authored
better screenreader support (#309)
# Changes * Overhauls much of template functionality to get some screenreader support in * Templates look for a `name.screenreader.template` file before `name.templatefile` if screenreader mode is enabled. * Failsover to normal templates if no screenreader template found * Attempts to strip out a lot of "drawing" characters and replace with spaces for everything that's sent * `set screenreader` command (alias `screenreader`) enables/disables * Created a couple screenreader templates for now - shop `list` table, and sunrise/sunset. * Still some work to do, such as customizing behavior of prompts when screenreader mode is active. # Example <img width="404" alt="image" src="https://github.com/user-attachments/assets/19b11145-425d-42fb-bfc6-6c2fe699dce5" />
1 parent eaf8c8d commit c789eff

File tree

89 files changed

+675
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+675
-333
lines changed

_datafiles/html/public/online.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h3>Users Online: </h3>
1212
<th>Alignment</th>
1313
<th>Profession</th>
1414
<th>Time Online</th>
15-
<th>Permission</th>
15+
<th>Role</th>
1616
</tr>
1717
{{range $index, $uInfo := .STATS.OnlineUsers}}
1818
<tr>
@@ -22,7 +22,7 @@ <h3>Users Online: </h3>
2222
<td align="center">{{ $uInfo.Alignment }}</td>
2323
<td align="center">{{ $uInfo.Profession }}</td>
2424
<td align="center">{{ $uInfo.OnlineTimeStr }}{{ if $uInfo.IsAFK }} (AFK){{end}}</td>
25-
<td align="center">{{ $uInfo.Permission }}</td>
25+
<td align="center">{{ $uInfo.Role }}</td>
2626
</tr>
2727
{{end}}
2828
</table>

_datafiles/world/default/keywords.yaml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -186,48 +186,49 @@ help-aliases:
186186
# They can be command + argument aliases
187187
# Key is the target command, value is the list of aliases
188188
command-aliases:
189-
say: ['.']
190-
broadcast: ['`']
191-
status: ['sta', 'stat', 'stats', 'score', 'info']
192-
inventory: ['i', 'inv', 'eq']
193-
look: ['l', 'examine']
194-
go: ['enter']
195-
experience: ['exp', 'xp', 'tnl']
196-
map: ['m']
197-
conditions: ['c', 'cond', 'conds']
198-
skills: ['sk', 'skill']
199-
scribe: ['scribble', 'write']
200-
equip: ['wear', 'wield', 'hold']
201-
remove: ['rem', 'unequip', 'unwear', 'unwield']
202-
throw: ['toss']
203-
attack: ['a', 'k', 'kill', 'fight']
204-
get: ['g', 'take']
205-
command: ['cmd']
206-
macros: ['=?', 'macro']
207-
sneak: ['sn']
208-
spells: ['spellbook']
209-
backstab: ['bs']
210-
killstats: ['kills', 'kd', 'killstat']
211-
quests: ['q', 'quest']
212-
shout: ['yell', 'scream', 'holler']
213-
picklock: ['pick', 'lockpick']
214-
keyring: ['key', 'keys']
215-
whisper: ['/w']
216-
unlock: ['open']
217-
buy: ['hire']
218-
trash: ['junk']
219-
put: ['place']
220-
history: ['log']
221-
noop: ['wake']
222-
syslogs: ['syslog']
223-
'party chat': ['pchat', 'psay']
224-
'bank deposit': ['deposit']
225-
'bank withdraw': ['withdraw']
226-
'storage add': ['store']
227-
'storage remove': ['unstore']
228-
'rank back': ['backrank']
229-
'rank front': ['frontrank']
230-
'help about': ['about']
189+
say: ['.']
190+
broadcast: ['`']
191+
status: ['sta', 'stat', 'stats', 'score', 'info']
192+
inventory: ['i', 'inv', 'eq']
193+
look: ['l', 'examine']
194+
go: ['enter']
195+
experience: ['exp', 'xp', 'tnl']
196+
map: ['m']
197+
conditions: ['c', 'cond', 'conds']
198+
skills: ['sk', 'skill']
199+
scribe: ['scribble', 'write']
200+
equip: ['wear', 'wield', 'hold']
201+
remove: ['rem', 'unequip', 'unwear', 'unwield']
202+
throw: ['toss']
203+
attack: ['a', 'k', 'kill', 'fight']
204+
get: ['g', 'take']
205+
command: ['cmd']
206+
macros: ['=?', 'macro']
207+
sneak: ['sn']
208+
spells: ['spellbook']
209+
backstab: ['bs']
210+
killstats: ['kills', 'kd', 'killstat']
211+
quests: ['q', 'quest']
212+
shout: ['yell', 'scream', 'holler']
213+
picklock: ['pick', 'lockpick']
214+
keyring: ['key', 'keys']
215+
whisper: ['/w']
216+
unlock: ['open']
217+
buy: ['hire']
218+
trash: ['junk']
219+
put: ['place']
220+
history: ['log']
221+
noop: ['wake']
222+
syslogs: ['syslog']
223+
'party chat': ['pchat', 'psay']
224+
'bank deposit': ['deposit']
225+
'bank withdraw': ['withdraw']
226+
'storage add': ['store']
227+
'storage remove': ['unstore']
228+
'rank back': ['backrank']
229+
'rank front': ['frontrank']
230+
'help about': ['about']
231+
'set screenreader': ['screenreader']
231232

232233
# Direction aliases
233234
direction-aliases:

_datafiles/world/default/templates/admincommands/help/command.server.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ The <ansi fg="command">server</ansi> command can be used in the following ways:
44
<ansi fg="command">server stats</ansi> Get stats on the server
55
<ansi fg="command">server ansi-strip</ansi> Strip out ansi tags
66
<ansi fg="command">server ansi-mono</ansi> Process ansi tags but remove color
7-
<ansi fg="command">server ansi-preparse</ansi> Process ansi tags before template logic
87
<ansi fg="command">server ansi-normal</ansi> Reset ansi server setting
98

109
<ansi fg="command">server set</ansi> Lists all server configuration settings
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ansi fg="day">The sun rises.</ansi>
2+
3+
It is <ansi fg="230">day {{ .Day }}</ansi> of <ansi fg="230">year {{ .Year }}</ansi>.
4+
The month is <ansi fg="230">{{ month .Month }}</ansi>.
5+
It is the year of the <ansi fg="230">{{ zodiac .Year }}</ansi>
6+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<ansi fg="night">The sun sets.</ansi>
2+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
{{ .Title }}
3+
{{- range $rowIndex, $row := .Rows }}
4+
{{- $name := $.GetCell $rowIndex 1 }}
5+
{{- $qty := $.GetCell $rowIndex 0 }}
6+
{{- $type := $.GetCell $rowIndex 2 }}
7+
{{- $price := $.GetCell $rowIndex 3 }}
8+
{{ $name }} x{{ $qty }} type {{ $type }} costs {{ $price }}
9+
{{- end }}

_datafiles/world/empty/keywords.yaml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -186,48 +186,49 @@ help-aliases:
186186
# They can be command + argument aliases
187187
# Key is the target command, value is the list of aliases
188188
command-aliases:
189-
say: ['.']
190-
broadcast: ['`']
191-
status: ['sta', 'stat', 'stats', 'score', 'info']
192-
inventory: ['i', 'inv', 'eq']
193-
look: ['l', 'examine']
194-
go: ['enter']
195-
experience: ['exp', 'xp', 'tnl']
196-
map: ['m']
197-
conditions: ['c', 'cond', 'conds']
198-
skills: ['sk', 'skill']
199-
scribe: ['scribble', 'write']
200-
equip: ['wear', 'wield', 'hold']
201-
remove: ['rem', 'unequip', 'unwear', 'unwield']
202-
throw: ['toss']
203-
attack: ['a', 'k', 'kill', 'fight']
204-
get: ['g', 'take']
205-
command: ['cmd']
206-
macros: ['=?', 'macro']
207-
sneak: ['sn']
208-
spells: ['spellbook']
209-
backstab: ['bs']
210-
killstats: ['kills', 'kd', 'killstat']
211-
quests: ['q', 'quest']
212-
shout: ['yell', 'scream', 'holler']
213-
picklock: ['pick', 'lockpick']
214-
keyring: ['key', 'keys']
215-
whisper: ['/w']
216-
unlock: ['open']
217-
buy: ['hire']
218-
trash: ['junk']
219-
put: ['place']
220-
history: ['log']
221-
noop: ['wake']
222-
syslogs: ['syslog']
223-
'party chat': ['pchat', 'psay']
224-
'bank deposit': ['deposit']
225-
'bank withdraw': ['withdraw']
226-
'storage add': ['store']
227-
'storage remove': ['unstore']
228-
'rank back': ['backrank']
229-
'rank front': ['frontrank']
230-
'help about': ['about']
189+
say: ['.']
190+
broadcast: ['`']
191+
status: ['sta', 'stat', 'stats', 'score', 'info']
192+
inventory: ['i', 'inv', 'eq']
193+
look: ['l', 'examine']
194+
go: ['enter']
195+
experience: ['exp', 'xp', 'tnl']
196+
map: ['m']
197+
conditions: ['c', 'cond', 'conds']
198+
skills: ['sk', 'skill']
199+
scribe: ['scribble', 'write']
200+
equip: ['wear', 'wield', 'hold']
201+
remove: ['rem', 'unequip', 'unwear', 'unwield']
202+
throw: ['toss']
203+
attack: ['a', 'k', 'kill', 'fight']
204+
get: ['g', 'take']
205+
command: ['cmd']
206+
macros: ['=?', 'macro']
207+
sneak: ['sn']
208+
spells: ['spellbook']
209+
backstab: ['bs']
210+
killstats: ['kills', 'kd', 'killstat']
211+
quests: ['q', 'quest']
212+
shout: ['yell', 'scream', 'holler']
213+
picklock: ['pick', 'lockpick']
214+
keyring: ['key', 'keys']
215+
whisper: ['/w']
216+
unlock: ['open']
217+
buy: ['hire']
218+
trash: ['junk']
219+
put: ['place']
220+
history: ['log']
221+
noop: ['wake']
222+
syslogs: ['syslog']
223+
'party chat': ['pchat', 'psay']
224+
'bank deposit': ['deposit']
225+
'bank withdraw': ['withdraw']
226+
'storage add': ['store']
227+
'storage remove': ['unstore']
228+
'rank back': ['backrank']
229+
'rank front': ['frontrank']
230+
'help about': ['about']
231+
'set screenreader': ['screenreader']
231232

232233
# Direction aliases
233234
direction-aliases:

_datafiles/world/empty/templates/admincommands/help/command.server.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ The <ansi fg="command">server</ansi> command can be used in the following ways:
44
<ansi fg="command">server stats</ansi> Get stats on the server
55
<ansi fg="command">server ansi-strip</ansi> Strip out ansi tags
66
<ansi fg="command">server ansi-mono</ansi> Process ansi tags but remove color
7-
<ansi fg="command">server ansi-preparse</ansi> Process ansi tags before template logic
87
<ansi fg="command">server ansi-normal</ansi> Reset ansi server setting
98

109
<ansi fg="command">server set</ansi> Lists all server configuration settings
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ansi fg="day">The sun rises.</ansi>
2+
3+
It is <ansi fg="230">day {{ .Day }}</ansi> of <ansi fg="230">year {{ .Year }}</ansi>.
4+
The month is <ansi fg="230">{{ month .Month }}</ansi>.
5+
It is the year of the <ansi fg="230">{{ zodiac .Year }}</ansi>
6+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<ansi fg="night">The sun sets.</ansi>
2+

0 commit comments

Comments
 (0)