@@ -20,6 +20,7 @@ import {
2020} from '@tabler/icons-react' ;
2121import { Link , Navigate , useParams } from 'react-router-dom' ;
2222
23+ import { useRecipeMultiplier } from '@/games/gamesSlice' ;
2324import { AllFactoryBuildingsMap } from '@/recipes/FactoryBuilding' ;
2425import { AllFactoryItemsMap } from '@/recipes/FactoryItem' ;
2526import { AllFactoryRecipesMap } from '@/recipes/FactoryRecipe' ;
@@ -28,13 +29,16 @@ import {
2829 UnlockedByMap ,
2930} from '@/recipes/FactorySchematic' ;
3031import { isDefaultRecipe , isMAMRecipe } from '@/recipes/graph/SchematicGraph' ;
32+ import { applyRecipeMultiplier } from '@/recipes/recipeMultiplier' ;
3133import { FactoryItemImage } from '@/recipes/ui/FactoryItemImage' ;
3234import { SectionCard , StatCard } from '../components/StatCard' ;
3335
3436export function CodexRecipeDetail ( ) {
3537 const { id } = useParams < { id : string } > ( ) ;
3638 const recipe = id ? AllFactoryRecipesMap [ id ] : undefined ;
3739
40+ const recipeMultiplier = useRecipeMultiplier ( ) ;
41+
3842 if ( ! recipe ) return < Navigate to = "/codex/recipes" replace /> ;
3943
4044 const building = AllFactoryBuildingsMap [ recipe . producedIn ] ;
@@ -119,7 +123,20 @@ export function CodexRecipeDetail() {
119123 ) }
120124 </ SimpleGrid >
121125
122- < SectionCard title = "Recipe Flow" >
126+ < SectionCard
127+ title = {
128+ recipeMultiplier !== 1 ? (
129+ < Group gap = "xs" >
130+ Recipe Flow
131+ < Badge variant = "light" color = "cyan" size = "sm" >
132+ { recipeMultiplier } x ingredients
133+ </ Badge >
134+ </ Group >
135+ ) : (
136+ 'Recipe Flow'
137+ )
138+ }
139+ >
123140 < Group
124141 gap = "md"
125142 align = "center"
@@ -130,7 +147,16 @@ export function CodexRecipeDetail() {
130147 < Stack gap = "xs" align = "center" miw = { 120 } >
131148 { recipe . ingredients . map ( ing => {
132149 const item = AllFactoryItemsMap [ ing . resource ] ;
133- const rate = ( ing . amount * 60 ) / recipe . time ;
150+ const effectiveAmount = applyRecipeMultiplier (
151+ ing . amount ,
152+ recipeMultiplier ,
153+ ) ;
154+ const effectiveDisplayAmount = applyRecipeMultiplier (
155+ ing . displayAmount ,
156+ recipeMultiplier ,
157+ ) ;
158+ const rate = ( effectiveAmount * 60 ) / recipe . time ;
159+ const isModified = effectiveDisplayAmount !== ing . displayAmount ;
134160 return (
135161 < Anchor
136162 key = { ing . resource }
@@ -150,8 +176,26 @@ export function CodexRecipeDetail() {
150176 { item ?. displayName ?? ing . resource }
151177 </ Text >
152178 < Text size = "xs" c = "dimmed" >
153- { ing . displayAmount } (
154- { rate % 1 === 0 ? rate : rate . toFixed ( 2 ) } /min)
179+ { isModified && (
180+ < Text
181+ span
182+ size = "xs"
183+ td = "line-through"
184+ c = "dimmed"
185+ mr = { 4 }
186+ >
187+ { ing . displayAmount }
188+ </ Text >
189+ ) }
190+ < Text
191+ span
192+ size = "xs"
193+ c = { isModified ? 'cyan' : undefined }
194+ fw = { isModified ? 600 : undefined }
195+ >
196+ { effectiveDisplayAmount }
197+ </ Text > { ' ' }
198+ ({ rate % 1 === 0 ? rate : rate . toFixed ( 2 ) } /min)
155199 </ Text >
156200 </ Stack >
157201 </ Group >
0 commit comments