aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/gui/widget/Control.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-09 23:35:45 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-09 23:35:45 +0800
commit1b21d26487636e50d03979acd5ca4a2a07761a25 (patch)
treed7d066b4e7491474f3a962593e97a2d6f0aa2ea2 /src/main/java/me/shedaniel/gui/widget/Control.java
parent77af6b3f548d34bfdafc585847d3d80ec783c7e7 (diff)
downloadRoughlyEnoughItems-1b21d26487636e50d03979acd5ca4a2a07761a25.tar.gz
RoughlyEnoughItems-1b21d26487636e50d03979acd5ca4a2a07761a25.tar.bz2
RoughlyEnoughItems-1b21d26487636e50d03979acd5ca4a2a07761a25.zip
Starting off rewrite
Diffstat (limited to 'src/main/java/me/shedaniel/gui/widget/Control.java')
-rwxr-xr-xsrc/main/java/me/shedaniel/gui/widget/Control.java127
1 files changed, 0 insertions, 127 deletions
diff --git a/src/main/java/me/shedaniel/gui/widget/Control.java b/src/main/java/me/shedaniel/gui/widget/Control.java
deleted file mode 100755
index d549e05f2..000000000
--- a/src/main/java/me/shedaniel/gui/widget/Control.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package me.shedaniel.gui.widget;
-
-import com.mojang.blaze3d.platform.GlStateManager;
-import me.shedaniel.api.TriBooleanSupplier;
-import me.shedaniel.gui.Drawable;
-import net.minecraft.client.render.BufferBuilder;
-import net.minecraft.client.render.Tessellator;
-import net.minecraft.client.render.VertexFormats;
-
-import java.awt.*;
-import java.util.function.BiConsumer;
-import java.util.function.IntFunction;
-
-/**
- * Created by James on 7/29/2018.
- */
-public abstract class Control extends Drawable {
-
- private boolean enabled = true;
- public IntFunction<Boolean> onClick;
- public TriBooleanSupplier onKeyDown;
- public BiConsumer<Character, Integer> charPressed;
-
- public Control(int x, int y, int width, int height) {
- super(x, y, width, height);
- }
-
- public Control(Rectangle rect) {
- super(rect);
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- public void move(int x, int y) {
- rect.x += x;
- rect.y += y;
- //rect.move(x+rect.x,rect.y+y);//Why the fuck?
- }
-
- protected static void drawRect(int p_drawRect_0_, int p_drawRect_1_, int p_drawRect_2_, int p_drawRect_3_, int p_drawRect_4_) {
- int lvt_5_3_;
- if (p_drawRect_0_ < p_drawRect_2_) {
- lvt_5_3_ = p_drawRect_0_;
- p_drawRect_0_ = p_drawRect_2_;
- p_drawRect_2_ = lvt_5_3_;
- }
-
- if (p_drawRect_1_ < p_drawRect_3_) {
- lvt_5_3_ = p_drawRect_1_;
- p_drawRect_1_ = p_drawRect_3_;
- p_drawRect_3_ = lvt_5_3_;
- }
- float lvt_5_3_1 = (float) (p_drawRect_4_ >> 24 & 255) / 255.0F;
- float lvt_6_1_ = (float) (p_drawRect_4_ >> 16 & 255) / 255.0F;
- float lvt_7_1_ = (float) (p_drawRect_4_ >> 8 & 255) / 255.0F;
- float lvt_8_1_ = (float) (p_drawRect_4_ & 255) / 255.0F;
- Tessellator lvt_9_1_ = Tessellator.getInstance();
- BufferBuilder lvt_10_1_ = lvt_9_1_.getBufferBuilder();
- GlStateManager.enableAlphaTest();
- GlStateManager.enableBlend();
- GlStateManager.disableTexture();
- GlStateManager.blendFuncSeparate(GlStateManager.SrcBlendFactor.SRC_ALPHA, GlStateManager.DstBlendFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcBlendFactor.ONE, GlStateManager.DstBlendFactor.ZERO);
- GlStateManager.color4f(lvt_6_1_, lvt_7_1_, lvt_8_1_, lvt_5_3_1);
- lvt_10_1_.begin(7, VertexFormats.POSITION);
- lvt_10_1_.vertex((double) p_drawRect_0_, (double) p_drawRect_3_, 0.0D).next();
- lvt_10_1_.vertex((double) p_drawRect_2_, (double) p_drawRect_3_, 0.0D).next();
- lvt_10_1_.vertex((double) p_drawRect_2_, (double) p_drawRect_1_, 0.0D).next();
- lvt_10_1_.vertex((double) p_drawRect_0_, (double) p_drawRect_1_, 0.0D).next();
- lvt_9_1_.draw();
- GlStateManager.enableTexture();
- GlStateManager.disableBlend();
- GlStateManager.disableAlphaTest();
- }
-
- protected void drawTexturedModalRect(int x, int y, int u, int v, int width, int height) {
- float lvt_7_1_ = 0.00390625F;
- float lvt_8_1_ = 0.00390625F;
- Tessellator lvt_9_1_ = Tessellator.getInstance();
- BufferBuilder lvt_10_1_ = lvt_9_1_.getBufferBuilder();
- lvt_10_1_.begin(7, VertexFormats.POSITION_UV);
- lvt_10_1_.vertex((double) (x + 0), (double) (y + height), (double) 200).texture((double) ((float) (u + 0) * 0.00390625F), (double) ((float) (v + height) * 0.00390625F)).next();
- lvt_10_1_.vertex((double) (x + width), (double) (y + height), (double) 200).texture((double) ((float) (u + width) * 0.00390625F), (double) ((float) (v + height) * 0.00390625F)).next();
- lvt_10_1_.vertex((double) (x + width), (double) (y + 0), (double) 200).texture((double) ((float) (u + width) * 0.00390625F), (double) ((float) (v + 0) * 0.00390625F)).next();
- lvt_10_1_.vertex((double) (x + 0), (double) (y + 0), (double) 200).texture((double) ((float) (u + 0) * 0.00390625F), (double) ((float) (v + 0) * 0.00390625F)).next();
- lvt_9_1_.draw();
- }
-
- protected void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, float zLevel) {
- float lvt_7_1_ = 0.00390625F;
- float lvt_8_1_ = 0.00390625F;
- Tessellator lvt_9_1_ = Tessellator.getInstance();
- BufferBuilder lvt_10_1_ = lvt_9_1_.getBufferBuilder();
- lvt_10_1_.begin(7, VertexFormats.POSITION_UV);
- lvt_10_1_.vertex((double) (x + 0), (double) (y + height), zLevel).texture((double) ((float) (u + 0) * 0.00390625F), (double) ((float) (v + height) * 0.00390625F)).next();
- lvt_10_1_.vertex((double) (x + width), (double) (y + height), zLevel).texture((double) ((float) (u + width) * 0.00390625F), (double) ((float) (v + height) * 0.00390625F)).next();
- lvt_10_1_.vertex((double) (x + width), (double) (y + 0), zLevel).texture((double) ((float) (u + width) * 0.00390625F), (double) ((float) (v + 0) * 0.00390625F)).next();
- lvt_10_1_.vertex((double) (x + 0), (double) (y + 0), zLevel).texture((double) ((float) (u + 0) * 0.00390625F), (double) ((float) (v + 0) * 0.00390625F)).next();
- lvt_9_1_.draw();
- }
-
- public void drawTexturedRect(int int_1, int int_2, int int_3, int int_4, int int_5, int int_6, double zOffset) {
- float float_1 = 0.00390625F;
- float float_2 = 0.00390625F;
- Tessellator tessellator_1 = Tessellator.getInstance();
- BufferBuilder bufferBuilder_1 = tessellator_1.getBufferBuilder();
- bufferBuilder_1.begin(7, VertexFormats.POSITION_UV);
- bufferBuilder_1.vertex((double)(int_1 + 0), (double)(int_2 + int_6), zOffset).texture((double)((float)(int_3 + 0) * 0.00390625F), (double)((float)(int_4 + int_6) * 0.00390625F)).next();
- bufferBuilder_1.vertex((double)(int_1 + int_5), (double)(int_2 + int_6), zOffset).texture((double)((float)(int_3 + int_5) * 0.00390625F), (double)((float)(int_4 + int_6) * 0.00390625F)).next();
- bufferBuilder_1.vertex((double)(int_1 + int_5), (double)(int_2 + 0), zOffset).texture((double)((float)(int_3 + int_5) * 0.00390625F), (double)((float)(int_4 + 0) * 0.00390625F)).next();
- bufferBuilder_1.vertex((double)(int_1 + 0), (double)(int_2 + 0), zOffset).texture((double)((float)(int_3 + 0) * 0.00390625F), (double)((float)(int_4 + 0) * 0.00390625F)).next();
- tessellator_1.draw();
- }
-
- public void tick() {
- }
-
- public void setOnClick(IntFunction<Boolean> onClick) {
- this.onClick = onClick;
- }
-
-}