rpg-engine 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +9 -6
  2. package/dist/campaign/create-campaign.js +2 -2
  3. package/dist/campaign/find-campaign.d.ts +4 -0
  4. package/dist/campaign/find-campaign.js +5 -1
  5. package/dist/campaign/host-files.js +22 -0
  6. package/dist/campaign/index.d.ts +2 -2
  7. package/dist/campaign/index.js +2 -2
  8. package/dist/campaign/last-choices.d.ts +10 -4
  9. package/dist/campaign/last-choices.js +43 -17
  10. package/dist/campaign/settings.d.ts +10 -2
  11. package/dist/campaign/settings.js +30 -6
  12. package/dist/chats/chat.d.ts +33 -0
  13. package/dist/chats/chat.js +50 -0
  14. package/dist/chats/claude-code.d.ts +5 -0
  15. package/dist/chats/claude-code.js +39 -0
  16. package/dist/chats/codex.d.ts +3 -0
  17. package/dist/chats/codex.js +42 -0
  18. package/dist/chats/index.d.ts +5 -0
  19. package/dist/chats/index.js +12 -0
  20. package/dist/chats/keep.d.ts +10 -0
  21. package/dist/chats/keep.js +50 -0
  22. package/dist/chats/read.d.ts +8 -0
  23. package/dist/chats/read.js +46 -0
  24. package/dist/cli/cli.js +6 -1
  25. package/dist/cli/command-line.js +3 -2
  26. package/dist/commands/book.d.ts +55 -0
  27. package/dist/commands/book.js +105 -0
  28. package/dist/commands/chats.d.ts +38 -0
  29. package/dist/commands/chats.js +93 -0
  30. package/dist/commands/config/config.js +1 -1
  31. package/dist/commands/config/dashboard.d.ts +8 -1
  32. package/dist/commands/config/dashboard.js +63 -15
  33. package/dist/commands/config/words.d.ts +1 -1
  34. package/dist/commands/config/words.js +17 -4
  35. package/dist/commands/find.js +1 -1
  36. package/dist/commands/image.d.ts +9 -0
  37. package/dist/commands/image.js +95 -18
  38. package/dist/commands/index.js +4 -0
  39. package/dist/commands/init.js +3 -3
  40. package/dist/commands/scene/close.d.ts +2 -0
  41. package/dist/commands/scene/close.js +13 -2
  42. package/dist/commands/scene/result.d.ts +2 -0
  43. package/dist/commands/scene/scene.d.ts +2 -0
  44. package/dist/commands/shared/campaign/book.d.ts +29 -0
  45. package/dist/commands/shared/campaign/book.js +95 -0
  46. package/dist/commands/shared/campaign/chats.d.ts +11 -0
  47. package/dist/commands/shared/campaign/chats.js +29 -0
  48. package/dist/commands/shared/campaign/images.js +7 -1
  49. package/dist/commands/shared/campaign/mode.js +3 -1
  50. package/dist/commands/shared/campaign/saves.js +13 -5
  51. package/dist/commands/shared/sheet/sheet.d.ts +7 -0
  52. package/dist/commands/shared/sheet/sheet.js +27 -0
  53. package/dist/commands/status.d.ts +1 -0
  54. package/dist/commands/status.js +4 -0
  55. package/dist/commands/view/page.js +4 -3
  56. package/dist/commands/view/result.d.ts +2 -0
  57. package/dist/commands/view/view.d.ts +1 -0
  58. package/dist/commands/view/view.js +4 -0
  59. package/dist/core/consents.d.ts +2 -2
  60. package/dist/core/consents.js +3 -3
  61. package/dist/core/context.d.ts +38 -2
  62. package/dist/core/download.js +1 -1
  63. package/dist/dashboard/acts/names.js +10 -5
  64. package/dist/dashboard/acts/sending.js +5 -2
  65. package/dist/dashboard/acts/sheet.js +66 -15
  66. package/dist/dashboard/api.js +3 -3
  67. package/dist/dashboard/app.js +2 -2
  68. package/dist/dashboard/guide/ar.md +11 -10
  69. package/dist/dashboard/guide/cs.md +10 -9
  70. package/dist/dashboard/guide/da.md +12 -11
  71. package/dist/dashboard/guide/de.md +12 -11
  72. package/dist/dashboard/guide/el.md +12 -11
  73. package/dist/dashboard/guide/en.md +9 -8
  74. package/dist/dashboard/guide/es.md +10 -9
  75. package/dist/dashboard/guide/fi.md +10 -9
  76. package/dist/dashboard/guide/fr.md +16 -15
  77. package/dist/dashboard/guide/he.md +11 -10
  78. package/dist/dashboard/guide/hi.md +10 -9
  79. package/dist/dashboard/guide/hu.md +14 -13
  80. package/dist/dashboard/guide/is.md +10 -9
  81. package/dist/dashboard/guide/it.md +13 -12
  82. package/dist/dashboard/guide/ja.md +10 -9
  83. package/dist/dashboard/guide/ko.md +11 -10
  84. package/dist/dashboard/guide/nb.md +12 -11
  85. package/dist/dashboard/guide/nl.md +10 -9
  86. package/dist/dashboard/guide/pl.md +11 -10
  87. package/dist/dashboard/guide/pt.md +12 -11
  88. package/dist/dashboard/guide/ro.md +10 -9
  89. package/dist/dashboard/guide/ru.md +12 -11
  90. package/dist/dashboard/guide/sv.md +10 -9
  91. package/dist/dashboard/guide/tr.md +13 -12
  92. package/dist/dashboard/guide/uk.md +13 -12
  93. package/dist/dashboard/guide/zh.md +11 -10
  94. package/dist/dashboard/i18n/ar.json +31 -5
  95. package/dist/dashboard/i18n/cs.json +31 -5
  96. package/dist/dashboard/i18n/da.json +31 -5
  97. package/dist/dashboard/i18n/de.json +31 -5
  98. package/dist/dashboard/i18n/el.json +31 -5
  99. package/dist/dashboard/i18n/es.json +31 -5
  100. package/dist/dashboard/i18n/fi.json +31 -5
  101. package/dist/dashboard/i18n/fr.json +31 -5
  102. package/dist/dashboard/i18n/he.json +31 -5
  103. package/dist/dashboard/i18n/hi.json +31 -5
  104. package/dist/dashboard/i18n/hu.json +31 -5
  105. package/dist/dashboard/i18n/is.json +31 -5
  106. package/dist/dashboard/i18n/it.json +32 -6
  107. package/dist/dashboard/i18n/ja.json +31 -5
  108. package/dist/dashboard/i18n/ko.json +31 -5
  109. package/dist/dashboard/i18n/nb.json +31 -5
  110. package/dist/dashboard/i18n/nl.json +31 -5
  111. package/dist/dashboard/i18n/pl.json +31 -5
  112. package/dist/dashboard/i18n/pt.json +31 -5
  113. package/dist/dashboard/i18n/ro.json +31 -5
  114. package/dist/dashboard/i18n/ru.json +31 -5
  115. package/dist/dashboard/i18n/sv.json +31 -5
  116. package/dist/dashboard/i18n/tr.json +31 -5
  117. package/dist/dashboard/i18n/uk.json +31 -5
  118. package/dist/dashboard/i18n/zh.json +31 -5
  119. package/dist/dashboard/journal/book.js +106 -0
  120. package/dist/dashboard/journal/journal.js +9 -8
  121. package/dist/dashboard/parts/labels.js +6 -0
  122. package/dist/dashboard/parts/widgets.js +1 -1
  123. package/dist/dashboard/place/view.js +1 -1
  124. package/dist/dashboard/settings/settings.js +10 -4
  125. package/dist/dashboard/settings/setup.js +5 -3
  126. package/dist/dashboard/sheet/sheet.js +8 -5
  127. package/dist/dashboard/style.css +459 -96
  128. package/dist/dashboard/world/calendar.js +1 -1
  129. package/dist/dashboard/world/lore.js +1 -1
  130. package/dist/helpers/briefs.d.ts +5 -0
  131. package/dist/helpers/briefs.js +8 -0
  132. package/dist/helpers/chosen.d.ts +8 -2
  133. package/dist/helpers/chosen.js +110 -6
  134. package/dist/helpers/codex.js +2 -1
  135. package/dist/helpers/index.d.ts +2 -2
  136. package/dist/helpers/index.js +2 -2
  137. package/dist/images/images.d.ts +2 -0
  138. package/dist/images/images.js +16 -2
  139. package/dist/images/index.d.ts +1 -1
  140. package/dist/images/index.js +1 -1
  141. package/dist/server/approver.d.ts +6 -0
  142. package/dist/server/approver.js +28 -0
  143. package/dist/server/chats.d.ts +3 -0
  144. package/dist/server/chats.js +27 -0
  145. package/dist/server/dashboard/news.js +36 -5
  146. package/dist/server/mcp.js +37 -6
  147. package/dist/server/player-acts.d.ts +7 -2
  148. package/dist/server/player-acts.js +10 -3
  149. package/instructions/start.md +1 -1
  150. package/package.json +2 -2
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "“{title}” is read: the master asks you where to start": "“{title}”已读完:主持人会问你从哪里开始",
3
+ "{by} makes them meanwhile.": "期间由 {by} 生成。",
3
4
  "{count} being read": "{count} 本读取中",
4
5
  "{count} books read": "已读取 {count} 本书",
5
6
  "{count} feet": "{count}英尺",
@@ -34,6 +35,7 @@
34
35
  "{game} of the story for every {real} you are away: when you come back, at your first move the master lets it pass and tells what the world did meanwhile": "你每离开{real},故事就过去{game}:你回来后的第一步行动时,主持人会让这段时间流逝,并讲述这期间世界发生了什么",
35
36
  "{hours}h": "{hours}小时",
36
37
  "{length} across": "宽 {length}",
38
+ "{maker} refused the last picture: {why}. {by} makes them instead.": "{maker} 拒绝了上一张图片:{why}。改由 {by} 生成。",
37
39
  "{minutes}m": "{minutes}分钟",
38
40
  "{month} {year}": "{year}年{month}",
39
41
  "{name} {version} needs a newer RPG Engine: update it in Installed.": "{name} {version} 需要更新版本的 RPG Engine,请在“已安装”中更新。",
@@ -80,6 +82,7 @@
80
82
  "{name}'s sheet": "{name}的角色卡",
81
83
  "{name}'s turn": "{name}的回合",
82
84
  "{names} found out": "{names}发现了",
85
+ "{number} of {count}": "第 {number} 章,共 {count} 章",
83
86
  "{page} is no longer changed in this campaign: there is nothing to put back.": "{page} 在本战役中已没有修改,无需恢复。",
84
87
  "{path}: in this campaign": "{path}:用于本战役",
85
88
  "{place}, on {map}": "{map}上的{place}",
@@ -176,11 +179,13 @@
176
179
  "An author's name": "作者姓名",
177
180
  "and": "和",
178
181
  "angry": "愤怒",
182
+ "another image tool connected to your AI app: the master asks you which in the chat": "使用已连接到你的 AI 应用的其他图片工具:主持人会在聊天中问你用哪一个",
183
+ "Another tool": "其他工具",
179
184
  "Answer in the window of your computer.": "请在你电脑的窗口中回答。",
180
185
  "Answer the master": "回答主持人",
181
186
  "Answer: {check}": "回应:{check}",
182
- "Answers the master": "回应主持人",
183
187
  "Answers the master: {check}": "回应主持人:{check}",
188
+ "Antigravity makes them in your chat, from your Google plan.": "由 Antigravity 在你的对话中使用你的 Google 套餐生成。",
184
189
  "Arcs": "长线",
185
190
  "Around": "周围",
186
191
  "Arrows move the map, plus and minus zoom, Escape closes a place's card. The list of places below says the same.": "方向键移动地图,加号和减号缩放,Esc 关闭地点卡片。下方的地点列表内容相同。",
@@ -246,6 +251,7 @@
246
251
  "Changed: your character does not know what changed.": "已修改:你的角色不知道改了什么。",
247
252
  "Changing the library…": "正在更改资料库…",
248
253
  "Chapter {number}": "第{number}章",
254
+ "Chapters": "章节",
249
255
  "Character voices": "角色配音",
250
256
  "Checkpoint": "存档点",
251
257
  "Checks": "检定",
@@ -275,6 +281,7 @@
275
281
  "Codex is on this computer but not logged in. To have pictures:\n1. Open a terminal: on Windows, Start, then type Terminal.\n2. Paste `codex login` and sign in with your ChatGPT account in the browser that opens.\nCodex makes them with your ChatGPT plan, never paying by the picture.": "这台电脑上已安装 Codex,但尚未登录。要使用图片:\n1. 打开终端:在 Windows 中点击开始,然后输入“终端”。\n2. 粘贴 `codex login`,并在弹出的浏览器中登录你的 ChatGPT 账号。\nCodex 使用你的 ChatGPT 套餐生成图片,无需按张付费。",
276
282
  "Codex makes them on this computer, from your ChatGPT plan.": "由 Codex 在这台电脑上使用你的 ChatGPT 套餐生成。",
277
283
  "Codex on this computer pays for each picture with an API key, which the engine never uses. To make them with your ChatGPT plan instead:\n1. Open a terminal: on Windows, Start, then type Terminal.\n2. Paste `codex login` and sign in with your ChatGPT account in the browser that opens.": "这台电脑上的 Codex 使用 API 密钥按张付费,而引擎从不使用该方式。若要改用你的 ChatGPT 套餐生成图片:\n1. 打开终端:在 Windows 中点击开始,然后输入“终端”。\n2. 粘贴 `codex login`,并在弹出的浏览器中登录你的 ChatGPT 账号。",
284
+ "Codex paints them on this computer, from your ChatGPT plan (Plus or higher)": "由 Codex 在这台电脑上绘制,使用你的 ChatGPT 套餐(Plus 或更高)",
278
285
  "Coin": "硬币",
279
286
  "Coin design": "硬币图案",
280
287
  "Coins": "硬币",
@@ -339,6 +346,7 @@
339
346
  "Difficulty": "难度",
340
347
  "Digital": "数字",
341
348
  "disgusted": "厌恶",
349
+ "Do you want pictures of places and of those you meet?": "要为地点和遇到的人物生成图片吗?",
342
350
  "Documents": "文档",
343
351
  "done": "已完成",
344
352
  "Done": "完成",
@@ -348,6 +356,8 @@
348
356
  "down": "倒下",
349
357
  "Download": "下载",
350
358
  "Download {name}": "下载 {name}",
359
+ "Download as a web page": "下载为网页",
360
+ "Download as Markdown": "下载为 Markdown",
351
361
  "drop the {count} highest": "去掉最高的{count}个",
352
362
  "drop the {count} lowest": "去掉最低的{count}个",
353
363
  "drop the highest": "去掉最高的",
@@ -444,6 +454,7 @@
444
454
  "held: {count}": "待定:{count}",
445
455
  "Help": "帮助",
446
456
  "Here": "此处",
457
+ "Here the master writes the story as a book: a chapter for each scene, once it ends.": "主持人会把故事写成一本书:每个场景结束后,就成为一章。",
447
458
  "hidden": "隐藏",
448
459
  "Hidden": "隐藏",
449
460
  "hidden: the master tells you only what comes of them": "隐藏:主持人只告诉你结果",
@@ -468,7 +479,7 @@
468
479
  "how the dice's edges are cut": "骰子边缘的切削方式",
469
480
  "how the master builds the stories they invent; a written adventure keeps its own": "主持人如何构建自创的故事;已有的成稿冒险沿用自身结构",
470
481
  "how the master writes": "主持人的写作方式",
471
- "How well do you know this game?": "你对这个游戏有多熟悉?",
482
+ "How well do you know role-playing games?": "你对角色扮演游戏了解多少?",
472
483
  "how your character is made in session zero": "零号团里如何创建你的角色",
473
484
  "I already have one": "我已有了",
474
485
  "I attack {target} with {item}.": "我用{item}攻击{target}。",
@@ -488,7 +499,6 @@
488
499
  "I'm ready": "我准备好了",
489
500
  "Ice": "冰",
490
501
  "if they all die, or if the table chooses it when one dies: back to the end of the last scene": "全员死亡时,或有一人死亡而玩家们选择回档时:回到上一个场景结束时",
491
- "if your character dies: back to the end of the last scene": "角色死亡时:回到上一个场景结束时",
492
502
  "Imperial": "英制",
493
503
  "Importing “{title}” in the chat": "正在聊天中导入“{title}”",
494
504
  "Importing “{title}”: opening the document": "正在导入“{title}”:打开文档",
@@ -496,6 +506,7 @@
496
506
  "Importing “{title}”: reading its parts": "正在导入“{title}”:读取各部分",
497
507
  "Importing “{title}”: writing the world": "正在导入“{title}”:撰写世界",
498
508
  "in {container}": "在{container}中",
509
+ "In a campaign begun before, ask the master to write the story so far.": "如果战役是之前开始的,可以请主持人写出到目前为止的故事。",
499
510
  "In the campaign": "已在战役中",
500
511
  "In the chat, with the master: {settings}.": "在聊天中与主持人一起决定:{settings}。",
501
512
  "In the open": "在野外",
@@ -716,6 +727,7 @@
716
727
  "Only the highest {die} counts": "只计最高的{die}",
717
728
  "Only the lowest {die} counts": "只计最低的{die}",
718
729
  "only the story; ask in brackets whenever you want": "只有故事;想问时用括号提问",
730
+ "only when all is lost: back to the end of the last scene": "仅在全盘皆输时使用:回到上一个场景的结尾",
719
731
  "only when the story turns on them": "仅当故事取决于它们时",
720
732
  "Onyx": "缟玛瑙",
721
733
  "Open": "打开",
@@ -786,6 +798,7 @@
786
798
  "Read {name}": "阅读{name}",
787
799
  "Read all you know": "阅读全部所知",
788
800
  "Read elsewhere": "在别处读过",
801
+ "Read it": "阅读",
789
802
  "Read the MIT licence": "查看 MIT 许可证",
790
803
  "Reading the map…": "正在读取地图…",
791
804
  "Reading…": "阅读中…",
@@ -808,6 +821,7 @@
808
821
  "roll one more {condition}": "{condition}时多掷一个骰子",
809
822
  "rolled at {time}": "于 {time} 掷骰",
810
823
  "Rolled better: {why}": "掷骰占优:{why}",
824
+ "rolled in the game, on the dashboard": "在游戏中掷骰,结果显示在面板上",
811
825
  "Rolled with the dashboard's dice": "用面板的骰子掷出",
812
826
  "Rolled with your dice": "用你的骰子掷出",
813
827
  "Rolled worse: {why}": "掷骰吃亏:{why}",
@@ -964,7 +978,6 @@
964
978
  "The dice are rolling…": "骰子正在滚动……",
965
979
  "the dice as they roll": "骰子滚动时的声音",
966
980
  "the dice decide": "由骰子决定",
967
- "the engine rolls them": "由引擎掷骰",
968
981
  "The extension is in the campaign: it counts from now on.": "扩展已加入战役,从现在起生效。",
969
982
  "The file is more than {size} MB: no package is that big.": "文件超过 {size} MB,没有哪个包会这么大。",
970
983
  "The folder {name} has characters npm cannot take: move it to another path.": "文件夹 {name} 含有 npm 不支持的字符,请移到其他路径。",
@@ -993,7 +1006,9 @@
993
1006
  "The language is on this computer, for every campaign.": "语言已在本机,所有战役通用。",
994
1007
  "the language of this page": "本页面的语言",
995
1008
  "the language the master plays in, and the page's too when it is translated": "主持人游戏时使用的语言;页面若已翻译,也使用该语言",
1009
+ "The last chapter": "最新一章",
996
1010
  "The master": "主持人",
1011
+ "The master asks you in the chat which tool to use.": "主持人会在聊天中问你使用哪个工具。",
997
1012
  "The master goes on with {version} in this chat. To play with {next}:": "在这个聊天中,主持人继续使用 {version}。要使用 {next} 来玩:",
998
1013
  "The master has already heard it.": "主持人已经听到了。",
999
1014
  "The master has read it": "主持人已读",
@@ -1004,6 +1019,9 @@
1004
1019
  "The master makes it": "由主持人生成",
1005
1020
  "the master makes it from a few words of yours": "主持人根据你的几句描述来创建",
1006
1021
  "the master makes them in session zero": "由主持人在零号团中创建",
1022
+ "the master makes them with {tool}": "由主持人用 {tool} 生成",
1023
+ "The master makes them with {tool}.": "由主持人用 {tool} 生成。",
1024
+ "the master makes them with ElevenLabs, connected to your AI app, from your ElevenLabs plan": "由主持人用已连接到你的 AI 应用的 ElevenLabs 生成,使用你的 ElevenLabs 套餐",
1007
1025
  "The master plays in {language}, and the page is written in it too.": "主持人使用{language}进行游戏,页面也使用这种语言。",
1008
1026
  "The master plays in {language}; the page stays in English: Codex or Claude Code would translate it on this computer.": "主持人使用{language}进行游戏;页面仍显示英文:Codex 或 Claude Code 可以在这台电脑上翻译页面。",
1009
1027
  "The master plays in {language}; the page stays in English.": "主持人使用{language}进行游戏,页面仍为英文。",
@@ -1058,6 +1076,8 @@
1058
1076
  "There is no player character yet: the sheet comes when the master writes one.": "还没有角色:主持人写好角色后,角色卡就会出现。",
1059
1077
  "These pages of the game system changed for this campaign: each line has what the game system gave, then what it is now, in bold.": "本战役中,游戏系统的这些页面有所改动:每行先是系统原有的内容,再用粗体显示现在的内容。",
1060
1078
  "These pages of the game system changed for this campaign.": "本战役中,游戏系统的这些页面有所改动。",
1079
+ "These words answer the master instead of a roll or a button: {question}": "这些话代替掷骰或按钮回答主持人:{question}",
1080
+ "These words answer the master's question: {question}": "这些话回答主持人的问题:{question}",
1061
1081
  "This campaign does not use {name}.": "这个战役没有使用 {name}。",
1062
1082
  "this campaign has": "本战役设定",
1063
1083
  "This campaign has {name} {version}, already in play: an adventure in play is not updated.": "这个战役已有 {name} {version},并且正在进行,进行中的冒险不会更新。",
@@ -1078,6 +1098,7 @@
1078
1098
  "Threat clocks": "威胁进度钟",
1079
1099
  "Time is up": "时间到了",
1080
1100
  "Time passes: {from} → {to}": "时间流逝:{from} → {to}",
1101
+ "Timeline": "时间线",
1081
1102
  "Title": "标题",
1082
1103
  "to": "通往",
1083
1104
  "To choose": "待选择",
@@ -1141,7 +1162,7 @@
1141
1162
  "What is already in play stays as it is, and you can go back whenever you want.": "已经在进行中的内容保持不变,你随时可以改回来。",
1142
1163
  "What it wrote in the campaign stays, and comes back if you install it again.": "它在战役中写入的内容会保留,重新安装后会恢复。",
1143
1164
  "what lights your way, as long as it lasts": "为你照亮前路的东西,直到用完为止",
1144
- "what never appears in the game": "游戏中绝不出现的内容",
1165
+ "what must never appear in the game": "游戏中绝不能出现的内容",
1145
1166
  "What runs the game: the master's tools and this page.": "驱动游戏的部分:主持人的工具和这个页面。",
1146
1167
  "What the master asks": "主持人的提问",
1147
1168
  "what the master asks you to roll": "主持人要你掷的骰子",
@@ -1162,6 +1183,9 @@
1162
1183
  "whether the story's time runs while you are away, from one session to the next": "从一次游戏到下一次,你不在时故事时间是否流逝",
1163
1184
  "Which page": "哪个页面",
1164
1185
  "Who is where": "谁在哪里",
1186
+ "who makes the pictures": "由谁生成图片",
1187
+ "Who makes them": "由谁生成",
1188
+ "Who makes them?": "由谁生成?",
1165
1189
  "who rolls your character's dice": "谁来替你的角色掷骰",
1166
1190
  "who speaks for the characters you meet": "由谁来为你遇到的角色发声",
1167
1191
  "Whose card": "谁的卡片",
@@ -1206,7 +1230,9 @@
1206
1230
  "You read it": "你读过它",
1207
1231
  "you roll your own and tell the values": "你自己掷骰并报出点数",
1208
1232
  "You said no: nothing changed.": "你选择了拒绝,没有任何更改。",
1233
+ "Your AI app": "你的 AI 应用",
1209
1234
  "your AI app decides, as it does in any chat": "由你的 AI 应用决定,和平时聊天一样",
1235
+ "your AI app, by its own means: Claude draws them as vector pictures, Codex and Antigravity paint them, each from your plan": "由你的 AI 应用自行生成:Claude 绘制矢量图,Codex 和 Antigravity 绘制画作,均使用你的套餐",
1210
1236
  "Your app decides": "由你的应用决定",
1211
1237
  "Your books": "你的书",
1212
1238
  "Your character": "你的角色",
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
2
+ // The story told as a book (T-227): the master's prose, a chapter for each closed scene, set as a book's pages: one chapter at a time on paper, its paragraphs
3
+ // justified and indented, a capital at its start; the chapters listed beside it, closing to the left, the last with its bookmark; downloaded as Markdown or as a
4
+ // web page that prints as the book.
5
+ import { render } from "preact";
6
+ import { useEffect, useRef, useState } from "preact/hooks";
7
+ import { sectionAddress } from "../address.js";
8
+ import { Icon } from "../parts/icons.js";
9
+ import { InlineText } from "../parts/markdown.js";
10
+ import { useChoice } from "../shell/prefs.js";
11
+ import { t } from "../text.js";
12
+ // Whether the list of chapters is open beside the page, kept in this browser; on a narrow screen it is above the page, closed until asked for.
13
+ const indexChoice = { key: "rpg-engine.book-index", initial: "open", values: ["open", "closed"] };
14
+ /** The book: the chapter the address asks for, or the last; the list of chapters beside it, and the pages turned by chapter, each a link to its address. */
15
+ export function Book({ chapters, asked, campaign }) {
16
+ const [index, setIndex] = useChoice(indexChoice);
17
+ const page = useRef(null);
18
+ const title = useRef(null);
19
+ const shown = useRef(false);
20
+ const [above, setAbove] = useState(false);
21
+ const narrow = window.matchMedia("(max-width: 760px)").matches;
22
+ const open = narrow ? above : index === "open";
23
+ const toggle = () => (narrow ? setAbove(!open) : setIndex(open ? "closed" : "open"));
24
+ // A chapter turned to, from the list or the page's foot, as #/journal/story/3: the focus on its title, its start in view; the book as opened keeps both.
25
+ useEffect(() => {
26
+ if (!shown.current) {
27
+ shown.current = true;
28
+ return;
29
+ }
30
+ setAbove(false);
31
+ title.current?.focus({ preventScroll: true });
32
+ // Its start hidden over the window or under the top: brought just under them.
33
+ if (page.current !== null && page.current.getBoundingClientRect().top < Number.parseFloat(getComputedStyle(page.current).scrollMarginTop)) {
34
+ page.current?.scrollIntoView({ block: "start", behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" });
35
+ }
36
+ }, [asked]);
37
+ if (chapters.length === 0) {
38
+ return (_jsxs("div", { class: "book-empty", children: [_jsx("p", { children: t("Here the master writes the story as a book: a chapter for each scene, once it ends.") }), _jsx("p", { children: t("In a campaign begun before, ask the master to write the story so far.") })] }));
39
+ }
40
+ const last = chapters[chapters.length - 1];
41
+ const current = chapters.find((chapter) => String(chapter.number) === asked) ?? last;
42
+ const at = chapters.indexOf(current);
43
+ const before = chapters[at - 1];
44
+ const after = chapters[at + 1];
45
+ return (_jsxs("div", { class: open ? "book" : "book index-closed", children: [_jsxs("nav", { class: "book-index", "aria-label": t("Chapters"), children: [_jsxs("button", { type: "button", class: "button quiet book-index-toggle", "aria-expanded": open, onClick: toggle, children: [_jsx(Icon, { name: "list" }), _jsx("span", { children: t("Chapters") })] }), open && (_jsx("ol", { children: chapters.map((chapter) => (_jsx("li", { children: _jsxs("a", { href: chapterAddress(chapter), "aria-current": chapter === current ? "page" : undefined, "aria-describedby": chapter === last ? `book-line-${chapter.number} book-last` : `book-line-${chapter.number}`, children: [_jsxs("span", { class: "book-index-title", children: [_jsx("span", { class: "book-index-number", children: chapter.number }), " ", chapter.title] }), _jsx("span", { class: "book-index-line", id: `book-line-${chapter.number}`, "aria-hidden": "true", children: openingWords(chapter.text) }), chapter === last && _jsx("span", { class: "book-mark", "aria-hidden": "true" }), chapter === last && _jsx("span", { class: "visually-hidden", id: "book-last", children: t("The last chapter") })] }) }, chapter.number))) }))] }), _jsxs("article", { class: current === last ? "book-page marked" : "book-page", ref: page, "aria-labelledby": "book-chapter-title", children: [_jsxs("header", { class: "book-head", children: [_jsx("p", { class: "book-number", children: t("Chapter {number}", { number: current.number }) }), _jsx("h3", { id: "book-chapter-title", ref: title, tabIndex: -1, children: current.title }), _jsx("span", { class: "book-ornament", "aria-hidden": "true", children: "\u2766" })] }), _jsx(BookText, { text: current.text }), _jsxs("footer", { class: "book-turn", children: [before === undefined ? _jsx("span", {}) : (_jsxs("a", { href: chapterAddress(before), children: [_jsx("span", { class: "book-arrow", "aria-hidden": "true", children: "\u2190" }), _jsxs("span", { class: "visually-hidden", children: [t("Chapter {number}", { number: before.number }), ":"] }), " ", before.title] })), _jsx("span", { class: "book-folio", children: t("{number} of {count}", { number: at + 1, count: chapters.length }) }), after === undefined ? _jsx("span", {}) : (_jsxs("a", { href: chapterAddress(after), class: "book-on", children: [_jsxs("span", { class: "visually-hidden", children: [t("Chapter {number}", { number: after.number }), ":"] }), " ", after.title, " ", _jsx("span", { class: "book-arrow", "aria-hidden": "true", children: "\u2192" })] }))] })] }), _jsxs("div", { class: "book-export", children: [_jsxs("button", { type: "button", class: "button quiet", onClick: () => download(fileName(campaign, "md"), "text/markdown", bookMarkdown(chapters, campaign)), children: [_jsx(Icon, { name: "download" }), t("Download as Markdown")] }), _jsxs("button", { type: "button", class: "button quiet", onClick: () => download(fileName(campaign, "html"), "text/html", bookPage(chapters, campaign)), children: [_jsx(Icon, { name: "download" }), t("Download as a web page")] })] })] }));
46
+ }
47
+ /** A chapter's prose: paragraphs apart by a blank line, a line of three marks alone a break within it, italics and bold as written. */
48
+ function BookText({ text }) {
49
+ return (_jsx("div", { class: "book-text", children: text.split(/\n\s*\n/).map((block) => block.trim()).filter((block) => block !== "").map((block, index) => isBreak(block)
50
+ ? _jsx("p", { class: "book-break", "aria-hidden": "true", children: "\u2042" }, index)
51
+ : (_jsx("p", { children: _jsx(InlineText, { text: block.replace(/^#+\s*/, "").replace(/\s*\n\s*/g, " ") }) }, index))) }));
52
+ }
53
+ /** A chapter's address, as #/journal/story/3: pushed, so that Back turns the page back. */
54
+ function chapterAddress(chapter) {
55
+ return sectionAddress("journal", "story", String(chapter.number));
56
+ }
57
+ function isBreak(block) {
58
+ return /^(?:[*\-_]\s*){3,}$|^⁂$/.test(block);
59
+ }
60
+ /** The first words of a chapter, for its line in the list. */
61
+ function openingWords(text) {
62
+ const first = text.split(/\n\s*\n/).map((block) => block.trim()).find((block) => block !== "" && !isBreak(block)) ?? "";
63
+ const plain = first.replace(/[*_#]/g, "").replace(/\s+/g, " ");
64
+ return plain.length <= 60 ? plain : `${plain.slice(0, plain.lastIndexOf(" ", 60) > 30 ? plain.lastIndexOf(" ", 60) : 60)}…`;
65
+ }
66
+ /** The book as one Markdown file: the campaign's name, then each chapter under its number and title. */
67
+ function bookMarkdown(chapters, campaign) {
68
+ const head = campaign === undefined ? "" : `# ${campaign}\n\n`;
69
+ return `${head}${chapters.map((chapter) => `## ${t("Chapter {number}", { number: chapter.number })}: ${chapter.title}\n\n${chapter.text}`).join("\n\n")}\n`;
70
+ }
71
+ /** The book as a web page of its own, set as the page sets it, each chapter starting a new sheet when printed. */
72
+ function bookPage(chapters, campaign) {
73
+ const holder = document.createElement("div");
74
+ render(_jsxs(_Fragment, { children: [campaign !== undefined && _jsx("h1", { children: campaign }), chapters.map((chapter) => (_jsxs("section", { class: "chapter", children: [_jsx("p", { class: "number", children: t("Chapter {number}", { number: chapter.number }) }), _jsx("h2", { children: chapter.title }), _jsx("p", { class: "ornament", "aria-hidden": "true", children: "\u2766" }), _jsx(BookText, { text: chapter.text })] }, chapter.number)))] }), holder);
75
+ const language = document.documentElement.lang || "en";
76
+ const title = (campaign ?? t("Story")).replace(/[<&]/g, (mark) => (mark === "<" ? "&lt;" : "&amp;"));
77
+ return `<!doctype html>\n<html lang="${language}" dir="${document.documentElement.dir || "ltr"}">\n<head>\n<meta charset="utf-8">\n<meta name="viewport" content="width=device-width, initial-scale=1">\n<title>${title}</title>\n<style>${exportStyle}</style>\n</head>\n<body>\n${holder.innerHTML}\n</body>\n</html>\n`;
78
+ }
79
+ // The exported page's own style: the book's setting, with no font of its own, and a sheet for each chapter in print.
80
+ const exportStyle = `
81
+ body { margin: 0 auto; padding: 3rem 1.5rem; max-width: 36rem; background: #f6eedb; color: #2f261b; font: 1.125rem/1.65 "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
82
+ h1 { text-align: center; font-weight: normal; font-size: 2.2rem; margin: 2rem 0 4rem; }
83
+ .chapter { margin-bottom: 4rem; }
84
+ .number { text-align: center; letter-spacing: .15em; text-transform: uppercase; font-size: .8rem; margin: 0; }
85
+ h2 { text-align: center; font-weight: normal; font-size: 1.6rem; margin: .3rem 0 0; }
86
+ .ornament { text-align: center; margin: .4rem 0 1.6rem; }
87
+ .book-text p { margin: 0; text-indent: 1.5em; text-align: justify; hyphens: auto; text-wrap: pretty; orphans: 2; widows: 2; }
88
+ .book-text p:first-child, .book-text .book-break + p { text-indent: 0; }
89
+ .book-text p:first-child:not(:lang(ar), :lang(hi), :lang(ja), :lang(zh), :lang(ko))::first-letter { float: inline-start; font-size: 3.2em; line-height: .85; padding-block-start: .05em; padding-inline-end: .08em; }
90
+ .book-text .book-break { text-align: center; text-indent: 0; margin: .8rem 0; }
91
+ @media (max-width: 30rem) { body { padding: 2rem 1.25rem; } .book-text p { text-align: start; } }
92
+ @media print { body { background: none; padding: 0; } .chapter { break-before: page; } h1 + .chapter { break-before: auto; } }
93
+ `;
94
+ function fileName(campaign, extension) {
95
+ const name = (campaign ?? t("Story")).replace(/[\\/:*?"<>|]+/g, " ").trim();
96
+ return `${name === "" ? "story" : name}.${extension}`;
97
+ }
98
+ /** Gives the browser a file to save. */
99
+ function download(name, type, text) {
100
+ const address = URL.createObjectURL(new Blob([text], { type: `${type};charset=utf-8` }));
101
+ const link = document.createElement("a");
102
+ link.href = address;
103
+ link.download = name;
104
+ link.click();
105
+ setTimeout(() => URL.revokeObjectURL(address), 1000);
106
+ }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
2
- // The Journal section (D-367, D-369, D-371, D-384, D-388): the quests the character knows as a video game's quest log, each with the time left before its deadline at its top, its
2
+ // The Journal section (D-367, D-369, D-371, D-384, D-388, T-227): the quests the character knows as a video game's quest log, each with the time left before its deadline at its top, its
3
3
  // goals, its counters as bars and its clock with its name, the main ones first and in gold; the ones the player follows, the main one until they choose, shown
4
- // small beside the page, or in Scene and Combat on a narrow screen; the story by its scenes, as chapters, the last first, each with what the diary tells of it; the companions'
4
+ // small beside the page, or in Scene and Combat on a narrow screen; the story told as a book; its timeline by scenes, as chapters, the last first, each with what the diary tells of it; the companions'
5
5
  // diaries (D-497); and the player's own notes.
6
6
  import { useEffect, useRef, useState } from "preact/hooks";
7
7
  import { sectionAddress } from "../address.js";
@@ -18,10 +18,11 @@ import { PageHead } from "../shell/pages.js";
18
18
  import { useChoice, useKeptText } from "../shell/prefs.js";
19
19
  import { PageTabs } from "../shell/tabs.js";
20
20
  import { arrowStep, t } from "../text.js";
21
+ import { Book } from "./book.js";
21
22
  import { Notes } from "./notes.js";
22
23
  // The tab the player last chose, kept in this browser.
23
- const tabChoice = { key: "rpg-engine.journal-tab", initial: "quests", values: ["quests", "story", "companions", "notes"] };
24
- /** The Journal: the tab the player last chose, or the one the address says, as #/journal/story, and a chapter in the story, as #/journal/story/3. */
24
+ const tabChoice = { key: "rpg-engine.journal-tab", initial: "quests", values: ["quests", "story", "timeline", "companions", "notes"] };
25
+ /** The Journal: the tab the player last chose, or the one the address says, as #/journal/story, and a chapter, of the book or of the timeline, as #/journal/story/3. */
25
26
  export function JournalView({ version, campaign, tab: asked, item }) {
26
27
  const journal = useJournal(version);
27
28
  const [chosen, setTab] = useChoice(tabChoice);
@@ -37,11 +38,11 @@ export function JournalView({ version, campaign, tab: asked, item }) {
37
38
  }, [asked]);
38
39
  // A chapter the address says, as the calendar's scenes lead to, brought into view once the story is read.
39
40
  useEffect(() => {
40
- const chapter = item === undefined || tab !== "story" ? null : document.querySelector(`.chapter[data-number="${CSS.escape(item)}"]`);
41
+ const chapter = item === undefined || tab !== "timeline" ? null : document.querySelector(`.chapter[data-number="${CSS.escape(item)}"]`);
41
42
  chapter?.scrollIntoView({ block: "center" });
42
43
  chapter?.focus({ preventScroll: true });
43
44
  }, [item, tab, journal.read !== undefined]);
44
- return (_jsxs("section", { class: "journal", "aria-labelledby": "journal-title", children: [_jsx(PageHead, { section: "journal", id: "journal-title" }), _jsx(PageTabs, { section: "journal", label: t("Journal"), chosen: tab, tabs: shown.map((key) => ({ key, name: tabName(key) })), onChoose: setTab }), _jsxs("div", { id: "journal-panel", role: "tabpanel", "aria-labelledby": `journal-tab-${tab}`, children: [journal.problem !== undefined && _jsx("p", { class: "journal-problem", role: "alert", children: journal.problem }), journal.read !== undefined && tab === "quests" && _jsx(QuestLog, { quests: journal.read.quests, followed: followed, onFollow: setFollowed }), journal.read !== undefined && tab === "story" && _jsx(Story, { chapters: journal.read.chapters, now: journal.read.now }), journal.read !== undefined && tab === "companions" && _jsx(Diaries, { thoughts: journal.read.thoughts ?? [] }), tab === "notes" && _jsx(Notes, { version: version }), journal.read === undefined && journal.problem === undefined && journal.done && tab !== "notes" && _jsx("p", { class: "journal-none", children: t("The journal starts with the player character.") })] }), _jsx(WidgetCards, { place: "page", page: "journal" })] }));
45
+ return (_jsxs("section", { class: "journal", "aria-labelledby": "journal-title", children: [_jsx(PageHead, { section: "journal", id: "journal-title" }), _jsx(PageTabs, { section: "journal", label: t("Journal"), chosen: tab, tabs: shown.map((key) => ({ key, name: tabName(key) })), onChoose: setTab }), _jsxs("div", { id: "journal-panel", role: "tabpanel", "aria-labelledby": `journal-tab-${tab}`, children: [journal.problem !== undefined && _jsx("p", { class: "journal-problem", role: "alert", children: journal.problem }), journal.read !== undefined && tab === "quests" && _jsx(QuestLog, { quests: journal.read.quests, followed: followed, onFollow: setFollowed }), journal.read !== undefined && tab === "story" && _jsx(Book, { chapters: journal.read.book ?? [], asked: item, campaign: campaign }), journal.read !== undefined && tab === "timeline" && _jsx(Timeline, { chapters: journal.read.chapters, now: journal.read.now }), journal.read !== undefined && tab === "companions" && _jsx(Diaries, { thoughts: journal.read.thoughts ?? [] }), tab === "notes" && _jsx(Notes, { version: version }), journal.read === undefined && journal.problem === undefined && journal.done && tab !== "notes" && _jsx("p", { class: "journal-none", children: t("The journal starts with the player character.") })] }), _jsx(WidgetCards, { place: "page", page: "journal" })] }));
45
46
  }
46
47
  /**
47
48
  * The quests the player follows (D-369), the main ones first, then the others, each group in the order they were followed. Beside the page one card, as a video
@@ -210,7 +211,7 @@ export function Deadline({ deadline }) {
210
211
  return (_jsxs("span", { class: near ? "quest-deadline near" : "quest-deadline", "data-tip": phraseLabel(byDateLabel(deadline.date)), children: [_jsx(Icon, { name: "hourglass" }), _jsxs("span", { children: [text, left && _jsx("span", { class: "quest-deadline-left", children: ` ${t("left")}` })] })] }));
211
212
  }
212
213
  /** The story by its scenes, the last first: each with its place and date, its summary, and what the diary tells of it, folded. */
213
- function Story({ chapters, now }) {
214
+ function Timeline({ chapters, now }) {
214
215
  if (chapters.length === 0) {
215
216
  return _jsx("p", { class: "journal-none", children: t("The story starts with the first scene.") });
216
217
  }
@@ -338,7 +339,7 @@ function plainText(text) {
338
339
  }
339
340
  /** A tab's name in the page's language. */
340
341
  function tabName(tab) {
341
- return tab === "quests" ? t("Quests") : tab === "story" ? t("Story") : tab === "companions" ? t("Companions") : t("Notes");
342
+ return tab === "quests" ? t("Quests") : tab === "story" ? t("Story") : tab === "timeline" ? t("Timeline") : tab === "companions" ? t("Companions") : t("Notes");
342
343
  }
343
344
  /** A chapter's key as the story grows, newest first: its number; a stretch between scenes by the chapter after it, so that what is open stays with it. */
344
345
  function chapterKey(chapters, index) {
@@ -230,6 +230,7 @@ export function settingLabel(name) {
230
230
  units: t("Units"),
231
231
  voices: t("Character voices"),
232
232
  pictures: t("Pictures"),
233
+ "pictures-by": t("Who makes them"),
233
234
  effort: t("Master's thinking"),
234
235
  lines: t("Lines"),
235
236
  veils: t("Veils"),
@@ -333,6 +334,11 @@ export function valueLabel(value) {
333
334
  stops: t("Stops"),
334
335
  "1d per 7d": t("A day a week"),
335
336
  "1d per 1d": t("Real time"),
337
+ chat: t("Your AI app"),
338
+ other: t("Another tool"),
339
+ // Names of programs, the same in every language.
340
+ codex: "Codex",
341
+ elevenlabs: "ElevenLabs",
336
342
  };
337
343
  return labels[value] ?? itemLabel(value);
338
344
  }
@@ -68,7 +68,7 @@ function Items({ items, field, fields }) {
68
68
  return (_jsx("ul", { class: [sentences ? "notes" : "chips", acting ? "acting" : ""].filter((name) => name !== "").join(" "), children: items.map((item) => {
69
69
  const label = itemLabel(item, fields);
70
70
  // An item is only a name: one of a page of the game system the campaign changed has the asterisk after it (D-564).
71
- return (_jsxs("li", { children: [acting ? _jsx(ActName, { verbs: verbs, item: label, children: label }) : label, isChanged(item) && _jsx(ChangedMark, {})] }, item));
71
+ return (_jsxs("li", { children: [acting ? _jsx(ActName, { verbs: verbs, item: label, page: item, children: label }) : label, isChanged(item) && _jsx(ChangedMark, {})] }, item));
72
72
  }) }));
73
73
  }
74
74
  /** Someone's effects as tags, each with its end; past `most`, how many more. */
@@ -81,7 +81,7 @@ export function PlaceMap({ map, place, acting, picking, choosing, bare = false,
81
81
  box.scrollLeft = Math.max(0, x * shown - box.clientWidth / 2);
82
82
  }, [map.columns, map.rows, self?.at.column, self?.at.row]);
83
83
  const drawn = (_jsxs(_Fragment, { children: [_jsx("path", { class: "lm-floor-fill", d: floor, "fill-rule": "evenodd" }), _jsx("g", { class: "lm-ground", "clip-path": "url(#lm-open)", children: open.filter((square) => groundKinds.includes(kindAt(map, square))).map((square) => _jsx(Ground, { kind: kindAt(map, square), x: X(square.column), y: Y(square.row), side: size, seed: square }, squareName(square))) }), _jsx("path", { class: "lm-grid", d: open.map((square) => `M${X(square.column)} ${Y(square.row)}h${size}v${size}h${-size}z`).join(""), "clip-path": "url(#lm-open)" }), open.filter((square) => featureAt(square)?.difficult).map((square) => _jsx(Corner, { x: X(square.column), y: Y(square.row), side: size }, squareName(square))), things.map((feature) => piecesOf(map, feature.symbol, feature.kind).map((piece) => (_jsxs("g", { class: `lm-thing ${feature.kind}`, children: [_jsx("title", { children: [featureName(feature), feature.blocks ? t("blocks") : "", feature.difficult ? t("difficult") : ""].filter((part) => part !== "").join(", ") }), _jsx(Thing, { kind: feature.kind, symbol: feature.symbol, x: X(piece.left), y: Y(piece.top), w: (piece.right - piece.left) * size, h: (piece.bottom - piece.top) * size, cells: piece.squares.map((square) => [X(square.column), Y(square.row)]) })] }, `${feature.symbol} ${piece.left} ${piece.top}`)))), _jsx("path", { class: "lm-shade", d: outline, "clip-path": "url(#lm-open)", filter: "url(#lm-blur)" })] }));
84
- return (_jsxs("section", { class: "lm", "aria-labelledby": "lm-title", children: [_jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "lm-title", children: t("Map") }), note: place }), _jsx("div", { ref: frame, class: picking === undefined && choosing === undefined ? "lm-frame" : "lm-frame panned", style: { "--map-width": String(width) }, children: _jsxs("svg", { ref: svg, class: `lm-svg lm-look-${map.ground}`, viewBox: `0 0 ${width} ${height}`, ...(picking === undefined && choosing === undefined ? {} : { width: width * 1.2 }), role: "img", "aria-label": t("Map of {place}", { place }), children: [_jsxs("defs", { children: [_jsx(Patterns, {}), _jsx(GlassDefs, { prefix: "lm" }), _jsxs("radialGradient", { id: "lm-hostile-glow", children: [_jsx("stop", { offset: "0.75", "stop-color": "#c8321f", "stop-opacity": "0.3" }), _jsx("stop", { offset: "1", "stop-color": "#c8321f", "stop-opacity": "0" })] }), _jsx("clipPath", { id: "lm-open", children: _jsx("path", { d: floor, "clip-rule": "evenodd" }) }), !walled && (_jsx("mask", { id: "lm-fade", maskUnits: "userSpaceOnUse", x: 0, y: 0, width: width, height: height, children: _jsx("rect", { x: X(0) + size * 0.35, y: Y(0) + size * 0.35, width: map.columns * size - size * 0.7, height: map.rows * size - size * 0.7, fill: "#fff", filter: "url(#lm-soft)" }) })), standing.map((one, index) => (_jsx("clipPath", { id: `lm-token-${index}`, children: _jsx("circle", { cx: middle(one)[0], cy: middle(one)[1], r: size * (one.side ?? 1) * 0.43 }) }, index)))] }), _jsx("rect", { class: "lm-paper", width: width, height: height }), _jsx("g", { class: "lm-walls", children: squares.filter((square) => ["wall", "rock", "window"].includes(kindAt(map, square)) && nearRoom(square)).map((square) => (_jsxs(Fragment, { children: [_jsx("rect", { class: "lm-wall-under", x: X(square.column), y: Y(square.row), width: size, height: size }), _jsx("rect", { class: `lm-wall ${kindAt(map, square)}`, x: X(square.column), y: Y(square.row), width: size, height: size })] }, squareName(square)))) }), walled ? drawn : _jsx("g", { mask: "url(#lm-fade)", children: drawn }), reach.length > 0 && (_jsx("g", { class: "lm-out", "aria-hidden": "true", "clip-path": "url(#lm-open)", children: open.filter((square) => !reach.some((near) => near.column === square.column && near.row === square.row)).map((square) => (_jsx("rect", { x: X(square.column), y: Y(square.row), width: size, height: size }, squareName(square)))) })), _jsx("path", { class: "lm-outline", d: outline, filter: "url(#lm-ink)" }), squares.filter((square) => ["door", "open-door", "secret-door"].includes(kindAt(map, square))).map((square) => (_jsx(Door, { kind: kindAt(map, square), name: featureAt(square)?.name ?? "door", square: square, map: map, x: X(square.column), y: Y(square.row) }, squareName(square)))), map.exits.map((exit, index) => {
84
+ return (_jsxs("section", { class: bare ? "lm bare" : "lm", ...(bare ? { "aria-label": `${t("Map")}: ${place}` } : { "aria-labelledby": "lm-title" }), children: [!bare && _jsx(CardHead, { icon: iconPath("world"), title: _jsx("h3", { id: "lm-title", children: t("Map") }), note: place }), _jsx("div", { ref: frame, class: picking === undefined && choosing === undefined ? "lm-frame" : "lm-frame panned", style: { "--map-width": String(width) }, children: _jsxs("svg", { ref: svg, class: `lm-svg lm-look-${map.ground}`, viewBox: `0 0 ${width} ${height}`, ...(picking === undefined && choosing === undefined ? {} : { width: width * 1.2 }), role: "img", "aria-label": t("Map of {place}", { place }), children: [_jsxs("defs", { children: [_jsx(Patterns, {}), _jsx(GlassDefs, { prefix: "lm" }), _jsxs("radialGradient", { id: "lm-hostile-glow", children: [_jsx("stop", { offset: "0.75", "stop-color": "#c8321f", "stop-opacity": "0.3" }), _jsx("stop", { offset: "1", "stop-color": "#c8321f", "stop-opacity": "0" })] }), _jsx("clipPath", { id: "lm-open", children: _jsx("path", { d: floor, "clip-rule": "evenodd" }) }), !walled && (_jsx("mask", { id: "lm-fade", maskUnits: "userSpaceOnUse", x: 0, y: 0, width: width, height: height, children: _jsx("rect", { x: X(0) + size * 0.35, y: Y(0) + size * 0.35, width: map.columns * size - size * 0.7, height: map.rows * size - size * 0.7, fill: "#fff", filter: "url(#lm-soft)" }) })), standing.map((one, index) => (_jsx("clipPath", { id: `lm-token-${index}`, children: _jsx("circle", { cx: middle(one)[0], cy: middle(one)[1], r: size * (one.side ?? 1) * 0.43 }) }, index)))] }), _jsx("rect", { class: "lm-paper", width: width, height: height }), _jsx("g", { class: "lm-walls", children: squares.filter((square) => ["wall", "rock", "window"].includes(kindAt(map, square)) && nearRoom(square)).map((square) => (_jsxs(Fragment, { children: [_jsx("rect", { class: "lm-wall-under", x: X(square.column), y: Y(square.row), width: size, height: size }), _jsx("rect", { class: `lm-wall ${kindAt(map, square)}`, x: X(square.column), y: Y(square.row), width: size, height: size })] }, squareName(square)))) }), walled ? drawn : _jsx("g", { mask: "url(#lm-fade)", children: drawn }), reach.length > 0 && (_jsx("g", { class: "lm-out", "aria-hidden": "true", "clip-path": "url(#lm-open)", children: open.filter((square) => !reach.some((near) => near.column === square.column && near.row === square.row)).map((square) => (_jsx("rect", { x: X(square.column), y: Y(square.row), width: size, height: size }, squareName(square)))) })), _jsx("path", { class: "lm-outline", d: outline, filter: "url(#lm-ink)" }), squares.filter((square) => ["door", "open-door", "secret-door"].includes(kindAt(map, square))).map((square) => (_jsx(Door, { kind: kindAt(map, square), name: featureAt(square)?.name ?? "door", square: square, map: map, x: X(square.column), y: Y(square.row) }, squareName(square)))), map.exits.map((exit, index) => {
85
85
  const square = squareOf(exit.square);
86
86
  return square === undefined ? null : _jsx(Exit, { side: sides[index], to: exit.to, x: X(square.column) + size / 2, y: Y(square.row) + size / 2, letters: Math.max(13, 12 / scale) }, exit.square);
87
87
  }), _jsxs("g", { class: "lm-coordinates", "font-size": letters, children: [Array.from({ length: map.columns }, (_, column) => _jsx("text", { x: X(column) + size / 2, y: top - 10, "text-anchor": "middle", children: columnName(column) }, `c${column}`)), Array.from({ length: map.rows }, (_, row) => _jsx("text", { x: left - 10, y: Y(row) + size / 2, "text-anchor": "end", "dominant-baseline": "middle", children: row + 1 }, `r${row}`))] }), _jsx("g", { class: "lm-tokens", children: standing.map((one, index) => {
@@ -23,7 +23,7 @@ const groups = [
23
23
  { names: ["dice", "master-rolls", "units"], system: true },
24
24
  { names: ["lines", "veils"] },
25
25
  { names: ["orders"] },
26
- { names: ["pictures", "language"] },
26
+ { names: ["pictures", "pictures-by", "language"] },
27
27
  ];
28
28
  /** The Settings section; with `several` player characters, what a value means says so where it speaks of one character (D-480 (2)). */
29
29
  export function SettingsView({ version, several = false }) {
@@ -159,8 +159,14 @@ function writtenLabel(setting, value) {
159
159
  const rate = setting === "between-sessions" ? rateParts(value) : undefined;
160
160
  return rate === undefined ? valueLabel(value) : t("{game} every {real}", rate);
161
161
  }
162
- /** What a value the page does not offer means: a rate of the time between sessions as the others say it, or that it reads as none (D-133); undefined for another setting's. */
162
+ /**
163
+ * What a value the page does not offer means: a rate of the time between sessions as the others say it, or that it reads as none (D-133); an image tool of
164
+ * the master's that makes the pictures (D-572); undefined for another setting's.
165
+ */
163
166
  function writtenMeans(setting, value) {
167
+ if (setting === "pictures-by") {
168
+ return t("the master makes them with {tool}", { tool: value });
169
+ }
164
170
  if (setting !== "between-sessions") {
165
171
  return undefined;
166
172
  }
@@ -299,9 +305,9 @@ function TextSetting({ setting, label, onChange }) {
299
305
  field.current?.focus();
300
306
  }, children: t("Clear") }))] })] }));
301
307
  }
302
- /** What the player should know of a setting on this computer, as how to have pictures: its lines, its steps in order, and the commands to copy. */
308
+ /** What the player should know of a setting on this computer, as how to have pictures: its lines, its steps in order, the commands to copy, and a line after. */
303
309
  function SettingNote({ note }) {
304
- const blocks = noteBlocks(t(note.text));
310
+ const blocks = [...noteBlocks(t(note.text, note.values)), ...(note.also === undefined ? [] : [t(note.also, note.values)])];
305
311
  return (_jsxs("div", { class: note.fix ? "setting-note fix" : "setting-note", children: [_jsx(Icon, { name: "info" }), _jsx("div", { class: "setting-note-text", children: blocks.map((block, index) => typeof block === "string" ? _jsx("p", { children: withCommands(block) }, index) : (_jsx("ol", { children: block.map((step) => _jsx("li", { children: withCommands(step) }, step)) }, index))) })] }));
306
312
  }
307
313
  /** A note's lines, those numbered as steps together. */
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
5
5
  import { useEffect, useRef, useState } from "preact/hooks";
6
6
  import { changeSetting, readSetup, sendSetupWord } from "../api.js";
7
7
  import { Icon } from "../parts/icons.js";
8
- import { phraseLabel, settingLabel, valueLabel } from "../parts/labels.js";
8
+ import { phraseLabel, settingLabel, systemNameLabel, valueLabel } from "../parts/labels.js";
9
9
  import { Master } from "../shell/master.js";
10
10
  import { arrowStep, t } from "../text.js";
11
11
  // The steps of a campaign before play (MOD-1).
@@ -71,7 +71,7 @@ function Question({ question, count, left, focus, onBack, onNext, onLeave, onTou
71
71
  const resting = useRef(undefined);
72
72
  const heading = useRef(null);
73
73
  const value = picked ?? question.value;
74
- const title = question.question === undefined ? settingLabel(question.name) : t(question.question);
74
+ const title = question.question === undefined ? settingLabel(question.name) : t(question.question, question.game === undefined ? {} : { game: systemNameLabel(question.game) });
75
75
  const id = `setup-${question.name.replace(/[^a-z0-9]+/gi, "-")}`;
76
76
  const isList = lists.has(question.name);
77
77
  const open = value === undefined && question.items === undefined && !left;
@@ -122,7 +122,9 @@ function Choices({ question, value, labelledBy, onPick }) {
122
122
  onPick(choices[next].value, true);
123
123
  buttons[next]?.focus();
124
124
  };
125
- return (_jsx("div", { class: "setup-choices", role: "radiogroup", "aria-labelledby": labelledBy, onKeyDown: move, children: choices.map((choice, index) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === choice.value, tabIndex: index === stop ? 0 : -1, class: "setup-choice", onClick: () => onPick(choice.value, false), children: [_jsxs("strong", { children: [choice.label === undefined ? valueLabel(choice.value) : phraseLabel(t(choice.label)), choice.value === question.suggested && _jsx("span", { class: "setup-suggested", children: choice.value === question.last ? t("Like last time") : t("Suggested") })] }), choice.means !== undefined && _jsx("span", { children: phraseLabel(t(choice.means)) })] }, choice.value))) }));
125
+ return (_jsx("div", { class: "setup-choices", role: "radiogroup", "aria-labelledby": labelledBy, onKeyDown: move, children: choices.map((choice, index) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === choice.value, tabIndex: index === stop ? 0 : -1, class: "setup-choice", onClick: () => onPick(choice.value, false), children: [_jsxs("strong", { children: [choice.label === undefined ? valueLabel(choice.value) : phraseLabel(t(choice.label)), choice.value === question.last
126
+ ? _jsx("span", { class: "setup-last", children: t("Like last time") })
127
+ : choice.value === question.suggested && _jsx("span", { class: "setup-suggested", children: t("Suggested") })] }), choice.means !== undefined && _jsx("span", { children: phraseLabel(t(choice.means)) })] }, choice.value))) }));
126
128
  }
127
129
  /** A list of the setup, lines or veils: its items to take off, a field to add one, and None for a player who wants none. */
128
130
  function ListQuestion({ question, onTouch, onProblem }) {
@@ -231,21 +231,24 @@ function ItemsTable({ group, fields }) {
231
231
  }
232
232
  const name = itemName(item.item);
233
233
  const bonds = (item.bonds ?? []).map((list) => fieldLabel(list, fields));
234
- const said = [
234
+ const parts = [
235
235
  item.inside === undefined ? undefined : t("in {container}", { container: itemName(item.inside) }),
236
236
  item.equipped === true ? t("Equipped") : undefined,
237
237
  ...bonds,
238
- ].filter((part) => part !== undefined).map((part) => `, ${part}`).join("");
238
+ ].filter((part) => part !== undefined);
239
+ const said = parts.map((part) => `, ${part}`).join("");
240
+ // What the thing's card says under its name: how many, where it is, whether equipped.
241
+ const facts = [...(count(item) === "" ? [] : [`×${count(item)}`]), ...parts];
239
242
  const words = (_jsxs(_Fragment, { children: [marked && _jsx(ItemPicture, { image: item.image, equipped: item.equipped === true }), _jsx("span", { children: name }), count(item) !== "" && _jsx("span", { class: "item-count", children: ` (${count(item)})` }), bonds.length > 0 && (_jsx("span", { class: "item-bond", "data-tip": bonds.join(", "), "aria-hidden": "true", children: _jsx(Icon, { name: "bond" }) })), said !== "" && _jsx("span", { class: "visually-hidden", children: said })] }));
240
243
  // The campaign changed its page of the game system (D-564): an asterisk after its name, outside what acts.
241
244
  const changed = item.layered === true && _jsx(ChangedMark, {});
242
- // The name acts, when the system names a verb for it; a container's opens and closes what it holds (D-495).
245
+ // The name opens the thing's card, with its verbs when the system names some; a container's opens and closes what it holds (D-495).
243
246
  const verbs = holds(index) ? undefined : itemVerbs(acts?.actions, item);
244
247
  return (_jsxs("tr", { class: item.depth === undefined ? undefined : "inside", children: [_jsxs("th", { scope: "row", class: holds(index) ? "holds" : undefined, style: item.depth === undefined ? undefined : { "--depth": item.depth }, children: [holds(index)
245
248
  ? (_jsxs("button", { type: "button", class: "fold", "aria-expanded": !closed.has(key(index)), onClick: () => toggle(index), children: [_jsx(Icon, { name: "fold" }), words] }))
246
- : verbs === undefined
249
+ : acts === undefined
247
250
  ? words
248
- : _jsx(ActName, { verbs: verbs, item: name, said: `${count(item) === "" ? "" : ` (${count(item)})`}${said}`, children: words }), changed] }), !carried && item.values.map((value) => _jsx("td", { class: widgetOf(value) === "text" ? undefined : "num", children: shownText(value.text, value.kind) }, value.field))] }, key(index)));
251
+ : (_jsx(ActName, { verbs: verbs ?? [], item: name, page: item.item, facts: facts, ...(item.document === true ? { document: true } : {}), said: `${count(item) === "" ? "" : ` (${count(item)})`}${said}`, children: words })), changed] }), !carried && item.values.map((value) => _jsx("td", { class: widgetOf(value) === "text" ? undefined : "num", children: shownText(value.text, value.kind) }, value.field))] }, key(index)));
249
252
  }) })] }));
250
253
  }
251
254
  /** A thing's picture, one colour as the words beside it, gold when equipped: the game's drawing of its kind as a mask, or the page's own of any thing. */