From fd3f22da29fbb4516b9be9d4e0ff139bc1b272e6 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 23 Aug 2021 20:06:03 +0700 Subject: [PATCH] Increase Z value of GUIs --- .../dbotthepony/mc/otm/screen/MatteryScreen.java | 2 +- .../mc/otm/screen/panels/EditablePanel.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/dbotthepony/mc/otm/screen/MatteryScreen.java b/src/main/java/ru/dbotthepony/mc/otm/screen/MatteryScreen.java index 97c1d0038..a32e8960f 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/screen/MatteryScreen.java +++ b/src/main/java/ru/dbotthepony/mc/otm/screen/MatteryScreen.java @@ -455,7 +455,7 @@ public abstract class MatteryScreen extends AbstractConta } } - float depth = -900f; + float depth = -400f; for (var panel : panels) { panel.set3DDepth(depth); diff --git a/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java b/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java index 036c37e9c..3deda98c9 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java +++ b/src/main/java/ru/dbotthepony/mc/otm/screen/panels/EditablePanel.java @@ -10,6 +10,9 @@ import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; +import static org.lwjgl.opengl.GL11.GL_ALWAYS; +import static org.lwjgl.opengl.GL11.GL_LESS; + /** * Superclass of all panels * This panel represent part of GMod's Panels API @@ -152,8 +155,21 @@ public class EditablePanel implements GuiEventListener { } stack.pushPose(); + + /*if (parent == null) { + RenderSystem.depthFunc(GL_ALWAYS); + RenderSystem.depthMask(true); + stack.translate(parent_x, parent_y, 0); + } else {*/ stack.translate(parent_x, parent_y, accumulated_depth); + //} + innerRender(stack, mouse_x, mouse_y, flag); + + /*if (parent == null) { + RenderSystem.depthFunc(GL_LESS); + }*/ + stack.popPose(); var most_depth = accumulated_depth;