This commit is contained in:
2026-05-08 11:44:42 +08:00
parent b08127031c
commit abf1f1ebea
249 changed files with 39411 additions and 887 deletions

View File

@@ -102,7 +102,7 @@ export function SkillEffectPreview({
const [playerActionMode, setPlayerActionMode] = useState<CombatActionMode>('idle');
const [sceneHostileNpcs, setSceneMonsters] = useState<SceneHostileNpc[]>(initialMonsters);
const [activeCombatEffects, setActiveCombatEffects] = useState<CombatVisualEffect[]>([]);
const [replayTick, setReplayTick] = useState(0);
const [restartTick, setRestartTick] = useState(0);
const [isPlaying, setIsPlaying] = useState(false);
useEffect(() => {
@@ -216,7 +216,7 @@ export function SkillEffectPreview({
active = false;
timers.forEach(timerId => window.clearTimeout(timerId));
};
}, [character, initialMonsters, mode, replayTick, scenePreset, skill]);
}, [character, initialMonsters, mode, restartTick, scenePreset, skill]);
return (
<div className="rounded-2xl border border-white/10 bg-black/20 p-4">
@@ -229,12 +229,12 @@ export function SkillEffectPreview({
</div>
<button
type="button"
onClick={() => setReplayTick(value => value + 1)}
onClick={() => setRestartTick(value => value + 1)}
disabled={!skill || isPlaying}
className="inline-flex items-center gap-2 rounded-lg border border-white/10 bg-black/30 px-3 py-2 text-xs text-zinc-200 transition hover:border-white/20 hover:text-white disabled:cursor-not-allowed disabled:opacity-50"
>
<RotateCcw className="h-3.5 w-3.5" />
<span>{isPlaying ? '播放中' : '重预览'}</span>
<span>{isPlaying ? '播放中' : '重预览'}</span>
</button>
</div>