sa2kit 1.6.30 → 1.6.31
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/AliyunOSSProvider-P6TOVKMM.mjs +6 -0
- package/dist/{AliyunOSSProvider-KJYRIZES.mjs.map → AliyunOSSProvider-P6TOVKMM.mjs.map} +1 -1
- package/dist/AliyunOSSProvider-Z5BRBCG6.js +15 -0
- package/dist/{AliyunOSSProvider-FWAKUB2T.js.map → AliyunOSSProvider-Z5BRBCG6.js.map} +1 -1
- package/dist/ConfigService-3DIC6C3Q.js +21 -0
- package/dist/{ConfigService-7MEZXKJ5.js.map → ConfigService-3DIC6C3Q.js.map} +1 -1
- package/dist/ConfigService-V6ZK273Z.mjs +4 -0
- package/dist/{ConfigService-BV57YYFW.mjs.map → ConfigService-V6ZK273Z.mjs.map} +1 -1
- package/dist/LocalStorageProvider-3RVPCQB3.mjs +6 -0
- package/dist/{LocalStorageProvider-RTPMUOZ2.mjs.map → LocalStorageProvider-3RVPCQB3.mjs.map} +1 -1
- package/dist/LocalStorageProvider-PP7MA5OT.js +15 -0
- package/dist/{LocalStorageProvider-XSRCUXOU.js.map → LocalStorageProvider-PP7MA5OT.js.map} +1 -1
- package/dist/PMXParser-2VTA737I.js +13 -0
- package/dist/{PMXParser-YBS3B6HM.js.map → PMXParser-2VTA737I.js.map} +1 -1
- package/dist/PMXParser-RNVQL76A.mjs +4 -0
- package/dist/{PMXParser-L6IWHL4I.mjs.map → PMXParser-RNVQL76A.mjs.map} +1 -1
- package/dist/analytics/index.js +46 -45
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +45 -44
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/analytics/server/index.js +4 -4
- package/dist/analytics/server/index.js.map +1 -1
- package/dist/analytics/server/index.mjs +4 -4
- package/dist/analytics/server/index.mjs.map +1 -1
- package/dist/api/index.js +5 -5
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +5 -5
- package/dist/api/index.mjs.map +1 -1
- package/dist/audioDetection/index.js +17 -16
- package/dist/audioDetection/index.js.map +1 -1
- package/dist/audioDetection/index.mjs +17 -16
- package/dist/audioDetection/index.mjs.map +1 -1
- package/dist/auth/client/index.js +4 -4
- package/dist/auth/client/index.mjs +1 -1
- package/dist/auth/components/index.js +3 -3
- package/dist/auth/components/index.js.map +1 -1
- package/dist/auth/components/index.mjs +3 -3
- package/dist/auth/components/index.mjs.map +1 -1
- package/dist/auth/index.js +29 -29
- package/dist/auth/index.mjs +5 -5
- package/dist/auth/middleware/index.js +3 -3
- package/dist/auth/middleware/index.mjs +2 -2
- package/dist/auth/routes/index.js +14 -14
- package/dist/auth/routes/index.mjs +2 -2
- package/dist/auth/services/index.js +7 -7
- package/dist/auth/services/index.mjs +1 -1
- package/dist/calendar/index.js +146 -182
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +139 -175
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/calendar/routes/index.js +1 -1
- package/dist/calendar/routes/index.js.map +1 -1
- package/dist/calendar/routes/index.mjs +1 -1
- package/dist/calendar/routes/index.mjs.map +1 -1
- package/dist/{chunk-5YQ5B7IZ.js → chunk-24HGREE6.js} +5 -5
- package/dist/{chunk-5YQ5B7IZ.js.map → chunk-24HGREE6.js.map} +1 -1
- package/dist/{chunk-6PRFP5EG.js → chunk-25OFOKNF.js} +6 -6
- package/dist/chunk-25OFOKNF.js.map +1 -0
- package/dist/{chunk-KQGP6BTS.mjs → chunk-3DXPQ4YV.mjs} +6 -6
- package/dist/chunk-3DXPQ4YV.mjs.map +1 -0
- package/dist/{chunk-3BGPZN4X.mjs → chunk-3NHAT7D4.mjs} +12 -12
- package/dist/chunk-3NHAT7D4.mjs.map +1 -0
- package/dist/{chunk-MW4BCIZC.mjs → chunk-4HC6M7FK.mjs} +3 -3
- package/dist/chunk-4HC6M7FK.mjs.map +1 -0
- package/dist/{chunk-ESRCX5TQ.mjs → chunk-52TN2QSS.mjs} +3 -3
- package/dist/{chunk-ESRCX5TQ.mjs.map → chunk-52TN2QSS.mjs.map} +1 -1
- package/dist/{chunk-DW2ZTOCV.js → chunk-5A7ERLKK.js} +105 -106
- package/dist/chunk-5A7ERLKK.js.map +1 -0
- package/dist/{chunk-CNTILN5J.mjs → chunk-5YQ62BKX.mjs} +20 -19
- package/dist/chunk-5YQ62BKX.mjs.map +1 -0
- package/dist/{chunk-6W5BMXJG.js → chunk-6OWNMJKG.js} +4 -4
- package/dist/{chunk-6W5BMXJG.js.map → chunk-6OWNMJKG.js.map} +1 -1
- package/dist/{chunk-TV3VKRJK.mjs → chunk-77M5AQG3.mjs} +37 -37
- package/dist/chunk-77M5AQG3.mjs.map +1 -0
- package/dist/{chunk-DUHZ7VZP.js → chunk-7VRT55ZD.js} +3 -3
- package/dist/chunk-7VRT55ZD.js.map +1 -0
- package/dist/{chunk-LX4XX6W7.js → chunk-C54W2CMK.js} +16 -16
- package/dist/chunk-C54W2CMK.js.map +1 -0
- package/dist/{chunk-3WOAPLEG.mjs → chunk-EB4NR623.mjs} +27 -26
- package/dist/chunk-EB4NR623.mjs.map +1 -0
- package/dist/{chunk-CD77U7LZ.js → chunk-GBPLX42J.js} +9 -9
- package/dist/chunk-GBPLX42J.js.map +1 -0
- package/dist/{chunk-TFQF2HDO.mjs → chunk-HDEOCX2L.mjs} +12 -12
- package/dist/chunk-HDEOCX2L.mjs.map +1 -0
- package/dist/{chunk-LFG6FPM5.mjs → chunk-KIP2CERU.mjs} +37 -38
- package/dist/chunk-KIP2CERU.mjs.map +1 -0
- package/dist/{chunk-6YKMCPQI.mjs → chunk-KZKIH4AS.mjs} +4 -4
- package/dist/chunk-KZKIH4AS.mjs.map +1 -0
- package/dist/{chunk-6MQUBPKB.mjs → chunk-LJ4CCSSY.mjs} +3 -3
- package/dist/{chunk-6MQUBPKB.mjs.map → chunk-LJ4CCSSY.mjs.map} +1 -1
- package/dist/{chunk-TOC5FSHP.js → chunk-NJ2SNXBJ.js} +12 -12
- package/dist/chunk-NJ2SNXBJ.js.map +1 -0
- package/dist/{chunk-OCR5DS4C.mjs → chunk-PE5EAHZK.mjs} +3 -3
- package/dist/chunk-PE5EAHZK.mjs.map +1 -0
- package/dist/{chunk-LZHMNOED.js → chunk-Q5EDCKQA.js} +26 -26
- package/dist/chunk-Q5EDCKQA.js.map +1 -0
- package/dist/{chunk-CLKKZSPZ.js → chunk-RBKGYWME.js} +20 -19
- package/dist/chunk-RBKGYWME.js.map +1 -0
- package/dist/{chunk-VRTRSEEH.mjs → chunk-RSJSZ7QH.mjs} +11 -11
- package/dist/chunk-RSJSZ7QH.mjs.map +1 -0
- package/dist/{chunk-E7RGBAYJ.js → chunk-TDCDEBGP.js} +30 -29
- package/dist/chunk-TDCDEBGP.js.map +1 -0
- package/dist/{chunk-T5OZHYVM.mjs → chunk-TVROG2Q4.mjs} +15 -15
- package/dist/chunk-TVROG2Q4.mjs.map +1 -0
- package/dist/{chunk-JZXJQMVE.js → chunk-UIFFDRTE.js} +11 -11
- package/dist/chunk-UIFFDRTE.js.map +1 -0
- package/dist/{chunk-UOFTHYIH.js → chunk-UL6XJGUZ.js} +4 -4
- package/dist/chunk-UL6XJGUZ.js.map +1 -0
- package/dist/{chunk-A3UP56MS.js → chunk-WA67GZSZ.js} +3 -3
- package/dist/chunk-WA67GZSZ.js.map +1 -0
- package/dist/{chunk-OLHGZXN3.mjs → chunk-WEEXCPSE.mjs} +5 -5
- package/dist/chunk-WEEXCPSE.mjs.map +1 -0
- package/dist/{chunk-OPPF3326.js → chunk-X3UU7JHT.js} +38 -38
- package/dist/chunk-X3UU7JHT.js.map +1 -0
- package/dist/{chunk-QU5OT4DF.js → chunk-XJ7ZAGC5.js} +5 -5
- package/dist/chunk-XJ7ZAGC5.js.map +1 -0
- package/dist/{chunk-ZI25QCHD.mjs → chunk-YOTQG4NP.mjs} +25 -25
- package/dist/chunk-YOTQG4NP.mjs.map +1 -0
- package/dist/{chunk-QAT2RWAO.mjs → chunk-Z36R3P62.mjs} +7 -7
- package/dist/chunk-Z36R3P62.mjs.map +1 -0
- package/dist/{chunk-7Z5LLJ3A.js → chunk-ZWQJSZEY.js} +13 -13
- package/dist/chunk-ZWQJSZEY.js.map +1 -0
- package/dist/config/index.js +6 -6
- package/dist/config/index.js.map +1 -1
- package/dist/config/index.mjs +6 -6
- package/dist/config/index.mjs.map +1 -1
- package/dist/config/server/index.js +37 -37
- package/dist/config/server/index.js.map +1 -1
- package/dist/config/server/index.mjs +37 -37
- package/dist/config/server/index.mjs.map +1 -1
- package/dist/i18n/index.d.mts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +16 -17
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/index.mjs +16 -17
- package/dist/i18n/index.mjs.map +1 -1
- package/dist/imageCrop/index.js +11 -10
- package/dist/imageCrop/index.js.map +1 -1
- package/dist/imageCrop/index.mjs +11 -10
- package/dist/imageCrop/index.mjs.map +1 -1
- package/dist/index.js +221 -246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -104
- package/dist/index.mjs.map +1 -1
- package/dist/logger/index.js +6 -6
- package/dist/logger/index.mjs +1 -1
- package/dist/mmd/admin/index.js +11 -10
- package/dist/mmd/admin/index.js.map +1 -1
- package/dist/mmd/admin/index.mjs +11 -10
- package/dist/mmd/admin/index.mjs.map +1 -1
- package/dist/mmd/index.js +223 -241
- package/dist/mmd/index.js.map +1 -1
- package/dist/mmd/index.mjs +220 -238
- package/dist/mmd/index.mjs.map +1 -1
- package/dist/mmd/server/index.js +6 -6
- package/dist/mmd/server/index.js.map +1 -1
- package/dist/mmd/server/index.mjs +6 -6
- package/dist/mmd/server/index.mjs.map +1 -1
- package/dist/music/index.js +16 -16
- package/dist/music/index.mjs +2 -2
- package/dist/music/server/index.js +8 -8
- package/dist/music/server/index.mjs +1 -1
- package/dist/request/index.js +2 -2
- package/dist/request/index.js.map +1 -1
- package/dist/request/index.mjs +2 -2
- package/dist/request/index.mjs.map +1 -1
- package/dist/storage/index.js +11 -11
- package/dist/storage/index.mjs +2 -2
- package/dist/testYourself/admin/index.js +3 -3
- package/dist/testYourself/admin/index.mjs +1 -1
- package/dist/testYourself/index.js +22 -22
- package/dist/testYourself/index.js.map +1 -1
- package/dist/testYourself/index.mjs +14 -14
- package/dist/testYourself/index.mjs.map +1 -1
- package/dist/testYourself/server/index.js +4 -4
- package/dist/testYourself/server/index.mjs +1 -1
- package/dist/universalExport/index.d.mts +3 -3
- package/dist/universalExport/index.d.ts +3 -3
- package/dist/universalExport/index.js +48 -47
- package/dist/universalExport/index.js.map +1 -1
- package/dist/universalExport/index.mjs +48 -47
- package/dist/universalExport/index.mjs.map +1 -1
- package/dist/universalExport/server/index.js +29 -29
- package/dist/universalExport/server/index.js.map +1 -1
- package/dist/universalExport/server/index.mjs +28 -28
- package/dist/universalExport/server/index.mjs.map +1 -1
- package/dist/universalFile/index.d.mts +3 -3
- package/dist/universalFile/index.d.ts +3 -3
- package/dist/universalFile/index.js +73 -72
- package/dist/universalFile/index.js.map +1 -1
- package/dist/universalFile/index.mjs +73 -72
- package/dist/universalFile/index.mjs.map +1 -1
- package/dist/universalFile/server/index.js +258 -260
- package/dist/universalFile/server/index.js.map +1 -1
- package/dist/universalFile/server/index.mjs +244 -246
- package/dist/universalFile/server/index.mjs.map +1 -1
- package/dist/utils/index.js +11 -11
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/AliyunOSSProvider-FWAKUB2T.js +0 -15
- package/dist/AliyunOSSProvider-KJYRIZES.mjs +0 -6
- package/dist/ConfigService-7MEZXKJ5.js +0 -21
- package/dist/ConfigService-BV57YYFW.mjs +0 -4
- package/dist/LocalStorageProvider-RTPMUOZ2.mjs +0 -6
- package/dist/LocalStorageProvider-XSRCUXOU.js +0 -15
- package/dist/PMXParser-L6IWHL4I.mjs +0 -4
- package/dist/PMXParser-YBS3B6HM.js +0 -13
- package/dist/chunk-3BGPZN4X.mjs.map +0 -1
- package/dist/chunk-3WOAPLEG.mjs.map +0 -1
- package/dist/chunk-6PRFP5EG.js.map +0 -1
- package/dist/chunk-6YKMCPQI.mjs.map +0 -1
- package/dist/chunk-7Z5LLJ3A.js.map +0 -1
- package/dist/chunk-A3UP56MS.js.map +0 -1
- package/dist/chunk-CD77U7LZ.js.map +0 -1
- package/dist/chunk-CLKKZSPZ.js.map +0 -1
- package/dist/chunk-CNTILN5J.mjs.map +0 -1
- package/dist/chunk-DUHZ7VZP.js.map +0 -1
- package/dist/chunk-DW2ZTOCV.js.map +0 -1
- package/dist/chunk-E7RGBAYJ.js.map +0 -1
- package/dist/chunk-JZXJQMVE.js.map +0 -1
- package/dist/chunk-KQGP6BTS.mjs.map +0 -1
- package/dist/chunk-LFG6FPM5.mjs.map +0 -1
- package/dist/chunk-LX4XX6W7.js.map +0 -1
- package/dist/chunk-LZHMNOED.js.map +0 -1
- package/dist/chunk-MW4BCIZC.mjs.map +0 -1
- package/dist/chunk-OCR5DS4C.mjs.map +0 -1
- package/dist/chunk-OLHGZXN3.mjs.map +0 -1
- package/dist/chunk-OPPF3326.js.map +0 -1
- package/dist/chunk-QAT2RWAO.mjs.map +0 -1
- package/dist/chunk-QU5OT4DF.js.map +0 -1
- package/dist/chunk-T5OZHYVM.mjs.map +0 -1
- package/dist/chunk-TFQF2HDO.mjs.map +0 -1
- package/dist/chunk-TOC5FSHP.js.map +0 -1
- package/dist/chunk-TV3VKRJK.mjs.map +0 -1
- package/dist/chunk-UOFTHYIH.js.map +0 -1
- package/dist/chunk-VRTRSEEH.mjs.map +0 -1
- package/dist/chunk-ZI25QCHD.mjs.map +0 -1
package/dist/mmd/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useMusic } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import { PMXParser } from '../chunk-
|
|
4
|
-
export { PMXParser } from '../chunk-
|
|
1
|
+
import { useMusic } from '../chunk-EB4NR623.mjs';
|
|
2
|
+
import '../chunk-4HC6M7FK.mjs';
|
|
3
|
+
import { PMXParser } from '../chunk-RSJSZ7QH.mjs';
|
|
4
|
+
export { PMXParser } from '../chunk-RSJSZ7QH.mjs';
|
|
5
5
|
import '../chunk-BJTO5JO5.mjs';
|
|
6
6
|
import React10, { forwardRef, useRef, useState, useEffect, useImperativeHandle, useCallback, useMemo } from 'react';
|
|
7
|
+
import { clsx } from 'clsx';
|
|
7
8
|
import * as THREE2 from 'three';
|
|
8
9
|
import { OutlineEffect, OrbitControls, MMDLoader, MMDAnimationHelper } from 'three-stdlib';
|
|
9
10
|
import { SkipBack, Pause, Play, SkipForward, Camera, Repeat, Repeat1, Shuffle, ListMusic, Music, X, Search, Loader2, Grid3x3, Settings, Minimize, Maximize, Video, Check, User, Image } from 'lucide-react';
|
|
@@ -72,7 +73,7 @@ var PMXEditor = class {
|
|
|
72
73
|
action: "add",
|
|
73
74
|
target: newTexture.index,
|
|
74
75
|
data: { path }
|
|
75
|
-
},
|
|
76
|
+
}, "\u6DFB\u52A0\u7EB9\u7406: " + path);
|
|
76
77
|
return newTexture.index;
|
|
77
78
|
}
|
|
78
79
|
/**
|
|
@@ -80,7 +81,7 @@ var PMXEditor = class {
|
|
|
80
81
|
*/
|
|
81
82
|
updateTexture(index, newPath) {
|
|
82
83
|
if (index < 0 || index >= this.data.textures.length) {
|
|
83
|
-
throw new Error(
|
|
84
|
+
throw new Error("Invalid texture index: " + index);
|
|
84
85
|
}
|
|
85
86
|
const oldPath = this.data.textures[index].path;
|
|
86
87
|
this.data.textures[index].path = newPath;
|
|
@@ -89,7 +90,7 @@ var PMXEditor = class {
|
|
|
89
90
|
action: "update",
|
|
90
91
|
target: index,
|
|
91
92
|
data: { oldPath, newPath }
|
|
92
|
-
},
|
|
93
|
+
}, "\u66F4\u65B0\u7EB9\u7406 #" + index + ": " + oldPath + " \u2192 " + newPath);
|
|
93
94
|
return true;
|
|
94
95
|
}
|
|
95
96
|
/**
|
|
@@ -97,13 +98,13 @@ var PMXEditor = class {
|
|
|
97
98
|
*/
|
|
98
99
|
deleteTexture(index) {
|
|
99
100
|
if (index < 0 || index >= this.data.textures.length) {
|
|
100
|
-
throw new Error(
|
|
101
|
+
throw new Error("Invalid texture index: " + index);
|
|
101
102
|
}
|
|
102
103
|
const usedByMaterials = this.data.materials.filter(
|
|
103
104
|
(m) => m.textureIndex === index || m.sphereTextureIndex === index || !m.isSharedToon && m.toonTextureIndex === index
|
|
104
105
|
);
|
|
105
106
|
if (usedByMaterials.length > 0) {
|
|
106
|
-
throw new Error(
|
|
107
|
+
throw new Error("\u7EB9\u7406 #" + index + " \u6B63\u5728\u88AB " + usedByMaterials.length + " \u4E2A\u6750\u8D28\u4F7F\u7528\uFF0C\u65E0\u6CD5\u5220\u9664");
|
|
107
108
|
}
|
|
108
109
|
const deletedTexture = this.data.textures.splice(index, 1)[0];
|
|
109
110
|
if (!deletedTexture) return false;
|
|
@@ -123,7 +124,7 @@ var PMXEditor = class {
|
|
|
123
124
|
action: "delete",
|
|
124
125
|
target: index,
|
|
125
126
|
data: { path: deletedTexture.path }
|
|
126
|
-
},
|
|
127
|
+
}, "\u5220\u9664\u7EB9\u7406 #" + index + ": " + deletedTexture.path);
|
|
127
128
|
return true;
|
|
128
129
|
}
|
|
129
130
|
/**
|
|
@@ -131,10 +132,10 @@ var PMXEditor = class {
|
|
|
131
132
|
*/
|
|
132
133
|
setMaterialMainTexture(materialIndex, textureIndex) {
|
|
133
134
|
if (materialIndex < 0 || materialIndex >= this.data.materials.length) {
|
|
134
|
-
throw new Error(
|
|
135
|
+
throw new Error("Invalid material index: " + materialIndex);
|
|
135
136
|
}
|
|
136
137
|
if (textureIndex !== -1 && (textureIndex < 0 || textureIndex >= this.data.textures.length)) {
|
|
137
|
-
throw new Error(
|
|
138
|
+
throw new Error("Invalid texture index: " + textureIndex);
|
|
138
139
|
}
|
|
139
140
|
const material = this.data.materials[materialIndex];
|
|
140
141
|
const oldIndex = material.textureIndex;
|
|
@@ -149,7 +150,7 @@ var PMXEditor = class {
|
|
|
149
150
|
oldIndex,
|
|
150
151
|
newIndex: textureIndex
|
|
151
152
|
}
|
|
152
|
-
},
|
|
153
|
+
}, "\u6750\u8D28 #" + materialIndex + " \u4E3B\u7EB9\u7406: #" + oldIndex + " \u2192 #" + textureIndex);
|
|
153
154
|
return true;
|
|
154
155
|
}
|
|
155
156
|
/**
|
|
@@ -157,10 +158,10 @@ var PMXEditor = class {
|
|
|
157
158
|
*/
|
|
158
159
|
setMaterialSphereTexture(materialIndex, textureIndex, mode = 1) {
|
|
159
160
|
if (materialIndex < 0 || materialIndex >= this.data.materials.length) {
|
|
160
|
-
throw new Error(
|
|
161
|
+
throw new Error("Invalid material index: " + materialIndex);
|
|
161
162
|
}
|
|
162
163
|
if (textureIndex !== -1 && (textureIndex < 0 || textureIndex >= this.data.textures.length)) {
|
|
163
|
-
throw new Error(
|
|
164
|
+
throw new Error("Invalid texture index: " + textureIndex);
|
|
164
165
|
}
|
|
165
166
|
const material = this.data.materials[materialIndex];
|
|
166
167
|
const oldIndex = material.sphereTextureIndex;
|
|
@@ -179,7 +180,7 @@ var PMXEditor = class {
|
|
|
179
180
|
oldMode,
|
|
180
181
|
newMode: mode
|
|
181
182
|
}
|
|
182
|
-
},
|
|
183
|
+
}, "\u6750\u8D28 #" + materialIndex + " Sphere\u7EB9\u7406: #" + oldIndex + " \u2192 #" + textureIndex + " (\u6A21\u5F0F: " + mode + ")");
|
|
183
184
|
return true;
|
|
184
185
|
}
|
|
185
186
|
/**
|
|
@@ -187,10 +188,10 @@ var PMXEditor = class {
|
|
|
187
188
|
*/
|
|
188
189
|
setMaterialToonTexture(materialIndex, textureIndex, isShared = false) {
|
|
189
190
|
if (materialIndex < 0 || materialIndex >= this.data.materials.length) {
|
|
190
|
-
throw new Error(
|
|
191
|
+
throw new Error("Invalid material index: " + materialIndex);
|
|
191
192
|
}
|
|
192
193
|
if (!isShared && textureIndex !== -1 && (textureIndex < 0 || textureIndex >= this.data.textures.length)) {
|
|
193
|
-
throw new Error(
|
|
194
|
+
throw new Error("Invalid texture index: " + textureIndex);
|
|
194
195
|
}
|
|
195
196
|
const material = this.data.materials[materialIndex];
|
|
196
197
|
const oldIndex = material.toonTextureIndex;
|
|
@@ -209,7 +210,7 @@ var PMXEditor = class {
|
|
|
209
210
|
oldShared,
|
|
210
211
|
isShared
|
|
211
212
|
}
|
|
212
|
-
},
|
|
213
|
+
}, "\u6750\u8D28 #" + materialIndex + " Toon\u7EB9\u7406: #" + oldIndex + " \u2192 #" + textureIndex + " (\u5171\u4EAB: " + isShared + ")");
|
|
213
214
|
return true;
|
|
214
215
|
}
|
|
215
216
|
/**
|
|
@@ -217,7 +218,7 @@ var PMXEditor = class {
|
|
|
217
218
|
*/
|
|
218
219
|
updateMaterial(materialIndex, updates) {
|
|
219
220
|
if (materialIndex < 0 || materialIndex >= this.data.materials.length) {
|
|
220
|
-
throw new Error(
|
|
221
|
+
throw new Error("Invalid material index: " + materialIndex);
|
|
221
222
|
}
|
|
222
223
|
const material = this.data.materials[materialIndex];
|
|
223
224
|
const oldData = { ...material };
|
|
@@ -243,7 +244,7 @@ var PMXEditor = class {
|
|
|
243
244
|
action: "update",
|
|
244
245
|
target: materialIndex,
|
|
245
246
|
data: { oldData, updates }
|
|
246
|
-
},
|
|
247
|
+
}, "\u66F4\u65B0\u6750\u8D28 #" + materialIndex + ": " + material.name);
|
|
247
248
|
return true;
|
|
248
249
|
}
|
|
249
250
|
/**
|
|
@@ -274,7 +275,7 @@ var PMXEditor = class {
|
|
|
274
275
|
if (material.isSharedToon) {
|
|
275
276
|
mapping.toonTexture = {
|
|
276
277
|
index: material.toonTextureIndex,
|
|
277
|
-
path:
|
|
278
|
+
path: "toon" + String(material.toonTextureIndex).padStart(2, "0") + ".bmp",
|
|
278
279
|
isShared: true
|
|
279
280
|
};
|
|
280
281
|
} else if (material.toonTextureIndex >= 0 && material.toonTextureIndex < this.data.textures.length) {
|
|
@@ -559,7 +560,7 @@ var PMXExporter = class {
|
|
|
559
560
|
this.view.setInt32(this.offset, value, true);
|
|
560
561
|
break;
|
|
561
562
|
default:
|
|
562
|
-
throw new Error(
|
|
563
|
+
throw new Error("Invalid index size: " + size);
|
|
563
564
|
}
|
|
564
565
|
this.offset += size;
|
|
565
566
|
}
|
|
@@ -602,7 +603,7 @@ var PMXEditor2 = ({
|
|
|
602
603
|
if (!editor) return;
|
|
603
604
|
const data2 = editor.getData();
|
|
604
605
|
const exporter = new PMXExporter(data2);
|
|
605
|
-
exporter.exportAndDownload(
|
|
606
|
+
exporter.exportAndDownload((data2.modelInfo.modelName || "model") + "_edited.pmx");
|
|
606
607
|
};
|
|
607
608
|
const handleMaterialTextureChange = (materialIndex, textureType, textureIndex) => {
|
|
608
609
|
if (!editor) return;
|
|
@@ -630,14 +631,14 @@ var PMXEditor2 = ({
|
|
|
630
631
|
try {
|
|
631
632
|
const index = editor.addTexture(path);
|
|
632
633
|
setRefresh((r) => r + 1);
|
|
633
|
-
alert(
|
|
634
|
+
alert("\u6210\u529F\u6DFB\u52A0\u7EB9\u7406 #" + index + ": " + path);
|
|
634
635
|
} catch (err) {
|
|
635
636
|
alert(err instanceof Error ? err.message : "\u6DFB\u52A0\u5931\u8D25");
|
|
636
637
|
}
|
|
637
638
|
};
|
|
638
639
|
const handleDeleteTexture = (index) => {
|
|
639
640
|
if (!editor) return;
|
|
640
|
-
if (!confirm(
|
|
641
|
+
if (!confirm("\u786E\u5B9A\u8981\u5220\u9664\u7EB9\u7406 #" + index + " \u5417\uFF1F")) return;
|
|
641
642
|
try {
|
|
642
643
|
editor.deleteTexture(index);
|
|
643
644
|
setRefresh((r) => r + 1);
|
|
@@ -647,16 +648,16 @@ var PMXEditor2 = ({
|
|
|
647
648
|
}
|
|
648
649
|
};
|
|
649
650
|
if (loading) {
|
|
650
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
651
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("pmx-editor loading", className) }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-center p-8" }, /* @__PURE__ */ React10.createElement("div", { className: "text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-blue-500 border-r-transparent" }), /* @__PURE__ */ React10.createElement("p", { className: "mt-4 text-gray-600" }, "\u6B63\u5728\u52A0\u8F7D\u6A21\u578B..."))));
|
|
651
652
|
}
|
|
652
653
|
if (error || !editor) {
|
|
653
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
654
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("pmx-editor error", className) }, /* @__PURE__ */ React10.createElement("div", { className: "rounded-lg bg-red-50 p-6 border border-red-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold text-red-800 mb-2" }, "\u274C \u52A0\u8F7D\u9519\u8BEF"), /* @__PURE__ */ React10.createElement("p", { className: "text-red-600" }, error || "\u672A\u77E5\u9519\u8BEF")));
|
|
654
655
|
}
|
|
655
656
|
const data = editor.getData();
|
|
656
657
|
const stats = editor.getStats();
|
|
657
658
|
const history = editor.getHistory();
|
|
658
659
|
const unusedTextures = editor.getUnusedTextures();
|
|
659
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
660
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("pmx-editor", className) }, /* @__PURE__ */ React10.createElement("div", { className: "bg-white border-b border-gray-200 p-4" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("h2", { className: "text-xl font-bold text-gray-900" }, data.modelInfo.modelName), /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, stats.materials, " \u6750\u8D28 | ", stats.textures, " \u7EB9\u7406 | ", stats.editHistory, " \u6B21\u7F16\u8F91")), /* @__PURE__ */ React10.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React10.createElement(
|
|
660
661
|
"button",
|
|
661
662
|
{
|
|
662
663
|
onClick: handleExport,
|
|
@@ -672,7 +673,7 @@ var PMXEditor2 = ({
|
|
|
672
673
|
{
|
|
673
674
|
key: tab.id,
|
|
674
675
|
onClick: () => setActiveTab(tab.id),
|
|
675
|
-
className:
|
|
676
|
+
className: clsx("py-3 px-4 font-medium transition-colors", activeTab === tab.id ? "border-b-2 border-blue-500 text-blue-600" : "text-gray-600 hover:text-gray-900")
|
|
676
677
|
},
|
|
677
678
|
tab.label
|
|
678
679
|
)))), /* @__PURE__ */ React10.createElement("div", { className: "p-6" }, activeTab === "materials" && /* @__PURE__ */ React10.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6" }, /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow" }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold" }, "\u6750\u8D28\u5217\u8868 (", data.materials.length, ")")), /* @__PURE__ */ React10.createElement("div", { className: "divide-y divide-gray-200 max-h-[600px] overflow-y-auto" }, data.materialTextureMappings.map((mapping) => /* @__PURE__ */ React10.createElement(
|
|
@@ -680,18 +681,18 @@ var PMXEditor2 = ({
|
|
|
680
681
|
{
|
|
681
682
|
key: mapping.materialIndex,
|
|
682
683
|
onClick: () => setSelectedMaterial(mapping.materialIndex),
|
|
683
|
-
className:
|
|
684
|
+
className: clsx("p-4 cursor-pointer hover:bg-gray-50", selectedMaterial === mapping.materialIndex ? "bg-blue-50" : "")
|
|
684
685
|
},
|
|
685
686
|
/* @__PURE__ */ React10.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React10.createElement(
|
|
686
687
|
"div",
|
|
687
688
|
{
|
|
688
689
|
className: "w-10 h-10 rounded border",
|
|
689
690
|
style: {
|
|
690
|
-
backgroundColor:
|
|
691
|
+
backgroundColor: "rgba(" + data.materials[mapping.materialIndex]?.diffuse[0] * 255 + ", " + data.materials[mapping.materialIndex]?.diffuse[1] * 255 + ", " + data.materials[mapping.materialIndex]?.diffuse[2] * 255 + ", 1)"
|
|
691
692
|
}
|
|
692
693
|
}
|
|
693
694
|
), /* @__PURE__ */ React10.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React10.createElement("p", { className: "font-medium" }, "#", mapping.materialIndex, ": ", mapping.materialName), /* @__PURE__ */ React10.createElement("p", { className: "text-xs text-gray-500" }, mapping.mainTexture && "\u{1F5BC}\uFE0F ", mapping.sphereTexture && "\u2728 ", mapping.toonTexture && "\u{1F3A8} ", !mapping.mainTexture && !mapping.sphereTexture && !mapping.toonTexture && "\u26AA \u65E0\u7EB9\u7406")))
|
|
694
|
-
)))), /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow" }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold" }, selectedMaterial !== null ?
|
|
695
|
+
)))), /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow" }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold" }, selectedMaterial !== null ? "\u7F16\u8F91\u6750\u8D28 #" + selectedMaterial : "\u8BF7\u9009\u62E9\u6750\u8D28")), selectedMaterial !== null && /* @__PURE__ */ React10.createElement("div", { className: "p-4 space-y-4" }, /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("label", { className: "block text-sm font-medium text-gray-700 mb-2" }, "\u{1F5BC}\uFE0F \u4E3B\u7EB9\u7406"), /* @__PURE__ */ React10.createElement(
|
|
695
696
|
"select",
|
|
696
697
|
{
|
|
697
698
|
value: data.materials[selectedMaterial].textureIndex,
|
|
@@ -771,16 +772,16 @@ var PMXViewer = ({
|
|
|
771
772
|
const getTextureUrl = (path) => {
|
|
772
773
|
if (!basePath) return path;
|
|
773
774
|
const normalizedPath = path.replace(/\\/g, "/");
|
|
774
|
-
return
|
|
775
|
+
return basePath + "/" + normalizedPath;
|
|
775
776
|
};
|
|
776
777
|
if (loading) {
|
|
777
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
778
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("pmx-viewer loading", className) }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-center p-8" }, /* @__PURE__ */ React10.createElement("div", { className: "text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-blue-500 border-r-transparent" }), /* @__PURE__ */ React10.createElement("p", { className: "mt-4 text-gray-600" }, "\u6B63\u5728\u89E3\u6790PMX\u6A21\u578B..."))));
|
|
778
779
|
}
|
|
779
780
|
if (error || !result) {
|
|
780
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
781
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("pmx-viewer error", className) }, /* @__PURE__ */ React10.createElement("div", { className: "rounded-lg bg-red-50 p-6 border border-red-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold text-red-800 mb-2" }, "\u274C \u89E3\u6790\u9519\u8BEF"), /* @__PURE__ */ React10.createElement("p", { className: "text-red-600" }, error || "\u672A\u77E5\u9519\u8BEF")));
|
|
781
782
|
}
|
|
782
783
|
const { header, modelInfo, textures, materials, materialTextureMappings, vertexCount, faceCount } = result;
|
|
783
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
784
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("pmx-viewer", className) }, /* @__PURE__ */ React10.createElement("div", { className: "border-b border-gray-200 mb-6" }, /* @__PURE__ */ React10.createElement("nav", { className: "flex space-x-4" }, [
|
|
784
785
|
{ id: "overview", label: "\u{1F4CA} \u6982\u89C8" },
|
|
785
786
|
{ id: "textures", label: "\u{1F5BC}\uFE0F \u7EB9\u7406\u5217\u8868" },
|
|
786
787
|
{ id: "materials", label: "\u{1F3A8} \u6750\u8D28\u5217\u8868" },
|
|
@@ -790,7 +791,7 @@ var PMXViewer = ({
|
|
|
790
791
|
{
|
|
791
792
|
key: tab.id,
|
|
792
793
|
onClick: () => setActiveTab(tab.id),
|
|
793
|
-
className:
|
|
794
|
+
className: clsx("py-2 px-4 font-medium transition-colors", activeTab === tab.id ? "border-b-2 border-blue-500 text-blue-600" : "text-gray-600 hover:text-gray-900")
|
|
794
795
|
},
|
|
795
796
|
tab.label
|
|
796
797
|
)))), activeTab === "overview" && /* @__PURE__ */ React10.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow p-6" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-xl font-bold mb-4" }, "\u6A21\u578B\u4FE1\u606F"), /* @__PURE__ */ React10.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4" }, /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, "\u6A21\u578B\u540D\u79F0"), /* @__PURE__ */ React10.createElement("p", { className: "font-medium" }, modelInfo.modelName || "\u672A\u547D\u540D")), /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, "\u82F1\u6587\u540D\u79F0"), /* @__PURE__ */ React10.createElement("p", { className: "font-medium" }, modelInfo.modelNameEnglish || "-")), /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, "PMX\u7248\u672C"), /* @__PURE__ */ React10.createElement("p", { className: "font-medium" }, header.version)), /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, "\u7F16\u7801\u683C\u5F0F"), /* @__PURE__ */ React10.createElement("p", { className: "font-medium" }, header.globals.encoding === 0 ? "UTF-16LE" : "UTF-8"))), modelInfo.comment && /* @__PURE__ */ React10.createElement("div", { className: "mt-4" }, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, "\u6CE8\u91CA"), /* @__PURE__ */ React10.createElement("p", { className: "text-sm mt-1 whitespace-pre-wrap" }, modelInfo.comment))), /* @__PURE__ */ React10.createElement("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4" }, /* @__PURE__ */ React10.createElement("div", { className: "bg-blue-50 rounded-lg p-4" }, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-blue-600 mb-1" }, "\u9876\u70B9\u6570"), /* @__PURE__ */ React10.createElement("p", { className: "text-2xl font-bold text-blue-900" }, vertexCount.toLocaleString())), /* @__PURE__ */ React10.createElement("div", { className: "bg-green-50 rounded-lg p-4" }, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-green-600 mb-1" }, "\u9762\u6570"), /* @__PURE__ */ React10.createElement("p", { className: "text-2xl font-bold text-green-900" }, faceCount.toLocaleString())), /* @__PURE__ */ React10.createElement("div", { className: "bg-purple-50 rounded-lg p-4" }, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-purple-600 mb-1" }, "\u7EB9\u7406\u6570"), /* @__PURE__ */ React10.createElement("p", { className: "text-2xl font-bold text-purple-900" }, textures.length)), /* @__PURE__ */ React10.createElement("div", { className: "bg-orange-50 rounded-lg p-4" }, /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-orange-600 mb-1" }, "\u6750\u8D28\u6570"), /* @__PURE__ */ React10.createElement("p", { className: "text-2xl font-bold text-orange-900" }, materials.length)))), activeTab === "textures" && /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow" }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold" }, "\u7EB9\u7406\u5217\u8868 (", textures.length, ")")), /* @__PURE__ */ React10.createElement("div", { className: "divide-y divide-gray-200" }, textures.map((texture) => /* @__PURE__ */ React10.createElement("div", { key: texture.index, className: "p-4 hover:bg-gray-50" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-start gap-4" }, /* @__PURE__ */ React10.createElement("div", { className: "flex-shrink-0 w-12 h-12 bg-gray-200 rounded flex items-center justify-center text-gray-500 text-xs" }, "#", texture.index), /* @__PURE__ */ React10.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React10.createElement("p", { className: "font-medium text-gray-900 truncate" }, texture.path), /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-500 mt-1" }, "\u5B8C\u6574URL:"), /* @__PURE__ */ React10.createElement("code", { className: "text-xs bg-gray-100 px-2 py-1 rounded block mt-1 overflow-x-auto" }, getTextureUrl(texture.path)))))))), activeTab === "materials" && /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow" }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold" }, "\u6750\u8D28\u5217\u8868 (", materials.length, ")")), /* @__PURE__ */ React10.createElement("div", { className: "divide-y divide-gray-200" }, materials.map((material, index) => /* @__PURE__ */ React10.createElement("div", { key: index, className: "p-4 hover:bg-gray-50" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-start gap-4" }, /* @__PURE__ */ React10.createElement(
|
|
@@ -798,10 +799,10 @@ var PMXViewer = ({
|
|
|
798
799
|
{
|
|
799
800
|
className: "flex-shrink-0 w-12 h-12 rounded border border-gray-300",
|
|
800
801
|
style: {
|
|
801
|
-
backgroundColor:
|
|
802
|
+
backgroundColor: "rgba(" + material.diffuse[0] * 255 + ", " + material.diffuse[1] * 255 + ", " + material.diffuse[2] * 255 + ", " + material.diffuse[3] + ")"
|
|
802
803
|
}
|
|
803
804
|
}
|
|
804
|
-
), /* @__PURE__ */ React10.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React10.createElement("p", { className: "font-medium text-gray-900" }, material.name ||
|
|
805
|
+
), /* @__PURE__ */ React10.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React10.createElement("p", { className: "font-medium text-gray-900" }, material.name || "\u6750\u8D28 #" + index), material.nameEnglish && /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, material.nameEnglish), /* @__PURE__ */ React10.createElement("div", { className: "mt-2 flex flex-wrap gap-2 text-xs" }, /* @__PURE__ */ React10.createElement("span", { className: "bg-blue-100 text-blue-700 px-2 py-1 rounded" }, "\u9762\u6570: ", material.surfaceCount / 3), material.textureIndex >= 0 && /* @__PURE__ */ React10.createElement("span", { className: "bg-green-100 text-green-700 px-2 py-1 rounded" }, "\u7EB9\u7406: #", material.textureIndex), material.sphereTextureIndex >= 0 && /* @__PURE__ */ React10.createElement("span", { className: "bg-purple-100 text-purple-700 px-2 py-1 rounded" }, "Sphere: #", material.sphereTextureIndex), material.toonTextureIndex >= 0 && /* @__PURE__ */ React10.createElement("span", { className: "bg-orange-100 text-orange-700 px-2 py-1 rounded" }, "Toon: ", material.isSharedToon ? "\u5171\u4EAB#" + material.toonTextureIndex : "#" + material.toonTextureIndex)))))))), activeTab === "mappings" && /* @__PURE__ */ React10.createElement("div", { className: "bg-white rounded-lg shadow" }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-semibold" }, "\u6750\u8D28-\u7EB9\u7406\u6620\u5C04\u5173\u7CFB (", materialTextureMappings.length, ")")), /* @__PURE__ */ React10.createElement("div", { className: "divide-y divide-gray-200" }, materialTextureMappings.map((mapping) => /* @__PURE__ */ React10.createElement("div", { key: mapping.materialIndex, className: "p-4 hover:bg-gray-50" }, /* @__PURE__ */ React10.createElement("div", { className: "mb-3" }, /* @__PURE__ */ React10.createElement("h4", { className: "font-semibold text-gray-900" }, "\u6750\u8D28 #", mapping.materialIndex, ": ", mapping.materialName), mapping.materialNameEnglish && /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-600" }, mapping.materialNameEnglish)), /* @__PURE__ */ React10.createElement("div", { className: "space-y-3 pl-4 border-l-2 border-gray-200" }, mapping.mainTexture && /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-xs font-medium text-gray-700 mb-1" }, "\u{1F5BC}\uFE0F \u4E3B\u7EB9\u7406"), /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-900" }, mapping.mainTexture.path), /* @__PURE__ */ React10.createElement("code", { className: "text-xs bg-blue-50 text-blue-700 px-2 py-1 rounded block mt-1" }, getTextureUrl(mapping.mainTexture.path))), mapping.sphereTexture && /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-xs font-medium text-gray-700 mb-1" }, "\u2728 Sphere\u7EB9\u7406 (", mapping.sphereTexture.mode, ")"), /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-900" }, mapping.sphereTexture.path), /* @__PURE__ */ React10.createElement("code", { className: "text-xs bg-purple-50 text-purple-700 px-2 py-1 rounded block mt-1" }, getTextureUrl(mapping.sphereTexture.path))), mapping.toonTexture && /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("p", { className: "text-xs font-medium text-gray-700 mb-1" }, "\u{1F3A8} Toon\u7EB9\u7406 ", mapping.toonTexture.isShared && "(\u5171\u4EAB)"), /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-900" }, mapping.toonTexture.path), !mapping.toonTexture.isShared && /* @__PURE__ */ React10.createElement("code", { className: "text-xs bg-orange-50 text-orange-700 px-2 py-1 rounded block mt-1" }, getTextureUrl(mapping.toonTexture.path))), !mapping.mainTexture && !mapping.sphereTexture && !mapping.toonTexture && /* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-500 italic" }, "\u65E0\u7EB9\u7406\u7ED1\u5B9A")))))));
|
|
805
806
|
};
|
|
806
807
|
|
|
807
808
|
// src/mmd/utils/ammo-loader.ts
|
|
@@ -838,7 +839,7 @@ var loadAmmo = (path = "/libs/ammo.wasm.js") => {
|
|
|
838
839
|
};
|
|
839
840
|
script.onerror = (err) => {
|
|
840
841
|
console.error("Failed to load Ammo.js script:", err);
|
|
841
|
-
reject(new Error(
|
|
842
|
+
reject(new Error("Failed to load Ammo.js from " + path));
|
|
842
843
|
};
|
|
843
844
|
document.body.appendChild(script);
|
|
844
845
|
});
|
|
@@ -885,7 +886,7 @@ function configureMaterialsForMMD(mesh, config = {}) {
|
|
|
885
886
|
});
|
|
886
887
|
}
|
|
887
888
|
});
|
|
888
|
-
console.log(
|
|
889
|
+
console.log("[MMD Material Config] Processed " + materialCount + " materials (Toon: " + toonMaterialCount + ", Phong: " + phongMaterialCount + ")");
|
|
889
890
|
}
|
|
890
891
|
function createGradientMap() {
|
|
891
892
|
const colors = new Uint8Array(5);
|
|
@@ -953,9 +954,9 @@ function configureRendererForMMD(renderer, options = {}) {
|
|
|
953
954
|
renderer.shadowMap.type = THREE2.PCFSoftShadowMap;
|
|
954
955
|
}
|
|
955
956
|
console.log("[MMD Renderer] Configured for MMD-style rendering");
|
|
956
|
-
console.log(
|
|
957
|
+
console.log(" - Tone Mapping: " + (toneMapping === THREE2.LinearToneMapping ? "Linear" : "Custom"));
|
|
957
958
|
console.log(` - Color Space: sRGB`);
|
|
958
|
-
console.log(
|
|
959
|
+
console.log(" - Shadow: " + (enableShadow ? "Enabled (PCF Soft)" : "Disabled"));
|
|
959
960
|
return renderer;
|
|
960
961
|
}
|
|
961
962
|
function generateToonTexture(index) {
|
|
@@ -965,8 +966,8 @@ function generateToonTexture(index) {
|
|
|
965
966
|
const ctx = canvas.getContext("2d");
|
|
966
967
|
const gradient = ctx.createLinearGradient(0, 0, 256, 0);
|
|
967
968
|
const brightness = 1 - (index - 1) / 9;
|
|
968
|
-
gradient.addColorStop(0,
|
|
969
|
-
gradient.addColorStop(1,
|
|
969
|
+
gradient.addColorStop(0, "rgb(" + 255 * brightness + ", " + 255 * brightness + ", " + 255 * brightness + ")");
|
|
970
|
+
gradient.addColorStop(1, "rgb(" + 128 * brightness + ", " + 128 * brightness + ", " + 128 * brightness + ")");
|
|
970
971
|
ctx.fillStyle = gradient;
|
|
971
972
|
ctx.fillRect(0, 0, 256, 1);
|
|
972
973
|
return canvas;
|
|
@@ -1041,7 +1042,7 @@ async function waitForMaterialsReady(object, renderer, scene, camera) {
|
|
|
1041
1042
|
resolve();
|
|
1042
1043
|
};
|
|
1043
1044
|
const onError = (e) => {
|
|
1044
|
-
console.warn(
|
|
1045
|
+
console.warn("[MMDPlayerBase] Texture " + (index + 1) + "/" + textures.length + ": Failed to load", e);
|
|
1045
1046
|
image.removeEventListener("load", onLoad);
|
|
1046
1047
|
image.removeEventListener("error", onError);
|
|
1047
1048
|
resolve();
|
|
@@ -1051,7 +1052,7 @@ async function waitForMaterialsReady(object, renderer, scene, camera) {
|
|
|
1051
1052
|
setTimeout(() => {
|
|
1052
1053
|
image.removeEventListener("load", onLoad);
|
|
1053
1054
|
image.removeEventListener("error", onError);
|
|
1054
|
-
console.warn(
|
|
1055
|
+
console.warn("[MMDPlayerBase] Texture " + (index + 1) + "/" + textures.length + ": Timeout");
|
|
1055
1056
|
resolve();
|
|
1056
1057
|
}, 5e3);
|
|
1057
1058
|
}
|
|
@@ -1513,7 +1514,7 @@ var MMDPlayerBase = forwardRef((props, ref) => {
|
|
|
1513
1514
|
if (mesh.skeleton) {
|
|
1514
1515
|
const boneCount = mesh.skeleton.bones.length;
|
|
1515
1516
|
if (boneCount > MAX_BONES) {
|
|
1516
|
-
console.warn(
|
|
1517
|
+
console.warn("[MMDPlayerBase] \u26A0\uFE0F Model has " + boneCount + " bones (max recommended: " + MAX_BONES + ")");
|
|
1517
1518
|
console.warn(`[MMDPlayerBase] This may cause performance issues on mobile devices`);
|
|
1518
1519
|
}
|
|
1519
1520
|
}
|
|
@@ -1542,14 +1543,14 @@ var MMDPlayerBase = forwardRef((props, ref) => {
|
|
|
1542
1543
|
(xhr) => {
|
|
1543
1544
|
if (xhr.lengthComputable) {
|
|
1544
1545
|
const percent = xhr.loaded / xhr.total * 100;
|
|
1545
|
-
if (Math.round(percent) % 20 === 0) console.log(
|
|
1546
|
+
if (Math.round(percent) % 20 === 0) console.log("[MMDPlayerBase] Stage loading: " + percent.toFixed(1) + "%");
|
|
1546
1547
|
}
|
|
1547
1548
|
},
|
|
1548
1549
|
(err) => reject(err)
|
|
1549
1550
|
);
|
|
1550
1551
|
});
|
|
1551
1552
|
if (checkCancelled()) return;
|
|
1552
|
-
console.log(
|
|
1553
|
+
console.log("[MMDPlayerBase] Stage model loaded: " + stagePath, stageMesh);
|
|
1553
1554
|
console.log("[MMDPlayerBase] \u{1F3A8} Traversing stage mesh to apply FX, multiFX:", !!multiFXAdapterRef.current, "singleFX:", !!fxAdapterRef.current);
|
|
1554
1555
|
let stageMaterialCount = 0;
|
|
1555
1556
|
stageMesh.traverse((child) => {
|
|
@@ -1592,7 +1593,7 @@ var MMDPlayerBase = forwardRef((props, ref) => {
|
|
|
1592
1593
|
try {
|
|
1593
1594
|
await waitForMaterialsReady(stageMesh, renderer, scene, camera);
|
|
1594
1595
|
} catch (e) {
|
|
1595
|
-
console.warn(
|
|
1596
|
+
console.warn("[MMDPlayerBase] Warmup error for stage " + stagePath + ":", e);
|
|
1596
1597
|
}
|
|
1597
1598
|
if (checkCancelled()) return;
|
|
1598
1599
|
scene.add(stageMesh);
|
|
@@ -1609,7 +1610,7 @@ var MMDPlayerBase = forwardRef((props, ref) => {
|
|
|
1609
1610
|
});
|
|
1610
1611
|
}
|
|
1611
1612
|
} catch (err) {
|
|
1612
|
-
console.error(
|
|
1613
|
+
console.error("Failed to load stage " + stagePath + ":", err);
|
|
1613
1614
|
}
|
|
1614
1615
|
}
|
|
1615
1616
|
if (checkCancelled()) return;
|
|
@@ -1632,7 +1633,7 @@ var MMDPlayerBase = forwardRef((props, ref) => {
|
|
|
1632
1633
|
const hours = Math.floor(runningTime / 36e5);
|
|
1633
1634
|
const minutes = Math.floor(runningTime % 36e5 / 6e4);
|
|
1634
1635
|
const seconds = Math.floor(runningTime % 6e4 / 1e3);
|
|
1635
|
-
const timeString = hours > 0 ?
|
|
1636
|
+
const timeString = hours > 0 ? hours + "\u5C0F\u65F6" + minutes + "\u5206" + seconds + "\u79D2" : minutes > 0 ? minutes + "\u5206" + seconds + "\u79D2" : seconds + "\u79D2";
|
|
1636
1637
|
alert(`\u26A0\uFE0F \u5185\u5B58\u6EA2\u51FA\u9519\u8BEF (OOM)
|
|
1637
1638
|
|
|
1638
1639
|
\u{1F4CA} \u7CFB\u7EDF\u8FD0\u884C\u7EDF\u8BA1\uFF1A
|
|
@@ -1715,7 +1716,7 @@ ${errorMessage}
|
|
|
1715
1716
|
physics.world.removeRigidBody(body.body);
|
|
1716
1717
|
}
|
|
1717
1718
|
} catch (e) {
|
|
1718
|
-
console.warn(
|
|
1719
|
+
console.warn("[MMDPlayerBase] Error removing body " + i + ":", e);
|
|
1719
1720
|
}
|
|
1720
1721
|
}
|
|
1721
1722
|
physics.bodies.length = 0;
|
|
@@ -1728,7 +1729,7 @@ ${errorMessage}
|
|
|
1728
1729
|
physics.world.removeConstraint(constraint);
|
|
1729
1730
|
}
|
|
1730
1731
|
} catch (e) {
|
|
1731
|
-
console.warn(
|
|
1732
|
+
console.warn("[MMDPlayerBase] Error removing constraint " + i + ":", e);
|
|
1732
1733
|
}
|
|
1733
1734
|
}
|
|
1734
1735
|
physics.constraints.length = 0;
|
|
@@ -1775,7 +1776,7 @@ ${errorMessage}
|
|
|
1775
1776
|
try {
|
|
1776
1777
|
Ammo2.destroy(components.worlds[i]);
|
|
1777
1778
|
} catch (e) {
|
|
1778
|
-
console.error(
|
|
1779
|
+
console.error("[MMDPlayerBase] \u274C Error destroying world #" + i + ":", e);
|
|
1779
1780
|
}
|
|
1780
1781
|
}
|
|
1781
1782
|
components.worlds.length = 0;
|
|
@@ -1785,7 +1786,7 @@ ${errorMessage}
|
|
|
1785
1786
|
try {
|
|
1786
1787
|
Ammo2.destroy(components.solvers[i]);
|
|
1787
1788
|
} catch (e) {
|
|
1788
|
-
console.error(
|
|
1789
|
+
console.error("[MMDPlayerBase] \u274C Error destroying solver #" + i + ":", e);
|
|
1789
1790
|
}
|
|
1790
1791
|
}
|
|
1791
1792
|
components.solvers.length = 0;
|
|
@@ -1795,7 +1796,7 @@ ${errorMessage}
|
|
|
1795
1796
|
try {
|
|
1796
1797
|
Ammo2.destroy(components.caches[i]);
|
|
1797
1798
|
} catch (e) {
|
|
1798
|
-
console.error(
|
|
1799
|
+
console.error("[MMDPlayerBase] \u274C Error destroying cache #" + i + ":", e);
|
|
1799
1800
|
}
|
|
1800
1801
|
}
|
|
1801
1802
|
components.caches.length = 0;
|
|
@@ -1805,7 +1806,7 @@ ${errorMessage}
|
|
|
1805
1806
|
try {
|
|
1806
1807
|
Ammo2.destroy(components.dispatchers[i]);
|
|
1807
1808
|
} catch (e) {
|
|
1808
|
-
console.error(
|
|
1809
|
+
console.error("[MMDPlayerBase] \u274C Error destroying dispatcher #" + i + ":", e);
|
|
1809
1810
|
}
|
|
1810
1811
|
}
|
|
1811
1812
|
components.dispatchers.length = 0;
|
|
@@ -1815,7 +1816,7 @@ ${errorMessage}
|
|
|
1815
1816
|
try {
|
|
1816
1817
|
Ammo2.destroy(components.configs[i]);
|
|
1817
1818
|
} catch (e) {
|
|
1818
|
-
console.error(
|
|
1819
|
+
console.error("[MMDPlayerBase] \u274C Error destroying config #" + i + ":", e);
|
|
1819
1820
|
}
|
|
1820
1821
|
}
|
|
1821
1822
|
components.configs.length = 0;
|
|
@@ -2212,7 +2213,7 @@ var ControlPanel = ({
|
|
|
2212
2213
|
"button",
|
|
2213
2214
|
{
|
|
2214
2215
|
onClick: onToggleListLoop,
|
|
2215
|
-
className:
|
|
2216
|
+
className: clsx("rounded-full p-2 transition-colors", isListLooping ? "bg-green-500/30 hover:bg-green-500/50" : "hover:bg-white/20"),
|
|
2216
2217
|
title: isListLooping ? "\u5217\u8868\u5FAA\u73AF\uFF1A\u5F00\u542F" : "\u5217\u8868\u5FAA\u73AF\uFF1A\u5173\u95ED"
|
|
2217
2218
|
},
|
|
2218
2219
|
/* @__PURE__ */ React10.createElement(Repeat, { size: 20 })
|
|
@@ -2220,7 +2221,7 @@ var ControlPanel = ({
|
|
|
2220
2221
|
"button",
|
|
2221
2222
|
{
|
|
2222
2223
|
onClick: onToggleLoop,
|
|
2223
|
-
className:
|
|
2224
|
+
className: clsx("rounded-full p-2 transition-colors", isLooping ? "bg-blue-500/30 hover:bg-blue-500/50" : "hover:bg-white/20"),
|
|
2224
2225
|
title: isLooping ? "\u5355\u66F2\u5FAA\u73AF\uFF1A\u5F00\u542F" : "\u5355\u66F2\u5FAA\u73AF\uFF1A\u5173\u95ED"
|
|
2225
2226
|
},
|
|
2226
2227
|
/* @__PURE__ */ React10.createElement(Repeat1, { size: 20 })
|
|
@@ -2236,7 +2237,7 @@ var ControlPanel = ({
|
|
|
2236
2237
|
"button",
|
|
2237
2238
|
{
|
|
2238
2239
|
onClick: onToggleAxes,
|
|
2239
|
-
className:
|
|
2240
|
+
className: clsx("rounded-full p-2 transition-colors", showAxes ? "bg-blue-500/30 hover:bg-blue-500/50" : "hover:bg-white/20"),
|
|
2240
2241
|
title: "\u663E\u793A/\u9690\u85CF\u5750\u6807\u8F74"
|
|
2241
2242
|
},
|
|
2242
2243
|
/* @__PURE__ */ React10.createElement(Grid3x3, { size: 20 })
|
|
@@ -2275,10 +2276,10 @@ var SettingsPanel = ({
|
|
|
2275
2276
|
{
|
|
2276
2277
|
key: item.id,
|
|
2277
2278
|
onClick: () => onSelectId?.(item.id),
|
|
2278
|
-
className:
|
|
2279
|
+
className: clsx("group flex items-center gap-3 rounded-lg p-3 transition-all", currentId === item.id ? "bg-blue-500/20 ring-1 ring-blue-500" : "bg-white/5 hover:bg-white/10")
|
|
2279
2280
|
},
|
|
2280
2281
|
/* @__PURE__ */ React10.createElement("div", { className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded bg-black/20 overflow-hidden" }, item.thumbnail ? /* @__PURE__ */ React10.createElement("img", { src: item.thumbnail, alt: item.name, className: "h-full w-full object-cover" }) : /* @__PURE__ */ React10.createElement(Video, { size: 20, className: "opacity-50" })),
|
|
2281
|
-
/* @__PURE__ */ React10.createElement("div", { className: "flex-1 text-left" }, /* @__PURE__ */ React10.createElement("div", { className:
|
|
2282
|
+
/* @__PURE__ */ React10.createElement("div", { className: "flex-1 text-left" }, /* @__PURE__ */ React10.createElement("div", { className: clsx("font-medium", currentId === item.id ? "text-blue-400" : "text-white") }, item.name), item.description && /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-white/50 truncate" }, item.description)),
|
|
2282
2283
|
currentId === item.id && /* @__PURE__ */ React10.createElement(Check, { size: 16, className: "text-blue-400" })
|
|
2283
2284
|
)));
|
|
2284
2285
|
};
|
|
@@ -2289,10 +2290,10 @@ var SettingsPanel = ({
|
|
|
2289
2290
|
{
|
|
2290
2291
|
key: opt.id,
|
|
2291
2292
|
onClick: () => onSelectOption?.(type, opt.id),
|
|
2292
|
-
className:
|
|
2293
|
+
className: clsx("relative flex flex-col items-center gap-2 rounded-lg p-2 text-center transition-all", currentVal === opt.id ? "bg-blue-500/20 ring-1 ring-blue-500" : "bg-white/5 hover:bg-white/10")
|
|
2293
2294
|
},
|
|
2294
2295
|
opt.thumbnail ? /* @__PURE__ */ React10.createElement("img", { src: opt.thumbnail, alt: opt.name, className: "h-16 w-full rounded object-cover bg-black/20" }) : /* @__PURE__ */ React10.createElement("div", { className: "flex h-16 w-full items-center justify-center rounded bg-black/20" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs opacity-30" }, opt.name.slice(0, 2))),
|
|
2295
|
-
/* @__PURE__ */ React10.createElement("div", { className:
|
|
2296
|
+
/* @__PURE__ */ React10.createElement("div", { className: clsx("w-full truncate text-xs", currentVal === opt.id ? "text-blue-400" : "text-white/80") }, opt.name),
|
|
2296
2297
|
currentVal === opt.id && /* @__PURE__ */ React10.createElement("div", { className: "absolute top-1 right-1 rounded-full bg-blue-500 p-0.5" }, /* @__PURE__ */ React10.createElement(Check, { size: 10, className: "text-white" }))
|
|
2297
2298
|
))));
|
|
2298
2299
|
};
|
|
@@ -2335,9 +2336,9 @@ var MMDPlayerEnhancedDebugInfo = ({
|
|
|
2335
2336
|
return /* @__PURE__ */ React10.createElement("div", { className: "text-white text-xs font-mono" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-sm font-bold mb-3 pb-2 border-b border-gray-700" }, "\u{1F3AE} MMDPlayerEnhanced Debug"), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u72B6\u6001"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u64AD\u653E\u4E2D:"), /* @__PURE__ */ React10.createElement(StatusBadge, { active: isPlaying, label: isPlaying ? "Playing" : "Paused" })), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5FAA\u73AF:"), /* @__PURE__ */ React10.createElement(StatusBadge, { active: isLooping, label: isLooping ? "On" : "Off" })), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u52A0\u8F7D\u4E2D:"), /* @__PURE__ */ React10.createElement(StatusBadge, { active: isLoading, label: isLoading ? "Loading" : "Ready" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u89C6\u56FE\u72B6\u6001"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5168\u5C4F:"), /* @__PURE__ */ React10.createElement(StatusBadge, { active: isFullscreen, label: isFullscreen ? "Yes" : "No" })), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5750\u6807\u8F74:"), /* @__PURE__ */ React10.createElement(StatusBadge, { active: showAxes, label: showAxes ? "Show" : "Hide" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u8D44\u6E90\u4FE1\u606F"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u6A21\u5F0F:"), /* @__PURE__ */ React10.createElement("span", { className: "text-blue-400 uppercase" }, mode)), mode === "list" && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u603B\u6570:"), /* @__PURE__ */ React10.createElement("span", { className: "text-green-400" }, totalResources)), currentResourceId && /* @__PURE__ */ React10.createElement("div", { className: "mt-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React10.createElement("div", { className: "text-gray-400 text-[10px]" }, "\u5F53\u524D\u8D44\u6E90"), /* @__PURE__ */ React10.createElement("div", { className: "text-white truncate" }, currentResourceName || currentResourceId), /* @__PURE__ */ React10.createElement("div", { className: "text-gray-500 text-[10px] mt-1 truncate" }, "ID: ", currentResourceId))))), memoryInfo && /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5185\u5B58\u76D1\u63A7 (Chrome only)"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5DF2\u7528:"), /* @__PURE__ */ React10.createElement("span", { className: "text-yellow-400 font-bold" }, memoryInfo.used, " MB")), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u603B\u8BA1:"), /* @__PURE__ */ React10.createElement("span", { className: "text-blue-400" }, memoryInfo.total, " MB")), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u9650\u5236:"), /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, memoryInfo.limit, " MB")), /* @__PURE__ */ React10.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React10.createElement("div", { className: "bg-gray-700 rounded-full h-2 overflow-hidden" }, /* @__PURE__ */ React10.createElement(
|
|
2336
2337
|
"div",
|
|
2337
2338
|
{
|
|
2338
|
-
className:
|
|
2339
|
+
className: clsx("h-full transition-all duration-300", parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 80 ? "bg-red-500" : parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 60 ? "bg-yellow-500" : "bg-green-500"),
|
|
2339
2340
|
style: {
|
|
2340
|
-
width:
|
|
2341
|
+
width: Math.min(100, parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100) + "%"
|
|
2341
2342
|
}
|
|
2342
2343
|
}
|
|
2343
2344
|
)), /* @__PURE__ */ React10.createElement("div", { className: "text-[9px] text-gray-500 mt-1 text-center" }, (parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100).toFixed(1), "%")))), /* @__PURE__ */ React10.createElement("div", { className: "mt-auto pt-4 border-t border-gray-700" }, /* @__PURE__ */ React10.createElement("div", { className: "text-gray-500 text-[10px]" }, "Last Update: ", (/* @__PURE__ */ new Date()).toLocaleTimeString())));
|
|
@@ -2345,7 +2346,7 @@ var MMDPlayerEnhancedDebugInfo = ({
|
|
|
2345
2346
|
var StatusBadge = ({ active, label }) => /* @__PURE__ */ React10.createElement(
|
|
2346
2347
|
"span",
|
|
2347
2348
|
{
|
|
2348
|
-
className:
|
|
2349
|
+
className: clsx("px-2 py-0.5 rounded text-[10px] font-bold", active ? "bg-green-600 text-white" : "bg-gray-700 text-gray-400")
|
|
2349
2350
|
},
|
|
2350
2351
|
label
|
|
2351
2352
|
);
|
|
@@ -2431,7 +2432,7 @@ var MMDPlayerEnhanced = ({
|
|
|
2431
2432
|
if (!containerRef.current) return;
|
|
2432
2433
|
if (!document.fullscreenElement) {
|
|
2433
2434
|
containerRef.current.requestFullscreen().catch((err) => {
|
|
2434
|
-
console.error(
|
|
2435
|
+
console.error("Error attempting to enable fullscreen: " + err.message);
|
|
2435
2436
|
});
|
|
2436
2437
|
setIsFullscreen(true);
|
|
2437
2438
|
} else {
|
|
@@ -2477,7 +2478,7 @@ var MMDPlayerEnhanced = ({
|
|
|
2477
2478
|
"div",
|
|
2478
2479
|
{
|
|
2479
2480
|
ref: containerRef,
|
|
2480
|
-
className:
|
|
2481
|
+
className: clsx("relative overflow-hidden bg-black group flex", className),
|
|
2481
2482
|
style
|
|
2482
2483
|
},
|
|
2483
2484
|
/* @__PURE__ */ React10.createElement("div", { className: "flex-1 relative" }, /* @__PURE__ */ React10.createElement(
|
|
@@ -2512,7 +2513,7 @@ var MMDPlayerEnhanced = ({
|
|
|
2512
2513
|
},
|
|
2513
2514
|
...rest
|
|
2514
2515
|
}
|
|
2515
|
-
), isLoading && /* @__PURE__ */ React10.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50 backdrop-blur-sm" }, /* @__PURE__ */ React10.createElement("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" })), /* @__PURE__ */ React10.createElement("div", { className:
|
|
2516
|
+
), isLoading && /* @__PURE__ */ React10.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50 backdrop-blur-sm" }, /* @__PURE__ */ React10.createElement("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" })), /* @__PURE__ */ React10.createElement("div", { className: clsx("transition-opacity duration-300", isPlaying && !showSettings ? "opacity-0 group-hover:opacity-100" : "opacity-100") }, /* @__PURE__ */ React10.createElement(
|
|
2516
2517
|
ControlPanel,
|
|
2517
2518
|
{
|
|
2518
2519
|
isPlaying,
|
|
@@ -2582,26 +2583,26 @@ var MMDPlaylistDebugInfo = ({
|
|
|
2582
2583
|
}, 1e3);
|
|
2583
2584
|
return () => clearInterval(timer);
|
|
2584
2585
|
}, []);
|
|
2585
|
-
return /* @__PURE__ */ React10.createElement("div", { className: "text-white text-xs font-mono" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-sm font-bold mb-3 pb-2 border-b border-gray-700" }, "\u{1F3AD} MMDPlaylist Debug"), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u5217\u8868"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "text-white truncate" }, playlistName), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u8FDB\u5EA6:"), /* @__PURE__ */ React10.createElement("span", { className: "text-blue-400" }, currentIndex + 1, " / ", totalNodes)), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5217\u8868\u5FAA\u73AF:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isListLooping, label: isListLooping ? "On" : "Off" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5F53\u524D\u8282\u70B9"), /* @__PURE__ */ React10.createElement("div", { className: "p-2 bg-gray-800 rounded space-y-1" }, /* @__PURE__ */ React10.createElement("div", { className: "text-white font-semibold truncate" }, currentNode.name), /* @__PURE__ */ React10.createElement("div", { className: "text-gray-500 text-[10px] truncate" }, "ID: ", currentNode.id), currentNode.duration && /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u65F6\u957F:"), /* @__PURE__ */ React10.createElement("span", { className: "text-green-400" }, currentNode.duration, "s")), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u8282\u70B9\u5FAA\u73AF:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isNodeLooping, label: isNodeLooping ? "On" : "Off" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u72B6\u6001"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u64AD\u653E\u4E2D:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isPlaying, label: isPlaying ? "Playing" : "Paused" })), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u52A0\u8F7D\u4E2D:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isLoading, label: isLoading ? "Loading" : "Ready" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u9884\u52A0\u8F7D\u7B56\u7565"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u7B56\u7565:"), /* @__PURE__ */ React10.createElement("span", { className:
|
|
2586
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "text-white text-xs font-mono" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-sm font-bold mb-3 pb-2 border-b border-gray-700" }, "\u{1F3AD} MMDPlaylist Debug"), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u5217\u8868"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "text-white truncate" }, playlistName), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u8FDB\u5EA6:"), /* @__PURE__ */ React10.createElement("span", { className: "text-blue-400" }, currentIndex + 1, " / ", totalNodes)), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5217\u8868\u5FAA\u73AF:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isListLooping, label: isListLooping ? "On" : "Off" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5F53\u524D\u8282\u70B9"), /* @__PURE__ */ React10.createElement("div", { className: "p-2 bg-gray-800 rounded space-y-1" }, /* @__PURE__ */ React10.createElement("div", { className: "text-white font-semibold truncate" }, currentNode.name), /* @__PURE__ */ React10.createElement("div", { className: "text-gray-500 text-[10px] truncate" }, "ID: ", currentNode.id), currentNode.duration && /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u65F6\u957F:"), /* @__PURE__ */ React10.createElement("span", { className: "text-green-400" }, currentNode.duration, "s")), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u8282\u70B9\u5FAA\u73AF:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isNodeLooping, label: isNodeLooping ? "On" : "Off" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u64AD\u653E\u72B6\u6001"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u64AD\u653E\u4E2D:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isPlaying, label: isPlaying ? "Playing" : "Paused" })), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u52A0\u8F7D\u4E2D:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isLoading, label: isLoading ? "Loading" : "Ready" })))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u9884\u52A0\u8F7D\u7B56\u7565"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u7B56\u7565:"), /* @__PURE__ */ React10.createElement("span", { className: clsx("px-2 py-0.5 rounded text-[10px] font-bold uppercase", preloadStrategy === "all" ? "bg-red-600 text-white" : preloadStrategy === "next" ? "bg-yellow-600 text-white" : "bg-gray-700 text-gray-400") }, preloadStrategy)), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5DF2\u9884\u52A0\u8F7D:"), /* @__PURE__ */ React10.createElement("span", { className: "text-purple-400" }, preloadedNodes.length)), preloadedNodes.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "mt-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React10.createElement("div", { className: "text-gray-400 text-[10px] mb-1" }, "\u9884\u52A0\u8F7D\u8282\u70B9\u7D22\u5F15"), /* @__PURE__ */ React10.createElement("div", { className: "flex flex-wrap gap-1" }, preloadedNodes.map((idx) => /* @__PURE__ */ React10.createElement(
|
|
2586
2587
|
"span",
|
|
2587
2588
|
{
|
|
2588
2589
|
key: idx,
|
|
2589
|
-
className:
|
|
2590
|
+
className: clsx("px-1.5 py-0.5 rounded text-[10px]", idx === currentIndex ? "bg-green-600 text-white font-bold" : "bg-gray-700 text-gray-300")
|
|
2590
2591
|
},
|
|
2591
2592
|
idx
|
|
2592
2593
|
)))))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u89C6\u56FE\u72B6\u6001"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 pl-2" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5168\u5C4F:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: isFullscreen, label: isFullscreen ? "Yes" : "No" })), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5750\u6807\u8F74:"), /* @__PURE__ */ React10.createElement(StatusBadge2, { active: showAxes, label: showAxes ? "Show" : "Hide" })))), memoryInfo && /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u5185\u5B58\u76D1\u63A7 (Chrome only)"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-2 p-2 bg-gray-800 rounded" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u5DF2\u7528:"), /* @__PURE__ */ React10.createElement("span", { className: "text-yellow-400 font-bold" }, memoryInfo.used, " MB")), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u603B\u8BA1:"), /* @__PURE__ */ React10.createElement("span", { className: "text-blue-400" }, memoryInfo.total, " MB")), /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between text-[10px]" }, /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, "\u9650\u5236:"), /* @__PURE__ */ React10.createElement("span", { className: "text-gray-400" }, memoryInfo.limit, " MB")), /* @__PURE__ */ React10.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React10.createElement("div", { className: "bg-gray-700 rounded-full h-2 overflow-hidden" }, /* @__PURE__ */ React10.createElement(
|
|
2593
2594
|
"div",
|
|
2594
2595
|
{
|
|
2595
|
-
className:
|
|
2596
|
+
className: clsx("h-full transition-all duration-300", parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 80 ? "bg-red-500" : parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100 > 60 ? "bg-yellow-500" : "bg-green-500"),
|
|
2596
2597
|
style: {
|
|
2597
|
-
width:
|
|
2598
|
+
width: Math.min(100, parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100) + "%"
|
|
2598
2599
|
}
|
|
2599
2600
|
}
|
|
2600
2601
|
)), /* @__PURE__ */ React10.createElement("div", { className: "text-[9px] text-gray-500 mt-1 text-center" }, (parseFloat(memoryInfo.used) / parseFloat(memoryInfo.limit) * 100).toFixed(1), "%")))), /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, /* @__PURE__ */ React10.createElement("h4", { className: "text-gray-400 mb-2" }, "\u8282\u70B9\u5217\u8868"), /* @__PURE__ */ React10.createElement("div", { className: "space-y-1 max-h-40 overflow-y-auto" }, Array.from({ length: totalNodes }).map((_, idx) => /* @__PURE__ */ React10.createElement(
|
|
2601
2602
|
"div",
|
|
2602
2603
|
{
|
|
2603
2604
|
key: idx,
|
|
2604
|
-
className:
|
|
2605
|
+
className: clsx("px-2 py-1 rounded text-[10px] flex items-center justify-between", idx === currentIndex ? "bg-blue-600 text-white font-bold" : preloadedNodes.includes(idx) ? "bg-yellow-900/50 text-yellow-300" : "bg-gray-800 text-gray-400")
|
|
2605
2606
|
},
|
|
2606
2607
|
/* @__PURE__ */ React10.createElement("span", null, "\u8282\u70B9 ", idx),
|
|
2607
2608
|
idx === currentIndex && /* @__PURE__ */ React10.createElement("span", null, "\u25B6"),
|
|
@@ -2611,12 +2612,10 @@ var MMDPlaylistDebugInfo = ({
|
|
|
2611
2612
|
var StatusBadge2 = ({ active, label }) => /* @__PURE__ */ React10.createElement(
|
|
2612
2613
|
"span",
|
|
2613
2614
|
{
|
|
2614
|
-
className:
|
|
2615
|
+
className: clsx("px-2 py-0.5 rounded text-[10px] font-bold", active ? "bg-green-600 text-white" : "bg-gray-700 text-gray-400")
|
|
2615
2616
|
},
|
|
2616
2617
|
label
|
|
2617
2618
|
);
|
|
2618
|
-
|
|
2619
|
-
// src/mmd/components/MMDPlaylist.tsx
|
|
2620
2619
|
var MMDPlaylist = ({
|
|
2621
2620
|
playlist,
|
|
2622
2621
|
stage,
|
|
@@ -2649,14 +2648,14 @@ var MMDPlaylist = ({
|
|
|
2649
2648
|
if (isTransitioning) return;
|
|
2650
2649
|
const node = nodes[index];
|
|
2651
2650
|
if (!node) return;
|
|
2652
|
-
console.log(
|
|
2651
|
+
console.log("[MMDPlaylist] Starting transition to node " + index);
|
|
2653
2652
|
const wasPlaying = isPlaying;
|
|
2654
2653
|
setIsPlaying(false);
|
|
2655
2654
|
setIsTransitioning(true);
|
|
2656
2655
|
requestAnimationFrame(() => {
|
|
2657
2656
|
requestAnimationFrame(() => {
|
|
2658
2657
|
setTimeout(() => {
|
|
2659
|
-
console.log(
|
|
2658
|
+
console.log("[MMDPlaylist] Loading new node " + index);
|
|
2660
2659
|
setCurrentIndex(index);
|
|
2661
2660
|
setIsLoading(true);
|
|
2662
2661
|
onNodeChange?.(node, index);
|
|
@@ -2667,7 +2666,7 @@ var MMDPlaylist = ({
|
|
|
2667
2666
|
if (wasPlaying) {
|
|
2668
2667
|
setIsPlaying(true);
|
|
2669
2668
|
}
|
|
2670
|
-
console.log(
|
|
2669
|
+
console.log("[MMDPlaylist] Transition to node " + index + " completed");
|
|
2671
2670
|
}, 100);
|
|
2672
2671
|
});
|
|
2673
2672
|
});
|
|
@@ -2709,7 +2708,7 @@ var MMDPlaylist = ({
|
|
|
2709
2708
|
if (!containerRef.current) return;
|
|
2710
2709
|
if (!document.fullscreenElement) {
|
|
2711
2710
|
containerRef.current.requestFullscreen().catch((err) => {
|
|
2712
|
-
console.error(
|
|
2711
|
+
console.error("Error attempting to enable fullscreen: " + err.message);
|
|
2713
2712
|
});
|
|
2714
2713
|
setIsFullscreen(true);
|
|
2715
2714
|
} else {
|
|
@@ -2737,7 +2736,7 @@ var MMDPlaylist = ({
|
|
|
2737
2736
|
nodes.forEach((node, idx) => {
|
|
2738
2737
|
if (!preloadedRef.current.has(idx)) {
|
|
2739
2738
|
preloadedRef.current.add(idx);
|
|
2740
|
-
console.log(
|
|
2739
|
+
console.log("[MMDPlaylist] Preload strategy: all - marked node " + idx + " (" + node.name + ")");
|
|
2741
2740
|
}
|
|
2742
2741
|
});
|
|
2743
2742
|
} else if (preload === "next") {
|
|
@@ -2745,7 +2744,7 @@ var MMDPlaylist = ({
|
|
|
2745
2744
|
const nextNode = nodes[nextIndex];
|
|
2746
2745
|
if (nextNode && !preloadedRef.current.has(nextIndex)) {
|
|
2747
2746
|
preloadedRef.current.add(nextIndex);
|
|
2748
|
-
console.log(
|
|
2747
|
+
console.log("[MMDPlaylist] Preload strategy: next - marked node " + nextIndex + " (" + nextNode.name + ")");
|
|
2749
2748
|
}
|
|
2750
2749
|
}
|
|
2751
2750
|
}, [currentIndex, nodes, preload]);
|
|
@@ -2763,7 +2762,7 @@ var MMDPlaylist = ({
|
|
|
2763
2762
|
if (toRemove.length > 0) {
|
|
2764
2763
|
toRemove.forEach((idx) => {
|
|
2765
2764
|
preloadedRef.current.delete(idx);
|
|
2766
|
-
console.log(
|
|
2765
|
+
console.log("[MMDPlaylist] Memory cleanup: removed preload mark for node " + idx);
|
|
2767
2766
|
});
|
|
2768
2767
|
}
|
|
2769
2768
|
}, [currentIndex, nodes.length, preload]);
|
|
@@ -2781,7 +2780,7 @@ var MMDPlaylist = ({
|
|
|
2781
2780
|
"div",
|
|
2782
2781
|
{
|
|
2783
2782
|
ref: containerRef,
|
|
2784
|
-
className:
|
|
2783
|
+
className: clsx("relative overflow-hidden bg-black group flex h-full", className),
|
|
2785
2784
|
style
|
|
2786
2785
|
},
|
|
2787
2786
|
/* @__PURE__ */ React10.createElement("div", { className: "flex-1 relative" }, !isTransitioning && /* @__PURE__ */ React10.createElement(
|
|
@@ -2807,10 +2806,10 @@ var MMDPlaylist = ({
|
|
|
2807
2806
|
onEnded: handleEnded,
|
|
2808
2807
|
onError
|
|
2809
2808
|
}
|
|
2810
|
-
), (isLoading || isTransitioning) && /* @__PURE__ */ React10.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50 backdrop-blur-sm" }, /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col items-center gap-3" }, /* @__PURE__ */ React10.createElement("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" }), /* @__PURE__ */ React10.createElement("div", { className: "text-sm text-white/80" }, isTransitioning ? "\u5207\u6362\u4E2D..." :
|
|
2809
|
+
), (isLoading || isTransitioning) && /* @__PURE__ */ React10.createElement("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50 backdrop-blur-sm" }, /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col items-center gap-3" }, /* @__PURE__ */ React10.createElement("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-blue-500" }), /* @__PURE__ */ React10.createElement("div", { className: "text-sm text-white/80" }, isTransitioning ? "\u5207\u6362\u4E2D..." : "\u6B63\u5728\u52A0\u8F7D " + (currentIndex + 1) + " / " + nodes.length))), /* @__PURE__ */ React10.createElement(
|
|
2811
2810
|
"div",
|
|
2812
2811
|
{
|
|
2813
|
-
className:
|
|
2812
|
+
className: clsx("transition-opacity duration-300", isPlaying && !showPlaylist ? "opacity-0 group-hover:opacity-100" : "opacity-100")
|
|
2814
2813
|
},
|
|
2815
2814
|
/* @__PURE__ */ React10.createElement(
|
|
2816
2815
|
ControlPanel,
|
|
@@ -2824,7 +2823,7 @@ var MMDPlaylist = ({
|
|
|
2824
2823
|
showAxes,
|
|
2825
2824
|
showPrevNext,
|
|
2826
2825
|
title: currentNode.name,
|
|
2827
|
-
subtitle:
|
|
2826
|
+
subtitle: currentIndex + 1 + " / " + nodes.length,
|
|
2828
2827
|
onPlayPause: handlePlayPause,
|
|
2829
2828
|
onPrevious: handlePrevious,
|
|
2830
2829
|
onNext: handleNext,
|
|
@@ -2855,12 +2854,12 @@ var MMDPlaylist = ({
|
|
|
2855
2854
|
goToNode(index);
|
|
2856
2855
|
setShowPlaylist(false);
|
|
2857
2856
|
},
|
|
2858
|
-
className:
|
|
2857
|
+
className: clsx("w-full flex items-center gap-3 p-3 rounded-lg mb-2 transition-all", index === currentIndex ? "bg-blue-600 text-white" : "bg-gray-800 text-gray-300 hover:bg-gray-700")
|
|
2859
2858
|
},
|
|
2860
2859
|
/* @__PURE__ */ React10.createElement(
|
|
2861
2860
|
"div",
|
|
2862
2861
|
{
|
|
2863
|
-
className:
|
|
2862
|
+
className: clsx("flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold", index === currentIndex ? "bg-white/20" : "bg-gray-700")
|
|
2864
2863
|
},
|
|
2865
2864
|
index + 1
|
|
2866
2865
|
),
|
|
@@ -3042,7 +3041,7 @@ var MMDLightingDebugPanel = ({
|
|
|
3042
3041
|
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
3043
3042
|
"div",
|
|
3044
3043
|
{
|
|
3045
|
-
className:
|
|
3044
|
+
className: clsx("fixed top-0", positionClass, "z-[9999] w-80 h-screen bg-white/95 backdrop-blur-md shadow-2xl overflow-y-auto transition-transform duration-300", translateClass, className)
|
|
3046
3045
|
},
|
|
3047
3046
|
/* @__PURE__ */ React10.createElement("div", { className: "p-4" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React10.createElement("h2", { className: "text-lg font-bold text-gray-900" }, "\u{1F3A8} \u5149\u7167\u8C03\u8BD5"), /* @__PURE__ */ React10.createElement(
|
|
3048
3047
|
"button",
|
|
@@ -3407,7 +3406,7 @@ var MMDLightingDebugPanel = ({
|
|
|
3407
3406
|
"button",
|
|
3408
3407
|
{
|
|
3409
3408
|
onClick: () => setShowPanel(true),
|
|
3410
|
-
className:
|
|
3409
|
+
className: clsx("fixed top-4", position === "right" ? "right-4" : "left-4", "z-[9999] px-4 py-2 bg-blue-500 text-white rounded-lg shadow-lg hover:bg-blue-600 text-sm transition-colors"),
|
|
3411
3410
|
"aria-label": "\u6253\u5F00\u8C03\u8BD5\u9762\u677F"
|
|
3412
3411
|
},
|
|
3413
3412
|
"\u{1F3A8} \u5149\u7167\u8C03\u8BD5"
|
|
@@ -3485,18 +3484,18 @@ function printDiagnosticReport(report) {
|
|
|
3485
3484
|
console.log("\u{1F50D} MMD\u6E32\u67D3\u8BCA\u65AD\u62A5\u544A");
|
|
3486
3485
|
console.log("=".repeat(60));
|
|
3487
3486
|
console.log("\n\u{1F4CA} \u6750\u8D28\u7EDF\u8BA1:");
|
|
3488
|
-
console.log(
|
|
3489
|
-
console.log(
|
|
3490
|
-
console.log(
|
|
3491
|
-
console.log(
|
|
3487
|
+
console.log(" \u603B\u6750\u8D28\u6570: " + report.totalMaterials);
|
|
3488
|
+
console.log(" MeshToonMaterial: " + report.toonMaterialCount);
|
|
3489
|
+
console.log(" MeshPhongMaterial: " + report.phongMaterialCount);
|
|
3490
|
+
console.log(" MeshStandardMaterial: " + report.standardMaterialCount);
|
|
3492
3491
|
console.log("\n\u{1F3A8} \u7EB9\u7406\u7EDF\u8BA1:");
|
|
3493
|
-
console.log(
|
|
3494
|
-
console.log(
|
|
3495
|
-
console.log(
|
|
3492
|
+
console.log(" \u6709Toon\u7EB9\u7406: " + report.materialsWithToon + " / " + report.totalMaterials + " " + (report.materialsWithToon > 0 ? "\u2705" : "\u274C"));
|
|
3493
|
+
console.log(" \u6709Sphere\u7EB9\u7406: " + report.materialsWithSphere + " / " + report.totalMaterials + " " + (report.materialsWithSphere > 0 ? "\u2705" : "\u274C"));
|
|
3494
|
+
console.log(" \u6709\u4E3B\u7EB9\u7406: " + report.materialsWithMainTexture + " / " + report.totalMaterials);
|
|
3496
3495
|
if (report.issues.length > 0) {
|
|
3497
3496
|
console.log("\n\u26A0\uFE0F \u53D1\u73B0\u7684\u95EE\u9898:");
|
|
3498
3497
|
report.issues.forEach((issue, i) => {
|
|
3499
|
-
console.log(
|
|
3498
|
+
console.log(" " + (i + 1) + ". " + issue);
|
|
3500
3499
|
});
|
|
3501
3500
|
} else {
|
|
3502
3501
|
console.log("\n\u2705 \u672A\u53D1\u73B0\u660E\u663E\u95EE\u9898");
|
|
@@ -3504,7 +3503,7 @@ function printDiagnosticReport(report) {
|
|
|
3504
3503
|
if (report.suggestions.length > 0) {
|
|
3505
3504
|
console.log("\n\u{1F4A1} \u6539\u8FDB\u5EFA\u8BAE:");
|
|
3506
3505
|
report.suggestions.forEach((suggestion, i) => {
|
|
3507
|
-
console.log(
|
|
3506
|
+
console.log(" " + (i + 1) + ". " + suggestion);
|
|
3508
3507
|
});
|
|
3509
3508
|
}
|
|
3510
3509
|
console.log("\n" + "=".repeat(60));
|
|
@@ -3564,8 +3563,7 @@ function listAllMaterials(scene) {
|
|
|
3564
3563
|
if (obj instanceof THREE2.Mesh || obj instanceof THREE2.SkinnedMesh) {
|
|
3565
3564
|
const materials = Array.isArray(obj.material) ? obj.material : [obj.material];
|
|
3566
3565
|
materials.forEach((mat) => {
|
|
3567
|
-
console.log(
|
|
3568
|
-
\u6750\u8D28 #${index}:`, obj.name || "unnamed");
|
|
3566
|
+
console.log("\n\u6750\u8D28 #" + index + ":", obj.name || "unnamed");
|
|
3569
3567
|
console.log(inspectMaterial(mat));
|
|
3570
3568
|
index++;
|
|
3571
3569
|
});
|
|
@@ -3618,14 +3616,13 @@ function printSphereDiagnostic(diagnostic) {
|
|
|
3618
3616
|
console.log("=".repeat(60));
|
|
3619
3617
|
console.log(`
|
|
3620
3618
|
\u{1F4CA} \u7EDF\u8BA1:`);
|
|
3621
|
-
console.log(
|
|
3622
|
-
console.log(
|
|
3623
|
-
console.log(
|
|
3619
|
+
console.log(" \u603B\u6750\u8D28\u6570: " + diagnostic.totalMaterials);
|
|
3620
|
+
console.log(" \u9884\u671F\u6709sphere\u7EB9\u7406: " + diagnostic.expectedSphere);
|
|
3621
|
+
console.log(" \u5B9E\u9645\u6709sphere\u7EB9\u7406: " + diagnostic.actualSphere + " " + (diagnostic.actualSphere > 0 ? "\u2705" : "\u274C"));
|
|
3624
3622
|
if (diagnostic.missingSphere.length > 0) {
|
|
3625
|
-
console.log(
|
|
3626
|
-
\u26A0\uFE0F \u7F3A\u5C11sphere\u7EB9\u7406\u7684\u6750\u8D28 (${diagnostic.missingSphere.length}\u4E2A):`);
|
|
3623
|
+
console.log("\n\u26A0\uFE0F \u7F3A\u5C11sphere\u7EB9\u7406\u7684\u6750\u8D28 (" + diagnostic.missingSphere.length + "\u4E2A):");
|
|
3627
3624
|
diagnostic.missingSphere.forEach((item, i) => {
|
|
3628
|
-
console.log(
|
|
3625
|
+
console.log(" " + (i + 1) + ". [" + item.index + "] " + item.name + " (\u5BF9\u8C61: " + item.objectName + ")");
|
|
3629
3626
|
});
|
|
3630
3627
|
} else {
|
|
3631
3628
|
console.log("\n\u2705 \u6240\u6709\u9884\u671F\u7684\u6750\u8D28\u90FD\u6709sphere\u7EB9\u7406");
|
|
@@ -3674,11 +3671,11 @@ function addDefaultSphereTextures(mesh, sphereTextureUrl) {
|
|
|
3674
3671
|
});
|
|
3675
3672
|
}
|
|
3676
3673
|
});
|
|
3677
|
-
console.log(
|
|
3674
|
+
console.log("\u{1F52E} \u6DFB\u52A0\u9ED8\u8BA4Sphere\u7EB9\u7406\u5230 " + appliedCount + " \u4E2A\u6750\u8D28");
|
|
3678
3675
|
}
|
|
3679
3676
|
async function checkModelSphereDefinition(modelUrl) {
|
|
3680
3677
|
try {
|
|
3681
|
-
const { PMXParser: PMXParser2 } = await import('../PMXParser-
|
|
3678
|
+
const { PMXParser: PMXParser2 } = await import('../PMXParser-RNVQL76A.mjs');
|
|
3682
3679
|
const parser = new PMXParser2();
|
|
3683
3680
|
const result = await parser.loadAndParse(modelUrl);
|
|
3684
3681
|
const sphereTextures = [];
|
|
@@ -3705,22 +3702,20 @@ async function checkModelSphereDefinition(modelUrl) {
|
|
|
3705
3702
|
}
|
|
3706
3703
|
async function printModelSphereInfo(modelUrl) {
|
|
3707
3704
|
console.log("\n\u{1F50D} \u68C0\u67E5\u6A21\u578B\u7684Sphere\u7EB9\u7406\u5B9A\u4E49...");
|
|
3708
|
-
console.log(
|
|
3705
|
+
console.log("\u6A21\u578B: " + modelUrl);
|
|
3709
3706
|
console.log("=".repeat(60));
|
|
3710
3707
|
const info = await checkModelSphereDefinition(modelUrl);
|
|
3711
3708
|
if (info.hasSphere) {
|
|
3712
|
-
console.log(
|
|
3713
|
-
\u2705 \u6A21\u578B\u5B9A\u4E49\u4E86 ${info.sphereTextures.length} \u4E2ASphere\u7EB9\u7406:`);
|
|
3709
|
+
console.log("\n\u2705 \u6A21\u578B\u5B9A\u4E49\u4E86 " + info.sphereTextures.length + " \u4E2ASphere\u7EB9\u7406:");
|
|
3714
3710
|
info.sphereTextures.forEach((item, i) => {
|
|
3715
|
-
console.log(
|
|
3716
|
-
|
|
3717
|
-
console.log(
|
|
3718
|
-
console.log(` \u6A21\u5F0F: ${item.mode}`);
|
|
3711
|
+
console.log("\n" + (i + 1) + ". " + item.materialName);
|
|
3712
|
+
console.log(" \u7EB9\u7406: " + item.texturePath);
|
|
3713
|
+
console.log(" \u6A21\u5F0F: " + item.mode);
|
|
3719
3714
|
});
|
|
3720
3715
|
console.log("\n\u{1F4A1} \u5EFA\u8BAE:");
|
|
3721
3716
|
console.log(" 1. \u68C0\u67E5\u4EE5\u4E0B\u6587\u4EF6\u662F\u5426\u5B58\u5728\u4E8E\u6A21\u578B\u76EE\u5F55:");
|
|
3722
3717
|
info.sphereTextures.forEach((item) => {
|
|
3723
|
-
console.log(
|
|
3718
|
+
console.log(" - " + item.texturePath);
|
|
3724
3719
|
});
|
|
3725
3720
|
console.log(" 2. \u786E\u4FDD\u8FD9\u4E9B\u6587\u4EF6\u53EF\u4EE5\u88AB\u8BBF\u95EE\uFF08\u65E0CORS\u9519\u8BEF\uFF09");
|
|
3726
3721
|
console.log(" 3. MMDLoader\u5E94\u8BE5\u4F1A\u81EA\u52A8\u52A0\u8F7D\u8FD9\u4E9B\u7EB9\u7406");
|
|
@@ -3760,7 +3755,7 @@ async function fullSphereDiagnostic(mesh, modelUrl) {
|
|
|
3760
3755
|
}
|
|
3761
3756
|
} else {
|
|
3762
3757
|
console.log("\n\u2705 \u68C0\u6D4B\u5230sphere\u7EB9\u7406\uFF01");
|
|
3763
|
-
console.log(
|
|
3758
|
+
console.log("\u5F53\u524D\u6709 " + runtimeDiag.actualSphere + " \u4E2A\u6750\u8D28\u4F7F\u7528sphere\u7EB9\u7406");
|
|
3764
3759
|
}
|
|
3765
3760
|
console.log("\n" + "=".repeat(60));
|
|
3766
3761
|
}
|
|
@@ -3907,7 +3902,7 @@ var DialogueBox = ({
|
|
|
3907
3902
|
const dialogueContent = /* @__PURE__ */ React10.createElement(
|
|
3908
3903
|
"div",
|
|
3909
3904
|
{
|
|
3910
|
-
className:
|
|
3905
|
+
className: clsx(className || ""),
|
|
3911
3906
|
style: {
|
|
3912
3907
|
position: "fixed",
|
|
3913
3908
|
bottom: 0,
|
|
@@ -3927,8 +3922,8 @@ var DialogueBox = ({
|
|
|
3927
3922
|
onClick: handleClick,
|
|
3928
3923
|
style: {
|
|
3929
3924
|
borderColor: theme.borderColor,
|
|
3930
|
-
backdropFilter:
|
|
3931
|
-
WebkitBackdropFilter:
|
|
3925
|
+
backdropFilter: "blur(" + theme.blur + ") saturate(200%)",
|
|
3926
|
+
WebkitBackdropFilter: "blur(" + theme.blur + ") saturate(200%)",
|
|
3932
3927
|
opacity: theme.opacity,
|
|
3933
3928
|
pointerEvents: "auto",
|
|
3934
3929
|
position: "relative",
|
|
@@ -4016,7 +4011,7 @@ var DialogueBox = ({
|
|
|
4016
4011
|
e.stopPropagation();
|
|
4017
4012
|
onToggleAuto?.();
|
|
4018
4013
|
},
|
|
4019
|
-
className:
|
|
4014
|
+
className: clsx("px-4 py-2 text-xs rounded-xl font-medium transition-all backdrop-blur-lg border hover:scale-105 active:scale-95 shadow-lg", isAutoMode ? "border-slate-400 text-slate-900" : "border-slate-300 hover:border-slate-400 text-slate-700"),
|
|
4020
4015
|
style: {
|
|
4021
4016
|
background: isAutoMode ? "linear-gradient(135deg, rgba(203, 213, 225, 0.95), rgba(148, 163, 184, 0.85))" : "linear-gradient(135deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.9))",
|
|
4022
4017
|
boxShadow: isAutoMode ? "0 4px 20px rgba(100, 116, 139, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8)" : "0 4px 16px rgba(100, 116, 139, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8)"
|
|
@@ -4131,7 +4126,7 @@ var HistoryPanel = ({
|
|
|
4131
4126
|
const historyContent = /* @__PURE__ */ React10.createElement(
|
|
4132
4127
|
"div",
|
|
4133
4128
|
{
|
|
4134
|
-
className:
|
|
4129
|
+
className: clsx("fixed inset-0 flex flex-col", className),
|
|
4135
4130
|
style: {
|
|
4136
4131
|
zIndex: 1,
|
|
4137
4132
|
pointerEvents: "auto",
|
|
@@ -4197,7 +4192,7 @@ var HistoryPanel = ({
|
|
|
4197
4192
|
), /* @__PURE__ */ React10.createElement("div", { className: "flex-1 overflow-y-auto p-6 space-y-4" }, history.length === 0 ? /* @__PURE__ */ React10.createElement("div", { className: "text-center text-white/70 py-20 text-lg font-medium", style: { textShadow: "0 2px 8px rgba(0, 0, 0, 0.3)" } }, "\u6682\u65E0\u5BF9\u8BDD\u5386\u53F2") : history.map((item, index) => /* @__PURE__ */ React10.createElement(
|
|
4198
4193
|
"div",
|
|
4199
4194
|
{
|
|
4200
|
-
key:
|
|
4195
|
+
key: item.nodeIndex + "-" + item.dialogueIndex + "-" + index,
|
|
4201
4196
|
className: "p-6 rounded-2xl transition-all hover:scale-[1.01] relative overflow-hidden cursor-pointer",
|
|
4202
4197
|
style: {
|
|
4203
4198
|
background: "linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1))",
|
|
@@ -4318,7 +4313,7 @@ var LoadingScreen = ({
|
|
|
4318
4313
|
const content = /* @__PURE__ */ React10.createElement(
|
|
4319
4314
|
"div",
|
|
4320
4315
|
{
|
|
4321
|
-
className:
|
|
4316
|
+
className: clsx("fixed inset-0 w-screen h-screen flex items-center justify-center", className),
|
|
4322
4317
|
style: {
|
|
4323
4318
|
zIndex: 999998,
|
|
4324
4319
|
pointerEvents: "auto",
|
|
@@ -4462,7 +4457,7 @@ var StartScreen = ({
|
|
|
4462
4457
|
const content = /* @__PURE__ */ React10.createElement(
|
|
4463
4458
|
"div",
|
|
4464
4459
|
{
|
|
4465
|
-
className:
|
|
4460
|
+
className: clsx("fixed inset-0 w-screen h-screen flex items-center justify-center overflow-hidden", className),
|
|
4466
4461
|
style: {
|
|
4467
4462
|
zIndex: 999999,
|
|
4468
4463
|
pointerEvents: "auto",
|
|
@@ -4492,8 +4487,8 @@ var StartScreen = ({
|
|
|
4492
4487
|
top: Math.random() * 100 + "%",
|
|
4493
4488
|
left: Math.random() * 100 + "%",
|
|
4494
4489
|
boxShadow: "0 0 10px rgba(148, 163, 184, 0.3)",
|
|
4495
|
-
animation:
|
|
4496
|
-
animationDelay:
|
|
4490
|
+
animation: "floatParticle " + (Math.random() * 10 + 10) + "s linear infinite",
|
|
4491
|
+
animationDelay: "-" + Math.random() * 20 + "s"
|
|
4497
4492
|
}
|
|
4498
4493
|
}
|
|
4499
4494
|
)))),
|
|
@@ -4837,18 +4832,10 @@ var CheerButton = ({
|
|
|
4837
4832
|
"button",
|
|
4838
4833
|
{
|
|
4839
4834
|
onClick,
|
|
4840
|
-
className:
|
|
4841
|
-
fixed bottom-32 right-8
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
hover:from-pink-600 hover:to-purple-600
|
|
4845
|
-
active:scale-95
|
|
4846
|
-
text-white font-bold text-lg
|
|
4847
|
-
shadow-lg hover:shadow-xl
|
|
4848
|
-
transition-all duration-200
|
|
4849
|
-
flex items-center gap-2
|
|
4850
|
-
${className}
|
|
4851
|
-
`,
|
|
4835
|
+
className: clsx(
|
|
4836
|
+
"fixed bottom-32 right-8 px-6 py-3 rounded-full bg-gradient-to-r from-pink-500 to-purple-500 hover:from-pink-600 hover:to-purple-600 active:scale-95 text-white font-bold text-lg shadow-lg hover:shadow-xl transition-all duration-200 flex items-center gap-2",
|
|
4837
|
+
className
|
|
4838
|
+
),
|
|
4852
4839
|
style: {
|
|
4853
4840
|
animation: "cheer-pulse 2s ease-in-out infinite",
|
|
4854
4841
|
zIndex: 1e6
|
|
@@ -5053,15 +5040,13 @@ var CheerParticles = forwardRef(
|
|
|
5053
5040
|
"div",
|
|
5054
5041
|
{
|
|
5055
5042
|
ref: containerRef,
|
|
5056
|
-
className:
|
|
5043
|
+
className: clsx("pointer-events-none absolute inset-0", className),
|
|
5057
5044
|
style: { zIndex: 999998 }
|
|
5058
5045
|
}
|
|
5059
5046
|
);
|
|
5060
5047
|
}
|
|
5061
5048
|
);
|
|
5062
5049
|
CheerParticles.displayName = "CheerParticles";
|
|
5063
|
-
|
|
5064
|
-
// src/mmd/visual-novel/MMDVisualNovel.tsx
|
|
5065
5050
|
var MMDVisualNovel = forwardRef(
|
|
5066
5051
|
({
|
|
5067
5052
|
script,
|
|
@@ -5153,7 +5138,7 @@ var MMDVisualNovel = forwardRef(
|
|
|
5153
5138
|
setPendingNodeIndex(nodeIndex);
|
|
5154
5139
|
return;
|
|
5155
5140
|
}
|
|
5156
|
-
console.log(
|
|
5141
|
+
console.log("[MMDVisualNovel] Transitioning to node " + nodeIndex);
|
|
5157
5142
|
setIsTransitioning(true);
|
|
5158
5143
|
setIsLoading(true);
|
|
5159
5144
|
setIsAnimationPlaying(false);
|
|
@@ -5175,7 +5160,7 @@ var MMDVisualNovel = forwardRef(
|
|
|
5175
5160
|
}
|
|
5176
5161
|
setTimeout(() => {
|
|
5177
5162
|
setIsTransitioning(false);
|
|
5178
|
-
console.log(
|
|
5163
|
+
console.log("[MMDVisualNovel] Transition to node " + nodeIndex + " completed, waiting for model load");
|
|
5179
5164
|
}, 100);
|
|
5180
5165
|
}, 300);
|
|
5181
5166
|
},
|
|
@@ -5189,7 +5174,7 @@ var MMDVisualNovel = forwardRef(
|
|
|
5189
5174
|
const val = variables[key];
|
|
5190
5175
|
if (val !== void 0 && map[val] !== void 0) {
|
|
5191
5176
|
nextNodeIndex = map[val];
|
|
5192
|
-
console.log(
|
|
5177
|
+
console.log("[MMDVisualNovel] Branching: " + key + "=" + val + " -> node " + nextNodeIndex);
|
|
5193
5178
|
} else {
|
|
5194
5179
|
nextNodeIndex = defaultIndex;
|
|
5195
5180
|
}
|
|
@@ -5369,7 +5354,7 @@ var MMDVisualNovel = forwardRef(
|
|
|
5369
5354
|
"div",
|
|
5370
5355
|
{
|
|
5371
5356
|
ref: containerRef,
|
|
5372
|
-
className:
|
|
5357
|
+
className: clsx("relative bg-black", className),
|
|
5373
5358
|
style: { width: "100%", height: "100%", overflow: "hidden", ...style }
|
|
5374
5359
|
},
|
|
5375
5360
|
/* @__PURE__ */ React10.createElement(
|
|
@@ -5444,7 +5429,7 @@ var MMDVisualNovel = forwardRef(
|
|
|
5444
5429
|
className: "h-full w-full",
|
|
5445
5430
|
style: {
|
|
5446
5431
|
backgroundColor: activeEffect.color || "white",
|
|
5447
|
-
animation:
|
|
5432
|
+
animation: "flash-anim " + (activeEffect.duration || 500) + "ms ease-out forwards"
|
|
5448
5433
|
}
|
|
5449
5434
|
}
|
|
5450
5435
|
),
|
|
@@ -5549,7 +5534,7 @@ var MMDVisualNovel = forwardRef(
|
|
|
5549
5534
|
if (choice.setVariable) {
|
|
5550
5535
|
const { key, value } = choice.setVariable;
|
|
5551
5536
|
setVariables((prev) => ({ ...prev, [key]: value }));
|
|
5552
|
-
console.log(
|
|
5537
|
+
console.log("[MMDVisualNovel] Variable set: " + key + " = " + value);
|
|
5553
5538
|
}
|
|
5554
5539
|
choice.onSelect?.();
|
|
5555
5540
|
if (choice.effect) {
|
|
@@ -5843,19 +5828,19 @@ var MusicControls = ({
|
|
|
5843
5828
|
const formatTime = (seconds) => {
|
|
5844
5829
|
const mins = Math.floor(seconds / 60);
|
|
5845
5830
|
const secs = Math.floor(seconds % 60);
|
|
5846
|
-
return
|
|
5831
|
+
return mins + ":" + secs.toString().padStart(2, "0");
|
|
5847
5832
|
};
|
|
5848
5833
|
const progress = duration > 0 ? currentTime / duration * 100 : 0;
|
|
5849
5834
|
return /* @__PURE__ */ React10.createElement(
|
|
5850
5835
|
"div",
|
|
5851
5836
|
{
|
|
5852
|
-
className:
|
|
5837
|
+
className: clsx("w-full max-w-4xl mx-auto px-6 py-4 bg-white/10 backdrop-blur-xl border border-white/20 rounded-2xl shadow-2xl pointer-events-auto transition-all group", className)
|
|
5853
5838
|
},
|
|
5854
5839
|
/* @__PURE__ */ React10.createElement("div", { className: "relative w-full h-1.5 bg-white/20 rounded-full mb-4 cursor-pointer group/progress overflow-hidden" }, /* @__PURE__ */ React10.createElement(
|
|
5855
5840
|
"div",
|
|
5856
5841
|
{
|
|
5857
5842
|
className: "absolute h-full bg-blue-500 rounded-full transition-all duration-300",
|
|
5858
|
-
style: { width:
|
|
5843
|
+
style: { width: progress + "%" }
|
|
5859
5844
|
}
|
|
5860
5845
|
), /* @__PURE__ */ React10.createElement(
|
|
5861
5846
|
"input",
|
|
@@ -5937,7 +5922,7 @@ var PlaylistPanel = ({
|
|
|
5937
5922
|
return /* @__PURE__ */ React10.createElement(
|
|
5938
5923
|
"div",
|
|
5939
5924
|
{
|
|
5940
|
-
className:
|
|
5925
|
+
className: clsx("fixed inset-y-0 right-0 w-80 bg-gray-900/90 backdrop-blur-2xl border-l border-white/10 shadow-2xl z-50 flex flex-col pointer-events-auto transform transition-transform duration-500 ease-out", isOpen ? "translate-x-0" : "translate-x-full", className)
|
|
5941
5926
|
},
|
|
5942
5927
|
/* @__PURE__ */ React10.createElement("div", { className: "flex flex-col p-6 border-b border-white/10 gap-4" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React10.createElement(Music, { className: "w-5 h-5 text-blue-400" }), /* @__PURE__ */ React10.createElement("h3", { className: "text-lg font-bold text-white" }, mikuMode ? "Miku \u6B4C\u66F2\u5E93" : "\u64AD\u653E\u5217\u8868")), /* @__PURE__ */ React10.createElement(
|
|
5943
5928
|
"button",
|
|
@@ -5963,10 +5948,10 @@ var PlaylistPanel = ({
|
|
|
5963
5948
|
{
|
|
5964
5949
|
key: track.id,
|
|
5965
5950
|
onClick: () => onSelectTrack(index),
|
|
5966
|
-
className:
|
|
5951
|
+
className: clsx("w-full flex items-center gap-4 p-3 rounded-xl transition-all group", isActive ? "bg-blue-500/20 border border-blue-500/30" : "hover:bg-white/5 border border-transparent")
|
|
5967
5952
|
},
|
|
5968
5953
|
/* @__PURE__ */ React10.createElement("div", { className: "relative w-12 h-12 flex-shrink-0 rounded-lg overflow-hidden bg-gray-800" }, track.coverUrl ? /* @__PURE__ */ React10.createElement("img", { src: track.coverUrl, alt: track.title, className: "w-full h-full object-cover" }) : /* @__PURE__ */ React10.createElement("div", { className: "w-full h-full flex items-center justify-center text-white/20" }, /* @__PURE__ */ React10.createElement(Music, { className: "w-6 h-6" })), isActive && /* @__PURE__ */ React10.createElement("div", { className: "absolute inset-0 bg-blue-500/40 flex items-center justify-center" }, /* @__PURE__ */ React10.createElement("div", { className: "flex gap-1 items-end h-4" }, /* @__PURE__ */ React10.createElement("div", { className: "w-1 bg-white animate-music-bar-1" }), /* @__PURE__ */ React10.createElement("div", { className: "w-1 bg-white animate-music-bar-2" }), /* @__PURE__ */ React10.createElement("div", { className: "w-1 bg-white animate-music-bar-3" })))),
|
|
5969
|
-
/* @__PURE__ */ React10.createElement("div", { className: "flex-1 text-left min-w-0" }, /* @__PURE__ */ React10.createElement("h4", { className:
|
|
5954
|
+
/* @__PURE__ */ React10.createElement("div", { className: "flex-1 text-left min-w-0" }, /* @__PURE__ */ React10.createElement("h4", { className: clsx("text-sm font-bold truncate", isActive ? "text-blue-400" : "text-white/90") }, track.title), /* @__PURE__ */ React10.createElement("p", { className: "text-xs text-white/40 truncate mt-0.5" }, track.artist || "\u672A\u77E5\u827A\u672F\u5BB6")),
|
|
5970
5955
|
!isActive && /* @__PURE__ */ React10.createElement("div", { className: "opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React10.createElement(Play, { className: "w-4 h-4 text-white/40 fill-current" }))
|
|
5971
5956
|
);
|
|
5972
5957
|
})),
|
|
@@ -6004,7 +5989,7 @@ var PlaylistPanel = ({
|
|
|
6004
5989
|
);
|
|
6005
5990
|
};
|
|
6006
5991
|
var TrackInfo = ({ track, className = "" }) => {
|
|
6007
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
5992
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("flex flex-col items-center text-center gap-2", className) }, /* @__PURE__ */ React10.createElement("div", { className: "px-4 py-1.5 bg-black/40 backdrop-blur-md rounded-full border border-white/10 shadow-lg" }, /* @__PURE__ */ React10.createElement("h2", { className: "text-lg font-bold text-white tracking-wider truncate max-w-md" }, track.title)), /* @__PURE__ */ React10.createElement("p", { className: "text-sm font-medium text-white/60 drop-shadow-md" }, track.artist || "\u672A\u77E5\u827A\u672F\u5BB6"));
|
|
6008
5993
|
};
|
|
6009
5994
|
|
|
6010
5995
|
// src/mmd/music-player/MMDMusicPlayer.tsx
|
|
@@ -6212,7 +6197,7 @@ var MMDMusicPlayer = forwardRef(
|
|
|
6212
6197
|
"div",
|
|
6213
6198
|
{
|
|
6214
6199
|
ref: containerRef,
|
|
6215
|
-
className:
|
|
6200
|
+
className: clsx("relative bg-black group", className),
|
|
6216
6201
|
style: { width: "100%", height: "100%", overflow: "hidden", ...style },
|
|
6217
6202
|
onMouseMove: resetUITimeout,
|
|
6218
6203
|
onClick: resetUITimeout
|
|
@@ -6265,7 +6250,7 @@ var MMDMusicPlayer = forwardRef(
|
|
|
6265
6250
|
/* @__PURE__ */ React10.createElement(
|
|
6266
6251
|
"div",
|
|
6267
6252
|
{
|
|
6268
|
-
className:
|
|
6253
|
+
className: clsx("absolute inset-0 z-10 flex flex-col justify-between transition-opacity duration-700 pointer-events-none", isUIVisible ? "opacity-100" : "opacity-0")
|
|
6269
6254
|
},
|
|
6270
6255
|
/* @__PURE__ */ React10.createElement("div", { className: "pt-12 px-8 flex justify-center" }, /* @__PURE__ */ React10.createElement(TrackInfo, { track: currentTrack })),
|
|
6271
6256
|
/* @__PURE__ */ React10.createElement("div", { className: "pb-12 px-8" }, /* @__PURE__ */ React10.createElement(
|
|
@@ -6523,7 +6508,7 @@ var MMDARPlayer = forwardRef(({
|
|
|
6523
6508
|
const url = URL.createObjectURL(blob);
|
|
6524
6509
|
const a = document.createElement("a");
|
|
6525
6510
|
a.href = url;
|
|
6526
|
-
a.download =
|
|
6511
|
+
a.download = "ar-photo-" + Date.now() + ".png";
|
|
6527
6512
|
document.body.appendChild(a);
|
|
6528
6513
|
a.click();
|
|
6529
6514
|
document.body.removeChild(a);
|
|
@@ -6881,7 +6866,7 @@ var MMDARPlayer = forwardRef(({
|
|
|
6881
6866
|
{
|
|
6882
6867
|
onClick: placeModel,
|
|
6883
6868
|
disabled: !state.markerDetected,
|
|
6884
|
-
className:
|
|
6869
|
+
className: clsx("px-6 py-2 rounded-lg transition-colors", state.markerDetected ? "bg-green-600 hover:bg-green-700 text-white" : "bg-gray-500 text-gray-300 cursor-not-allowed")
|
|
6885
6870
|
},
|
|
6886
6871
|
"\u{1F4CD} \u653E\u7F6E\u6A21\u578B"
|
|
6887
6872
|
), state.modelPlaced && /* @__PURE__ */ React10.createElement(
|
|
@@ -6891,7 +6876,7 @@ var MMDARPlayer = forwardRef(({
|
|
|
6891
6876
|
className: "px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors"
|
|
6892
6877
|
},
|
|
6893
6878
|
"\u{1F4F8} \u62CD\u7167"
|
|
6894
|
-
)), /* @__PURE__ */ React10.createElement("div", { className: "absolute top-4 right-4 flex space-x-2" }, /* @__PURE__ */ React10.createElement("div", { className:
|
|
6879
|
+
)), /* @__PURE__ */ React10.createElement("div", { className: "absolute top-4 right-4 flex space-x-2" }, /* @__PURE__ */ React10.createElement("div", { className: clsx("w-3 h-3 rounded-full", state.cameraReady ? "bg-green-400" : "bg-red-400"), title: "\u6444\u50CF\u5934" }), /* @__PURE__ */ React10.createElement("div", { className: clsx("w-3 h-3 rounded-full", state.arReady ? "bg-green-400" : "bg-red-400"), title: "AR" }), /* @__PURE__ */ React10.createElement("div", { className: clsx("w-3 h-3 rounded-full", window.DeviceOrientationEvent ? "bg-purple-400" : "bg-gray-400"), title: "\u9640\u87BA\u4EEA" }), /* @__PURE__ */ React10.createElement("div", { className: clsx("w-3 h-3 rounded-full", state.markerDetected ? "bg-blue-400" : "bg-gray-400"), title: "\u6807\u8BB0\u68C0\u6D4B" }), /* @__PURE__ */ React10.createElement("div", { className: clsx("w-3 h-3 rounded-full", state.modelPlaced && modelRootRef.current?.visible ? "bg-green-400" : "bg-yellow-400"), title: "\u6A21\u578B" }))));
|
|
6895
6880
|
});
|
|
6896
6881
|
MMDARPlayer.displayName = "MMDARPlayer";
|
|
6897
6882
|
|
|
@@ -7049,7 +7034,7 @@ var HLSLToGLSLConverter = class {
|
|
|
7049
7034
|
*/
|
|
7050
7035
|
convertTypes(code) {
|
|
7051
7036
|
for (const [hlslType, glslType] of Object.entries(this.typeMap)) {
|
|
7052
|
-
const regex = new RegExp(
|
|
7037
|
+
const regex = new RegExp("\\b" + hlslType + "\\b", "g");
|
|
7053
7038
|
code = code.replace(regex, glslType);
|
|
7054
7039
|
}
|
|
7055
7040
|
return code;
|
|
@@ -7059,7 +7044,7 @@ var HLSLToGLSLConverter = class {
|
|
|
7059
7044
|
*/
|
|
7060
7045
|
convertFunctions(code) {
|
|
7061
7046
|
for (const [hlslFunc, glslFunc] of Object.entries(this.functionMap)) {
|
|
7062
|
-
const regex = new RegExp(
|
|
7047
|
+
const regex = new RegExp("\\b" + hlslFunc + "\\b", "g");
|
|
7063
7048
|
code = code.replace(regex, glslFunc);
|
|
7064
7049
|
}
|
|
7065
7050
|
code = this.convertMulFunction(code);
|
|
@@ -7082,7 +7067,7 @@ var HLSLToGLSLConverter = class {
|
|
|
7082
7067
|
*/
|
|
7083
7068
|
convertSemantics(code, shaderType) {
|
|
7084
7069
|
for (const [hlslSemantic, glslSemantic] of Object.entries(this.semanticMap)) {
|
|
7085
|
-
const regex = new RegExp(
|
|
7070
|
+
const regex = new RegExp("\\b" + hlslSemantic + "\\b", "g");
|
|
7086
7071
|
code = code.replace(regex, glslSemantic);
|
|
7087
7072
|
}
|
|
7088
7073
|
return code;
|
|
@@ -7164,7 +7149,7 @@ vec4 saturate(vec4 x) { return clamp(x, 0.0, 1.0); }
|
|
|
7164
7149
|
const vsFunc = effect.shaderFunctions?.find((f) => f.name === vertexShaderName);
|
|
7165
7150
|
const fsFunc = effect.shaderFunctions?.find((f) => f.name === fragmentShaderName);
|
|
7166
7151
|
if (!vsFunc || !fsFunc) {
|
|
7167
|
-
this.warnings.push(
|
|
7152
|
+
this.warnings.push("Shader functions not found: " + vertexShaderName + " or " + fragmentShaderName);
|
|
7168
7153
|
return null;
|
|
7169
7154
|
}
|
|
7170
7155
|
const vertexShader = this.convert(vsFunc.body, "vertex");
|
|
@@ -7268,7 +7253,7 @@ var FXParser = class {
|
|
|
7268
7253
|
const vsFunc = effect.shaderFunctions.find((f) => f.name === vertexShaderName);
|
|
7269
7254
|
const fsFunc = effect.shaderFunctions.find((f) => f.name === fragmentShaderName);
|
|
7270
7255
|
if (!vsFunc || !fsFunc) {
|
|
7271
|
-
warnings.push(
|
|
7256
|
+
warnings.push("Shader functions not found: " + vertexShaderName + " or " + fragmentShaderName);
|
|
7272
7257
|
return {
|
|
7273
7258
|
warnings
|
|
7274
7259
|
};
|
|
@@ -7408,8 +7393,8 @@ var FXParser = class {
|
|
|
7408
7393
|
if (match && match[1] && define.value && !define.isCommented) {
|
|
7409
7394
|
const purpose = match[1].toLowerCase();
|
|
7410
7395
|
const path = define.value.replace(/"/g, "");
|
|
7411
|
-
const widthDefine = defines.find((d) => d.name ===
|
|
7412
|
-
const heightDefine = defines.find((d) => d.name ===
|
|
7396
|
+
const widthDefine = defines.find((d) => d.name === define.name + "_X");
|
|
7397
|
+
const heightDefine = defines.find((d) => d.name === define.name + "_Y");
|
|
7413
7398
|
textures.push({
|
|
7414
7399
|
name: define.name,
|
|
7415
7400
|
path,
|
|
@@ -7601,10 +7586,7 @@ var FXParser = class {
|
|
|
7601
7586
|
extractShaderFunction(effect, functionName) {
|
|
7602
7587
|
const func = effect.shaderFunctions.find((f) => f.name === functionName);
|
|
7603
7588
|
if (!func) return null;
|
|
7604
|
-
return
|
|
7605
|
-
{
|
|
7606
|
-
${func.body}
|
|
7607
|
-
}`;
|
|
7589
|
+
return func.returnType + " " + func.name + "(" + func.parameters + ")" + (func.outputSemantic ? " : " + func.outputSemantic : "") + "\n{\n" + func.body + "\n}";
|
|
7608
7590
|
}
|
|
7609
7591
|
/**
|
|
7610
7592
|
* 获取所有启用的功能标志
|
|
@@ -7698,7 +7680,7 @@ var FXToThreeAdapter = class {
|
|
|
7698
7680
|
this.effect.parameters.forEach((param) => {
|
|
7699
7681
|
const name = param.name.toLowerCase();
|
|
7700
7682
|
if (name.startsWith("add")) {
|
|
7701
|
-
console.log(
|
|
7683
|
+
console.log('[FXToThreeAdapter] Skipping additive param "' + param.name + '" (not an absolute value)');
|
|
7702
7684
|
return;
|
|
7703
7685
|
}
|
|
7704
7686
|
if (name.includes("materialrgb") || name.includes("material")) {
|
|
@@ -7709,7 +7691,7 @@ var FXToThreeAdapter = class {
|
|
|
7709
7691
|
colorValue[1],
|
|
7710
7692
|
colorValue[2]
|
|
7711
7693
|
);
|
|
7712
|
-
console.log(
|
|
7694
|
+
console.log('[FXToThreeAdapter] Found color param "' + param.name + '":', colorValue);
|
|
7713
7695
|
}
|
|
7714
7696
|
}
|
|
7715
7697
|
if (name.includes("emissive")) {
|
|
@@ -7720,7 +7702,7 @@ var FXToThreeAdapter = class {
|
|
|
7720
7702
|
emissiveValue[1],
|
|
7721
7703
|
emissiveValue[2]
|
|
7722
7704
|
);
|
|
7723
|
-
console.log(
|
|
7705
|
+
console.log('[FXToThreeAdapter] Found emissive param "' + param.name + '":', emissiveValue);
|
|
7724
7706
|
}
|
|
7725
7707
|
}
|
|
7726
7708
|
if (name.includes("specular")) {
|
|
@@ -7731,14 +7713,14 @@ var FXToThreeAdapter = class {
|
|
|
7731
7713
|
specularValue[1],
|
|
7732
7714
|
specularValue[2]
|
|
7733
7715
|
);
|
|
7734
|
-
console.log(
|
|
7716
|
+
console.log('[FXToThreeAdapter] Found specular param "' + param.name + '":', specularValue);
|
|
7735
7717
|
}
|
|
7736
7718
|
}
|
|
7737
7719
|
if (name.includes("shininess") || name.includes("specularpower")) {
|
|
7738
7720
|
const shininessValue = this.parseFloat(param.defaultValue);
|
|
7739
7721
|
if (shininessValue !== null) {
|
|
7740
7722
|
config.shininess = shininessValue;
|
|
7741
|
-
console.log(
|
|
7723
|
+
console.log('[FXToThreeAdapter] Found shininess param "' + param.name + '":', shininessValue);
|
|
7742
7724
|
}
|
|
7743
7725
|
}
|
|
7744
7726
|
if (config.uniforms && param.defaultValue) {
|
|
@@ -7798,13 +7780,13 @@ var FXToThreeAdapter = class {
|
|
|
7798
7780
|
*/
|
|
7799
7781
|
async loadTextures() {
|
|
7800
7782
|
const promises = this.effect.textures.map(async (fxTexture) => {
|
|
7801
|
-
const path = this.basePath ?
|
|
7783
|
+
const path = this.basePath ? this.basePath + "/" + fxTexture.path : fxTexture.path;
|
|
7802
7784
|
try {
|
|
7803
7785
|
const texture = await this.loadTexture(path);
|
|
7804
7786
|
this.loadedTextures.set(fxTexture.name, texture);
|
|
7805
7787
|
return { name: fxTexture.name, texture };
|
|
7806
7788
|
} catch (error) {
|
|
7807
|
-
console.warn(
|
|
7789
|
+
console.warn("Failed to load texture " + fxTexture.name + ":", error);
|
|
7808
7790
|
return null;
|
|
7809
7791
|
}
|
|
7810
7792
|
});
|
|
@@ -7955,7 +7937,7 @@ var FXToThreeAdapter = class {
|
|
|
7955
7937
|
*/
|
|
7956
7938
|
getSummary() {
|
|
7957
7939
|
return {
|
|
7958
|
-
materialParams: this.effect.parameters.map((p) =>
|
|
7940
|
+
materialParams: this.effect.parameters.map((p) => p.type + " " + p.name),
|
|
7959
7941
|
textures: this.effect.textures.map((t) => t.path),
|
|
7960
7942
|
renderFeatures: this.effect.defines.filter((d) => !d.isCommented && (d.name.startsWith("USE_") || d.name.includes("SHADOW"))).map((d) => d.name)
|
|
7961
7943
|
};
|
|
@@ -7995,13 +7977,13 @@ var MultiFXAdapter = class {
|
|
|
7995
7977
|
try {
|
|
7996
7978
|
const fileType = this.detectFileType(config.path, config.type);
|
|
7997
7979
|
const desc = config.description || config.path;
|
|
7998
|
-
console.log(
|
|
7980
|
+
console.log("[MultiFXAdapter] Loading " + fileType.toUpperCase() + " file:", desc);
|
|
7999
7981
|
const effect = await this.parser.loadAndParse(config.path);
|
|
8000
7982
|
this.effects.set(config.path, effect);
|
|
8001
7983
|
const adapter = new FXToThreeAdapter(effect, config.texturePath || "");
|
|
8002
7984
|
this.adapters.set(config.path, adapter);
|
|
8003
7985
|
if (this.options.autoLoadTextures) {
|
|
8004
|
-
console.log(
|
|
7986
|
+
console.log("[MultiFXAdapter] Loading textures for " + fileType + ":", desc);
|
|
8005
7987
|
await adapter.loadTextures();
|
|
8006
7988
|
}
|
|
8007
7989
|
const defaultPriority = fileType === "x" ? -10 : 0;
|
|
@@ -8015,9 +7997,9 @@ var MultiFXAdapter = class {
|
|
|
8015
7997
|
});
|
|
8016
7998
|
this.configs.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
|
|
8017
7999
|
const lastConfig = this.configs[this.configs.length - 1];
|
|
8018
|
-
console.log(
|
|
8019
|
-
console.log(
|
|
8020
|
-
console.log(
|
|
8000
|
+
console.log("[MultiFXAdapter] " + fileType.toUpperCase() + " loaded successfully:", desc);
|
|
8001
|
+
console.log("[MultiFXAdapter] - Priority: " + (lastConfig?.priority ?? 0));
|
|
8002
|
+
console.log("[MultiFXAdapter] - Target: " + (lastConfig?.target ?? "all"));
|
|
8021
8003
|
} catch (error) {
|
|
8022
8004
|
console.error("[MultiFXAdapter] Failed to load effect file:", config.path, error);
|
|
8023
8005
|
throw error;
|
|
@@ -8064,15 +8046,15 @@ var MultiFXAdapter = class {
|
|
|
8064
8046
|
shouldApply = config.target === target;
|
|
8065
8047
|
}
|
|
8066
8048
|
if (!shouldApply) {
|
|
8067
|
-
console.log(
|
|
8049
|
+
console.log("[MultiFXAdapter] - Skipping " + (config.description || config.path) + " (target mismatch: " + config.target + " !== " + target + ")");
|
|
8068
8050
|
return;
|
|
8069
8051
|
}
|
|
8070
8052
|
const adapter = this.adapters.get(config.path);
|
|
8071
8053
|
if (!adapter) {
|
|
8072
|
-
console.log(
|
|
8054
|
+
console.log("[MultiFXAdapter] - Skipping " + (config.description || config.path) + " (adapter not found)");
|
|
8073
8055
|
return;
|
|
8074
8056
|
}
|
|
8075
|
-
console.log(
|
|
8057
|
+
console.log("[MultiFXAdapter] \u2705 Applying " + (config.description || config.path) + " (priority: " + config.priority + ")");
|
|
8076
8058
|
const materialConfig = adapter.extractMaterialConfig();
|
|
8077
8059
|
switch (this.options.mergeStrategy) {
|
|
8078
8060
|
case "override":
|
|
@@ -8129,7 +8111,7 @@ var MultiFXAdapter = class {
|
|
|
8129
8111
|
const adapter = this.adapters.get(config.path);
|
|
8130
8112
|
if (!adapter) return;
|
|
8131
8113
|
const renderConfig = adapter.extractRenderConfig();
|
|
8132
|
-
console.log(
|
|
8114
|
+
console.log("[MultiFXAdapter] Processing " + (config.description || config.path) + ":");
|
|
8133
8115
|
console.log(" - enableShadow:", renderConfig.enableShadow);
|
|
8134
8116
|
console.log(" - shadowMapSize:", renderConfig.shadowMapSize);
|
|
8135
8117
|
console.log(" - toneMapping:", renderConfig.toneMapping);
|
|
@@ -8228,17 +8210,17 @@ var MultiFXAdapter = class {
|
|
|
8228
8210
|
return config.target === target;
|
|
8229
8211
|
});
|
|
8230
8212
|
if (!shaderConfig) {
|
|
8231
|
-
console.log(
|
|
8213
|
+
console.log("[MultiFXAdapter] No shader material config found for target: " + target);
|
|
8232
8214
|
return null;
|
|
8233
8215
|
}
|
|
8234
8216
|
const adapter = this.adapters.get(shaderConfig.path);
|
|
8235
8217
|
if (!adapter) {
|
|
8236
|
-
console.warn(
|
|
8218
|
+
console.warn("[MultiFXAdapter] Adapter not found for: " + shaderConfig.path);
|
|
8237
8219
|
return null;
|
|
8238
8220
|
}
|
|
8239
8221
|
const material = adapter.createShaderMaterial();
|
|
8240
8222
|
if (material) {
|
|
8241
|
-
console.log(
|
|
8223
|
+
console.log("[MultiFXAdapter] \u2705 Created ShaderMaterial for target: " + target + " from " + (shaderConfig.description || shaderConfig.path));
|
|
8242
8224
|
}
|
|
8243
8225
|
return material;
|
|
8244
8226
|
}
|
|
@@ -8372,11 +8354,11 @@ var MultiFXAdapter = class {
|
|
|
8372
8354
|
applyLayered(scene, renderer, modelMeshes, stageMeshes) {
|
|
8373
8355
|
console.log("[MultiFXAdapter] Applying layered effects...");
|
|
8374
8356
|
const sceneEffects = this.getSceneEffects();
|
|
8375
|
-
console.log(
|
|
8357
|
+
console.log("[MultiFXAdapter] Applying " + sceneEffects.length + " scene-level effects (.x files)");
|
|
8376
8358
|
sceneEffects.forEach((config) => {
|
|
8377
8359
|
const adapter = this.adapters.get(config.path);
|
|
8378
8360
|
if (adapter) {
|
|
8379
|
-
console.log(
|
|
8361
|
+
console.log("[MultiFXAdapter] - Applying: " + (config.description || config.path));
|
|
8380
8362
|
const renderConfig = adapter.extractRenderConfig();
|
|
8381
8363
|
if (renderConfig.toneMapping !== void 0) {
|
|
8382
8364
|
renderer.toneMapping = renderConfig.toneMapping;
|
|
@@ -8395,9 +8377,9 @@ var MultiFXAdapter = class {
|
|
|
8395
8377
|
}
|
|
8396
8378
|
});
|
|
8397
8379
|
const modelEffects = this.getModelEffects();
|
|
8398
|
-
console.log(
|
|
8380
|
+
console.log("[MultiFXAdapter] Applying " + modelEffects.length + " model-level effects (.fx files)");
|
|
8399
8381
|
modelEffects.forEach((config) => {
|
|
8400
|
-
console.log(
|
|
8382
|
+
console.log("[MultiFXAdapter] - Applying: " + (config.description || config.path));
|
|
8401
8383
|
if (modelMeshes) {
|
|
8402
8384
|
modelMeshes.forEach((mesh) => {
|
|
8403
8385
|
if (mesh instanceof THREE2.Mesh && mesh.material instanceof THREE2.MeshPhongMaterial) {
|
|
@@ -8430,16 +8412,16 @@ var MultiFXAdapter = class {
|
|
|
8430
8412
|
console.log("\n[MultiFXAdapter] Current Configuration:");
|
|
8431
8413
|
console.log("\u2550".repeat(60));
|
|
8432
8414
|
const summary = this.getSummary();
|
|
8433
|
-
console.log(
|
|
8434
|
-
console.log(
|
|
8435
|
-
console.log(
|
|
8415
|
+
console.log("Total Effects: " + summary.totalFX);
|
|
8416
|
+
console.log(" - Scene-level (.x): " + summary.xFiles);
|
|
8417
|
+
console.log(" - Model-level (.fx): " + summary.fxFiles);
|
|
8436
8418
|
console.log("\nLoad Order (by priority):");
|
|
8437
8419
|
summary.configs.forEach((config, index) => {
|
|
8438
8420
|
const icon = config.type === "x" ? "\u{1F30D}" : "\u{1F3A8}";
|
|
8439
|
-
console.log(
|
|
8440
|
-
console.log(
|
|
8421
|
+
console.log(index + 1 + ". " + icon + " [" + config.type.toUpperCase() + "] " + (config.description || config.path));
|
|
8422
|
+
console.log(" Priority: " + config.priority + ", Target: " + config.target);
|
|
8441
8423
|
if (config.features.length > 0) {
|
|
8442
|
-
console.log(
|
|
8424
|
+
console.log(" Features: " + config.features.join(", "));
|
|
8443
8425
|
}
|
|
8444
8426
|
});
|
|
8445
8427
|
console.log("\u2550".repeat(60) + "\n");
|
|
@@ -8452,7 +8434,7 @@ function exportFXToJSON(effect) {
|
|
|
8452
8434
|
}
|
|
8453
8435
|
function exportFXToMarkdown(effect) {
|
|
8454
8436
|
const lines = [];
|
|
8455
|
-
lines.push(
|
|
8437
|
+
lines.push("# " + effect.fileName);
|
|
8456
8438
|
lines.push("");
|
|
8457
8439
|
if (effect.defines.length > 0) {
|
|
8458
8440
|
lines.push("## \u5B8F\u5B9A\u4E49 (Defines)");
|
|
@@ -8461,7 +8443,7 @@ function exportFXToMarkdown(effect) {
|
|
|
8461
8443
|
lines.push("|------|-----|------|------|");
|
|
8462
8444
|
effect.defines.forEach((d) => {
|
|
8463
8445
|
const status = d.isCommented ? "\u7981\u7528" : "\u542F\u7528";
|
|
8464
|
-
lines.push(
|
|
8446
|
+
lines.push("| " + d.name + " | " + (d.value || "-") + " | " + status + " | " + (d.comment || "-") + " |");
|
|
8465
8447
|
});
|
|
8466
8448
|
lines.push("");
|
|
8467
8449
|
}
|
|
@@ -8471,8 +8453,8 @@ function exportFXToMarkdown(effect) {
|
|
|
8471
8453
|
lines.push("| \u540D\u79F0 | \u8DEF\u5F84 | \u5C3A\u5BF8 | \u7528\u9014 |");
|
|
8472
8454
|
lines.push("|------|------|------|------|");
|
|
8473
8455
|
effect.textures.forEach((t) => {
|
|
8474
|
-
const size = t.width && t.height ?
|
|
8475
|
-
lines.push(
|
|
8456
|
+
const size = t.width && t.height ? t.width + "x" + t.height : "-";
|
|
8457
|
+
lines.push("| " + t.name + " | " + t.path + " | " + size + " | " + (t.purpose || "-") + " |");
|
|
8476
8458
|
});
|
|
8477
8459
|
lines.push("");
|
|
8478
8460
|
}
|
|
@@ -8482,7 +8464,7 @@ function exportFXToMarkdown(effect) {
|
|
|
8482
8464
|
lines.push("| \u540D\u79F0 | \u7C7B\u578B | \u8BED\u4E49 | \u9ED8\u8BA4\u503C |");
|
|
8483
8465
|
lines.push("|------|------|------|--------|");
|
|
8484
8466
|
effect.parameters.forEach((p) => {
|
|
8485
|
-
lines.push(
|
|
8467
|
+
lines.push("| " + p.name + " | " + p.type + " | " + (p.semantic || "-") + " | " + (p.defaultValue || "-") + " |");
|
|
8486
8468
|
});
|
|
8487
8469
|
lines.push("");
|
|
8488
8470
|
}
|
|
@@ -8492,7 +8474,7 @@ function exportFXToMarkdown(effect) {
|
|
|
8492
8474
|
lines.push("| \u53C2\u6570 | \u5BF9\u8C61\u540D | \u63A7\u5236\u9879 |");
|
|
8493
8475
|
lines.push("|------|--------|--------|");
|
|
8494
8476
|
effect.controllers.forEach((c) => {
|
|
8495
|
-
lines.push(
|
|
8477
|
+
lines.push("| " + c.name + " | " + c.objectName + " | " + c.itemName + " |");
|
|
8496
8478
|
});
|
|
8497
8479
|
lines.push("");
|
|
8498
8480
|
}
|
|
@@ -8500,7 +8482,7 @@ function exportFXToMarkdown(effect) {
|
|
|
8500
8482
|
lines.push("## \u5305\u542B\u6587\u4EF6 (Includes)");
|
|
8501
8483
|
lines.push("");
|
|
8502
8484
|
effect.includes.forEach((inc) => {
|
|
8503
|
-
lines.push(
|
|
8485
|
+
lines.push("- " + inc);
|
|
8504
8486
|
});
|
|
8505
8487
|
lines.push("");
|
|
8506
8488
|
}
|
|
@@ -8508,15 +8490,15 @@ function exportFXToMarkdown(effect) {
|
|
|
8508
8490
|
lines.push("## \u6280\u672F (Techniques)");
|
|
8509
8491
|
lines.push("");
|
|
8510
8492
|
effect.techniques.forEach((t) => {
|
|
8511
|
-
lines.push(
|
|
8493
|
+
lines.push("### " + t.name);
|
|
8512
8494
|
lines.push("");
|
|
8513
8495
|
t.passes.forEach((p, idx) => {
|
|
8514
|
-
lines.push(
|
|
8496
|
+
lines.push("#### Pass " + (p.name || idx + 1));
|
|
8515
8497
|
if (p.vertexShader) {
|
|
8516
|
-
lines.push(
|
|
8498
|
+
lines.push("- **\u9876\u70B9\u7740\u8272\u5668**: " + p.vertexShader.function + " (" + p.vertexShader.profile + ")");
|
|
8517
8499
|
}
|
|
8518
8500
|
if (p.pixelShader) {
|
|
8519
|
-
lines.push(
|
|
8501
|
+
lines.push("- **\u50CF\u7D20\u7740\u8272\u5668**: " + p.pixelShader.function + " (" + p.pixelShader.profile + ")");
|
|
8520
8502
|
}
|
|
8521
8503
|
lines.push("");
|
|
8522
8504
|
});
|
|
@@ -8622,7 +8604,7 @@ function getConfigSummaryText(effect) {
|
|
|
8622
8604
|
if (hasFeature(effect, "USE_ROUNDNORMAL")) {
|
|
8623
8605
|
features.push("RoundNormal");
|
|
8624
8606
|
}
|
|
8625
|
-
return features.length > 0 ?
|
|
8607
|
+
return features.length > 0 ? "\u542F\u7528\u529F\u80FD: " + features.join(", ") : "\u65E0\u7279\u6B8A\u529F\u80FD\u542F\u7528";
|
|
8626
8608
|
}
|
|
8627
8609
|
function extractTexturePaths(effect) {
|
|
8628
8610
|
return effect.textures.map((t) => t.path);
|
|
@@ -8635,14 +8617,14 @@ function validateFXEffect(effect) {
|
|
|
8635
8617
|
}
|
|
8636
8618
|
effect.textures.forEach((texture) => {
|
|
8637
8619
|
if (!texture.path || texture.path === "") {
|
|
8638
|
-
errors.push(
|
|
8620
|
+
errors.push("\u7EB9\u7406 " + texture.name + " \u7F3A\u5C11\u8DEF\u5F84");
|
|
8639
8621
|
}
|
|
8640
8622
|
});
|
|
8641
8623
|
effect.parameters.forEach((param) => {
|
|
8642
8624
|
if (param.type.includes("float") && param.defaultValue) {
|
|
8643
8625
|
const floatRegex = /^float[234]?\s*\(/;
|
|
8644
8626
|
if (!floatRegex.test(param.defaultValue) && isNaN(parseFloat(param.defaultValue))) {
|
|
8645
|
-
warnings.push(
|
|
8627
|
+
warnings.push("\u53C2\u6570 " + param.name + " \u7684\u9ED8\u8BA4\u503C\u53EF\u80FD\u4E0D\u5408\u6CD5: " + param.defaultValue);
|
|
8646
8628
|
}
|
|
8647
8629
|
}
|
|
8648
8630
|
});
|
|
@@ -8694,23 +8676,23 @@ var FXViewer = ({
|
|
|
8694
8676
|
parse();
|
|
8695
8677
|
}, [source, isContent, fileName, onParsed, onError]);
|
|
8696
8678
|
if (loading) {
|
|
8697
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
8679
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("font-sans bg-white border border-gray-300 rounded-lg overflow-hidden p-8 text-center", className) }, /* @__PURE__ */ React10.createElement("div", { className: "text-xl text-gray-600" }, "\u52A0\u8F7D\u4E2D..."));
|
|
8698
8680
|
}
|
|
8699
8681
|
if (error || !effect || !summary) {
|
|
8700
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
8682
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("font-sans bg-white border border-gray-300 rounded-lg overflow-hidden p-8 text-center", className) }, /* @__PURE__ */ React10.createElement("div", { className: "text-red-700" }, /* @__PURE__ */ React10.createElement("h3", { className: "m-0 mb-4 text-2xl" }, "\u274C \u89E3\u6790\u9519\u8BEF"), /* @__PURE__ */ React10.createElement("p", null, error || "\u672A\u77E5\u9519\u8BEF")));
|
|
8701
8683
|
}
|
|
8702
8684
|
const validation = validateFXEffect(effect);
|
|
8703
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
8685
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("font-sans bg-white border border-gray-300 rounded-lg overflow-hidden", className) }, /* @__PURE__ */ React10.createElement("div", { className: "p-4 md:p-6 bg-gradient-to-br from-indigo-500 to-purple-600 text-white" }, /* @__PURE__ */ React10.createElement("h2", { className: "m-0 mb-2 text-xl md:text-2xl font-semibold" }, effect.fileName), /* @__PURE__ */ React10.createElement("p", { className: "m-0 text-sm opacity-90" }, getConfigSummaryText(effect))), /* @__PURE__ */ React10.createElement("div", { className: "flex bg-gray-100 border-b border-gray-300 overflow-x-auto" }, /* @__PURE__ */ React10.createElement(
|
|
8704
8686
|
"button",
|
|
8705
8687
|
{
|
|
8706
|
-
className:
|
|
8688
|
+
className: clsx("flex-1 min-w-[80px] md:min-w-[100px] px-3 md:px-4 py-2 md:py-3 border-none bg-transparent text-gray-600 text-xs md:text-sm cursor-pointer transition-all border-b-2", activeTab === "summary" ? "bg-white text-indigo-500 border-b-indigo-500 font-semibold" : "border-b-transparent hover:bg-gray-200 hover:text-gray-800"),
|
|
8707
8689
|
onClick: () => setActiveTab("summary")
|
|
8708
8690
|
},
|
|
8709
8691
|
"\u6458\u8981"
|
|
8710
8692
|
), /* @__PURE__ */ React10.createElement(
|
|
8711
8693
|
"button",
|
|
8712
8694
|
{
|
|
8713
|
-
className:
|
|
8695
|
+
className: clsx("flex-1 min-w-[80px] md:min-w-[100px] px-3 md:px-4 py-2 md:py-3 border-none bg-transparent text-gray-600 text-xs md:text-sm cursor-pointer transition-all border-b-2", activeTab === "defines" ? "bg-white text-indigo-500 border-b-indigo-500 font-semibold" : "border-b-transparent hover:bg-gray-200 hover:text-gray-800"),
|
|
8714
8696
|
onClick: () => setActiveTab("defines")
|
|
8715
8697
|
},
|
|
8716
8698
|
"\u5B8F\u5B9A\u4E49 (",
|
|
@@ -8719,7 +8701,7 @@ var FXViewer = ({
|
|
|
8719
8701
|
), /* @__PURE__ */ React10.createElement(
|
|
8720
8702
|
"button",
|
|
8721
8703
|
{
|
|
8722
|
-
className:
|
|
8704
|
+
className: clsx("flex-1 min-w-[80px] md:min-w-[100px] px-3 md:px-4 py-2 md:py-3 border-none bg-transparent text-gray-600 text-xs md:text-sm cursor-pointer transition-all border-b-2", activeTab === "textures" ? "bg-white text-indigo-500 border-b-indigo-500 font-semibold" : "border-b-transparent hover:bg-gray-200 hover:text-gray-800"),
|
|
8723
8705
|
onClick: () => setActiveTab("textures")
|
|
8724
8706
|
},
|
|
8725
8707
|
"\u7EB9\u7406 (",
|
|
@@ -8728,7 +8710,7 @@ var FXViewer = ({
|
|
|
8728
8710
|
), /* @__PURE__ */ React10.createElement(
|
|
8729
8711
|
"button",
|
|
8730
8712
|
{
|
|
8731
|
-
className:
|
|
8713
|
+
className: clsx("flex-1 min-w-[80px] md:min-w-[100px] px-3 md:px-4 py-2 md:py-3 border-none bg-transparent text-gray-600 text-xs md:text-sm cursor-pointer transition-all border-b-2", activeTab === "parameters" ? "bg-white text-indigo-500 border-b-indigo-500 font-semibold" : "border-b-transparent hover:bg-gray-200 hover:text-gray-800"),
|
|
8732
8714
|
onClick: () => setActiveTab("parameters")
|
|
8733
8715
|
},
|
|
8734
8716
|
"\u53C2\u6570 (",
|
|
@@ -8737,17 +8719,17 @@ var FXViewer = ({
|
|
|
8737
8719
|
), /* @__PURE__ */ React10.createElement(
|
|
8738
8720
|
"button",
|
|
8739
8721
|
{
|
|
8740
|
-
className:
|
|
8722
|
+
className: clsx("flex-1 min-w-[80px] md:min-w-[100px] px-3 md:px-4 py-2 md:py-3 border-none bg-transparent text-gray-600 text-xs md:text-sm cursor-pointer transition-all border-b-2", activeTab === "validation" ? "bg-white text-indigo-500 border-b-indigo-500 font-semibold" : "border-b-transparent hover:bg-gray-200 hover:text-gray-800"),
|
|
8741
8723
|
onClick: () => setActiveTab("validation")
|
|
8742
8724
|
},
|
|
8743
8725
|
"\u9A8C\u8BC1"
|
|
8744
8726
|
)), /* @__PURE__ */ React10.createElement("div", { className: "p-4 md:p-6 max-h-[500px] md:max-h-[600px] overflow-y-auto" }, activeTab === "summary" && /* @__PURE__ */ React10.createElement(SummaryTab, { summary, effect }), activeTab === "defines" && /* @__PURE__ */ React10.createElement(DefinesTab, { effect }), activeTab === "textures" && /* @__PURE__ */ React10.createElement(TexturesTab, { effect }), activeTab === "parameters" && /* @__PURE__ */ React10.createElement(ParametersTab, { effect }), activeTab === "validation" && /* @__PURE__ */ React10.createElement(ValidationTab, { validation })));
|
|
8745
8727
|
};
|
|
8746
|
-
var SummaryTab = ({ summary, effect }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("div", { className: "grid grid-cols-2 md:grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-4 mb-8" }, /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "\u5B8F\u5B9A\u4E49"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.defineCount)), /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "\u53C2\u6570"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.parameterCount)), /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "\u7EB9\u7406"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.textureCount)), /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "Technique"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.techniqueCount))), /* @__PURE__ */ React10.createElement("div", { className: "mt-8" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg m-0 mb-4 text-gray-800 border-b-2 border-indigo-500 pb-2" }, "\u529F\u80FD\u7279\u6027"), /* @__PURE__ */ React10.createElement("div", { className: "flex flex-wrap gap-3" }, /* @__PURE__ */ React10.createElement("div", { className:
|
|
8747
|
-
var DefinesTab = ({ effect }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("table", { className: "w-full border-collapse text-xs md:text-sm" }, /* @__PURE__ */ React10.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-300" }, /* @__PURE__ */ React10.createElement("tr", null, /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u540D\u79F0"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u503C"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u72B6\u6001"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u884C\u53F7"))), /* @__PURE__ */ React10.createElement("tbody", null, effect.defines.map((define, idx) => /* @__PURE__ */ React10.createElement("tr", { key: idx, className:
|
|
8748
|
-
var TexturesTab = ({ effect }) => /* @__PURE__ */ React10.createElement("div", null, effect.textures.length === 0 ? /* @__PURE__ */ React10.createElement("p", { className: "text-center text-gray-500 py-8 italic" }, "\u672A\u627E\u5230\u7EB9\u7406\u5B9A\u4E49") : /* @__PURE__ */ React10.createElement("table", { className: "w-full border-collapse text-xs md:text-sm" }, /* @__PURE__ */ React10.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-300" }, /* @__PURE__ */ React10.createElement("tr", null, /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u540D\u79F0"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u8DEF\u5F84"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u5C3A\u5BF8"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u7528\u9014"))), /* @__PURE__ */ React10.createElement("tbody", null, effect.textures.map((texture, idx) => /* @__PURE__ */ React10.createElement("tr", { key: idx, className: "hover:bg-gray-50" }, /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("code", { className: "bg-gray-100 px-2 py-1 rounded text-xs font-mono" }, texture.name)), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, texture.path), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, texture.width && texture.height ?
|
|
8728
|
+
var SummaryTab = ({ summary, effect }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("div", { className: "grid grid-cols-2 md:grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-4 mb-8" }, /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "\u5B8F\u5B9A\u4E49"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.defineCount)), /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "\u53C2\u6570"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.parameterCount)), /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "\u7EB9\u7406"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.textureCount)), /* @__PURE__ */ React10.createElement("div", { className: "p-6 bg-gradient-to-br from-gray-100 to-blue-100 rounded-lg text-center" }, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-gray-600 mb-2 uppercase tracking-wide" }, "Technique"), /* @__PURE__ */ React10.createElement("div", { className: "text-3xl font-bold text-gray-800" }, summary.techniqueCount))), /* @__PURE__ */ React10.createElement("div", { className: "mt-8" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg m-0 mb-4 text-gray-800 border-b-2 border-indigo-500 pb-2" }, "\u529F\u80FD\u7279\u6027"), /* @__PURE__ */ React10.createElement("div", { className: "flex flex-wrap gap-3" }, /* @__PURE__ */ React10.createElement("div", { className: clsx("px-4 py-2 rounded-full text-sm font-medium", summary.hasLocalShadow ? "bg-green-100 text-green-800" : "bg-red-100 text-red-800") }, summary.hasLocalShadow ? "\u2713" : "\u2717", " LocalShadow"), /* @__PURE__ */ React10.createElement("div", { className: clsx("px-4 py-2 rounded-full text-sm font-medium", summary.hasExcellentShadow ? "bg-green-100 text-green-800" : "bg-red-100 text-red-800") }, summary.hasExcellentShadow ? "\u2713" : "\u2717", " ExcellentShadow"), /* @__PURE__ */ React10.createElement("div", { className: clsx("px-4 py-2 rounded-full text-sm font-medium", summary.hasHgShadow ? "bg-green-100 text-green-800" : "bg-red-100 text-red-800") }, summary.hasHgShadow ? "\u2713" : "\u2717", " HgShadow"))), effect.includes.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "mt-8" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg m-0 mb-4 text-gray-800 border-b-2 border-indigo-500 pb-2" }, "\u5305\u542B\u6587\u4EF6"), /* @__PURE__ */ React10.createElement("ul", { className: "list-none p-0 m-0" }, effect.includes.map((inc, idx) => /* @__PURE__ */ React10.createElement("li", { key: idx, className: "py-2 border-b border-gray-200 last:border-b-0" }, /* @__PURE__ */ React10.createElement("code", { className: "bg-gray-100 px-2 py-1 rounded text-xs font-mono" }, inc))))), effect.controllers.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "mt-8" }, /* @__PURE__ */ React10.createElement("h3", { className: "text-lg m-0 mb-4 text-gray-800 border-b-2 border-indigo-500 pb-2" }, "\u63A7\u5236\u5668"), /* @__PURE__ */ React10.createElement("ul", { className: "list-none p-0 m-0" }, effect.controllers.map((ctrl, idx) => /* @__PURE__ */ React10.createElement("li", { key: idx, className: "py-2 border-b border-gray-200 last:border-b-0" }, /* @__PURE__ */ React10.createElement("strong", null, ctrl.name), ": ", ctrl.objectName, " / ", ctrl.itemName)))));
|
|
8729
|
+
var DefinesTab = ({ effect }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("table", { className: "w-full border-collapse text-xs md:text-sm" }, /* @__PURE__ */ React10.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-300" }, /* @__PURE__ */ React10.createElement("tr", null, /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u540D\u79F0"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u503C"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u72B6\u6001"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u884C\u53F7"))), /* @__PURE__ */ React10.createElement("tbody", null, effect.defines.map((define, idx) => /* @__PURE__ */ React10.createElement("tr", { key: idx, className: clsx("hover:bg-gray-50", define.isCommented ? "opacity-50" : "") }, /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("code", { className: "bg-gray-100 px-2 py-1 rounded text-xs font-mono" }, define.name)), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, define.value || "-"), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("span", { className: clsx("inline-block px-3 py-1 rounded-xl text-xs font-medium", define.isCommented ? "bg-red-100 text-red-800" : "bg-green-100 text-green-800") }, define.isCommented ? "\u7981\u7528" : "\u542F\u7528")), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, define.lineNumber))))));
|
|
8730
|
+
var TexturesTab = ({ effect }) => /* @__PURE__ */ React10.createElement("div", null, effect.textures.length === 0 ? /* @__PURE__ */ React10.createElement("p", { className: "text-center text-gray-500 py-8 italic" }, "\u672A\u627E\u5230\u7EB9\u7406\u5B9A\u4E49") : /* @__PURE__ */ React10.createElement("table", { className: "w-full border-collapse text-xs md:text-sm" }, /* @__PURE__ */ React10.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-300" }, /* @__PURE__ */ React10.createElement("tr", null, /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u540D\u79F0"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u8DEF\u5F84"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u5C3A\u5BF8"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u7528\u9014"))), /* @__PURE__ */ React10.createElement("tbody", null, effect.textures.map((texture, idx) => /* @__PURE__ */ React10.createElement("tr", { key: idx, className: "hover:bg-gray-50" }, /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("code", { className: "bg-gray-100 px-2 py-1 rounded text-xs font-mono" }, texture.name)), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, texture.path), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, texture.width && texture.height ? texture.width + "\xD7" + texture.height : "-"), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, texture.purpose || "-"))))));
|
|
8749
8731
|
var ParametersTab = ({ effect }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("table", { className: "w-full border-collapse text-xs md:text-sm" }, /* @__PURE__ */ React10.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-300" }, /* @__PURE__ */ React10.createElement("tr", null, /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u540D\u79F0"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u7C7B\u578B"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u8BED\u4E49"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u9ED8\u8BA4\u503C"), /* @__PURE__ */ React10.createElement("th", { className: "px-2 md:px-3 py-2 md:py-3 text-left font-semibold text-gray-800" }, "\u884C\u53F7"))), /* @__PURE__ */ React10.createElement("tbody", null, effect.parameters.map((param, idx) => /* @__PURE__ */ React10.createElement("tr", { key: idx, className: "hover:bg-gray-50" }, /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("code", { className: "bg-gray-100 px-2 py-1 rounded text-xs font-mono" }, param.name)), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, /* @__PURE__ */ React10.createElement("code", { className: "bg-gray-100 px-2 py-1 rounded text-xs font-mono" }, param.type)), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, param.semantic || "-"), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, param.defaultValue || "-"), /* @__PURE__ */ React10.createElement("td", { className: "px-2 md:px-3 py-2 md:py-3 border-b border-gray-200" }, param.lineNumber))))));
|
|
8750
|
-
var ValidationTab = ({ validation }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("div", { className:
|
|
8732
|
+
var ValidationTab = ({ validation }) => /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("div", { className: clsx("p-6 rounded-lg mb-6 text-center", validation.isValid ? "bg-green-100 text-green-800" : "bg-red-100 text-red-800") }, /* @__PURE__ */ React10.createElement("h3", { className: "m-0 text-xl" }, validation.isValid ? "\u2713 \u9A8C\u8BC1\u901A\u8FC7" : "\u2717 \u9A8C\u8BC1\u5931\u8D25")), validation.errors.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "mb-6" }, /* @__PURE__ */ React10.createElement("h4", { className: "m-0 mb-3 text-base text-gray-800" }, "\u9519\u8BEF (", validation.errors.length, ")"), /* @__PURE__ */ React10.createElement("ul", { className: "list-none p-0 m-0" }, validation.errors.map((error, idx) => /* @__PURE__ */ React10.createElement("li", { key: idx, className: "p-3 mb-2 bg-red-100 text-red-800 rounded border-l-4 border-red-800" }, error)))), validation.warnings.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "mb-6" }, /* @__PURE__ */ React10.createElement("h4", { className: "m-0 mb-3 text-base text-gray-800" }, "\u8B66\u544A (", validation.warnings.length, ")"), /* @__PURE__ */ React10.createElement("ul", { className: "list-none p-0 m-0" }, validation.warnings.map((warning, idx) => /* @__PURE__ */ React10.createElement("li", { key: idx, className: "p-3 mb-2 bg-orange-100 text-orange-700 rounded border-l-4 border-orange-700" }, warning)))), validation.isValid && validation.warnings.length === 0 && /* @__PURE__ */ React10.createElement("p", { className: "text-center text-green-800 py-8 text-lg" }, "FX\u6587\u4EF6\u7ED3\u6784\u5B8C\u6574\uFF0C\u6CA1\u6709\u53D1\u73B0\u95EE\u9898\u3002"));
|
|
8751
8733
|
FXViewer.displayName = "FXViewer";
|
|
8752
8734
|
var FXThreePreview = ({
|
|
8753
8735
|
effect,
|
|
@@ -8873,12 +8855,12 @@ var FXThreePreview = ({
|
|
|
8873
8855
|
};
|
|
8874
8856
|
}, [effect, texturePath, objectType]);
|
|
8875
8857
|
if (loading) {
|
|
8876
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
8858
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("fx-three-preview loading", className) }, /* @__PURE__ */ React10.createElement("div", { className: "preview-loading" }, "\u52A0\u8F7D\u4E2D..."));
|
|
8877
8859
|
}
|
|
8878
8860
|
if (error) {
|
|
8879
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
8861
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("fx-three-preview error", className) }, /* @__PURE__ */ React10.createElement("div", { className: "preview-error" }, /* @__PURE__ */ React10.createElement("h3", null, "\u274C \u6E32\u67D3\u5931\u8D25"), /* @__PURE__ */ React10.createElement("p", null, error)));
|
|
8880
8862
|
}
|
|
8881
|
-
return /* @__PURE__ */ React10.createElement("div", { className:
|
|
8863
|
+
return /* @__PURE__ */ React10.createElement("div", { className: clsx("fx-three-preview", className) }, /* @__PURE__ */ React10.createElement(
|
|
8882
8864
|
"div",
|
|
8883
8865
|
{
|
|
8884
8866
|
ref: containerRef,
|