aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java6
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java6
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java9
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java6
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java9
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java4
6 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java
index e332a7b0..d30b82c9 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java
@@ -25,6 +25,9 @@ import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import java.awt.*;
@@ -60,6 +63,9 @@ public class MButton extends MPanel {
int x = (getBounds().width - width) / 2;
int y = (getBounds().height - renderer.FONT_HEIGHT) / 2 + 1;
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
renderer.drawString(getText(), x,y, foreground.getRGB());
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java
index 2bb7f2d3..cd0289a0 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MLabel.java
@@ -23,6 +23,9 @@ import lombok.Getter;
import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.renderer.GlStateManager;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import java.awt.*;
@@ -61,6 +64,9 @@ public class MLabel extends MPanel {
} else{
return;
}
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
renderer.drawString(getText(), x,y, 0xffffff);
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java
index 11772704..d870daf2 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MNavigatingPane.java
@@ -26,6 +26,9 @@ import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import java.awt.*;
import java.util.*;
@@ -83,6 +86,9 @@ public class MNavigatingPane extends MPanel {
Gui.drawRect(1, 16, getBounds().width-1, getBounds().height-1, background2 != null ? background2.getRGB() : 0);
FontRenderer fr = Minecraft.getMinecraft().fontRendererObj;
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
fr.drawString(currentPage.replace(".", " > "), 20, 20, 0xFFFFFFFF);
}
@@ -191,6 +197,9 @@ public class MNavigatingPane extends MPanel {
int x = (getBounds().width - width) / 2;
int y = (getBounds().height - 3 - renderer.FONT_HEIGHT) / 2 + 3;
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
renderer.drawString(text, x,y, foreground.getRGB());
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java
index 4e7e2463..f26fd956 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTabbedPane.java
@@ -25,6 +25,9 @@ import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import java.awt.*;
import java.util.ArrayList;
@@ -141,6 +144,9 @@ public class MTabbedPane extends MPanel {
int x = (getBounds().width - width) / 2;
int y = (getBounds().height - 3 - renderer.FONT_HEIGHT) / 2 + 3;
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
renderer.drawString(text, x,y, foreground.getRGB());
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java
index 957a59b1..c26a1b21 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java
@@ -25,7 +25,10 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
+import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import java.awt.*;
import java.awt.datatransfer.*;
@@ -68,6 +71,9 @@ public class MTextField extends MPanel {
clip(new ScaledResolution(mc), clip.x + 1, clip.y + 1, clip.width - 2, clip.height - 2);
FontRenderer fr = mc.fontRendererObj;
int y = (getBounds().height - fr.FONT_HEIGHT) / 2;
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
fr.drawString(text, 3 - xOffset, y, foreground.getRGB());
// draw selection
if (isFocused) {
@@ -75,6 +81,9 @@ public class MTextField extends MPanel {
int startX = fr.getStringWidth(text.substring(0, selectionStart)) - xOffset;
int endX = fr.getStringWidth(text.substring(0, selectionEnd)) - xOffset;
Gui.drawRect(3 + startX, y, 3 + endX, y + fr.FONT_HEIGHT, 0xFF00FF00);
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
fr.drawString(text.substring(selectionStart, selectionEnd), 3 + startX, y, foreground.getRGB());
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java
index 41e281da..432fd0a8 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java
@@ -27,6 +27,7 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL14;
import java.awt.*;
@@ -48,6 +49,9 @@ public class MToggleButton extends MPanel {
FontRenderer fr = Minecraft.getMinecraft().fontRendererObj;
double scale = 2;
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (enabled) {
int x = (int) ((scale * bounds.height - fr.FONT_HEIGHT)/2 + gap);
GlStateManager.pushMatrix();