update: play property animation

update: event format field
fix: test
This commit is contained in:
Vick Scarlet
2026-08-16 20:06:16 +08:00
committed by 神戸小鳥
parent cd82d175c2
commit 6eea7d0d87
15 changed files with 110 additions and 155 deletions
+9 -11
View File
@@ -1,4 +1,4 @@
import { useEffect, useState, useRef } from 'react'
import { useEffect, useState, useRef, useMemo } from 'react'
import { usePicked, useEnd, useProfile } from '@remake/hooks'
import { useEndJudge } from '@/hooks/judge'
import { properties, judgeDisplay } from '@/display'
@@ -27,26 +27,24 @@ interface TalentListProps {
}
function TalentList({ picked, picker }: TalentListProps) {
const [profile] = useProfile()
const [talents, setTalents] = useState(usePicked())
const items = usePicked()
const talents = useMemo(() => {
if (!isDev || !profile.locked) return items
return new Set([...items, ...profile.locked])
}, [])
const hasInitialized = useRef(false)
useEffect(() => {
if (!profile.locked) return
let currentTalents = talents
if (isDev) {
currentTalents = new Set([...talents, ...profile.locked])
setTalents(currentTalents)
}
if (!hasInitialized.current) {
for (const id of profile.locked) {
if (currentTalents.has(id) && !picked.has(id)) {
if (talents.has(id) && !picked.has(id)) {
picker(id)
}
}
hasInitialized.current = true
}
}, [profile, talents, picked, picker])
}, [picked, picker])
return (
<ul className="talent-list">
{Array.from(talents, id => (