CustomInteractable
基本信息
api.diagram.interactable.CustomInteractable —— 通用可交互图元。
类注释直言:This class is a flexible way to create arbitrary interactables, but requires a lot of setup.
已实现方法
| 方法 | 行 |
|---|---|
interact(DiagramState, RecipeType) |
73 |
draw(DiagramState) |
78 |
drawOverlay(DiagramState) |
85 |
drawTooltip(DiagramState, Point) |
92 |
static final class Builder |
115 |
直接子类
AllDiagramsButton extends CustomInteractable —— 「查看本组全部图」的按钮,
两个构造器都接收 DiagramGroupInfo,说明按钮文案/尺寸由组元数据推导。
使用者实例
- LensColour 的颜色切换槽位(
colourlenseslabel) - GT Diagram Util 的
buildMaterialInfoButton
关联
CustomInteractable 与 Diagram 组合成图;
InteractiveComponentGroup 则是另一个 Interactable 实现,
专用于「一组 DisplayComponent 共用一个槽位、点击轮换」的语义
(提供 currentIndex / currentComponent / cycleTooltip)。
相关条目
源码
src/main/java/com/github/dcysteine/neicustomdiagram/api/diagram/interactable/CustomInteractable.javasrc/main/java/com/github/dcysteine/neicustomdiagram/api/diagram/interactable/AllDiagramsButton.javasrc/main/java/com/github/dcysteine/neicustomdiagram/api/diagram/interactable/InteractiveComponentGroup.java