diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-01-28 18:33:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-28 18:33:57 +0100 |
commit | ec0fba2756e4d2e7e0f46bfd5cd4bff6208541f8 (patch) | |
tree | 00838595106b428a7665220528116afbbd17cbab /src/main/java/at/hannibal2/skyhanni | |
parent | 0ba2b871d08b456775c372b45216c3cffa008ce8 (diff) | |
download | skyhanni-ec0fba2756e4d2e7e0f46bfd5cd4bff6208541f8.tar.gz skyhanni-ec0fba2756e4d2e7e0f46bfd5cd4bff6208541f8.tar.bz2 skyhanni-ec0fba2756e4d2e7e0f46bfd5cd4bff6208541f8.zip |
fixed chat rendering and title rendering z layers (#953)
Fixed render overlapping problem with chat, skyhanni guis and title. #953
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
3 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt index 305088949..917ea9f5d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt @@ -24,7 +24,9 @@ class RenderData { if (!SkyHanniDebugsAndTests.globalRender) return if (GuiEditManager.isInGui() || VisualWordGui.isInGui()) return + GlStateManager.translate(0f,0f,-3f) GuiRenderEvent.GuiOverlayRenderEvent().postAndCatch() + GlStateManager.translate(0f,0f,3f) } @SubscribeEvent @@ -38,7 +40,9 @@ class RenderData { GlStateManager.enableDepth() if (GuiEditManager.isInGui()) { + GlStateManager.translate(0f,0f,-3f) GuiRenderEvent.GuiOverlayRenderEvent().postAndCatch() + GlStateManager.translate(0f,0f,3f) } GuiRenderEvent.ChestGuiOverlayRenderEvent().postAndCatch() diff --git a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt index 275a6f9f7..6dd0c6725 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt @@ -8,7 +8,6 @@ import io.github.moulberry.moulconfig.internal.TextRenderUtils import net.minecraft.client.Minecraft import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager -import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds @@ -57,7 +56,7 @@ class TitleManager { endTime = SimpleTimeMark.farPast() } - @SubscribeEvent(priority = EventPriority.LOWEST) + @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (endTime.isInPast()) return @@ -70,7 +69,7 @@ class TitleManager { val renderer = Minecraft.getMinecraft().fontRendererObj GlStateManager.pushMatrix() - GlStateManager.translate((width / 2).toFloat(), (height / heightModifier).toFloat(), 0.0f) + GlStateManager.translate((width / 2).toFloat(), (height / heightModifier).toFloat(), 3.0f) GlStateManager.scale(fontSizeModifier, fontSizeModifier, fontSizeModifier) TextRenderUtils.drawStringCenteredScaledMaxWidth(display, renderer, 0f, 0f, true, 75, 0) GlStateManager.popMatrix() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt index 01f9941aa..142fd8165 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -8,7 +8,6 @@ import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper import io.github.moulberry.notenoughupdates.util.Utils import net.minecraft.client.Minecraft import net.minecraft.client.gui.Gui -import net.minecraft.client.gui.GuiChat import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.client.renderer.GlStateManager import net.minecraft.item.ItemStack @@ -233,8 +232,6 @@ interface Renderable { override fun render(posX: Int, posY: Int) { GlStateManager.pushMatrix() - if (Minecraft.getMinecraft().currentScreen is GuiChat) - GlStateManager.translate(0F, 0F, -3F) any.renderOnScreen(0F, 0F, scaleMultiplier = scale) GlStateManager.popMatrix() } |