文档目录
Thermal 机器基座
Thermal 机器基座:`THERMAL_MACHINES` 数据表渲染容器背景、槽位、能量表、进度与右侧强化面板,机器标签居中。
粉碎机玩家
import { THERMAL_DEMO_PLAYER_HOTBAR, THERMAL_DEMO_PLAYER_MAIN } from "../thermal-demo-data";
import { ThermalMachineScreen } from "./index";
interface ThermalMachineScreenDemoProps {
energy?: { amount: number; capacity: number };
progress?: number;
speed?: number;
}
/**
* ThermalMachineScreen 预览用例:以 pulverizer 布局表驱动,铁矿石 → 2 铁粉,
* 进度箭头 / 火焰 / 能量表与玩家背包。
*/
export function ThermalMachineScreenDemo({
energy = { amount: 240000, capacity: 400000 },
progress = 0.5,
speed = 0.75,
}: ThermalMachineScreenDemoProps = {}) {
return (
<ThermalMachineScreen
energy={energy}
input={{ count: 1, icon: "iron-ore", tooltip: "铁矿石" }}
inputs={[null]}
machine="pulverizer"
output={{ count: 2, icon: "iron-ingot", tooltip: "铁粉 ×2" }}
outputs={[null, null, null]}
playerHotbar={THERMAL_DEMO_PLAYER_HOTBAR}
playerItems={THERMAL_DEMO_PLAYER_MAIN}
progress={progress}
speed={speed}
/>
);
}
安装
$pnpm add @tennantite/thermalnpm 方式安装编译产物;需要改造源码请用上方的 CLI 拷贝安装。
源码
packages/thermal/src/thermal-machine-screen/index.tsxnpm 包保留源码目录,可直接复制改造。