dsh-plugin-token-war 0.4.0 → 0.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.4.2 — 2026-11-09
4
+
5
+ - 手机/窄屏适配:360–430px 宽度下战场只显示前 3 个角色,敌人卡缩窄,避免遮挡;任务行改为更适合触控的高度与列宽;窄屏标签与操作按钮加大。
6
+ - 新增手机端截图 `docs/screenshots/06-mobile-390x700.png`。
7
+
3
8
  ## v0.4.0 — 2026-11-08
4
9
 
5
10
  首个公开版本。
package/README.md CHANGED
@@ -7,11 +7,19 @@
7
7
 
8
8
  ## 安装
9
9
 
10
- ### DSH 插件管理器(推荐)
10
+ ### 从 npm 安装(推荐)
11
11
 
12
- 插件管理器 → 安装插件 → 本地目录 → 选择包含 `package.json` 的 `dsh-plugin-token-war` 目录,刷新页面。
12
+ ```bash
13
+ dsh plugin --profile <profile> add dsh-plugin-token-war
14
+ ```
15
+
16
+ 包页:https://www.npmjs.com/package/dsh-plugin-token-war
17
+
18
+ 或在 DSH 插件市场搜索 **Token War**(市场收录后)。
13
19
 
14
- 或使用 DSH CLI:
20
+ ### 本地目录安装
21
+
22
+ 插件管理器 → 安装插件 → 本地目录 → 选择包含 `package.json` 的 `dsh-plugin-token-war` 目录,刷新页面。或:
15
23
 
16
24
  ```bash
17
25
  dsh plugin --profile <profile> add /absolute/path/dsh-plugin-token-war
@@ -32,7 +40,7 @@ HTML 文件、`localhost`、DSH 面板是不同存储来源,进度互通请用
32
40
  ## 玩法
33
41
 
34
42
  - **任务**:20 个循环任务自动并行生产 Token,升级提高单周期收益;未解锁任务会显示解锁关卡。
35
- - **军团**:5 家厂商、10 个模型型号,按关卡解锁;同厂商共享一个已验收角色,战力按厂商汇总。
43
+ - **军团**:5 家厂商、10 个模型型号,按关卡解锁;同厂商共享一个角色,战力按厂商汇总。
36
44
  - **战斗**:军团自动推进关卡,敌人是无尽 TODO;没有最终 Boss。
37
45
  - **厂商事件**:10 个本地静态戏仿事件,同时最多一个,自动生效,不做永久惩罚。
38
46
  - **蒸馏**:重置本代 Token / 任务等级 / 关卡 / 本代训练,保留模型、任务解锁、累计权重与世代编号;自动蒸馏先用有界试算确认收益。
@@ -42,7 +50,7 @@ HTML 文件、`localhost`、DSH 面板是不同存储来源,进度互通请用
42
50
 
43
51
  ![窄窗口 / 紧凑布局](https://raw.githubusercontent.com/JJJACKsong/dsh-plugin-token-war/main/docs/screenshots/05-compact-620x480.png)
44
52
 
45
- ## 轻量与隐私
53
+ ## 本地与隐私
46
54
 
47
55
  - 纯本地:不读取会话或工作区,不调用模型,不发网络请求,无遥测。
48
56
  - 单屏:固定布局,无页面滚动;窄容器自动切换「任务 / 军团 / 蒸馏」标签。
@@ -54,7 +62,7 @@ Agent 完成或等待批准时,顶部会切换为高亮提醒并显示「返
54
62
 
55
63
  ![Agent 完成提醒](https://raw.githubusercontent.com/JJJACKsong/dsh-plugin-token-war/main/docs/screenshots/03-agent-reminder.png)
56
64
 
57
- ## 模型名单(2026-11-08 核对)
65
+ ## 模型名单
58
66
 
59
67
  | 厂商 | 早期型号 | 后期型号 |
60
68
  | --- | --- | --- |
@@ -77,12 +85,6 @@ npm start # 本地预览
77
85
 
78
86
  要求 Node 22+。构建产物 `index.html` 与 `lib/client.js` 已随仓库提交,安装包直接可用。
79
87
 
80
- ## 设计与验收
81
-
82
- - 视觉:16-bit Manual 暗色版(墨黑纸面、米白硬线、硬边阴影、DeepSeek 蓝 / 青 / 金强调;全系统黑体,无 WebFont)。见 `docs/DESIGN.md`。
83
- - 真实 DSH 环境验收:安装 / 卸载 / 挂载 / 刷新 / 禁用重启用;Agent 完成与等待提醒 + 返回会话;原生存档 / 导入导出 / 坏档恢复;双窗口单写者;隐藏停止 + 补算;三档视口无滚动无裁切。
84
- - 经济内核从首次可玩版起未改;UI 与名单更新不影响存档兼容。
85
-
86
88
  ## License 与素材
87
89
 
88
90
  - 代码:MIT,见 [LICENSE](LICENSE)。
package/index.html CHANGED
@@ -245,6 +245,18 @@
245
245
  .tw-app[data-compact=true] .tw-metric-coins .tw-metric-value{font-size:28px}
246
246
  .tw-app[data-compact=true] .tw-metric-stage .tw-metric-value{font-size:16px}
247
247
  .tw-app[data-compact=true] .tw-status-actions button{height:23px;padding:0 7px;font-size:9px}
248
+ .tw-app[data-compact=true] .tw-statusbar{min-height:56px}
249
+ .tw-app[data-compact=true] .tw-status-actions button{height:30px;padding:0 9px;font-size:10px}
250
+ .tw-app[data-compact=true] .tw-run{height:28px;font-size:10px}
251
+ .tw-app[data-compact=true] .tw-notice-rail{height:30px}
252
+ .tw-app[data-compact=true] .tw-ws-tabs button{height:34px;font-size:11px;padding:0 12px}
253
+ .tw-app[data-compact=true] .tw-panel-head{height:34px}
254
+ .tw-app[data-compact=true] .tw-task-row{grid-template-columns:18px minmax(0,1fr) 70px 94px;height:40px;gap:7px;padding:0 4px}
255
+ .tw-app[data-compact=true] .tw-task-name{font-size:12px}
256
+ .tw-app[data-compact=true] .tw-task-reward{font-size:10.5px}
257
+ .tw-app[data-compact=true] .tw-task-reward small{font-size:8.5px}
258
+ .tw-app[data-compact=true] .tw-up{height:28px;font-size:9px;padding:0 5px}
259
+ .tw-app[data-compact=true] .tw-panel-title{font-size:12px}
248
260
  .tw-app[data-compact=true] .tw-task-lv{display:none}
249
261
  .tw-app[data-compact=true] .tw-task-row{grid-template-columns:20px minmax(0,1fr) 60px 80px}
250
262
 
@@ -357,7 +369,7 @@ const {amount,fromLog,log,add,subtract,multiply,scale,divide,power,numeric,ratio
357
369
  const {TASKS,ROSTER,EVENTS} = __twmods["config"];
358
370
 
359
371
  const SAVE_VERSION = 1;
360
- const GAME_VERSION = '0.4.0';
372
+ const GAME_VERSION = '0.4.2';
361
373
  const MAX_OFFLINE_MS = 30 * 86400000;
362
374
  const HP_GROWTH = 1.085;
363
375
  const TRAIN_GROWTH = 1.15;
@@ -945,14 +957,16 @@ function mountGame(root,{assetData={},hostNotice=null}={}) {
945
957
  for(let x=-100;x<W+200;x+=90){ctx.beginPath();ctx.moveTo(W*.5+(x-W*.5)*.75,groundY+1);ctx.lineTo(x,H);ctx.stroke();}
946
958
  const ev=currentEvent(s);
947
959
  ctx.textAlign='left';ctx.textBaseline='alphabetic';
948
- // 左侧 70%:最多 5 个角色,尺寸随战场高度
960
+ // 左侧:手机/窄屏最多 3 个角色,避免和敌人卡互相遮挡
949
961
  const owned=ROSTER.enabledVendors.filter(v=>ROSTER.models.some(m=>m.vendor===v&&s.models.includes(m.id)));
950
- const leftW=W*0.70;
962
+ const compactCanvas=W<520;
963
+ const visibleOwned=compactCanvas?owned.slice(0,3):owned;
964
+ const leftW=W*(compactCanvas?0.66:0.70);
951
965
  const charH=Math.max(40,Math.min(H*0.64,groundY-14));
952
966
  const scaleC=charH/192;
953
967
  const slot=Math.max(56,Math.min(150,leftW/Math.max(1,owned.length)));
954
- const x0=(leftW-slot*owned.length)/2+slot/2;
955
- owned.forEach((id,i)=>{
968
+ const x0=(leftW-slot*visibleOwned.length)/2+slot/2;
969
+ visibleOwned.forEach((id,i)=>{
956
970
  loadCharacter(id);
957
971
  const character=CATALOG.characters.find(c=>c.id===id),image=images.get(id),x=x0+i*slot;
958
972
  const t=(animationTime+i*550)%2800;
@@ -964,11 +978,11 @@ function mountGame(root,{assetData={},hostNotice=null}={}) {
964
978
  if(image)drawFrame(ctx,image,CATALOG,frame,x,groundY+1,scaleC);
965
979
  else{ctx.fillStyle=VENDOR_COLORS[id];ctx.fillRect(x-charH*.18,groundY-charH*.7,charH*.36,charH*.7);}
966
980
  ctx.save();ctx.shadowColor='#000000';ctx.shadowBlur=3;ctx.shadowOffsetY=1;
967
- ctx.textAlign='center';ctx.font="700 11px 'PingFang SC','Heiti SC',system-ui,sans-serif";ctx.fillStyle=VENDOR_TEXT[id]||VENDOR_COLORS[id];
981
+ ctx.textAlign='center';ctx.font=`700 ${compactCanvas?10:11}px 'PingFang SC','Heiti SC',system-ui,sans-serif`;ctx.fillStyle=VENDOR_TEXT[id]||VENDOR_COLORS[id];
968
982
  ctx.fillText(fitText(VENDOR_LABELS[id],slot-4),x,groundY+14);
969
983
  if(H>=112){
970
984
  const latest=ROSTER.models.filter(m=>m.vendor===id&&s.models.includes(m.id)).at(-1);
971
- ctx.globalAlpha=.86;ctx.font="10px 'PingFang SC','Heiti SC',system-ui,sans-serif";ctx.fillStyle=VENDOR_TEXT[id]||VENDOR_COLORS[id];
985
+ ctx.globalAlpha=.86;ctx.font=`${compactCanvas?9:10}px 'PingFang SC','Heiti SC',system-ui,sans-serif`;ctx.fillStyle=VENDOR_TEXT[id]||VENDOR_COLORS[id];
972
986
  ctx.fillText(fitText(latest?latest.name:'',slot-4),x,groundY+26);
973
987
  ctx.globalAlpha=1;
974
988
  }
@@ -980,7 +994,7 @@ function mountGame(root,{assetData={},hostNotice=null}={}) {
980
994
  }
981
995
  });
982
996
  // 右侧 26%:敌人 / TODO 任务卡
983
- const cardW=Math.max(132,Math.round(W*0.26)),cardX=Math.round(W-cardW-12);
997
+ const cardW=Math.max(compactCanvas?96:132,Math.round(W*(compactCanvas?0.27:0.26))),cardX=Math.round(W-cardW-(compactCanvas?8:12));
984
998
  const cardTop=Math.max(26,Math.round(H*0.16)),cardH=Math.max(38,groundY-cardTop-26);
985
999
  const boss=s.stage%10===0;
986
1000
  ctx.save();ctx.shadowColor='#000000';ctx.shadowBlur=3;ctx.shadowOffsetY=1;
@@ -1008,8 +1022,8 @@ function mountGame(root,{assetData={},hostNotice=null}={}) {
1008
1022
  const labelY=barY+barH+4,labelH=17;
1009
1023
  ctx.fillStyle='#17181D';ctx.fillRect(cardX,labelY,cardW,labelH);
1010
1024
  ctx.strokeStyle='#E9E3D6';ctx.lineWidth=1;ctx.strokeRect(cardX+.5,labelY+.5,cardW-1,labelH-1);
1011
- ctx.textAlign='center';ctx.font="600 10px 'PingFang SC','Heiti SC',system-ui,sans-serif";ctx.fillStyle='#E9E3D6';
1012
- ctx.fillText(`剩余工作量 ${Math.round(hp*100)}% · STAGE ${s.stage}`,cardX+cardW/2,labelY+12);
1025
+ ctx.textAlign='center';ctx.font=`600 ${compactCanvas?8:10}px 'PingFang SC','Heiti SC',system-ui,sans-serif`;ctx.fillStyle='#E9E3D6';
1026
+ ctx.fillText(compactCanvas?`剩余 ${Math.round(hp*100)}% · ST ${s.stage}`:`剩余工作量 ${Math.round(hp*100)}% · STAGE ${s.stage}`,cardX+cardW/2,labelY+(compactCanvas?11:12));
1013
1027
  lastRenderedStage=s.stage;
1014
1028
  if(s.paused||!held){
1015
1029
  ctx.fillStyle='#0E0F12E6';ctx.fillRect(0,0,W,H);