mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-12 09:49:28 +02:00
fix(v1.0.3): fix startup window display, single instance lock, relative assets and obj packaging
This commit is contained in:
1 parent
47fb80602f
commit
af479df65a
7 files changed
+58
-4
No files matched your search
@@ -13,7 +13,7 @@ interface AvatarModelLoaderProps {
|
||||
|
||||
type AvatarManifest = Partial<Record<Exclude<EveAvatar, 'eve'>, string | null>>;
|
||||
|
||||
const AVATAR_MANIFEST_PATH = '/avatars/avatar-manifest.json';
|
||||
const AVATAR_MANIFEST_PATH = './avatars/avatar-manifest.json';
|
||||
|
||||
const LoadedGlbAvatar: React.FC<{
|
||||
path: string;
|
||||
@@ -81,8 +81,16 @@ export const AvatarModelLoader: React.FC<AvatarModelLoaderProps> = ({ avatarId,
|
||||
})
|
||||
.then((manifest) => {
|
||||
if (cancelled || !manifest) return;
|
||||
const nextAssetPath = manifest[avatarId];
|
||||
setAssetPath(typeof nextAssetPath === 'string' && nextAssetPath.trim() ? nextAssetPath : null);
|
||||
let nextAssetPath = manifest[avatarId];
|
||||
if (typeof nextAssetPath === 'string' && nextAssetPath.trim()) {
|
||||
// Si le chemin commence par un slash, on le rend relatif pour fonctionner sous le protocole file:// en production
|
||||
if (nextAssetPath.startsWith('/')) {
|
||||
nextAssetPath = '.' + nextAssetPath;
|
||||
}
|
||||
setAssetPath(nextAssetPath);
|
||||
} else {
|
||||
setAssetPath(null);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) setAssetPath(null);
|
||||
|
||||
@@ -269,7 +269,7 @@ export const EveModel: React.FC<EveModelProps> = ({ emotion, isSpeaking, avatarI
|
||||
|
||||
// Charger les matériaux et le modèle OBJ depuis le répertoire public
|
||||
const materials = useLoader(MTLLoader, './Eve/EVE.mtl');
|
||||
const obj = useLoader(OBJLoader, './Eve/EVE.obj', (loader) => {
|
||||
const obj = useLoader(OBJLoader, './Eve/EVE.obj.bin', (loader) => {
|
||||
materials.preload();
|
||||
loader.setMaterials(materials);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user