support amitaro

This commit is contained in:
wataru 2023-03-25 20:52:06 +09:00
parent 8a4e76795a
commit 61f485756d
17 changed files with 170 additions and 89 deletions

View File

@ -0,0 +1,40 @@
[
{ "mode": "normal", "z_index": 0, "number": 10, "layer_path": "ROOT_全身" },
{ "mode": "normal", "z_index": 1, "number": 500, "layer_path": "ROOT_!目_*通常" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*通常→" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*∩∩" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "normal", "z_index": 2, "number": 800, "layer_path": "ROOT_!口_*にこ" },
{ "mode": "normal", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_*おすまし" },
{ "mode": "normal", "z_index": 3, "number": 1000, "layer_path": "ROOT_!眉_*平行" },
{ "mode": "normal", "z_index": 3, "number": 1000, "layer_path": "ROOT_!眉_*通常" },
{ "mode": "normal", "z_index": 4, "number": 1000, "layer_path": "ROOT_表情_なし" },
{ "mode": "normal", "z_index": 4, "number": 1000, "layer_path": "ROOT_表情_赤面" },
{ "mode": "normal", "z_index": 5, "number": 1000, "layer_path": "ROOT_漫符_なし" },
{ "mode": "talking", "z_index": 0, "number": 10, "layer_path": "ROOT_全身" },
{ "mode": "talking", "z_index": 1, "number": 500, "layer_path": "ROOT_!目_*通常" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*通常→" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*∩∩" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "talking", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_*お" },
{ "mode": "talking", "z_index": 2, "number": 50, "layer_path": "ROOT_!口_*え" },
{ "mode": "talking", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_* -" },
{ "mode": "talking", "z_index": 2, "number": 50, "layer_path": "ROOT_!口_*う" },
{ "mode": "talking", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_*にこ" },
{ "mode": "talking", "z_index": 3, "number": 200, "layer_path": "ROOT_!眉_*平行" },
{ "mode": "talking", "z_index": 3, "number": 400, "layer_path": "ROOT_!眉_*通常" },
{ "mode": "talking", "z_index": 3, "number": 400, "layer_path": "ROOT_!眉_*ドヤ" },
{ "mode": "talking", "z_index": 4, "number": 200, "layer_path": "ROOT_表情_なし" },
{ "mode": "talking", "z_index": 4, "number": 1000, "layer_path": "ROOT_表情_赤面" },
{ "mode": "talking", "z_index": 5, "number": 100, "layer_path": "ROOT_漫符_なし" },
{ "mode": "talking", "z_index": 5, "number": 1000, "layer_path": "ROOT_漫符_*♪" },
{ "mode": "talking", "z_index": 0, "number": 10, "layer_path": "ROOT_全身" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*" },
{ "mode": "talking", "z_index": 2, "number": 10, "layer_path": "ROOT_!口_*え" },
{ "mode": "talking", "z_index": 3, "number": 10, "layer_path": "ROOT_!眉_*平行" },
{ "mode": "talking", "z_index": 4, "number": 10, "layer_path": "ROOT_表情_なし" },
{ "mode": "talking", "z_index": 5, "number": 10, "layer_path": "ROOT_漫符_なし" }
]

View File

@ -0,0 +1,6 @@
{
"charaName": "あみたろ",
"psdFile": "/assets/settings/amitaro/amitaro.psd",
"motionFile": "/assets/settings/amitaro/motion.json",
"motionSpeedRate": 0.5
}

View File

@ -1,5 +1,6 @@
{
"charaName": "つくよみちゃん",
"psdFile": "/assets/settings/tsukuyomi/tsukuyomi.psd",
"motionFile": "/assets/settings/tsukuyomi/motion.json"
"charaName": "あみたろ",
"psdFile": "/assets/settings/amitaro/amitaro.psd",
"motionFile": "/assets/settings/amitaro/motion.json",
"motionSpeedRate": 0.5
}

View File

@ -1,5 +1,6 @@
{
"charaName": "つくよみちゃん",
"psdFile": "/assets/settings/tsukuyomi/tsukuyomi.psd",
"motionFile": "/assets/settings/tsukuyomi/motion.json"
"motionFile": "/assets/settings/tsukuyomi/motion.json",
"motionSpeedRate": 1
}

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@dannadori/psdanimator": "^1.0.15",
"@dannadori/psdanimator": "^1.0.16",
"@dannadori/voice-changer-client-js": "^1.0.96",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-brands-svg-icons": "^6.3.0",
@ -24,8 +24,8 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.0",
"@types/node": "^18.15.5",
"@types/react": "^18.0.28",
"@types/node": "^18.15.9",
"@types/react": "^18.0.29",
"@types/react-dom": "^18.0.11",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
@ -41,13 +41,13 @@
"npm-run-all": "^4.1.5",
"postcss-loader": "^7.1.0",
"postcss-nested": "^6.0.1",
"prettier": "^2.8.6",
"rimraf": "^4.4.0",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"style-loader": "^3.3.2",
"ts-loader": "^9.4.2",
"tsconfig-paths": "^4.1.2",
"typescript": "^5.0.2",
"webpack": "^5.76.2",
"webpack": "^5.76.3",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.1"
}
@ -3188,9 +3188,9 @@
}
},
"node_modules/@dannadori/psdanimator": {
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/@dannadori/psdanimator/-/psdanimator-1.0.15.tgz",
"integrity": "sha512-cf9v3xc5N+V588MkY3vsc394TzsMFxQnCmmq452VQTFWpjcsKLA8X1g0x2Z9WA6oIE6d6LT/cB6EZ30mrB1afg==",
"version": "1.0.16",
"resolved": "https://registry.npmjs.org/@dannadori/psdanimator/-/psdanimator-1.0.16.tgz",
"integrity": "sha512-leA8V8LY009RfpxijE3yCVoD1LVnLfb0O4zRZclOvTa6NitNCIO6Xe/3SfN1Rkq4zhaU3TRL6CMotS/vIFx2MA==",
"dependencies": {
"@dannadori/worker-manager": "^1.0.11",
"@webtoon/psd": "^0.3.0"
@ -3818,9 +3818,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "18.15.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.5.tgz",
"integrity": "sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew=="
"version": "18.15.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.9.tgz",
"integrity": "sha512-dUxhiNzBLr6IqlZXz6e/rN2YQXlFgOei/Dxy+e3cyXTJ4txSUbGT2/fmnD6zd/75jDMeW5bDee+YXxlFKHoV0A=="
},
"node_modules/@types/prop-types": {
"version": "15.7.5",
@ -3841,9 +3841,9 @@
"dev": true
},
"node_modules/@types/react": {
"version": "18.0.28",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz",
"integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==",
"version": "18.0.29",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.29.tgz",
"integrity": "sha512-wXHktgUABxplw1+UnljseDq4+uztQyp2tlWZRIxHlpchsCFqiYkvaDS8JR7eKOQm8wziTH/el5qL7D6gYNkYcw==",
"dev": true,
"dependencies": {
"@types/prop-types": "*",
@ -8947,9 +8947,9 @@
}
},
"node_modules/prettier": {
"version": "2.8.6",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.6.tgz",
"integrity": "sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==",
"version": "2.8.7",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz",
"integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
@ -9421,9 +9421,9 @@
}
},
"node_modules/rimraf": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.0.tgz",
"integrity": "sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz",
"integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==",
"dev": true,
"dependencies": {
"glob": "^9.2.0"
@ -10675,9 +10675,9 @@
}
},
"node_modules/webpack": {
"version": "5.76.2",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.2.tgz",
"integrity": "sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w==",
"version": "5.76.3",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz",
"integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==",
"dev": true,
"dependencies": {
"@types/eslint-scope": "^3.7.3",
@ -13671,9 +13671,9 @@
}
},
"@dannadori/psdanimator": {
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/@dannadori/psdanimator/-/psdanimator-1.0.15.tgz",
"integrity": "sha512-cf9v3xc5N+V588MkY3vsc394TzsMFxQnCmmq452VQTFWpjcsKLA8X1g0x2Z9WA6oIE6d6LT/cB6EZ30mrB1afg==",
"version": "1.0.16",
"resolved": "https://registry.npmjs.org/@dannadori/psdanimator/-/psdanimator-1.0.16.tgz",
"integrity": "sha512-leA8V8LY009RfpxijE3yCVoD1LVnLfb0O4zRZclOvTa6NitNCIO6Xe/3SfN1Rkq4zhaU3TRL6CMotS/vIFx2MA==",
"requires": {
"@dannadori/worker-manager": "^1.0.11",
"@webtoon/psd": "^0.3.0"
@ -14198,9 +14198,9 @@
"dev": true
},
"@types/node": {
"version": "18.15.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.5.tgz",
"integrity": "sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew=="
"version": "18.15.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.9.tgz",
"integrity": "sha512-dUxhiNzBLr6IqlZXz6e/rN2YQXlFgOei/Dxy+e3cyXTJ4txSUbGT2/fmnD6zd/75jDMeW5bDee+YXxlFKHoV0A=="
},
"@types/prop-types": {
"version": "15.7.5",
@ -14221,9 +14221,9 @@
"dev": true
},
"@types/react": {
"version": "18.0.28",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz",
"integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==",
"version": "18.0.29",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.29.tgz",
"integrity": "sha512-wXHktgUABxplw1+UnljseDq4+uztQyp2tlWZRIxHlpchsCFqiYkvaDS8JR7eKOQm8wziTH/el5qL7D6gYNkYcw==",
"dev": true,
"requires": {
"@types/prop-types": "*",
@ -18005,9 +18005,9 @@
"dev": true
},
"prettier": {
"version": "2.8.6",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.6.tgz",
"integrity": "sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==",
"version": "2.8.7",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz",
"integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==",
"dev": true
},
"prettier-linter-helpers": {
@ -18367,9 +18367,9 @@
"dev": true
},
"rimraf": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.0.tgz",
"integrity": "sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz",
"integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==",
"dev": true,
"requires": {
"glob": "^9.2.0"
@ -19293,9 +19293,9 @@
}
},
"webpack": {
"version": "5.76.2",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.2.tgz",
"integrity": "sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w==",
"version": "5.76.3",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz",
"integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.3",

View File

@ -23,8 +23,8 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.0",
"@types/node": "^18.15.5",
"@types/react": "^18.0.28",
"@types/node": "^18.15.9",
"@types/react": "^18.0.29",
"@types/react-dom": "^18.0.11",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
@ -40,18 +40,18 @@
"npm-run-all": "^4.1.5",
"postcss-loader": "^7.1.0",
"postcss-nested": "^6.0.1",
"prettier": "^2.8.6",
"rimraf": "^4.4.0",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"style-loader": "^3.3.2",
"ts-loader": "^9.4.2",
"tsconfig-paths": "^4.1.2",
"typescript": "^5.0.2",
"webpack": "^5.76.2",
"webpack": "^5.76.3",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.1"
},
"dependencies": {
"@dannadori/psdanimator": "^1.0.15",
"@dannadori/psdanimator": "^1.0.16",
"@dannadori/voice-changer-client-js": "^1.0.96",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-brands-svg-icons": "^6.3.0",

View File

@ -0,0 +1,40 @@
[
{ "mode": "normal", "z_index": 0, "number": 10, "layer_path": "ROOT_全身" },
{ "mode": "normal", "z_index": 1, "number": 500, "layer_path": "ROOT_!目_*通常" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*通常→" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*∩∩" },
{ "mode": "normal", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "normal", "z_index": 2, "number": 800, "layer_path": "ROOT_!口_*にこ" },
{ "mode": "normal", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_*おすまし" },
{ "mode": "normal", "z_index": 3, "number": 1000, "layer_path": "ROOT_!眉_*平行" },
{ "mode": "normal", "z_index": 3, "number": 1000, "layer_path": "ROOT_!眉_*通常" },
{ "mode": "normal", "z_index": 4, "number": 1000, "layer_path": "ROOT_表情_なし" },
{ "mode": "normal", "z_index": 4, "number": 1000, "layer_path": "ROOT_表情_赤面" },
{ "mode": "normal", "z_index": 5, "number": 1000, "layer_path": "ROOT_漫符_なし" },
{ "mode": "talking", "z_index": 0, "number": 10, "layer_path": "ROOT_全身" },
{ "mode": "talking", "z_index": 1, "number": 500, "layer_path": "ROOT_!目_*通常" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*通常→" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*∩∩" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*微笑" },
{ "mode": "talking", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_*お" },
{ "mode": "talking", "z_index": 2, "number": 50, "layer_path": "ROOT_!口_*え" },
{ "mode": "talking", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_* -" },
{ "mode": "talking", "z_index": 2, "number": 50, "layer_path": "ROOT_!口_*う" },
{ "mode": "talking", "z_index": 2, "number": 100, "layer_path": "ROOT_!口_*にこ" },
{ "mode": "talking", "z_index": 3, "number": 200, "layer_path": "ROOT_!眉_*平行" },
{ "mode": "talking", "z_index": 3, "number": 400, "layer_path": "ROOT_!眉_*通常" },
{ "mode": "talking", "z_index": 3, "number": 400, "layer_path": "ROOT_!眉_*ドヤ" },
{ "mode": "talking", "z_index": 4, "number": 200, "layer_path": "ROOT_表情_なし" },
{ "mode": "talking", "z_index": 4, "number": 1000, "layer_path": "ROOT_表情_赤面" },
{ "mode": "talking", "z_index": 5, "number": 100, "layer_path": "ROOT_漫符_なし" },
{ "mode": "talking", "z_index": 5, "number": 1000, "layer_path": "ROOT_漫符_*♪" },
{ "mode": "talking", "z_index": 0, "number": 10, "layer_path": "ROOT_全身" },
{ "mode": "talking", "z_index": 1, "number": 10, "layer_path": "ROOT_!目_*" },
{ "mode": "talking", "z_index": 2, "number": 10, "layer_path": "ROOT_!口_*え" },
{ "mode": "talking", "z_index": 3, "number": 10, "layer_path": "ROOT_!眉_*平行" },
{ "mode": "talking", "z_index": 4, "number": 10, "layer_path": "ROOT_表情_なし" },
{ "mode": "talking", "z_index": 5, "number": 10, "layer_path": "ROOT_漫符_なし" }
]

View File

@ -0,0 +1,6 @@
{
"charaName": "あみたろ",
"psdFile": "/assets/settings/amitaro/amitaro.psd",
"motionFile": "/assets/settings/amitaro/motion.json",
"motionSpeedRate": 0.5
}

View File

@ -1,5 +1,6 @@
{
"charaName": "つくよみちゃん",
"psdFile": "/assets/settings/tsukuyomi/tsukuyomi.psd",
"motionFile": "/assets/settings/tsukuyomi/motion.json"
"charaName": "あみたろ",
"psdFile": "/assets/settings/amitaro/amitaro.psd",
"motionFile": "/assets/settings/amitaro/motion.json",
"motionSpeedRate": 0.5
}

View File

@ -1,5 +1,6 @@
{
"charaName": "つくよみちゃん",
"psdFile": "/assets/settings/tsukuyomi/tsukuyomi.psd",
"motionFile": "/assets/settings/tsukuyomi/motion.json"
"motionFile": "/assets/settings/tsukuyomi/motion.json",
"motionSpeedRate": 1
}

View File

@ -89,7 +89,7 @@ const App = () => {
<span className="title"></span>
</div>
<div className="top-title">
<span className="top-title-version"> ver.0.0α</span>
<span className="top-title-version">{appState.appSettings.appSettings.charaName} ver.0.1</span>
<span className="belongings">
{githubLink}
{manualLink}

View File

@ -4,12 +4,14 @@ export type AppSettings = {
charaName: string,
psdFile: string,
motionFile: string,
motionSpeedRate: number
}
const InitialAppSettings: AppSettings = {
charaName: "",
psdFile: "",
motionFile: "",
motionSpeedRate: 1
}
export type AppSettingStates = {

View File

@ -7,7 +7,7 @@ type PsdAnimationState = {
};
export type PsdAnimationStateAndMethod = PsdAnimationState & {
loadPsd: (psdFile: string, motionFile: string) => Promise<void>
loadPsd: (psdFile: string, motionFile: string, speedRate: number) => Promise<void>
start: () => Promise<void>
switchNormalMotion: () => Promise<void>
switchTalkingMotion: () => Promise<void>
@ -20,12 +20,13 @@ export const usePsdAnimation = (): PsdAnimationStateAndMethod => {
}, [])
const [psdAnimationInitialized, setPsdAnimationInitialized] = useState<boolean>(false)
const loadPsd = async (psdFile: string, motionFile: string) => {
const loadPsd = async (psdFile: string, motionFile: string, speedRate: number) => {
const psd = await (await fetch(psdFile)).arrayBuffer()
const motion = await (await fetch(motionFile)).json() as AnimationFrameInfo[]
const canvas = document.getElementById(TSUKUYOMI_CANVAS) as HTMLCanvasElement
// const c = generateConfig(psdFile, canvas, 640, 480, true)
const c = generateConfig(psd, canvas, 640, 480, false)
c.processorURL = "https://cdn.jsdelivr.net/npm/@dannadori/psdanimator@1.0.17/dist/process.js"
c.transfer = [c.canvas]
await w.init(c)
console.log("[psd animator] Initialized")
@ -38,34 +39,16 @@ export const usePsdAnimation = (): PsdAnimationStateAndMethod => {
await w.execute(p1)
console.log("[psd animator] Set motion")
setPsdAnimationInitialized(true)
const p3: PSDAnimatorParams = {
type: "SET_WAIT_RATE",
waitRate: speedRate,
transfer: []
}
await w.execute(p3)
}
// "ROOT_!眉 _*通常眉",
// "ROOT_!眉 _*通常眉:少し下げ",
// "ROOT_!眉 _*喜び・驚き",
// "ROOT_!目_*通常目",
// "ROOT_!目_*目を少し細める ★デフォルト",
// "ROOT_!目_*目を細める",
// "ROOT_!目_*目を閉じる",
// "ROOT_!目_*目を閉じて微笑む",
// "ROOT_!頬 _*通常",
// "ROOT_!口 _*口を閉じて微笑む",
// "ROOT_!口 _*小さく笑う",
// "ROOT_!口 _*大きく笑う",
// "ROOT_!髪おさげ_!髪(おさげ) ※選択肢なし",
// "ROOT_!左腕_*左手を下げる",
// "ROOT_!左腕_*左手でご案内",
// "ROOT_!左腕_*左手を胸の前に:グー",
// "ROOT_!左腕_*左手を胸の前に:パー",
// "ROOT_!左腕_*左手を口に当てる",
// "ROOT_!右腕_*右手を下げる",
// "ROOT_!右腕_*右手でご案内",
// "ROOT_!右腕_*右手を胸の前に:グー",
// "ROOT_!右腕_*右手を胸の前に:パー",
// "ROOT_!右腕_*右手を口に当てる",
// "ROOT_!体_!体 ※選択肢なし"
const start = async () => {
const p3: PSDAnimatorParams = {
type: "START",

View File

@ -44,7 +44,7 @@ export const AppStateProvider = ({ children }: Props) => {
useEffect(() => {
if (appSettings.appSettings.charaName.length > 0) {
psdAnimationState.loadPsd(appSettings.appSettings.psdFile, appSettings.appSettings.motionFile)
psdAnimationState.loadPsd(appSettings.appSettings.psdFile, appSettings.appSettings.motionFile, appSettings.appSettings.motionSpeedRate)
}
}, [appSettings.appSettings])