From 53a7406204cda863f739509c55ad0c8a4e89653b Mon Sep 17 00:00:00 2001 From: ttttdoy Date: Fri, 30 Aug 2024 21:19:03 -0400 Subject: [PATCH] the gui centering of 2024 --- .../creator/ToolGunCreatorSerializedScreen.kt | 32 ++++++---- .../creator/ToolGunCreatorSpawnMenuFactory.kt | 64 +++++++++++-------- 2 files changed, 55 insertions(+), 41 deletions(-) diff --git a/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSerializedScreen.kt b/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSerializedScreen.kt index 967a907b..42ad31fc 100644 --- a/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSerializedScreen.kt +++ b/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSerializedScreen.kt @@ -6,10 +6,9 @@ import breadmod.menu.item.ToolGunCreatorMenu import breadmod.util.gui.IHoldScreen import breadmod.util.gui.SerializedScreen import breadmod.util.gui.widget.ContainerWidget -import breadmod.util.render.PostProcessingRegistry import breadmod.util.render.rgMinecraft -import breadmod.util.render.shaderPreCompilation import net.minecraft.client.KeyMapping +import net.minecraft.client.gui.GuiGraphics import net.minecraft.client.renderer.PostChain import net.minecraft.network.chat.Component import net.minecraft.world.entity.player.Inventory @@ -39,19 +38,26 @@ internal class ToolGunCreatorSerializedScreen( const val POST_PROCESSING_ENTRY_BLUR_NAME = "ToolGun Creator Mode GUI Blur" } + override fun render(pGuiGraphics: GuiGraphics, pMouseX: Int, pMouseY: Int, pPartialTick: Float) { + super.render(pGuiGraphics, pMouseX, pMouseY, pPartialTick) + } + override fun init() { super.init() - if (blurChain == null) { - shaderPreCompilation[blurChainLoc.toString()] = { _, _, _, _, _ -> - TODO("Figure it out. https://ktstephano.github.io/rendering/opengl/ssbos") - } + rootWidget.x = (width - rootWidget.width) / 2 + rootWidget.y = (height - rootWidget.height) / 2 - blurChain = PostChain( - rgMinecraft.textureManager, rgMinecraft.resourceManager, - rgMinecraft.mainRenderTarget, blurChainLoc - ) - } - PostProcessingRegistry.addProcessor(POST_PROCESSING_ENTRY_BLUR_NAME, blurChain!!) +// if (blurChain == null) { +// shaderPreCompilation[blurChainLoc.toString()] = { _, _, _, _, _ -> +// TODO("Figure it out. https://ktstephano.github.io/rendering/opengl/ssbos") +// } +// +// blurChain = PostChain( +// rgMinecraft.textureManager, rgMinecraft.resourceManager, +// rgMinecraft.mainRenderTarget, blurChainLoc +// ) +// } +// PostProcessingRegistry.addProcessor(POST_PROCESSING_ENTRY_BLUR_NAME, blurChain!!) } /** @@ -61,6 +67,6 @@ internal class ToolGunCreatorSerializedScreen( */ override fun onClose() { super.onClose() - PostProcessingRegistry.removeProcessor(POST_PROCESSING_ENTRY_BLUR_NAME) +// PostProcessingRegistry.removeProcessor(POST_PROCESSING_ENTRY_BLUR_NAME) } } \ No newline at end of file diff --git a/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSpawnMenuFactory.kt b/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSpawnMenuFactory.kt index 138e0f05..1ad267fc 100644 --- a/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSpawnMenuFactory.kt +++ b/src/main/kotlin/breadmod/client/screen/tool_gun/creator/ToolGunCreatorSpawnMenuFactory.kt @@ -36,42 +36,50 @@ internal object ToolGunCreatorSpawnMenuFactory : SerializedScreenFactory