- Home
- Plugins
- Just for Fun
- dsh-pet-split
dsh-pet-split
halosunqaq/dsh-pet-split
Makes the dsh-pet desktop pet split phantom copies each time it bounces off a screen edge; the copies fade out once they rest. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
dsh plugin --profile web add github:halosunqaq/dsh-pet-splitREADME
小肥鱼分裂 · dsh-pet-split
给 dsh-pet 桌宠加一个纯外部机制:小肥鱼撞到屏幕边缘反弹时,分裂出幻影分身;分身在反弹里继续裂,停稳后慢慢散去。
不修改 dsh-pet 的任何文件,也不往它的进程里注入代码 —— 它照常从 npm 更新,卸载本插件也不留痕迹。
- 桌面那块(Electron 透明窗里的宠物):用窗口位置流判定反弹,独立的 Electron 覆盖层画分身。
- 网页那块(DSH 页面里的宠物):客户端模块读
.dsh-pet-root的几何位置,页面内 canvas 画分身。
要求
| 项目 | 要求 |
|---|---|
| DSH | 已在 0.2.3-alpha.2 上验证;engines.dsh 声明 `>=0.2.0 <0.3.0-0 |
| dsh-pet | 已安装并启用(本插件不代装) |
| 平台 | Windows。桌面分身依赖 user32 窗口轨迹;网页分身在任意平台的 DSH Web 页面可用 |
| 观察能力 | 插件带 settings.section 设置分区与 client 模块 |
安装
从插件市场索引安装(推荐)
DSH 本身不带中心市场:打开 插件 → 发现(Discover)→ 索引源(Index sources),添加本仓库的索引地址(需要先启用实验性插件「自定义插件索引」/ Custom plugin indexes):
https://cdn.jsdelivr.net/gh/halosunqaq/dsh-pet-split@main/index.json
jsDelivr 不通时用:
https://raw.githubusercontent.com/halosunqaq/dsh-pet-split/main/index.json
索引里的版本指向 npm 上的精确版本号,安装前可以在确认框里核对来源。
从 npm 安装(最省事)
dsh plugin --profile desktop add dsh-pet-split
预构建包,安装时不会再触发 pnpm 的构建脚本授权。
从源码安装
dsh plugin --profile desktop add github:halosunqaq/dsh-pet-split
建议钉住标签或 commit:
dsh plugin --profile desktop add "git+https://github.com/halosunqaq/dsh-pet-split.git#v0.4.0"
首次从 Git 安装时 pnpm 可能拦下构建脚本并提示 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED,按提示把它写进 profile 的 pnpm-workspace.yaml 的 allowBuilds 后重试即可。
装好后在 插件 页确认 dsh-pet-split 已启用;网页端第一次需要重启一次 DSH(客户端模块有缓存)。
用法
把桌宠拖起来往屏幕边缘甩:
- 只在撞墙反弹那一刻分裂,每次 2 只,左右墙、天花板、地面都算;
- 分身继承反弹方向,速度 ±12%、角度 ±14° 的偏差,所以会自然散开;
- 分身自己也会撞、也会裂,同屏上限 14 只,到顶只弹不裂;
- 任何一只静止满 5 秒开始 1.2 秒淡出,原始小肥鱼永远保留;
- 分身是幻影:整层窗口点击穿透,不挡桌面操作;
- 桌宠整个被打出屏幕(屏内不足 35%)时,会用 dsh-pet 自己的摆位接口把它拉回主屏中央。
设置
设置面板里会多一个「小肥鱼分裂」分区(与「插件」「技能中心」并列):
| 选项 | 默认 | 说明 |
|---|---|---|
| 桌面分身大小 | 0.42 | 分身宽 / 宠物窗口宽 |
| 网页分身大小 | 0.8 | 分身宽 / 宠物根节点宽 |
| 绝对宽度 | 0 | > 0 时两端统一用这个像素宽 |
| 同屏上限 | 14 | 2–60 |
| 每次分裂只数 | 2 | 1–6 |
| 静止后消散 | 5000 ms | 300–30000 |
| 淡出时长 | 1200 ms | 200–5000 |
「重抽动作池」换一批素材,「恢复默认」一键还原。桌面端保存即生效,网页端 30 秒内生效。
也可以直接改 %USERPROFILE%\.dsh\dsh-pet-split\tuning.json(插件首次启动自动生成)。
限制
- 分身用的是 dsh-pet 素材里的动画,不是原鱼当前动作的实时镜像 —— 无侵入做不到镜像,也不会随原鱼换装。
- 桌面分身只支持 Windows;网页分身在 DSH Web 页面里跟随第一只
.dsh-pet-root。 - 需要本机已下载 Electron(
%USERPROFILE%\.dsh\electron\electron.exe,启用过一次 dsh-pet 桌面模式就会有)。找不到时只在日志里报一行,不创建覆盖层。 - 影子层是常驻的透明覆盖窗口(每块屏一个,内存约 100–200 MB)。在插件页把这一行关掉,覆盖层与监视进程会一起退出。
- 低配机器上 14 只 × 多路视频解码可能掉帧,调小绝对宽度或上限即可。
排错
日志:%USERPROFILE%\.dsh\dsh-pet-split\log.txt。关键行:
影子层就绪,覆盖 N 块显示器—— 覆盖层起来了;反弹触发 spawn:v=(…), px=…—— 判定到一次撞墙;网页端ping: loaded / clips / found-pet-root / first-hit—— 网页端健康度;设置页保存:{…}—— 设置面板写入。
改完代码怎么生效:index.js / runtime/*(不含 client.js)在插件页关再开;client.js 要重启 DSH。
开发
目录与实现细节见 HANDOFF.md 和 docs/DETAIL.md。
两套渲染(runtime/overlay.js 桌面 canvas、client.js 网页 canvas)是故意分开的,改一端不会炸另一端。
English
A standalone DSH bundle that makes the dsh-pet desktop pet split into phantom copies whenever it bounces off a screen edge; the copies keep splitting while they bounce and fade out once they come to rest. It never edits dsh-pet's files or injects into its process: bounce detection comes from a 16 ms window-position stream (Windows) or the pet's DOM geometry (web page), and the copies are drawn by a separate transparent Electron overlay or an in-page canvas.
Requires DSH 0.2.3-alpha.2 (verified) plus an installed and enabled dsh-pet; the desktop overlay is Windows-only. Tuning lives in Settings → 小肥鱼分裂, or %USERPROFILE%\.dsh\dsh-pet-split\tuning.json.
许可
MIT
Related plugins
dsh-web-ui (dsh-pet)
zhu1090093659/dsh-web-ui
dsh-pet (dsh-pet)
pc2005-cloud/dsh-pet
dsh-tavern (dsh-tavern)
flizzywine/dsh-tavern
dsh-tavern (dsh-profile-bridge)
flizzywine/dsh-tavern