diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-11-24 00:07:07 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-11-24 00:07:07 +0100 |
| commit | 20458e27c44ac498950cfaf408c35e7170d2a875 (patch) | |
| tree | 8f73378dec15f7df21b69d466ce684c4b7a23a12 /src/main/kotlin/features/items/recipes/ComponentWidget.kt | |
| parent | 709c32ed2788c15f9f03a1bcbe6648e533e662c6 (diff) | |
| download | Firmament-20458e27c44ac498950cfaf408c35e7170d2a875.tar.gz Firmament-20458e27c44ac498950cfaf408c35e7170d2a875.tar.bz2 Firmament-20458e27c44ac498950cfaf408c35e7170d2a875.zip | |
feat: scrollable recipe viewer
Diffstat (limited to 'src/main/kotlin/features/items/recipes/ComponentWidget.kt')
| -rw-r--r-- | src/main/kotlin/features/items/recipes/ComponentWidget.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/kotlin/features/items/recipes/ComponentWidget.kt b/src/main/kotlin/features/items/recipes/ComponentWidget.kt index b5c4211..08a2aa2 100644 --- a/src/main/kotlin/features/items/recipes/ComponentWidget.kt +++ b/src/main/kotlin/features/items/recipes/ComponentWidget.kt @@ -8,13 +8,13 @@ import net.minecraft.network.chat.Component import moe.nea.firmament.repo.recipes.RecipeLayouter import moe.nea.firmament.util.MC -class ComponentWidget(val point: Point, var text: Component) : RecipeWidget(), RecipeLayouter.Updater<Component> { +class ComponentWidget(override var position: Point, var text: Component) : RecipeWidget(), RecipeLayouter.Updater<Component> { override fun update(newValue: Component) { this.text = newValue } - override val rect: Rectangle - get() = Rectangle(point, Dimension(MC.font.width(text), MC.font.lineHeight)) + override val size: Dimension + get() = Dimension(MC.font.width(text), MC.font.lineHeight) override fun render( guiGraphics: GuiGraphics, @@ -22,6 +22,6 @@ class ComponentWidget(val point: Point, var text: Component) : RecipeWidget(), R mouseY: Int, partialTick: Float ) { - guiGraphics.drawString(MC.font, text, point.x, point.y, -1) + guiGraphics.drawString(MC.font, text, position.x, position.y, -1) } } |
