diff options
author | Linnea Gräf <nea@nea.moe> | 2024-07-29 00:23:17 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-07-29 00:23:17 +0200 |
commit | fcee10e493e7f09639c2933e278ae81bdeee60b3 (patch) | |
tree | 193e72ae9c2b04aca4532605847a53eeeb143889 /src/main/kotlin/moe | |
parent | 60994a08677d864f79de58d8912b02d2d7077289 (diff) | |
download | Firmament-fcee10e493e7f09639c2933e278ae81bdeee60b3.tar.gz Firmament-fcee10e493e7f09639c2933e278ae81bdeee60b3.tar.bz2 Firmament-fcee10e493e7f09639c2933e278ae81bdeee60b3.zip |
Fix inventory buttons overlapping in storage overlay (also fixes skyblocker)
Diffstat (limited to 'src/main/kotlin/moe')
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayCustom.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayCustom.kt index a349c0f..3619f18 100644 --- a/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayCustom.kt +++ b/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayCustom.kt @@ -42,6 +42,12 @@ class StorageOverlayCustom( override fun onInit() { overview.init(MinecraftClient.getInstance(), screen.width, screen.height) + overview.init() + screen as AccessorHandledScreen + screen.x_Firmament = overview.measurements.x + screen.y_Firmament = overview.measurements.y + screen.backgroundWidth_Firmament = overview.measurements.totalWidth + screen.backgroundHeight_Firmament = overview.measurements.totalHeight } override fun isPointOverSlot(slot: Slot, xOffset: Int, yOffset: Int, pointX: Double, pointY: Double): Boolean { diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayScreen.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayScreen.kt index c371eb4..62d9952 100644 --- a/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayScreen.kt +++ b/src/main/kotlin/moe/nea/firmament/features/inventory/storageoverlay/StorageOverlayScreen.kt @@ -48,12 +48,14 @@ class StorageOverlayScreen : Screen(Text.literal("")) { val y = height / 2 - (overviewHeight + PLAYER_HEIGHT) / 2 val playerX = width / 2 - PLAYER_WIDTH / 2 val playerY = y + overviewHeight - PLAYER_Y_INSET + val totalWidth = overviewWidth + val totalHeight = overviewWidth - PLAYER_Y_INSET + PLAYER_HEIGHT } var measurements = Measurements() var lastRenderedInnerHeight = 0 - override fun init() { + public override fun init() { super.init() pageWidthCount = StorageOverlay.TConfig.columns .coerceAtMost((width - PADDING) / (PAGE_WIDTH + PADDING)) |