Documentation
FdCookingPotScreen
FD cooking pot (176×166): six ingredient slots plus meal display, container and output slots, heat flame, cooking arrow and recipe book button; slot frames and pot body come baked into the original texture.
厨锅物品栏
点击物品槽切换受热状态;点击配方书按钮切换按钮态。
import { useState } from "react";
import { FD_DEMO_ITEMS } from "../fd-demo-data";
import { FdCookingPotScreen } from "./index";
interface FdCookingPotScreenDemoProps {
progress?: number;
}
export function FdCookingPotScreenDemo({ progress = 0.6 }: FdCookingPotScreenDemoProps = {}) {
const [heated, setHeated] = useState(true);
const [recipeBookOpen, setRecipeBookOpen] = useState(false);
return (
<div className="flex flex-col gap-3">
<FdCookingPotScreen
container={FD_DEMO_ITEMS.bowl}
heated={heated}
ingredients={[
FD_DEMO_ITEMS.brownMushroom,
FD_DEMO_ITEMS.redMushroom,
null,
null,
null,
null,
]}
meal={undefined}
onRecipeBookToggle={() => { setRecipeBookOpen(value => !value); }}
onSlotClick={() => { setHeated(value => !value); }}
output={FD_DEMO_ITEMS.mushroomStew}
progress={progress}
recipeBookOpen={recipeBookOpen}
/>
<p className="text-xs opacity-60">
点击物品槽切换受热状态;点击配方书按钮切换按钮态。
</p>
</div>
);
}
Install
$pnpm add @tennantite/farmersdelightnpm installs the compiled package; use the CLI copy above to adapt the source.
Source
packages/farmersdelight/src/fd-cooking-pot-screen/index.tsxThe npm package keeps the source tree, so you can copy and adapt it directly.