diff options
author | Linnea Gräf <nea@nea.moe> | 2023-08-19 13:25:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-19 13:25:11 +0200 |
commit | 672c0521f0f5cdd84d7e24ac8d1a7343092e63c3 (patch) | |
tree | 963811bfb3d3bb92525a0753d1cfbff8b6e2eb29 /src/main/java | |
parent | a9cfc1db8d5a9436a0c3def82492fcf0d66240c4 (diff) | |
download | skyhanni-672c0521f0f5cdd84d7e24ac8d1a7343092e63c3.tar.gz skyhanni-672c0521f0f5cdd84d7e24ac8d1a7343092e63c3.tar.bz2 skyhanni-672c0521f0f5cdd84d7e24ac8d1a7343092e63c3.zip |
Merge pull request #387
* Add more z-indexing
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 10 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt | 8 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 672b26743..0150e7311 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -35,11 +35,10 @@ object RenderUtils { } infix fun Slot.highlight(color: Color) { - val lightingState = GL11.glIsEnabled(GL11.GL_LIGHTING) - - GlStateManager.disableLighting() GlStateManager.color(1f, 1f, 1f, 1f) - + GlStateManager.pushAttrib() + GL11.glDisable(GL11.GL_LIGHTING) + GL11.glEnable(GL11.GL_DEPTH_TEST) GlStateManager.pushMatrix() // TODO don't use z GlStateManager.translate(0f, 0f, 110 + Minecraft.getMinecraft().renderItem.zLevel) @@ -51,8 +50,7 @@ object RenderUtils { color.rgb ) GlStateManager.popMatrix() - - if (lightingState) GlStateManager.enableLighting() + GlStateManager.popAttrib() } fun RenderWorldLastEvent.drawColor( 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 7407d5c6b..81ddaabde 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -8,6 +8,7 @@ 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 @@ -113,7 +114,10 @@ interface Renderable { if (isHovered(posX, posY)) { if (condition() && shouldAllowLink(true, bypassChecks)) { list[Pair(posX, posY)] = indexes + GlStateManager.pushMatrix() + GlStateManager.translate(0F, 0F, 400F) RenderLineTooltips.drawHoveringText(posX, posY, tips, stack) + GlStateManager.popMatrix() } } else { if (list.contains(Pair(posX, posY))) { @@ -190,7 +194,11 @@ interface Renderable { override val height = 10 override fun render(posX: Int, posY: Int) { + GlStateManager.pushMatrix() + if (Minecraft.getMinecraft().currentScreen == null || Minecraft.getMinecraft().currentScreen is GuiChat) + GlStateManager.translate(0F, 0F, -145F) any.renderOnScreen(0F, 0F, scaleMultiplier = scale) + GlStateManager.popMatrix() } } |