Release Healer Man 0.1.29
This commit is contained in:
1 parent
8c9809d3e0
commit
544c1bee91
120 files changed
+4363
-1036
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { memo, useEffect, useMemo, useRef, useState, type MutableRefObject } from "react";
|
||||
import { memo, useEffect, useMemo, useRef, useState, type MutableRefObject, type ReactNode } from "react";
|
||||
import { useFrame, useThree } from "@react-three/fiber";
|
||||
import {
|
||||
AdditiveBlending,
|
||||
@@ -35,6 +35,7 @@ import {
|
||||
originalCombatAnchorActorId,
|
||||
originalAuraMatchesPresentationEvent,
|
||||
originalEmitterParticleBudget,
|
||||
selectCombatEffectRender,
|
||||
parseOriginalCombatEffectGraph,
|
||||
type OriginalCombatEffectAnimatedTrackName,
|
||||
type OriginalCombatEffectGraph,
|
||||
@@ -730,15 +731,12 @@ export const OriginalCombatEffect = memo(function OriginalCombatEffect({
|
||||
quality,
|
||||
active,
|
||||
onDone,
|
||||
}: OriginalCombatEffectProps) {
|
||||
fallback,
|
||||
}: OriginalCombatEffectProps & { readonly fallback: ReactNode }) {
|
||||
const [loaded, setLoaded] = useState<readonly LoadedOriginalGraph[] | null>(null);
|
||||
const onDoneRef = useRef(onDone);
|
||||
const terminalRef = useRef(false);
|
||||
onDoneRef.current = onDone;
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
terminalRef.current = false;
|
||||
setLoaded(null);
|
||||
void preloadCombatEffectManifest().then(async () => {
|
||||
const assets = combatOriginalPhaseAssets(event);
|
||||
@@ -756,21 +754,19 @@ export const OriginalCombatEffect = memo(function OriginalCombatEffect({
|
||||
failures,
|
||||
);
|
||||
}
|
||||
if (ready.length) {
|
||||
setLoaded(ready);
|
||||
return;
|
||||
}
|
||||
if (!terminalRef.current) {
|
||||
terminalRef.current = true;
|
||||
onDoneRef.current();
|
||||
}
|
||||
// Keep any usable original layers; only substitute when none can render.
|
||||
setLoaded(ready);
|
||||
}).catch(() => {
|
||||
if (!cancelled) setLoaded([]);
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [event]);
|
||||
|
||||
return loaded ? (
|
||||
if (loaded === null) return null;
|
||||
const selection = selectCombatEffectRender("original", loaded.map((item) => item.asset));
|
||||
return selection.kind === "original" ? (
|
||||
<LoadedOriginalCombatEffect
|
||||
event={event}
|
||||
quality={quality}
|
||||
@@ -778,7 +774,7 @@ export const OriginalCombatEffect = memo(function OriginalCombatEffect({
|
||||
loaded={loaded}
|
||||
onDone={onDone}
|
||||
/>
|
||||
) : null;
|
||||
) : fallback;
|
||||
}, (previous, next) => (
|
||||
previous.event === next.event
|
||||
&& previous.quality === next.quality
|
||||
|
||||
Reference in new issue
Block a user