d
This commit is contained in:
parent
266e877f20
commit
2c81a94856
File diff suppressed because it is too large
Load Diff
55596
javascript/classes.js
55596
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -5,14 +5,12 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
|||
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
|
||||
public class RoundedUtil {
|
||||
final static Minecraft mc = Minecraft.getMinecraft();
|
||||
final static FontRenderer fr = mc.fontRendererObj;
|
||||
|
||||
final static Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
public static void drawSmoothRoundedRect(float x, float y, float x1, float y1, float radius, int color) {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
|
@ -39,7 +37,7 @@ public class RoundedUtil {
|
|||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||
for (i = 90; i <= 180; i += 3)
|
||||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||
EaglercraftGPU.glEndList();
|
||||
tessellator.draw();
|
||||
worldrenderer.begin(RealOpenGLEnums.GL_LINE_LOOP, DefaultVertexFormats.POSITION_TEX);
|
||||
for (i = 0; i <= 90; i += 3)
|
||||
glVertex2d(x + radius + Math.sin(i * Math.PI / 180.0D) * radius * -1.0D, y + radius + Math.cos(i * Math.PI / 180.0D) * radius * -1.0D);
|
||||
|
@ -49,7 +47,7 @@ public class RoundedUtil {
|
|||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||
for (i = 90; i <= 180; i += 3)
|
||||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||
EaglercraftGPU.glEndList();
|
||||
tessellator.draw();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableTexture2D();
|
||||
|
@ -83,7 +81,7 @@ public class RoundedUtil {
|
|||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y1 - radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||
for (i = 90; i <= 180; i += 3)
|
||||
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
|
||||
EaglercraftGPU.glEndList();
|
||||
tessellator.draw();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableBlend();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.minecraft.client.gui;
|
||||
|
||||
import dev.resent.util.render.Color;
|
||||
import dev.resent.util.render.RenderUtils;
|
||||
import dev.resent.util.render.RoundedUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
|
@ -75,7 +76,7 @@ public class GuiButton extends Gui {
|
|||
* Draws this button to the screen.
|
||||
*/
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
|
||||
RoundedUtil.drawSmoothRoundedRect(this.xPosition, this.yPosition, xPosition + width, yPosition + this.height, 4, Color.BLACK.getRGB());
|
||||
RenderUtils.drawRoundedRect(this.xPosition, this.yPosition, xPosition + width, yPosition + this.height, 4, Color.BLACK.getRGB());
|
||||
|
||||
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2f, this.yPosition + (this.height - 8) / 2f, this.hovered ? new Color(47, 116, 253, 255).getRGB() : new Color(200, 200, 200).getRGB());
|
||||
|
|
Loading…
Reference in New Issue
Block a user