Started creating GuiEditKeyframe

Therefore, added support for floating point numbers in GuiNumberInput
This commit is contained in:
CrushedPixel
2015-05-20 16:40:54 +02:00
parent ce9e717d21
commit 4754ecc6bf
18 changed files with 248 additions and 52 deletions

View File

@@ -7,12 +7,16 @@ import java.awt.*;
public class GuiArrowButton extends GuiButton {
private boolean upwards = false;
public enum Direction {
UP, DOWN, RIGHT, LEFT;
}
public GuiArrowButton(int buttonId, int x, int y, String buttonText, boolean upwards) {
private Direction dir;
public GuiArrowButton(int buttonId, int x, int y, String buttonText, Direction dir) {
super(buttonId, x, y, buttonText);
this.upwards = upwards;
this.dir = dir;
width = 20;
height = 20;
}
@@ -21,14 +25,18 @@ public class GuiArrowButton extends GuiButton {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
try {
super.drawButton(mc, mouseX, mouseY);
if(upwards) {
if(dir == Direction.UP) {
for(int i = 0; i <= Math.ceil(height / 2) - 5; i++) {
drawHorizontalLine(xPosition + width - height + i + 4, xPosition + width - i - 6, yPosition + height - ((height / 3) + i + 2), Color.BLACK.getRGB());
}
} else {
} else if(dir == Direction.DOWN) {
for(int i = 0; i <= Math.ceil(height / 2) - 5; i++) {
drawHorizontalLine(xPosition + width - height + i + 4, xPosition + width - i - 6, yPosition + (height / 3) + i + 2, Color.BLACK.getRGB());
}
} else if(dir == Direction.LEFT) {
} else if(dir == Direction.RIGHT) {
}
} catch(Exception e) {
e.printStackTrace();