根本原因: 點穿是逐像素讀 canvas 該點的 alpha 來決定,而 2.0.7 起每一幀都會重驗。 人物的手腳與邊緣會隨動畫在透明/不透明之間切換(實測小念 hover 時 idle+jumping 共 11 幀,只有 44% 的人物像素每一幀都不透明;running 也只有 56%),游標停在邊緣時點穿位元就跟著動畫高速切換,按下去那一瞬間剛好是 透明幀,滑鼠事件就穿到底下的視窗去了。hover 會觸發跳三下,正好是使用者 伸手要抓寵物的時候,最容易中。 影響: 游標明明在寵物身上,左鍵拖不動、右鍵沒有選單,點擊落到底下的視窗。 修法: 點穿與 hover 一樣改用人物方框(canvas 矩形)或氣泡矩形判定,狀態只取決於 游標位置,不再與動畫幀連動;移除 overSprite 與 tick 內的每幀重驗。這也是 Codex 的做法。README 對應段落與對照表同步更新。版號 2.0.10。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
91 lines
2.3 KiB
JSON
91 lines
2.3 KiB
JSON
{
|
||
"name": "claude-pet",
|
||
"version": "2.0.10",
|
||
"description": "Codex Pets 相容的 Claude Code 桌面寵物(spriteVersionNumber 2:9 個動作列 + 16 方向追視)",
|
||
"main": "main.js",
|
||
"private": true,
|
||
"scripts": {
|
||
"start": "electron .",
|
||
"hooks:install": "node scripts/install-hooks.js",
|
||
"hooks:uninstall": "node scripts/uninstall-hooks.js",
|
||
"autostart:install": "node scripts/autostart.js install",
|
||
"autostart:uninstall": "node scripts/autostart.js uninstall",
|
||
"autostart:status": "node scripts/autostart.js status",
|
||
"predist": "npm version patch --no-git-tag-version",
|
||
"dist": "electron-builder --win",
|
||
"pack": "electron-builder --win --dir",
|
||
"release": "node scripts/release.js",
|
||
"predist:portable": "npm version patch --no-git-tag-version",
|
||
"dist:portable": "electron-builder --win portable"
|
||
},
|
||
"devDependencies": {
|
||
"electron": "^43.4.1",
|
||
"electron-builder": "^26.0.12"
|
||
},
|
||
"author": "JianMiau",
|
||
"build": {
|
||
"appId": "com.jianmiau.claude-pet",
|
||
"productName": "Claude Pet",
|
||
"copyright": "JianMiau",
|
||
"directories": {
|
||
"output": "dist",
|
||
"buildResources": "build"
|
||
},
|
||
"files": [
|
||
"main.js",
|
||
"preload.js",
|
||
"renderer/**/*",
|
||
"lib/**/*",
|
||
"hook/**/*",
|
||
"package.json"
|
||
],
|
||
"asarUnpack": [
|
||
"hook/**/*"
|
||
],
|
||
"win": {
|
||
"target": [
|
||
{
|
||
"target": "nsis",
|
||
"arch": [
|
||
"x64"
|
||
]
|
||
},
|
||
{
|
||
"target": "portable",
|
||
"arch": [
|
||
"x64"
|
||
]
|
||
},
|
||
{
|
||
"target": "zip",
|
||
"arch": [
|
||
"x64"
|
||
]
|
||
}
|
||
],
|
||
"icon": "build/icon.ico"
|
||
},
|
||
"nsis": {
|
||
"oneClick": false,
|
||
"perMachine": false,
|
||
"allowToChangeInstallationDirectory": true,
|
||
"createDesktopShortcut": true,
|
||
"createStartMenuShortcut": true,
|
||
"shortcutName": "Claude Pet",
|
||
"deleteAppDataOnUninstall": false,
|
||
"artifactName": "${productName}-${version}-setup.${ext}"
|
||
},
|
||
"portable": {
|
||
"artifactName": "${productName}-${version}-portable.${ext}",
|
||
"unpackDirName": "ClaudePet",
|
||
"requestExecutionLevel": "user"
|
||
},
|
||
"extraFiles": [
|
||
{
|
||
"from": "pets",
|
||
"to": "pets"
|
||
}
|
||
]
|
||
}
|
||
}
|