mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-18 19:29:32 +00:00
Experimental "up" arrow thing for the back-to-index arrow
This commit is contained in:
1 parent
1514d7d612
commit
1c670116e4
3 files changed
+29
-8
No files matched your search
@@ -18,12 +18,12 @@ public class GuiArrow extends GuiButton {
|
||||
public static final int HEIGHT = 10;
|
||||
|
||||
// Appearance
|
||||
public int arrowType;
|
||||
public ArrowType arrowType;
|
||||
public int color;
|
||||
public int hoverColor;
|
||||
|
||||
public GuiArrow(int buttonId, int x, int y, int arrowType, int color, int hoverColor) {
|
||||
super(buttonId, x, y, WIDTH, HEIGHT, "");
|
||||
public GuiArrow(int buttonId, int x, int y, ArrowType arrowType, int color, int hoverColor) {
|
||||
super(buttonId, x, y, arrowType.w, arrowType.h, "");
|
||||
|
||||
this.arrowType = arrowType;
|
||||
this.color = color;
|
||||
@@ -44,8 +44,29 @@ public class GuiArrow extends GuiButton {
|
||||
float b = (color & 0xff) / 255.F;
|
||||
|
||||
GlStateManager.color(r, g, b);
|
||||
Gui.drawScaledCustomSizeModalRect(xPosition, yPosition, X, HEIGHT * arrowType, WIDTH, HEIGHT, width, height, 512, 512);
|
||||
Gui.drawScaledCustomSizeModalRect(xPosition, yPosition, arrowType.x, arrowType.y, width, height, width, height, 512, 512);
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
public enum ArrowType {
|
||||
NEXT(412, 0),
|
||||
PREV(412, 10),
|
||||
RIGHT(412, 20),
|
||||
LEFT(412, 30),
|
||||
BACK_UP(412, 40, 18, 18);
|
||||
|
||||
final int x, y, w, h;
|
||||
|
||||
ArrowType(int x, int y) {
|
||||
this(x, y, WIDTH, HEIGHT);
|
||||
}
|
||||
|
||||
ArrowType(int x, int y, int w, int h) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.w = w;
|
||||
this.h = h;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,10 +429,10 @@ public class GuiBook extends GuiScreen implements IProgressMeter {
|
||||
height /= 2F;
|
||||
}*/
|
||||
|
||||
previousArrow = new GuiArrow(0, -50, -50, 1, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
nextArrow = new GuiArrow(1, -50, -50, 0, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
backArrow = new GuiArrow(2, width / 2 - GuiArrow.WIDTH / 2, height / 2 + GuiArrow.HEIGHT / 2 + PAGE_HEIGHT/2, 3, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
indexArrow = new GuiArrow(3, width / 2 - PAGE_WIDTH_UNSCALED, height / 2 - PAGE_HEIGHT_UNSCALED / 2 - 3, 3, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
previousArrow = new GuiArrow(0, -50, -50, GuiArrow.ArrowType.PREV, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
nextArrow = new GuiArrow(1, -50, -50, GuiArrow.ArrowType.NEXT, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
backArrow = new GuiArrow(2, width / 2 - GuiArrow.WIDTH / 2, height / 2 + GuiArrow.HEIGHT / 2 + PAGE_HEIGHT/2, GuiArrow.ArrowType.LEFT, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
indexArrow = new GuiArrow(3, width / 2 - PAGE_WIDTH_UNSCALED - GuiArrow.WIDTH / 2, height / 2 - PAGE_HEIGHT_UNSCALED / 2, GuiArrow.ArrowType.BACK_UP, book.appearance.arrowColor, book.appearance.arrowColorHover);
|
||||
|
||||
buttonList.add(previousArrow);
|
||||
buttonList.add(nextArrow);
|
||||
|
||||
Reference in new issue
Block a user