fix: storage overlay "edit pages" being misaligned

closes https://github.com/nea89o/Firmament/issues/120
This commit is contained in:
Linnea Gräf
2025-07-01 14:50:29 +02:00
parent 3518f881c2
commit 269e988f99

View File

@@ -154,13 +154,16 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
fun editPages() { fun editPages() {
isExiting = true isExiting = true
MC.instance.send {
val hs = MC.screen as? HandledScreen<*> val hs = MC.screen as? HandledScreen<*>
if (StorageBackingHandle.fromScreen(hs) is StorageBackingHandle.Overview) { if (StorageBackingHandle.fromScreen(hs) is StorageBackingHandle.Overview) {
hs.customGui = null hs.customGui = null
hs.init(MC.instance, width, height)
} else { } else {
MC.sendCommand("storage") MC.sendCommand("storage")
} }
} }
}
val guiContext = GuiContext(EmptyComponent()) val guiContext = GuiContext(EmptyComponent())
private val knobStub = EmptyComponent() private val knobStub = EmptyComponent()