rpg-engine 0.20.0 → 0.21.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.
- package/dist/adventures/index.d.ts +1 -1
- package/dist/adventures/index.js +1 -1
- package/dist/adventures/source.d.ts +3 -0
- package/dist/adventures/source.js +11 -49
- package/dist/campaign/create-campaign.d.ts +1 -1
- package/dist/campaign/create-campaign.js +3 -2
- package/dist/campaign/find-campaign.d.ts +2 -0
- package/dist/campaign/find-campaign.js +2 -0
- package/dist/campaign/index.d.ts +1 -1
- package/dist/campaign/index.js +1 -1
- package/dist/campaign/settings.js +2 -2
- package/dist/commands/book.d.ts +16 -35
- package/dist/commands/book.js +86 -62
- package/dist/commands/config/config.js +1 -1
- package/dist/commands/config/dashboard.d.ts +2 -2
- package/dist/commands/config/dashboard.js +9 -3
- package/dist/commands/config/words.js +1 -1
- package/dist/commands/image.d.ts +5 -0
- package/dist/commands/image.js +6 -3
- package/dist/commands/package/data.d.ts +35 -0
- package/dist/commands/package/data.js +117 -0
- package/dist/commands/package/here.d.ts +7 -2
- package/dist/commands/package/here.js +23 -11
- package/dist/commands/package/install.js +14 -15
- package/dist/commands/package/language.d.ts +15 -0
- package/dist/commands/package/language.js +109 -0
- package/dist/commands/package/package.js +20 -10
- package/dist/commands/package/result.d.ts +19 -0
- package/dist/commands/package/theme.d.ts +13 -0
- package/dist/commands/package/theme.js +66 -0
- package/dist/commands/package/uninstall.d.ts +4 -1
- package/dist/commands/package/uninstall.js +29 -9
- package/dist/commands/scene/close.d.ts +1 -1
- package/dist/commands/scene/close.js +15 -8
- package/dist/commands/shared/books/adventures.d.ts +0 -4
- package/dist/commands/shared/books/adventures.js +2 -31
- package/dist/commands/shared/books/words.js +3 -2
- package/dist/commands/shared/campaign/book.d.ts +21 -8
- package/dist/commands/shared/campaign/book.js +65 -42
- package/dist/commands/shared/campaign/saves.js +2 -2
- package/dist/commands/shared/campaign/world.js +2 -1
- package/dist/commands/shared/packages/catalog.d.ts +3 -3
- package/dist/commands/shared/packages/catalog.js +98 -42
- package/dist/commands/shared/packages/unpacked.d.ts +50 -0
- package/dist/commands/shared/packages/unpacked.js +146 -0
- package/dist/core/archive.d.ts +13 -0
- package/dist/core/archive.js +76 -0
- package/dist/core/context.d.ts +2 -0
- package/dist/core/context.js +1 -0
- package/dist/core/store.d.ts +5 -1
- package/dist/core/store.js +15 -2
- package/dist/dashboard/api.js +24 -1
- package/dist/dashboard/app.js +7 -2
- package/dist/dashboard/guide/ar.md +8 -8
- package/dist/dashboard/guide/cs.md +8 -8
- package/dist/dashboard/guide/da.md +9 -9
- package/dist/dashboard/guide/de.md +8 -8
- package/dist/dashboard/guide/el.md +8 -8
- package/dist/dashboard/guide/en.md +7 -7
- package/dist/dashboard/guide/es.md +8 -8
- package/dist/dashboard/guide/fi.md +8 -8
- package/dist/dashboard/guide/fr.md +8 -8
- package/dist/dashboard/guide/he.md +8 -8
- package/dist/dashboard/guide/hi.md +8 -8
- package/dist/dashboard/guide/hu.md +8 -8
- package/dist/dashboard/guide/is.md +8 -8
- package/dist/dashboard/guide/it.md +8 -8
- package/dist/dashboard/guide/ja.md +8 -8
- package/dist/dashboard/guide/ko.md +8 -8
- package/dist/dashboard/guide/nb.md +9 -9
- package/dist/dashboard/guide/nl.md +8 -8
- package/dist/dashboard/guide/pl.md +8 -8
- package/dist/dashboard/guide/pt.md +8 -8
- package/dist/dashboard/guide/ro.md +8 -8
- package/dist/dashboard/guide/ru.md +9 -9
- package/dist/dashboard/guide/sv.md +8 -8
- package/dist/dashboard/guide/tr.md +8 -8
- package/dist/dashboard/guide/uk.md +9 -9
- package/dist/dashboard/guide/zh.md +8 -8
- package/dist/dashboard/i18n/ar.json +33 -5
- package/dist/dashboard/i18n/cs.json +33 -5
- package/dist/dashboard/i18n/da.json +33 -5
- package/dist/dashboard/i18n/de.json +33 -5
- package/dist/dashboard/i18n/el.json +33 -5
- package/dist/dashboard/i18n/es.json +33 -5
- package/dist/dashboard/i18n/fi.json +33 -5
- package/dist/dashboard/i18n/fr.json +33 -5
- package/dist/dashboard/i18n/he.json +33 -5
- package/dist/dashboard/i18n/hi.json +33 -5
- package/dist/dashboard/i18n/hu.json +33 -5
- package/dist/dashboard/i18n/is.json +33 -5
- package/dist/dashboard/i18n/it.json +33 -5
- package/dist/dashboard/i18n/ja.json +33 -5
- package/dist/dashboard/i18n/ko.json +33 -5
- package/dist/dashboard/i18n/nb.json +33 -5
- package/dist/dashboard/i18n/nl.json +33 -5
- package/dist/dashboard/i18n/pl.json +33 -5
- package/dist/dashboard/i18n/pt.json +33 -5
- package/dist/dashboard/i18n/ro.json +33 -5
- package/dist/dashboard/i18n/ru.json +33 -5
- package/dist/dashboard/i18n/sv.json +33 -5
- package/dist/dashboard/i18n/tr.json +33 -5
- package/dist/dashboard/i18n/uk.json +33 -5
- package/dist/dashboard/i18n/zh.json +33 -5
- package/dist/dashboard/journal/book.js +3 -2
- package/dist/dashboard/journal/journal.js +8 -5
- package/dist/dashboard/kit.js +1 -1
- package/dist/dashboard/packages/catalog.js +31 -14
- package/dist/dashboard/packages/engine.js +46 -2
- package/dist/dashboard/packages/installed.js +13 -0
- package/dist/dashboard/packages/outcomes.js +21 -0
- package/dist/dashboard/packages/packages.js +41 -18
- package/dist/dashboard/packages/rows.js +3 -1
- package/dist/dashboard/parts/icons.js +3 -0
- package/dist/dashboard/parts/picture.js +89 -0
- package/dist/dashboard/parts/refusals.js +8 -1
- package/dist/dashboard/parts/widgets.js +2 -1
- package/dist/dashboard/play/scene.js +8 -5
- package/dist/dashboard/settings/settings.js +23 -13
- package/dist/dashboard/sheet/party.js +5 -2
- package/dist/dashboard/sheet/sheet.js +2 -1
- package/dist/dashboard/shell/notices.js +2 -2
- package/dist/dashboard/shell/system-style.js +45 -12
- package/dist/dashboard/shell/tooltip.js +223 -0
- package/dist/dashboard/style.css +283 -132
- package/dist/dashboard/world/lore.js +4 -3
- package/dist/dashboard/world/place-card.js +2 -1
- package/dist/languages/index.d.ts +1 -1
- package/dist/languages/index.js +1 -1
- package/dist/languages/pack.d.ts +4 -1
- package/dist/languages/pack.js +16 -5
- package/dist/packages/engine.d.ts +7 -0
- package/dist/packages/engine.js +32 -1
- package/dist/packages/index.d.ts +1 -1
- package/dist/packages/index.js +1 -1
- package/dist/server/dashboard/engine.d.ts +18 -0
- package/dist/server/dashboard/engine.js +31 -0
- package/dist/server/dashboard/files.d.ts +8 -1
- package/dist/server/dashboard/files.js +30 -10
- package/dist/server/dashboard/index.d.ts +3 -0
- package/dist/server/dashboard/index.js +10 -1
- package/dist/server/dashboard/pictures.d.ts +7 -0
- package/dist/server/dashboard/pictures.js +62 -0
- package/dist/server/dashboard/writes.d.ts +5 -3
- package/dist/server/dashboard/writes.js +45 -14
- package/dist/testing/index.js +1 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +4 -2
- package/dist/themes/installed.d.ts +14 -0
- package/dist/themes/installed.js +28 -0
- package/dist/themes/theme.d.ts +7 -0
- package/dist/themes/theme.js +22 -0
- package/instructions/core.md +3 -3
- package/instructions/dashboard-guide.md +1 -0
- package/instructions/mentor-hints.md +1 -1
- package/instructions/mentor-tutorial.md +1 -1
- package/instructions/party.md +1 -1
- package/instructions/play.md +2 -2
- package/package.json +1 -1
- package/systems/free/instructions/outcomes-told.md +1 -1
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"{name} {version} needs a newer RPG Engine: update it in Installed.": "{name} {version} 需要更新版本的 RPG Engine,请在“已安装”中更新。",
|
|
42
42
|
"{name} {version} was made for an older RPG Engine: look for a newer version of it.": "{name} {version} 是为旧版 RPG Engine 制作的,请找一个更新的版本。",
|
|
43
43
|
"{name} brings changes to the game system that cannot be used as they are written: whoever made it has to fix them.": "{name} 带来的游戏系统修改无法按现有写法使用,需要由作者修正。",
|
|
44
|
+
"{name} cannot be used, and is not on this computer: {why}": "{name} 无法使用,也不在这台电脑上:{why}",
|
|
44
45
|
"{name} cannot be used, and version {version} stays: {why}": "{name} 无法使用,将保留 {version} 版:{why}",
|
|
45
|
-
"{name} cannot be used, and was taken off this computer: {why}": "{name} 无法使用,已从这台电脑上移除:{why}",
|
|
46
46
|
"{name} changes something of the game system that is in the scene being played: try again once the scene is over.": "{name} 修改了当前场景中正在使用的游戏系统内容,请在场景结束后再试。",
|
|
47
47
|
"{name} does not read: it is not a package's .zip or .tgz.": "无法读取 {name},它不是包的 .zip 或 .tgz 文件。",
|
|
48
48
|
"{name} found out": "{name}发现了",
|
|
@@ -60,7 +60,10 @@
|
|
|
60
60
|
"{name} is neither a .zip nor a .tgz.": "{name} 既不是 .zip 也不是 .tgz 文件。",
|
|
61
61
|
"{name} is no book RPG Engine reads: give a {kinds} file, or a folder of them.": "RPG Engine 无法读取 {name},请提供 {kinds} 文件,或包含这些文件的文件夹。",
|
|
62
62
|
"{name} is no full path: write it from its drive or its root.": "{name} 不是完整路径,请从盘符或根目录开始写。",
|
|
63
|
+
"{name} is no package: it has no adventure.yaml, theme.yaml or language.yaml at its top. A document is imported by the master.": "{name} 不是包:其顶层没有 adventure.yaml、theme.yaml 或 language.yaml。文档需由主持人导入。",
|
|
64
|
+
"{name} is no theme the page can use: {why}": "{name} 不是页面可用的主题:{why}",
|
|
63
65
|
"{name} is not a package for RPG Engine.": "{name} 不是 RPG Engine 的包。",
|
|
66
|
+
"{name} is not a PNG, JPEG, WebP or SVG picture.": "{name} 不是 PNG、JPEG、WebP 或 SVG 图片。",
|
|
64
67
|
"{name} is not an adventure: it has no adventure.yaml at its top. A document is imported by the master.": "{name} 不是冒险:顶层没有 adventure.yaml。文档需要由主持人导入。",
|
|
65
68
|
"{name} is not on this computer.": "这台电脑上没有 {name}。",
|
|
66
69
|
"{name} is not the name of an npm package.": "{name} 不是有效的 npm 包名。",
|
|
@@ -83,6 +86,8 @@
|
|
|
83
86
|
"{name}'s turn": "{name}的回合",
|
|
84
87
|
"{names} found out": "{names}发现了",
|
|
85
88
|
"{number} of {count}": "第 {number} 章,共 {count} 章",
|
|
89
|
+
"{page} comes from the game system, with its own picture.": "{page} 来自游戏系统,自带图片。",
|
|
90
|
+
"{page} has your picture now.": "{page} 已换上你的图片。",
|
|
86
91
|
"{page} is no longer changed in this campaign: there is nothing to put back.": "{page} 在本战役中已没有修改,无需恢复。",
|
|
87
92
|
"{path}: in this campaign": "{path}:用于本战役",
|
|
88
93
|
"{place}, on {map}": "{map}上的{place}",
|
|
@@ -148,6 +153,8 @@
|
|
|
148
153
|
"Add a coin": "加一枚硬币",
|
|
149
154
|
"Add a coin: {count} chosen": "加一枚硬币:已选 {count} 枚",
|
|
150
155
|
"add a die to the die {condition}": "{condition}时给该骰子追加一次掷骰",
|
|
156
|
+
"Add a picture: {page}": "添加图片:{page}",
|
|
157
|
+
"Add a picture…": "添加图片…",
|
|
151
158
|
"Add to {setting}": "添加到{setting}",
|
|
152
159
|
"Add what you know, e.g. Initiative": "添加你已了解的,例如先攻",
|
|
153
160
|
"Add, e.g. leave one alive": "添加,例如:留一个活口",
|
|
@@ -244,6 +251,8 @@
|
|
|
244
251
|
"challenge": "挑战",
|
|
245
252
|
"Change it in Settings.": "可在设置中更改。",
|
|
246
253
|
"Change the campaign's name": "修改战役名称",
|
|
254
|
+
"Change the picture: {page}": "更换图片:{page}",
|
|
255
|
+
"Change the picture…": "更换图片…",
|
|
247
256
|
"Change the rules": "更改规则",
|
|
248
257
|
"Change what you sent": "修改已发送的内容",
|
|
249
258
|
"Changed in this campaign": "本战役中已修改",
|
|
@@ -454,11 +463,12 @@
|
|
|
454
463
|
"held: {count}": "待定:{count}",
|
|
455
464
|
"Help": "帮助",
|
|
456
465
|
"Here": "此处",
|
|
457
|
-
"Here the master writes the story as a book: a chapter
|
|
466
|
+
"Here the master writes the story as a book: a chapter each time the story turns.": "主持人会把故事写成一本书:故事每有转折,就添一章。",
|
|
458
467
|
"hidden": "隐藏",
|
|
459
468
|
"Hidden": "隐藏",
|
|
460
469
|
"hidden: the master tells you only what comes of them": "隐藏:主持人只告诉你结果",
|
|
461
470
|
"Hide the panel": "隐藏面板",
|
|
471
|
+
"Hide until the next version": "下个版本前不再提示",
|
|
462
472
|
"High": "最高",
|
|
463
473
|
"highest of {count}": "{count}个中取最高",
|
|
464
474
|
"Hills": "丘陵",
|
|
@@ -529,17 +539,20 @@
|
|
|
529
539
|
"it asks for a password to open: save a copy without one.": "打开需要密码:请另存一份无密码的副本。",
|
|
530
540
|
"It asks whether code that RPG Engine did not publish may run here. Can't see it? It is behind the browser.": "它会询问是否允许运行并非 RPG Engine 发布的代码。看不到窗口?它在浏览器后面。",
|
|
531
541
|
"It asks whether RPG Engine may read the documents of that folder. Can't see it? It is behind the browser.": "它会询问 RPG Engine 是否可以读取该文件夹中的文档。没看到?它在浏览器后面。",
|
|
542
|
+
"It asks whether to update RPG Engine on this computer. Can't see it? It is behind the browser.": "窗口会询问是否在这台电脑上更新 RPG Engine。没看到?它可能在浏览器后面。",
|
|
532
543
|
"It can be put back once the scene being played is over.": "当前场景结束后即可恢复。",
|
|
533
544
|
"It cannot be undone from this page: ask the master to write it again.": "在此页面无法撤销,请让主持人重新写入。",
|
|
534
545
|
"It did not reach the game: try again.": "没有发送到游戏:请重试。",
|
|
546
|
+
"It does not pass the page's checks: Settings does not offer it.": "它未通过页面的检查,设置中不会提供。",
|
|
535
547
|
"It does not read: install it again.": "无法读取:请重新安装。",
|
|
536
548
|
"it does not read: the file is damaged, or is not what its name says.": "无法读取:文件已损坏,或与文件名不符。",
|
|
537
549
|
"It goes off this computer, and out of this campaign. Another campaign that uses it asks to install it again.": "它会从本机和本战役中移除。其他使用它的战役会提示你重新安装。",
|
|
538
550
|
"It goes off this computer: a new campaign can no longer choose it. This campaign does not change.": "它将从本机移除:新战役将无法再选择它。本战役不受影响。",
|
|
539
551
|
"It goes off this computer: the dashboard goes back to its own words in this language.": "它将从本机移除:面板会恢复该语言的原有文字。",
|
|
552
|
+
"It goes off this computer: where you chose it, the page goes back to the game's style, or its own.": "它会从这台电脑上移除:你选用它的地方,页面将恢复为游戏的风格或页面自带的风格。",
|
|
540
553
|
"it is locked by DRM, which RPG Engine never opens.": "文件受 DRM 保护,RPG Engine 无法打开。",
|
|
541
554
|
"it stopped the reader twice: too big or damaged, or kept busy by another program. Close that program, or save the file again.": "读取器两次中断:文件太大或已损坏,或被其他程序占用。请关闭该程序,或重新保存文件。",
|
|
542
|
-
"It tells the kind by itself: a game system, an adventure, an extension or a language. A file is a .zip or a .tgz.": "
|
|
555
|
+
"It tells the kind by itself: a game system, an adventure, an extension, a theme or a language. A file is a .zip or a .tgz.": "类型会自动识别:游戏系统、冒险、扩展、主题或语言。文件为 .zip 或 .tgz。",
|
|
543
556
|
"It's {name}'s turn": "轮到{name}",
|
|
544
557
|
"It's the turn of": "轮到",
|
|
545
558
|
"Item": "物品",
|
|
@@ -657,10 +670,12 @@
|
|
|
657
670
|
"No scene of the story on this day.": "这一天没有故事场景。",
|
|
658
671
|
"No set end": "无固定终点",
|
|
659
672
|
"No window for your yes opens on this computer: add it from your terminal, in the campaign's folder.": "这台电脑上无法打开确认窗口:请在战役文件夹中通过终端添加。",
|
|
673
|
+
"No window for your yes opens on this computer: update RPG Engine from a terminal.": "这台电脑无法弹出确认窗口,请在终端中更新 RPG Engine。",
|
|
660
674
|
"None": "无",
|
|
661
675
|
"None open now.": "目前没有未完成的。",
|
|
662
676
|
"None yet: add one in Add, from the catalog, a .zip or a link.": "暂无:在“添加”中从目录、.zip 文件或链接添加。",
|
|
663
677
|
"None yet: add the folder of your manuals.": "还没有:添加你的规则书文件夹吧。",
|
|
678
|
+
"None: a theme changes the page's colours, faces and pictures, in every campaign; you find them in Add, in the catalog.": "暂无:主题会改变页面的颜色、字体和图片,适用于所有战役;可在“添加”的目录中找到。",
|
|
664
679
|
"None: an extension adds rules and tools to the game; you find them in Add, in the catalog.": "暂无:扩展可为游戏增添规则和工具,你可以在“添加”的目录中找到。",
|
|
665
680
|
"None: nothing kept out.": "无:不排除任何内容。",
|
|
666
681
|
"None. The dashboard has its own languages; a language package takes the place of one with a translation made by hand.": "暂无。面板自带多种语言;语言包可替换其中一种,用手工翻译取代原有译文。",
|
|
@@ -726,7 +741,7 @@
|
|
|
726
741
|
"One package at a time: wait for the one under way, then try again.": "一次只能处理一个包:请等当前的完成后再试。",
|
|
727
742
|
"Only the highest {die} counts": "只计最高的{die}",
|
|
728
743
|
"Only the lowest {die} counts": "只计最低的{die}",
|
|
729
|
-
"only the story; ask in
|
|
744
|
+
"only the story; ask in [OOC: …] whenever you want": "只讲故事;想提问时随时用 [OOC: …]",
|
|
730
745
|
"only when all is lost: back to the end of the last scene": "仅在全盘皆输时使用:回到上一个场景的结尾",
|
|
731
746
|
"only when the story turns on them": "仅当故事取决于它们时",
|
|
732
747
|
"Onyx": "缟玛瑙",
|
|
@@ -832,6 +847,7 @@
|
|
|
832
847
|
"Rounded": "圆润",
|
|
833
848
|
"RPG Engine {version} is installed already: it comes with a new chat.": "RPG Engine {version} 已安装,新开聊天后生效。",
|
|
834
849
|
"RPG Engine {version} is installed.": "RPG Engine {version} 已安装。",
|
|
850
|
+
"RPG Engine {version} is out.": "RPG Engine {version} 已发布。",
|
|
835
851
|
"RPG Engine {version} is the latest: there is nothing to update.": "RPG Engine {version} 已是最新版本,无需更新。",
|
|
836
852
|
"RPG Engine cannot use {name}, and took it off this computer again.": "RPG Engine 无法使用 {name},已将它从这台电脑上移除。",
|
|
837
853
|
"RPG Engine was not updated.": "RPG Engine 未更新。",
|
|
@@ -850,6 +866,7 @@
|
|
|
850
866
|
"Saved.": "已存档。",
|
|
851
867
|
"Saves": "存档",
|
|
852
868
|
"Scene": "场景",
|
|
869
|
+
"Scene {number}": "场景 {number}",
|
|
853
870
|
"Scroll": "卷轴",
|
|
854
871
|
"Search": "搜索",
|
|
855
872
|
"Search a language…": "搜索语言…",
|
|
@@ -862,6 +879,7 @@
|
|
|
862
879
|
"See RPG Engine": "查看 RPG Engine",
|
|
863
880
|
"Send": "发送",
|
|
864
881
|
"Send to the master": "发送给主持人",
|
|
882
|
+
"Sending…": "正在发送…",
|
|
865
883
|
"Sent to the master: they write it in your page once you agree in the chat.": "已发送给主持人:在聊天中商定后,主持人会把它写进你的页面。",
|
|
866
884
|
"Session zero": "零号团",
|
|
867
885
|
"Setting up {campaign}": "正在准备{campaign}",
|
|
@@ -963,7 +981,7 @@
|
|
|
963
981
|
"The campaign starts over.": "战役重新开始。",
|
|
964
982
|
"The campaign's name": "战役名称",
|
|
965
983
|
"The catalog does not answer.": "目录没有响应。",
|
|
966
|
-
"The catalog's adventures come from GitHub: a .zip or a link can be added all the same.": "
|
|
984
|
+
"The catalog's adventures and themes come from GitHub: a .zip or a link can be added all the same.": "目录中的冒险和主题来自 GitHub,也可以通过 .zip 或链接添加。",
|
|
967
985
|
"The change did not reach the game: try again.": "更改没有发送到游戏:请重试。",
|
|
968
986
|
"The checks the master asks of you come here, and the master's rolls you may see.": "主持人要你做的检定会出现在这里,你能看到的主持人掷骰也在这里。",
|
|
969
987
|
"The choices": "选择",
|
|
@@ -971,6 +989,8 @@
|
|
|
971
989
|
"The code of {name} does not work: {why}": "{name} 的代码无法运行:{why}",
|
|
972
990
|
"the colours, faces and pictures of {name}, from the game system": "{name}的颜色、字体和图片,来自游戏系统",
|
|
973
991
|
"the colours, faces and pictures of the game system": "游戏系统的颜色、字体和图片",
|
|
992
|
+
"the colours, faces and pictures: a theme you installed, or the page's own": "颜色、字体和图片:你安装的主题,或页面自带的",
|
|
993
|
+
"the colours, faces and pictures: the game system's, a theme you installed, or the page's own": "颜色、字体和图片:游戏系统的、你安装的主题,或页面自带的",
|
|
974
994
|
"the column": "侧栏",
|
|
975
995
|
"The dashboard of the campaign, beside the chat where you play.": "战役仪表盘,就在你游玩的聊天旁边。",
|
|
976
996
|
"The day's upkeep": "每日消耗",
|
|
@@ -1046,6 +1066,7 @@
|
|
|
1046
1066
|
"the page's look": "页面外观",
|
|
1047
1067
|
"The pages this option names": "此选项所指的页面",
|
|
1048
1068
|
"The party is in no place the character knows, as on a road between two.": "队伍不在角色所知的任何地点,比如在两地之间的路上。",
|
|
1069
|
+
"The picture is more than {size} MB: make it smaller.": "图片超过 {size} MB,请压缩后再试。",
|
|
1049
1070
|
"the pictures of places, quests and those you meet, made on this computer": "在这台电脑上生成的地点、任务和所遇之人的图片",
|
|
1050
1071
|
"the pictures on your coins, heads first": "硬币上的图案,先正面后反面",
|
|
1051
1072
|
"The players' roll:": "玩家的掷骰:",
|
|
@@ -1061,7 +1082,9 @@
|
|
|
1061
1082
|
"The story starts on day {day}": "故事始于第{day}天",
|
|
1062
1083
|
"The story starts on day {day}, {time}": "故事始于第{day}天{time}",
|
|
1063
1084
|
"The story starts with the first scene.": "故事从第一个场景开始。",
|
|
1085
|
+
"the style of this page": "本页面的风格",
|
|
1064
1086
|
"The text above lies behind the master's screen, forbidden to the players' eyes.": "以上文字位于主持人的屏风之后,玩家不得窥视。",
|
|
1087
|
+
"The theme is on this computer, for every campaign: choose it in Settings, under Game style.": "主题已存放在这台电脑上,适用于所有战役:请在“设置”的“游戏风格”中选择。",
|
|
1065
1088
|
"The title of the note {title}": "笔记“{title}”的标题",
|
|
1066
1089
|
"the top bar": "顶栏",
|
|
1067
1090
|
"the units of the story": "故事使用的单位",
|
|
@@ -1070,6 +1093,7 @@
|
|
|
1070
1093
|
"The world as it was at the start, without the player characters: a .zip to give to others.": "开局时的世界,不含玩家角色:一个可分享给他人的 .zip 文件。",
|
|
1071
1094
|
"the world waits for you: the story picks up at the moment you left it": "世界会等你:故事从你离开的那一刻继续",
|
|
1072
1095
|
"Theme": "主题",
|
|
1096
|
+
"Themes": "主题",
|
|
1073
1097
|
"There is already a game system called {system} on this computer: {name} would take its name.": "这台电脑上已有名为 {system} 的游戏系统,{name} 会占用它的名称。",
|
|
1074
1098
|
"There is no {name} on this computer: give its full path.": "这台电脑上没有 {name},请输入完整路径。",
|
|
1075
1099
|
"There is no player character yet: the map starts with one.": "还没有角色:有了角色,地图才会开始。",
|
|
@@ -1136,6 +1160,7 @@
|
|
|
1136
1160
|
"Up to date": "已是最新",
|
|
1137
1161
|
"Update": "更新",
|
|
1138
1162
|
"Update {name} to {version}": "将 {name} 更新到 {version}",
|
|
1163
|
+
"Update it in Packages": "前往“包”更新",
|
|
1139
1164
|
"Update RPG Engine first": "先更新 RPG Engine",
|
|
1140
1165
|
"Updating RPG Engine…": "正在更新 RPG Engine…",
|
|
1141
1166
|
"Updating…": "正在更新…",
|
|
@@ -1215,9 +1240,11 @@
|
|
|
1215
1240
|
"Wry": "戏谑",
|
|
1216
1241
|
"You": "你",
|
|
1217
1242
|
"you bring one you already have, as a sheet, a file or a description, at its level": "带上你已有的角色,可以是角色卡、文件或描述,沿用其等级",
|
|
1243
|
+
"You can also give a page you see a picture of your own: with its picture button, or dropped in the campaign's inbox folder for the master.": "你也可以为看到的页面设置自己的图片:点击页面的图片按钮,或者把图片放进战役的 inbox 文件夹,交给主持人。",
|
|
1218
1244
|
"You can also tell the master in the chat: they hear what you choose here.": "你也可以在聊天中告诉主持人:你在这里的选择,主持人也会收到。",
|
|
1219
1245
|
"You can go to another page: it goes on by itself.": "你可以前往其他页面,它会自动继续。",
|
|
1220
1246
|
"You carry it": "你带着它",
|
|
1247
|
+
"You choose one in Settings, under Game style.": "请在“设置”的“游戏风格”中选择。",
|
|
1221
1248
|
"You chose {most}: take one off to choose another.": "你已选了 {most} 项:取消一项后才能再选其他的。",
|
|
1222
1249
|
"You decide": "你来定",
|
|
1223
1250
|
"you find the row on your sheet, or roll from the tray, as at the table": "你可以在角色卡上找到对应的一行,或从骰盘掷骰,就像在牌桌上一样",
|
|
@@ -1241,6 +1268,7 @@
|
|
|
1241
1268
|
"Your character has no document called “{name}”.": "你的角色没有名为“{name}”的文档。",
|
|
1242
1269
|
"Your character knows its name, and nothing more yet.": "你的角色只知道它的名字,其他暂时一无所知。",
|
|
1243
1270
|
"Your character knows no one and nothing yet: whom they meet and what they learn comes here, as the master writes it.": "你的角色还不认识任何人,也一无所知。随着主持人的叙述,遇到的人和得知的事都会记录在这里。",
|
|
1271
|
+
"Your character knows no page called {page}: reload the page.": "你的角色没有名为 {page} 的页面,请刷新页面。",
|
|
1244
1272
|
"Your character knows no place on the map yet: it grows as the master writes where places are.": "你的角色还不知道地图上的任何地点:随着主持人写下各地点的位置,地图会逐渐丰富。",
|
|
1245
1273
|
"Your character knows nothing called “{name}”.": "你的角色不知道任何叫“{name}”的事物。",
|
|
1246
1274
|
"your character never dies": "你的角色永不死亡",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
|
2
|
+
// The story told as a book (T-227): the master's prose, a chapter each time the story turns, set as a book's pages: one chapter at a time on paper, its paragraphs
|
|
3
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
4
|
// web page that prints as the book.
|
|
5
5
|
import { render } from "preact";
|
|
@@ -35,7 +35,7 @@ export function Book({ chapters, asked, campaign }) {
|
|
|
35
35
|
}
|
|
36
36
|
}, [asked]);
|
|
37
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
|
|
38
|
+
return (_jsxs("div", { class: "book-empty", children: [_jsx("p", { children: t("Here the master writes the story as a book: a chapter each time the story turns.") }), _jsx("p", { children: t("In a campaign begun before, ask the master to write the story so far.") })] }));
|
|
39
39
|
}
|
|
40
40
|
const last = chapters[chapters.length - 1];
|
|
41
41
|
const current = chapters.find((chapter) => String(chapter.number) === asked) ?? last;
|
|
@@ -87,6 +87,7 @@ h2 { text-align: center; font-weight: normal; font-size: 1.6rem; margin: .3rem 0
|
|
|
87
87
|
.book-text p { margin: 0; text-indent: 1.5em; text-align: justify; hyphens: auto; text-wrap: pretty; orphans: 2; widows: 2; }
|
|
88
88
|
.book-text p:first-child, .book-text .book-break + p { text-indent: 0; }
|
|
89
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
|
+
@supports (initial-letter: 3) { .book-text p:first-child:not(:lang(ar), :lang(hi), :lang(ja), :lang(zh), :lang(ko))::first-letter { float: none; margin-inline-end: .22em; padding: 0; font-size: 1em; line-height: inherit; initial-letter: 3; } }
|
|
90
91
|
.book-text .book-break { text-align: center; text-indent: 0; margin: .8rem 0; }
|
|
91
92
|
@media (max-width: 30rem) { body { padding: 2rem 1.25rem; } .book-text p { text-align: start; } }
|
|
92
93
|
@media print { body { background: none; padding: 0; } .chapter { break-before: page; } h1 + .chapter { break-before: auto; } }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
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 told as a book; its timeline by scenes,
|
|
4
|
+
// small beside the page, or in Scene and Combat on a narrow screen; the story told as a book; its timeline by scenes, numbered, 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";
|
|
@@ -14,6 +14,7 @@ import { fieldLabel, phraseLabel, sceneTypeLabel } from "../parts/labels.js";
|
|
|
14
14
|
import { endedQuests, followedQuests, keptFollowed } from "../parts/layout.js";
|
|
15
15
|
import { placeKinds } from "../parts/map-symbols.js";
|
|
16
16
|
import { knowersOf, Markdown } from "../parts/markdown.js";
|
|
17
|
+
import { PictureButton } from "../parts/picture.js";
|
|
17
18
|
import { PageHead } from "../shell/pages.js";
|
|
18
19
|
import { useChoice, useKeptText } from "../shell/prefs.js";
|
|
19
20
|
import { PageTabs } from "../shell/tabs.js";
|
|
@@ -164,7 +165,7 @@ function QuestCard({ quest, followed, onFollow }) {
|
|
|
164
165
|
quest.place === undefined ? undefined : t("at {place}", { place: quest.place }),
|
|
165
166
|
quest.deadline === undefined ? undefined : byDateLabel(quest.deadline.date),
|
|
166
167
|
].filter((part) => part !== undefined);
|
|
167
|
-
return (_jsxs("article", { class: ["quest-card", quest.main ? "main" : "", quest.status].filter((name) => name !== "").join(" "), "aria-labelledby": id, children: [_jsxs("header", { class: "quest-cover", children: [_jsx(QuestFace, { quest: quest }), _jsxs("div", { class: "quest-cover-top", children: [open && (_jsx("button", { type: "button", class: followed ? "followed-star on" : "followed-star", "aria-pressed": followed, "aria-label": t("Follow {quest}", { quest: quest.name }), "data-tip": t("Follow {quest}", { quest: quest.name }), onClick: () => onFollow(quest.name, !followed), children: _jsx(Star, {}) })), open && quest.deadline !== undefined && _jsx(Deadline, { deadline: quest.deadline }), quest.main && _jsx("span", { class: "quest-badge", children: t("Main") })] }), _jsx("h4", { class: "quest-name", id: id, title: quest.name, children: quest.name })] }), from.length > 0 && _jsx("p", { class: "quest-from", children: from.join(" · ") }), quest.text !== "" && (_jsx("div", { class: "quest-text", children: _jsx(Markdown, { text: quest.text, secretKnowers: knowersOf(quest.knownBy) }) })), quest.goals.length > 0 && _jsx(Goals, { quest: quest }), (quest.counters.length > 0 || quest.clock !== undefined) && (_jsxs("div", { class: "quest-measures", children: [quest.counters.map((counter) => _jsx(QuestBar, { counter: counter }, counter.field)), quest.clock !== undefined && (_jsxs("span", { class: "quest-clock", children: [_jsx(ClockFace, { clock: quest.clock, hidden: true }), _jsxs("span", { children: [quest.clock.name ?? t("Clock"), " ", quest.clock.value, "/", quest.clock.max] })] }))] }))] }));
|
|
168
|
+
return (_jsxs("article", { class: ["quest-card", quest.main ? "main" : "", quest.status].filter((name) => name !== "").join(" "), "aria-labelledby": id, children: [_jsxs("header", { class: "quest-cover picture-host", children: [_jsx(QuestFace, { quest: quest }), _jsxs("div", { class: "quest-cover-top", children: [open && (_jsx("button", { type: "button", class: followed ? "followed-star on" : "followed-star", "aria-pressed": followed, "aria-label": t("Follow {quest}", { quest: quest.name }), "data-tip": t("Follow {quest}", { quest: quest.name }), onClick: () => onFollow(quest.name, !followed), children: _jsx(Star, {}) })), open && quest.deadline !== undefined && _jsx(Deadline, { deadline: quest.deadline }), quest.main && _jsx("span", { class: "quest-badge", children: t("Main") })] }), _jsx("h4", { class: "quest-name", id: id, title: quest.name, children: quest.name }), _jsx(PictureButton, { page: quest.name, has: quest.picture !== undefined, icon: true })] }), from.length > 0 && _jsx("p", { class: "quest-from", children: from.join(" · ") }), quest.text !== "" && (_jsx("div", { class: "quest-text", children: _jsx(Markdown, { text: quest.text, secretKnowers: knowersOf(quest.knownBy) }) })), quest.goals.length > 0 && _jsx(Goals, { quest: quest }), (quest.counters.length > 0 || quest.clock !== undefined) && (_jsxs("div", { class: "quest-measures", children: [quest.counters.map((counter) => _jsx(QuestBar, { counter: counter }, counter.field)), quest.clock !== undefined && (_jsxs("span", { class: "quest-clock", children: [_jsx(ClockFace, { clock: quest.clock, hidden: true }), _jsxs("span", { children: [quest.clock.name ?? t("Clock"), " ", quest.clock.value, "/", quest.clock.max] })] }))] }))] }));
|
|
168
169
|
}
|
|
169
170
|
// The mark of a quest whose place has no kind the map draws: a flag.
|
|
170
171
|
const questFlag = "M6 21V3.5 M6 4.5h11l-2.6 4 2.6 4H6";
|
|
@@ -208,7 +209,9 @@ export function Deadline({ deadline }) {
|
|
|
208
209
|
const text = minutes === undefined ? byDateLabel(deadline.date) : minutes <= 0 ? t("Time is up") : durationText(minutes);
|
|
209
210
|
// Its word apart, which the followed quest's strip leaves to a screen reader on a phone.
|
|
210
211
|
const left = minutes !== undefined && minutes > 0;
|
|
211
|
-
|
|
212
|
+
const by = phraseLabel(byDateLabel(deadline.date));
|
|
213
|
+
// Its date in its tip, and for a screen reader before the time left, as the tip is for the eye (T-228).
|
|
214
|
+
return (_jsxs("span", { class: near ? "quest-deadline near" : "quest-deadline", "data-tip": by, children: [minutes !== undefined && _jsx("span", { class: "visually-hidden", children: by }), _jsx(Icon, { name: "hourglass" }), _jsxs("span", { children: [text, left && _jsx("span", { class: "quest-deadline-left", children: ` ${t("left")}` })] })] }));
|
|
212
215
|
}
|
|
213
216
|
/** The story by its scenes, the last first: each with its place and date, its summary, and what the diary tells of it, folded. */
|
|
214
217
|
function Timeline({ chapters, now }) {
|
|
@@ -217,7 +220,7 @@ function Timeline({ chapters, now }) {
|
|
|
217
220
|
}
|
|
218
221
|
return (_jsxs("ol", { class: "story", children: [_jsxs("li", { class: "eyebrow story-mark now", children: [_jsx("b", { children: t("Now") }), now !== undefined && _jsx("span", { children: phraseLabel(gameDateLabel(now)) })] }), chapters.map((chapter, index) => chapter.title === undefined
|
|
219
222
|
? _jsx(Between, { chapter: chapter }, chapterKey(chapters, index))
|
|
220
|
-
: (_jsxs("li", { class: ["chapter", chapter.open ? "now" : "", chapter.picture === undefined && placeKinds[chapter.kind ?? ""] === undefined ? "bare" : ""].join(" ").trim(), "data-number": chapter.number, tabIndex: -1, children: [_jsx(ChapterPicture, { chapter: chapter }), _jsxs("div", { class: "chapter-body", children: [_jsxs("header", { class: "chapter-head", children: [chapter.number !== undefined && _jsx("span", { class: "eyebrow chapter-number", children: t("
|
|
223
|
+
: (_jsxs("li", { class: ["chapter", chapter.open ? "now" : "", chapter.picture === undefined && placeKinds[chapter.kind ?? ""] === undefined ? "bare" : ""].join(" ").trim(), "data-number": chapter.number, tabIndex: -1, children: [_jsx(ChapterPicture, { chapter: chapter }), _jsxs("div", { class: "chapter-body", children: [_jsxs("header", { class: "chapter-head", children: [chapter.number !== undefined && _jsx("span", { class: "eyebrow chapter-number", children: t("Scene {number}", { number: chapter.number }) }), _jsx("h3", { children: chapter.title }), chapter.open && _jsx("span", { class: "chapter-now", children: t("Now") }), chapter.type !== undefined && _jsx("span", { class: "chapter-type", children: phraseLabel(sceneTypeLabel(chapter.type)) })] }), (chapter.place !== undefined || chapter.date !== undefined) && (_jsx("p", { class: "chapter-when", children: [chapter.place, chapter.date === undefined ? undefined : phraseLabel(gameDateLabel(chapter.date))].filter((part) => part !== undefined).join(" · ") })), chapter.summary !== undefined && _jsx("p", { class: "chapter-summary", children: chapter.summary }), chapter.facts.length > 0 && (_jsxs("details", { class: "chapter-facts", children: [_jsx("summary", { children: chapter.facts.length === 1 ? t("1 thing that happened") : t("{count} things that happened", { count: chapter.facts.length }) }), _jsx(Facts, { facts: chapter.facts })] }))] })] }, chapterKey(chapters, index)))), _jsx("li", { class: "eyebrow story-mark start", children: _jsx("b", { children: t("The start") }) })] }));
|
|
221
224
|
}
|
|
222
225
|
/** The companions' diaries, the last line first, all of them or one companion's (D-497): each line with who wrote it and when, in their own words. */
|
|
223
226
|
function Diaries({ thoughts }) {
|
|
@@ -246,7 +249,7 @@ function Diaries({ thoughts }) {
|
|
|
246
249
|
function ChapterPicture({ chapter }) {
|
|
247
250
|
const kind = placeKinds[chapter.kind ?? ""];
|
|
248
251
|
if (chapter.picture !== undefined) {
|
|
249
|
-
return (
|
|
252
|
+
return (_jsxs("div", { class: "chapter-picture picture-host", children: [_jsx("img", { src: pictureAddress(chapter.picture), alt: "", loading: "lazy", "aria-hidden": "true" }), chapter.place !== undefined && _jsx(PictureButton, { page: chapter.place, has: true, icon: true })] }));
|
|
250
253
|
}
|
|
251
254
|
return kind === undefined ? null : (_jsx("div", { class: "chapter-picture kind", "aria-hidden": "true", children: _jsx("svg", { viewBox: "0 0 24 24", children: _jsx("path", { d: kind.glyph }) }) }));
|
|
252
255
|
}
|
package/dist/dashboard/kit.js
CHANGED
|
@@ -10,7 +10,7 @@ export { Text, Track, Value, Who } from "./packages/widgets.js";
|
|
|
10
10
|
export { statusIcons } from "./parts/icons.js";
|
|
11
11
|
/** A button of words, as the page's: gold for the one main action, quiet for a secondary one, danger for one that loses something. */
|
|
12
12
|
export function Button({ children, onClick, kind, disabled, tip }) {
|
|
13
|
-
return (_jsx("button", { type: "button", class: kind === undefined ? "button" : `button ${kind}`, "aria-disabled": disabled === true ? "true" : undefined, "data-tip": tip, onClick: () => disabled !== true && onClick(), children: children }));
|
|
13
|
+
return (_jsx("button", { type: "button", class: kind === undefined ? "button" : `button ${kind}`, "aria-disabled": disabled === true ? "true" : undefined, "aria-description": tip, "data-tip": tip, onClick: () => disabled !== true && onClick(), children: children }));
|
|
14
14
|
}
|
|
15
15
|
/** A button of an icon, named by its words, which its tooltip shows. */
|
|
16
16
|
export function IconButton({ path, label, onClick }) {
|
|
@@ -45,7 +45,7 @@ export function AddField({ state, onAdd, onFile }) {
|
|
|
45
45
|
if (file !== undefined) {
|
|
46
46
|
onFile(file);
|
|
47
47
|
}
|
|
48
|
-
} })] }), _jsx("p", { class: "package-note", id: "package-source-about", children: t("It tells the kind by itself: a game system, an adventure, an extension or a language. A file is a .zip or a .tgz.") }), empty && state.work === undefined && _jsx("p", { class: "package-said problem", role: "status", children: t("Write a link, an npm name or a folder first.") }), _jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said, onSee: state.onSee })] }));
|
|
48
|
+
} })] }), _jsx("p", { class: "package-note", id: "package-source-about", children: t("It tells the kind by itself: a game system, an adventure, an extension, a theme or a language. A file is a .zip or a .tgz.") }), empty && state.work === undefined && _jsx("p", { class: "package-said problem", role: "status", children: t("Write a link, an npm name or a folder first.") }), _jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said, onSee: state.onSee })] }));
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* The catalog (D-486), always open: a search, chips for the kinds with how many each has, wrapping on a phone; the first rows, five or three on a phone, then
|
|
@@ -96,19 +96,35 @@ export function newerOf(name, kind, catalog) {
|
|
|
96
96
|
export function entryOf(name, kind, catalog) {
|
|
97
97
|
return catalog?.entries.find((one) => one.kind === kind && samePackage(one, name));
|
|
98
98
|
}
|
|
99
|
-
/**
|
|
99
|
+
/** A theme here as the catalog has it, from GitHub: the repository it was installed from, which the engine marks installed, by its name. */
|
|
100
|
+
export function themeEntryOf(theme, catalog) {
|
|
101
|
+
return catalog?.entries.find((one) => one.kind === "theme" && one.installed !== undefined && foldedText(one.title) === foldedText(theme.name));
|
|
102
|
+
}
|
|
103
|
+
/** A language here as the catalog has it: npm's by its package, one of data alone by its code, from the GitHub repository it was installed from. */
|
|
104
|
+
export function languageEntryOf(language, catalog) {
|
|
105
|
+
return language.unpacked === true
|
|
106
|
+
? catalog?.entries.find((one) => one.kind === "language" && one.installed !== undefined && one.language?.toLowerCase() === language.code.toLowerCase())
|
|
107
|
+
: entryOf(language.package, "language", catalog);
|
|
108
|
+
}
|
|
109
|
+
/** The newer version the catalog has of an entry here; undefined when it has none. */
|
|
110
|
+
export function newerVersion(entry) {
|
|
111
|
+
return entry?.update === true ? entry.version : undefined;
|
|
112
|
+
}
|
|
113
|
+
/** How many packages here npm or GitHub has a newer version of: the count on the Installed tab. */
|
|
100
114
|
export function updateCount(view, catalog) {
|
|
101
115
|
const systems = (view.systems ?? []).filter((one) => one.package !== undefined && newerOf(one.package, "system", catalog) !== undefined);
|
|
102
116
|
const extensions = view.installed.filter((one) => newerOf(one.package, "extension", catalog) !== undefined);
|
|
103
|
-
const languages = (view.languages ?? []).filter((one) =>
|
|
104
|
-
|
|
117
|
+
const languages = (view.languages ?? []).filter((one) => newerVersion(languageEntryOf(one, catalog)) !== undefined);
|
|
118
|
+
const themes = (view.themes ?? []).filter((one) => newerVersion(themeEntryOf(one, catalog)) !== undefined);
|
|
119
|
+
return systems.length + extensions.length + languages.length + themes.length;
|
|
105
120
|
}
|
|
106
121
|
/** A catalog's title: an adventure's as its author wrote it; an npm package's name with its first letter a capital, as the rows of what is here. */
|
|
107
122
|
export function entryTitle(entry) {
|
|
108
|
-
// A language by its code, as lang-de: named in the page's language.
|
|
109
|
-
const code = entry.kind === "language" ? /^(?:lang-)?([a-z]{2,3}(?:-[a-z0-9]+)?)$/i.exec(entry.title)?.[1] : undefined;
|
|
123
|
+
// A language by its code, GitHub's as its language.yaml gives it, npm's by its name, as lang-de: named in the page's language.
|
|
124
|
+
const code = entry.kind === "language" ? entry.language ?? /^(?:lang-)?([a-z]{2,3}(?:-[a-z0-9]+)?)$/i.exec(entry.title)?.[1] : undefined;
|
|
110
125
|
const language = code === undefined ? undefined : languageName(code, pageLanguage());
|
|
111
|
-
|
|
126
|
+
// An adventure's and a theme's titles are their authors'.
|
|
127
|
+
return entry.kind === "adventure" || entry.kind === "theme" ? entry.title : phraseLabel(language ?? entry.title);
|
|
112
128
|
}
|
|
113
129
|
/** npm or GitHub away, or both: the rest is added all the same; the engine's words under the page's, and Try again. */
|
|
114
130
|
function CatalogAway({ failed, asking, onRetry }) {
|
|
@@ -117,7 +133,7 @@ function CatalogAway({ failed, asking, onRetry }) {
|
|
|
117
133
|
? [t("The catalog does not answer."), t("A file, a link or a folder can be added all the same.")]
|
|
118
134
|
: failed.npm !== undefined
|
|
119
135
|
? [t("npm does not answer."), t("Game systems, extensions and languages come from npm: a file, a link or a folder can be added all the same.")]
|
|
120
|
-
: [t("GitHub does not answer."), t("The catalog's adventures come from GitHub: a .zip or a link can be added all the same.")];
|
|
136
|
+
: [t("GitHub does not answer."), t("The catalog's adventures and themes come from GitHub: a .zip or a link can be added all the same.")];
|
|
121
137
|
const why = [...new Set([failed.npm, failed.github].filter((one) => one !== undefined))];
|
|
122
138
|
return (_jsxs("div", { class: "package-offline", role: "status", children: [_jsx(Icon, { name: "offline" }), _jsxs("div", { children: [_jsxs("p", { children: [_jsx("strong", { children: headline }), " ", line] }), why.map((one) => (_jsx("p", { class: "package-why", children: _jsx("bdi", { children: one }) }, one))), _jsxs("button", { type: "button", class: "button package-button", "aria-disabled": asking, onClick: () => !asking && onRetry(), children: [_jsx(Icon, { name: "update" }), t("Try again")] })] })] }));
|
|
123
139
|
}
|
|
@@ -134,12 +150,13 @@ function CatalogRow({ entry, named, view, state, needs, onAdd, onUpdate }) {
|
|
|
134
150
|
entry.author !== undefined && !entry.verified && !entry.code ? t("by {author}", { author: entry.author }) : "",
|
|
135
151
|
entry.levels === undefined ? "" : levelsText(entry.levels),
|
|
136
152
|
entry.length ?? "",
|
|
137
|
-
|
|
153
|
+
// An adventure's language; a language's own is its title.
|
|
154
|
+
entry.language === undefined || entry.kind === "language" ? "" : languageName(entry.language, pageLanguage()) ?? entry.language,
|
|
138
155
|
entry.stars === undefined || entry.stars === 0 ? "" : `★ ${entry.stars}`,
|
|
139
156
|
asksYes ? t("has code: asks your yes") : "",
|
|
140
157
|
entry.kind === "system" && here === "none" && view.system !== null ? t("for a new campaign: this one stays in {system}", { system: systemNameLabel(view.system.name) }) : "",
|
|
141
158
|
].filter((fact) => fact !== "");
|
|
142
|
-
const version = entry.update && entry.installed !== undefined && entry.version !== undefined
|
|
159
|
+
const version = entry.update && entry.installed !== undefined && entry.installed !== "" && entry.version !== undefined
|
|
143
160
|
? (_jsxs("span", { class: "package-update", children: [_jsx(Icon, { name: "update" }), `${isolated(entry.installed)} ${pageDirection() === "rtl" ? "←" : "→"} ${isolated(entry.version)}`] }))
|
|
144
161
|
: entry.version;
|
|
145
162
|
const action = (word, label, icon, onClick, accent = false) => (_jsxs("button", { type: "button", class: accent ? "button package-button accent" : "button package-button", "aria-label": label, "aria-disabled": state.busy, onClick: () => !state.busy && onClick(), children: [_jsx(Icon, { name: icon }), word] }));
|
|
@@ -154,16 +171,16 @@ function CatalogRow({ entry, named, view, state, needs, onAdd, onUpdate }) {
|
|
|
154
171
|
: action(asksYes ? t("Add…") : t("Add"), t("Add {name}", { name: entryTitle(entry) }), "plus", onAdd), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said, onSee: state.onSee })] }));
|
|
155
172
|
}
|
|
156
173
|
// The kinds in the order of the chips, each with its tile.
|
|
157
|
-
const kindOrder = ["system", "adventure", "extension", "language"];
|
|
158
|
-
const kindIcon = { system: "dice", adventure: "world", extension: "packages", language: "language" };
|
|
174
|
+
const kindOrder = ["system", "adventure", "extension", "theme", "language"];
|
|
175
|
+
const kindIcon = { system: "dice", adventure: "world", extension: "packages", theme: "theme", language: "language" };
|
|
159
176
|
/** A kind, for one package. */
|
|
160
177
|
function kindLabel(kind) {
|
|
161
|
-
const labels = { system: t("System"), adventure: t("Adventure"), extension: t("Extension"), language: t("Language") };
|
|
178
|
+
const labels = { system: t("System"), adventure: t("Adventure"), extension: t("Extension"), theme: t("Theme"), language: t("Language") };
|
|
162
179
|
return labels[kind];
|
|
163
180
|
}
|
|
164
181
|
/** A kind, for its chip. */
|
|
165
182
|
function kindsLabel(kind) {
|
|
166
|
-
const labels = { system: t("Systems"), adventure: t("Adventures"), extension: t("Extensions"), language: t("Languages") };
|
|
183
|
+
const labels = { system: t("Systems"), adventure: t("Adventures"), extension: t("Extensions"), theme: t("Themes"), language: t("Languages") };
|
|
167
184
|
return labels[kind];
|
|
168
185
|
}
|
|
169
186
|
/** Whether an entry matches what the player searched: by its title, what it is or who wrote it, case and accents aside. */
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
-
// RPG Engine itself on the Packages page: its card, how a new chat takes the version installed, and what a package's latest needs of it
|
|
3
|
-
|
|
2
|
+
// RPG Engine itself on the Packages page: its card, how a new chat takes the version installed, and what a package's latest needs of it; and the page's
|
|
3
|
+
// notice of a newer one (T-219).
|
|
4
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
5
|
+
import { sectionAddress } from "../address.js";
|
|
6
|
+
import { readEngine } from "../api.js";
|
|
4
7
|
import { CardHead } from "../parts/card.js";
|
|
5
8
|
import { Icon, iconPath } from "../parts/icons.js";
|
|
6
9
|
import { t } from "../text.js";
|
|
@@ -9,6 +12,38 @@ import { PackageRow, SaidNote, UpdateButton, VersionMeta, WorkNote } from "./row
|
|
|
9
12
|
export const engineName = "RPG Engine";
|
|
10
13
|
// Where the engine installed from this page is kept while the chat goes on with the one before it: in this tab, through a reload.
|
|
11
14
|
const updatedKey = "rpg-engine-updated";
|
|
15
|
+
// The newer version whose notice the player hid, on this browser: the next one is said again.
|
|
16
|
+
const hiddenKey = "rpg-engine-newer-hidden";
|
|
17
|
+
/**
|
|
18
|
+
* The page's notice of a newer RPG Engine on npm (T-219), as the server knows it today, read once as the page opens and never waited for; with the way to
|
|
19
|
+
* the Packages page, where its card updates it, and a cross that hides it until a newer one. None on that page, for a development link, or once installed.
|
|
20
|
+
*/
|
|
21
|
+
export function useEngineNotice(section) {
|
|
22
|
+
const [newer, setNewer] = useState();
|
|
23
|
+
const [hidden, setHidden] = useState(hiddenVersion);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
void readEngine().then((read) => setNewer(read?.update === true && read.install !== "link" ? read.latest : undefined), () => undefined);
|
|
26
|
+
}, []);
|
|
27
|
+
if (newer === undefined || newer === hidden || newer === keptUpdate()?.to || section === "packages") {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const hide = () => {
|
|
31
|
+
try {
|
|
32
|
+
localStorage.setItem(hiddenKey, newer);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Hidden while the page is open.
|
|
36
|
+
}
|
|
37
|
+
setHidden(newer);
|
|
38
|
+
};
|
|
39
|
+
return [{
|
|
40
|
+
kind: "info",
|
|
41
|
+
key: "engine-newer",
|
|
42
|
+
text: t("RPG Engine {version} is out.", { version: newer }),
|
|
43
|
+
link: { href: sectionAddress("packages"), text: t("Update it in Packages") },
|
|
44
|
+
hide: { label: t("Hide until the next version"), onHide: hide },
|
|
45
|
+
}];
|
|
46
|
+
}
|
|
12
47
|
/** The engine installed from this page in this tab, if any. */
|
|
13
48
|
export function keptUpdate() {
|
|
14
49
|
try {
|
|
@@ -85,3 +120,12 @@ function RestartNote({ updated }) {
|
|
|
85
120
|
: [t("Close this chat."), t("Start a new chat in the campaign, as you always do."), t("Reload this page.")];
|
|
86
121
|
return (_jsxs("div", { ref: note, class: "package-said package-restart", role: "status", tabIndex: -1, children: [_jsx("p", { children: `✓ ${t("RPG Engine {version} is installed.", { version: updated.to })}` }), _jsx("p", { children: t("The master goes on with {version} in this chat. To play with {next}:", { version: updated.from, next: updated.to }) }), _jsx("ol", { children: steps.map((step) => _jsx("li", { children: step }, step)) })] }));
|
|
87
122
|
}
|
|
123
|
+
/** The newer version whose notice the player hid, if any. */
|
|
124
|
+
function hiddenVersion() {
|
|
125
|
+
try {
|
|
126
|
+
return localStorage.getItem(hiddenKey) ?? undefined;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -41,6 +41,19 @@ export function MissingRow({ name, state, onInstall }) {
|
|
|
41
41
|
const shown = phraseLabel(name.replace(/^@[^/]+\//, ""));
|
|
42
42
|
return (_jsxs(PackageRow, { tile: "alert", tone: "broken", name: shown, about: _jsx("span", { class: "package-red", children: t("Missing on this computer: the master does not use it until you install it.") }), actions: _jsxs("button", { type: "button", class: "button package-button", "aria-label": t("Install {name}", { name: shown }), "aria-disabled": state.busy, onClick: () => !state.busy && onInstall(), children: [_jsx(Icon, { name: "download" }), t("Install")] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* A theme installed on this computer (D-574): its name, its version and GitHub's newer one, and whether this page shows it now; one that fails a check, in red
|
|
46
|
+
* with why, which Settings does not offer.
|
|
47
|
+
*/
|
|
48
|
+
export function ThemeRow({ theme, newer, shown, fresh, state, onUpdate, onUninstall }) {
|
|
49
|
+
const name = _jsx("bdi", { children: theme.name });
|
|
50
|
+
const problems = theme.problems ?? [];
|
|
51
|
+
const uninstall = _jsx(UninstallButton, { name: theme.name, busy: state.busy, onClick: onUninstall });
|
|
52
|
+
if (problems.length > 0) {
|
|
53
|
+
return (_jsxs(PackageRow, { tile: "alert", tone: "broken", name: name, about: _jsx("span", { class: "package-red", children: t("It does not pass the page's checks: Settings does not offer it.") }), meta: _jsxs(_Fragment, { children: [theme.version !== undefined && `${theme.version} · `, _jsx("bdi", { class: "package-why", children: problems[0] })] }), row: `theme:${theme.id}`, fresh: fresh, actions: uninstall, children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
54
|
+
}
|
|
55
|
+
return (_jsxs(PackageRow, { tile: "theme", name: name, meta: (theme.version !== undefined || newer !== undefined || shown) && (_jsxs(_Fragment, { children: [_jsx(VersionMeta, { version: theme.version, newer: newer }), shown && `${theme.version !== undefined || newer !== undefined ? " · " : ""}${t("the style of this page")}`] })), row: `theme:${theme.id}`, fresh: fresh, actions: _jsxs(_Fragment, { children: [newer !== undefined && _jsx(UpdateButton, { name: theme.name, version: newer, busy: state.busy, onClick: onUpdate }), uninstall] }), children: [_jsx(WorkNote, { work: state.work }), _jsx(SaidNote, { said: state.said })] }));
|
|
56
|
+
}
|
|
44
57
|
/** A language package: its name, whose it is, its version and npm's newer one, and whether this page is written in it. */
|
|
45
58
|
export function LanguageRow({ language, newer, needs, fresh, state, onUpdate, onUninstall }) {
|
|
46
59
|
const page = pageLanguage().toLowerCase().split("-")[0] === language.code.toLowerCase().split("-")[0];
|
|
@@ -14,6 +14,23 @@ export function failure(at, action, name, outcome) {
|
|
|
14
14
|
}
|
|
15
15
|
return { at, problem: true, text: action === "add" ? t("Nothing was added.") : t("Nothing changed."), why: outcome.error };
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Why RPG Engine was not updated (T-219), in the page's words: the no, another package's work; where no window for the yes opens or npm failed, with the
|
|
19
|
+
* command that updates it from a terminal.
|
|
20
|
+
*/
|
|
21
|
+
export function engineFailure(outcome) {
|
|
22
|
+
const command = "npm install -g rpg-engine";
|
|
23
|
+
if (outcome.code === "declined") {
|
|
24
|
+
return { text: t("You said no: nothing changed.") };
|
|
25
|
+
}
|
|
26
|
+
if (outcome.code === "busy") {
|
|
27
|
+
return { text: t("One package at a time: wait for the one under way, then try again.") };
|
|
28
|
+
}
|
|
29
|
+
if (outcome.code === "no-window") {
|
|
30
|
+
return { text: t("No window for your yes opens on this computer: update RPG Engine from a terminal."), command };
|
|
31
|
+
}
|
|
32
|
+
return { text: t("RPG Engine was not updated."), why: outcome.error, ...(outcome.code === "engine-failed" ? { command } : {}) };
|
|
33
|
+
}
|
|
17
34
|
/** What an addition did, by the kind the engine recognized. */
|
|
18
35
|
export function addedText(kind) {
|
|
19
36
|
const texts = {
|
|
@@ -21,6 +38,7 @@ export function addedText(kind) {
|
|
|
21
38
|
extension: t("The extension is in the campaign: it counts from now on."),
|
|
22
39
|
system: t("The game system is on this computer, for a new campaign."),
|
|
23
40
|
language: t("The language is on this computer, for every campaign."),
|
|
41
|
+
theme: t("The theme is on this computer, for every campaign: choose it in Settings, under Game style."),
|
|
24
42
|
};
|
|
25
43
|
return kind === undefined ? t("Done.") : texts[kind];
|
|
26
44
|
}
|
|
@@ -35,6 +53,9 @@ export function doneText(action, name) {
|
|
|
35
53
|
}
|
|
36
54
|
/** What uninstalling does, by kind. */
|
|
37
55
|
export function uninstallText(what) {
|
|
56
|
+
if (what === "theme") {
|
|
57
|
+
return _jsx("p", { children: t("It goes off this computer: where you chose it, the page goes back to the game's style, or its own.") });
|
|
58
|
+
}
|
|
38
59
|
if (what === "system") {
|
|
39
60
|
return _jsx("p", { children: t("It goes off this computer: a new campaign can no longer choose it. This campaign does not change.") });
|
|
40
61
|
}
|