(MatrixStack matrices, int mouseX, int mouseY, float delta)
| 57 | float animTicks = 0; |
| 58 | int length = 0; |
| 59 | public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { |
| 60 | // RenderUtils.startScissor(this.x, this.y, this.width, (int)animTicks); |
| 61 | this.color = category != null && !ModuleManager.INSTANCE.getModule(ClickGUIModule.class).customColor.is("Custom") ? category.color : ModuleManager.INSTANCE.getModule(ClickGUIModule.class).color.getColor(); |
| 62 | Screen.fill(matrices, x, y, x + width, y + height, color.getRGB()); |
| 63 | Screen.fill(matrices, x + 1, y + 1, x + width - 1, y + height - (this.extended ? 0 : 0), new Color(25, 25, 25).getRGB()); |
| 64 | FontManager.roboto.drawWithShadow(matrices, title, x + (height / 3), y + (height / 6), -1); |
| 65 | FontManager.roboto.drawWithShadow(matrices, extended ? "-" : "+", x + width - (height / 1.5f), y + (height / 6), -1); |
| 66 | if (this.extended) { |
| 67 | buttons.sort(Comparator.comparingInt(b -> (int)FontManager.roboto.getWidth(((Button)b).getText())).reversed()); |
| 68 | for (Button button : buttons) { |
| 69 | button.setWidth(this.width); |
| 70 | button.render(matrices, mouseX, mouseY, delta); |
| 71 | length = buttons.size() * height; |
| 72 | if (this.animTicks > length + height + 1) animTicks--; |
| 73 | if (this.extended) if (animTicks < length + height + 1) { |
| 74 | animTicks++; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | } if (!this.extended) { |
| 79 | |
| 80 | length = height; |
| 81 | RenderUtils.drawBorderRect(matrices, this.x + 1, this.y, this.x + this.width - 1, this.y + this.height, color.getRGB(), 1); |
| 82 | } |
| 83 | if (this.extended) { |
| 84 | // if (animTicks <= 201) animTicks+=5; |
| 85 | } else { |
| 86 | |
| 87 | } |
| 88 | // System.out.println(animTicks + this.title); |
| 89 | RenderUtils.endScissor(); |
| 90 | // Screen.fill(matrices, this.x, this.y, this.x + this.width, this.y + 100, ColorUtils.transparent(-1, 50)); |
| 91 | |
| 92 | } |
| 93 | |
| 94 | public void mouseClicked(double mouseX, double mouseY, int button) { |
| 95 | if (hovered(mouseX, mouseY)) { |
no test coverage detected