Skip to content

Commit da09cbe

Browse files
dwa
1 parent eba96a9 commit da09cbe

13 files changed

Lines changed: 556 additions & 80 deletions

lib/components/inspector/scoreboard_inspector.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ class _ScoreboardInspectorState extends State<ScoreboardInspector> {
8686
required: true,
8787
trailing: const HuiFieldHelp('scoreboard.title'),
8888
help:
89-
'Centered above the lines. The rendered form is cut at 32 '
90-
'characters, colour codes included.',
89+
'Centered above the lines. The rendered form is safely capped '
90+
'at 32 UTF-16 units, colour codes included.',
9191
control: dom.div(<Widget>[
9292
TextInput(
9393
value: doc.title,
@@ -106,7 +106,7 @@ class _ScoreboardInspectorState extends State<ScoreboardInspector> {
106106
),
107107
dom.div(classes: 'hui-hologram-line-preview', <Widget>[
108108
GlossTextLine(
109-
render: renderGlossLine(
109+
render: renderGlossScoreboardTitle(
110110
doc.title,
111111
animations: _store.workspaceAnimations,
112112
emoji: _store.workspaceEmoji,
@@ -183,7 +183,7 @@ class _ScoreboardInspectorState extends State<ScoreboardInspector> {
183183
),
184184
dom.div(classes: 'hui-hologram-line-preview', <Widget>[
185185
GlossTextLine(
186-
render: renderGlossLine(
186+
render: renderGlossScoreboardLine(
187187
line,
188188
animations: _store.workspaceAnimations,
189189
emoji: _store.workspaceEmoji,

lib/components/scoreboard/scoreboard_view.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/// The scoreboard surface: a vanilla-style sidebar mock, right-anchored the
22
/// way the client draws it.
33
///
4-
/// Fidelity notes, all from `BoardService.java`: the title renders through
5-
/// the text pipeline and is cut at 32 characters INCLUDING colour codes
6-
/// (`MAX_TITLE_LENGTH`, line 40-41,363-367); at most 15 lines reach the
7-
/// client (`MAX_LINES`, line 377-380); every line renders through the same
8-
/// pipeline per viewer, so `|animation.<id>|` references play here through
9-
/// the workspace-scoped resolver exactly as they would in game. The dimmed
10-
/// score column stands in for the vanilla sidebar's row scores.
4+
/// The title renders through Gloss's text pipeline, then VolmLib safely caps
5+
/// it at 32 UTF-16 units including colour codes. At most 15 lines reach the
6+
/// client; VolmLib maps every rendered line into
7+
/// its 16-character team prefix plus 16-character suffix, including carried
8+
/// colour codes. The dimmed score column stands in for the vanilla sidebar's
9+
/// row scores.
1110
///
1211
/// Owns a playback clock while any rendered line (or the title) plays an
1312
/// animation and the store's animations toggle is on. Mounted only while the
@@ -134,7 +133,7 @@ class _ScoreboardViewState extends State<ScoreboardView> {
134133
child: dom.div(classes: 'hui-scoreboard-sidebar', <Widget>[
135134
dom.div(classes: 'hui-scoreboard-title', <Widget>[
136135
GlossTextLine(
137-
render: renderGlossLine(
136+
render: renderGlossScoreboardTitle(
138137
doc.title,
139138
animations: animations,
140139
emoji: emoji,
@@ -146,7 +145,7 @@ class _ScoreboardViewState extends State<ScoreboardView> {
146145
dom.div(classes: 'hui-scoreboard-row', <Widget>[
147146
dom.span(classes: 'hui-scoreboard-row-text', <Widget>[
148147
GlossTextLine(
149-
render: renderGlossLine(
148+
render: renderGlossScoreboardLine(
150149
doc.lines[index],
151150
animations: animations,
152151
emoji: emoji,
@@ -181,15 +180,17 @@ class _ScoreboardViewState extends State<ScoreboardView> {
181180
String _readout(GlossScoreboardDoc doc, int clipped, bool titleTruncated) {
182181
final List<String> parts = <String>[
183182
doc.primary ? 'primary' : 'not primary',
184-
doc.hideNumbers ? 'score numbers hidden' : 'score numbers visible',
183+
doc.hideNumbers
184+
? 'score numbers hidden on supported runtimes'
185+
: 'score numbers visible',
185186
doc.permissionGated
186187
? 'needs $glossBoardPermissionNodePrefix${doc.effectivePermission}'
187188
: 'everyone',
188189
if (doc.effectiveGroups.isNotEmpty)
189190
'groups: ${doc.effectiveGroups.join(', ')}',
190191
if (clipped > 0)
191192
'$clipped line${clipped == 1 ? '' : 's'} past the 15-line render cap',
192-
if (titleTruncated) 'title cut at 32 rendered characters in game',
193+
if (titleTruncated) 'title exceeds the 32-unit in-game cap',
193194
];
194195
return parts.join(' · ');
195196
}

lib/config/field_docs.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -502,21 +502,24 @@ const Map<String, HuiFieldDoc> huiFieldDocs = <String, HuiFieldDoc>{
502502
'scoreboard.title': HuiFieldDoc(
503503
title: 'Title',
504504
body:
505-
'Rendered through the text pipeline per viewer, then cut at 32 '
506-
'characters WITH the colour codes still counted — an & code costs 2 '
505+
'Rendered through the text pipeline per viewer, then safely capped '
506+
'at 32 UTF-16 units WITH the colour codes still counted — an & code costs 2 '
507507
'and a [RRGGBB] tag costs 14 of the budget, so a hex-coloured title '
508508
'has 18 characters left. {{ code }} evaluates before that cut, so a '
509-
'time-driven colour or calculated title is measured after rendering.',
510-
citation: 'BoardService.java:363-367',
509+
'time-driven colour or calculated title is measured after rendering. '
510+
'Line breaks become spaces.',
511+
citation: 'Board.java:201-206',
511512
),
512513
'scoreboard.lines': HuiFieldDoc(
513514
title: 'Lines',
514515
body:
515516
'Top to bottom, each through the text pipeline per viewer — '
516517
'placeholders, |animation.<id>|, metrics, colours and {{ code }} all '
517-
'work. Code can call papi/papiNumber, metric, bar, select, mix and '
518-
'the math library. Only the first 15 lines reach the client.',
519-
citation: 'BoardService.java:377-380',
518+
'work. VolmLib renders each row as a 16-character team prefix plus '
519+
'a 16-character suffix; inherited colour and format codes consume '
520+
'suffix space. Line breaks become spaces, rows never wrap, and only '
521+
'the first 15 lines reach the client.',
522+
citation: 'BoardEntry.java:24-40',
520523
),
521524
'scoreboard.primary': HuiFieldDoc(
522525
title: 'Primary board',

lib/config/gloss_templates.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const String kGlossScoreboardShowcaseJson = r'''
130130
"",
131131
"|animation.rainbow|&lLIVE EVENT",
132132
"&d:heart: &fWelcome!",
133-
"[55FFFF]play.example.net"
133+
"&bplay.example.net"
134134
],
135135
"primary": true,
136136
"hideNumbers": true,

0 commit comments

Comments
 (0)