aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-03-10 23:06:05 +0900
committersyeyoung <cyong06@naver.com>2021-03-10 23:06:05 +0900
commit92ce9024b73df31f3c88ad23a7443dec2578469c (patch)
treedd7f6c928c79e2847a34ccb47820a037d244e361 /src/main/java/kr/syeyoung/dungeonsguide/roomedit
parenta7030786cc5f3b756f8b538f8f071cd7d5c14e77 (diff)
downloadSkyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.tar.gz
Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.tar.bz2
Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.zip
finally fix gui flashing issue.
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java15
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java14
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java14
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java16
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java5
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java11
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java9
7 files changed, 52 insertions, 32 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java
index d8cf391e..da08a330 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonAddSet.java
@@ -127,19 +127,24 @@ public class GuiDungeonAddSet extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+
+
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
+ GlStateManager.disableLighting();
+ GlStateManager.disableFog();
+ GL11.glDisable(GL11.GL_FOG);
+ GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
- GlStateManager.disableLighting();
- GlStateManager.disableFog();GL11.glDisable(GL11.GL_FOG);
- GlStateManager.color(1,1,1,1);
- GlStateManager.pushAttrib();
mainPanel.render0(scaledResolution, new Point(0,0), new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
+ GlStateManager.enableDepth();
+ GlStateManager.depthMask(true);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
- GlStateManager.popAttrib();
+ GlStateManager.enableBlend();
+ GlStateManager.enableLighting();
}
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java
index e39b136a..9857b509 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java
@@ -163,19 +163,23 @@ public class GuiDungeonParameterEdit extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
+ GlStateManager.disableLighting();
+ GlStateManager.disableFog();
+ GL11.glDisable(GL11.GL_FOG);
+ GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
- GlStateManager.disableLighting();
- GlStateManager.disableFog();GL11.glDisable(GL11.GL_FOG);
- GlStateManager.color(1,1,1,1);
- GlStateManager.pushAttrib();
mainPanel.render0(scaledResolution, new Point(0,0), new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
- GlStateManager.popAttrib();
+ GlStateManager.enableDepth();
+ GlStateManager.depthMask(true);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
+ GlStateManager.enableBlend();
+ GlStateManager.enableLighting();
}
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java
index 34d7f740..f7638fc7 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonRoomEdit.java
@@ -59,19 +59,23 @@ public class GuiDungeonRoomEdit extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
+ GlStateManager.disableLighting();
+ GlStateManager.disableFog();
+ GL11.glDisable(GL11.GL_FOG);
+ GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
- GlStateManager.disableLighting();
- GlStateManager.disableFog();GL11.glDisable(GL11.GL_FOG);
- GlStateManager.color(1,1,1,1);
- GlStateManager.pushAttrib();
mainPanel.render0(scaledResolution, new Point(0,0), new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
- GlStateManager.popAttrib();
+ GlStateManager.enableDepth();
+ GlStateManager.depthMask(true);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
+ GlStateManager.enableBlend();
+ GlStateManager.enableLighting();
}
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java
index 74bffd78..8601275c 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java
@@ -120,19 +120,23 @@ public class GuiDungeonValueEdit extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
try {
+
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
+ GlStateManager.disableLighting();
+ GlStateManager.disableFog();
+ GL11.glDisable(GL11.GL_FOG);
+ GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
- GlStateManager.disableLighting();
- GlStateManager.disableFog();GL11.glDisable(GL11.GL_FOG);
- GlStateManager.color(1,1,1,1);
- GlStateManager.pushAttrib();
- mainPanel.render0(scaledResolution, new Point(0, 0), new Rectangle(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
- GlStateManager.popAttrib();
+ mainPanel.render0(scaledResolution, new Point(0,0), new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
+ GlStateManager.enableDepth();
+ GlStateManager.depthMask(true);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
+ GlStateManager.enableBlend();
+ GlStateManager.enableLighting();
} catch (Throwable e) {
e.printStackTrace();
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java
index 3a111436..a0c17ef8 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/ActionTreeDisplayPane.java
@@ -5,6 +5,7 @@ import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionTree;
import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionTreeUtil;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.gui.MPanel;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
@@ -155,8 +156,8 @@ public class ActionTreeDisplayPane extends MPanel {
int offset = 2;
int height = (fr.FONT_HEIGHT + offset) * lines.length;
- Gui.drawRect(x,y,x + maxWidth +10, y + height + 10, 0xff000000);
- Gui.drawRect(x+1,y+1,x + maxWidth +8, y + height + 8, 0xff4d4d4d);
+ RenderUtils.drawRectSafe(x,y,x + maxWidth +10, y + height + 10, 0xff000000);
+ RenderUtils.drawRectSafe(x+1,y+1,x + maxWidth +8, y + height + 8, 0xff4d4d4d);
for (int i = 0; i < lines.length; i++) {
fr.drawString(lines[i], x + 5, y + 5 + i*(fr.FONT_HEIGHT + offset), 0xffffffff);
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java
index 86739f46..fcd8e69b 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomDataDisplayPane.java
@@ -2,6 +2,7 @@ package kr.syeyoung.dungeonsguide.roomedit.panes;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.gui.MPanel;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -33,14 +34,14 @@ public class RoomDataDisplayPane extends MPanel {
int[][] blocks = dungeonRoom.getDungeonRoomInfo().getBlocks();
// draw Axis;
- Gui.drawRect(0,0,10,10,0x77777777);
+ RenderUtils.drawRectSafe(0,0,10,10,0x77777777);
clip(sr, clip.x + 10, clip.y, clip.width - 10, 10);
- Gui.drawRect(0,0,getBounds().width, getBounds().height, 0x77777777);
+ RenderUtils.drawRectSafe(0,0,getBounds().width, getBounds().height, 0x77777777);
for (int x = 0; x < blocks[0].length; x++) {
fr.drawString(x+"", x * 16 +10 + offsetX, 0, 0xFFFFFFFF);
}
clip(sr, clip.x, clip.y +10, 10, clip.height-10);
- Gui.drawRect(0,0,getBounds().width, getBounds().height, 0x77777777);
+ RenderUtils.drawRectSafe(0,0,getBounds().width, getBounds().height, 0x77777777);
for (int z = 0; z < blocks.length; z++) {
fr.drawString(z+"", 2, z * 16 + 10 + offsetY, 0xFFFFFFFF);
}
@@ -53,9 +54,9 @@ public class RoomDataDisplayPane extends MPanel {
for (int x = 0; x < blocks[z].length; x++) {
int data = blocks[z][x];
if (z == selectedY && x == selectedX){
- Gui.drawRect(x *16 +10+offsetX, z *16 +10 + offsetY, x *16 +26 +offsetX, z *16 +26 + offsetY, 0xAA707070);
+ RenderUtils.drawRectSafe(x *16 +10+offsetX, z *16 +10 + offsetY, x *16 +26 +offsetX, z *16 +26 + offsetY, 0xAA707070);
} else if (z == hoverY && x == hoverX) {
- Gui.drawRect(x *16 +10+offsetX, z *16 +10 + offsetY, x *16 +26 +offsetX, z *16 +26 + offsetY, 0xAA505050);
+ RenderUtils.drawRectSafe(x *16 +10+offsetX, z *16 +10 + offsetY, x *16 +26 +offsetX, z *16 +26 + offsetY, 0xAA505050);
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java
index 4250045c..6c6cc6a5 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/panes/RoomMatchDisplayPane.java
@@ -5,6 +5,7 @@ import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry;
import kr.syeyoung.dungeonsguide.gui.MPanel;
import kr.syeyoung.dungeonsguide.utils.ArrayUtils;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -44,14 +45,14 @@ public class RoomMatchDisplayPane extends MPanel {
int width = Math.max(currentBlocks[0].length, targetBlocks[0].length);
// draw Axis;
- Gui.drawRect(0,0,10,10,0x77777777);
+ RenderUtils.drawRectSafe(0,0,10,10,0x77777777);
clip(sr, clip.x + 10, clip.y, clip.width - 10, 10);
- Gui.drawRect(0,0,getBounds().width, getBounds().height, 0x77777777);
+ RenderUtils.drawRectSafe(0,0,getBounds().width, getBounds().height, 0x77777777);
for (int x = 0; x < width; x++) {
fr.drawString(x+"", x * 16 +10 + offsetX, 0, 0xFFFFFFFF);
}
clip(sr, clip.x, clip.y +10, 10, clip.height-10);
- Gui.drawRect(0,0,getBounds().width, getBounds().height, 0x77777777);
+ RenderUtils.drawRectSafe(0,0,getBounds().width, getBounds().height, 0x77777777);
for (int z = 0; z < height; z++) {
fr.drawString(z+"", 2, z * 16 + 10 + offsetY, 0xFFFFFFFF);
}
@@ -72,7 +73,7 @@ public class RoomMatchDisplayPane extends MPanel {
}
if (z == hoverY && x == hoverX) {
- Gui.drawRect(x *16 +10+offsetX, z *16 +10 + offsetY, x *16 +26 +offsetX, z *16 +26 + offsetY, 0xAA505050);
+ RenderUtils.drawRectSafe(x *16 +10+offsetX, z *16 +10 + offsetY, x *16 +26 +offsetX, z *16 +26 + offsetY, 0xAA505050);
}
if (data1 == data2) drawItemStack(new ItemStack(Item.getItemFromBlock(Block.getBlockById(data1)), 1), x * 16 +10 + offsetX, z *16 +10 + offsetY);