Skip to content

Commit

Permalink
Default superimposition to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
frzyc committed Nov 27, 2024
1 parent 59de9c4 commit 024d8be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/sr/formula-ui/src/lightCone/util.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { own } from '@genshin-optimizer/sr/formula'
import { useSrCalcContext } from '@genshin-optimizer/sr/ui'
import type { ReactNode } from 'react'

export function SuperImposeWrapper({
children,
}: {
children: (superimpose: number) => ReactNode
}) {
// const calc = useSrCalcContext()

// TODO: FIXME: a character without a lightcone will cause an error
const superimpose = 1 // calc?.compute(own.lightCone.superimpose).val ?? 1
const calc = useSrCalcContext()
const superimpose = calc?.compute(own.lightCone.superimpose).val ?? 1
return children(superimpose)
}
3 changes: 3 additions & 0 deletions libs/sr/formula/src/data/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ const data: TagMapNodeEntries = [

// Default conditionals to 0
reader.with('qt', 'cond').add(0),

// Default superimposition to 1
reader.withTag(own.lightCone.superimpose.tag).add(1),
]
export default data

0 comments on commit 024d8be

Please sign in to comment.