diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/guide')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTab.kt | 34 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTablePage.kt | 3 |
2 files changed, 21 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTab.kt b/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTab.kt index 231402d33..fd199b48a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTab.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTab.kt @@ -42,24 +42,28 @@ class GuideTab( private var selectColor = NOT_SELECTED_COLOR - private val renderable = Renderable.clickAndHover(object : Renderable { - override val width = this@GuideTab.width - override val height = this@GuideTab.height - override val horizontalAlign: HorizontalAlignment = HorizontalAlignment.LEFT - override val verticalAlign: VerticalAlignment = VerticalAlignment.TOP + private val renderable = Renderable.clickAndHover( + object : Renderable { + override val width = this@GuideTab.width + override val height = this@GuideTab.height + override val horizontalAlign: HorizontalAlignment = HorizontalAlignment.LEFT + override val verticalAlign: VerticalAlignment = VerticalAlignment.TOP - val itemRender = Renderable.itemStack( - item, 1.0, horizontalAlign = HorizontalAlignment.CENTER, verticalAlign = VerticalAlignment.CENTER - ) + val itemRender = Renderable.itemStack( + item, 1.0, horizontalAlign = HorizontalAlignment.CENTER, verticalAlign = VerticalAlignment.CENTER + ) - override fun render(posX: Int, posY: Int) { - Gui.drawRect(0, 0, width, height, selectColor) - itemRender.renderXYAligned(posX, posY, width, height) + override fun render(posX: Int, posY: Int) { + Gui.drawRect(0, 0, width, height, selectColor) + itemRender.renderXYAligned(posX, posY, width, height) + } + }, + listOf(tip), + onClick = { + click() + SoundUtils.playClickSound() } - }, listOf(tip), onClick = { - click() - SoundUtils.playClickSound() - }) + ) fun render(posX: Int, posY: Int) { renderable.render(posX, posY) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTablePage.kt b/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTablePage.kt index 85dd5bdda..a0dc51c8b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTablePage.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/guide/GuideTablePage.kt @@ -27,7 +27,8 @@ abstract class GuideTablePage( yPadding = ySpace ), Renderable.horizontalContainer(footer, footerSpacing, horizontalAlign = HorizontalAlignment.CENTER) - ), spacing = ySpace + ), + spacing = ySpace ) } } |