diff --git a/src/main/java/cc/fros/features/gui/Widget.java b/src/main/java/cc/fros/features/gui/Widget.java index 58ac66a..6c904cd 100644 --- a/src/main/java/cc/fros/features/gui/Widget.java +++ b/src/main/java/cc/fros/features/gui/Widget.java @@ -2,6 +2,7 @@ package cc.fros.features.gui; import cc.fros.util.render.FrosFont; +import cc.fros.Fros; import cc.fros.features.Feature; import cc.fros.features.gui.items.Item; import cc.fros.features.gui.items.buttons.Button; @@ -52,11 +53,30 @@ public class Widget this.context = context; this.drag(mouseX, mouseY); float totalItemHeight = this.open ? this.getTotalItemHeight() - 2.0f : 0.0f; - int color = ClickGuiModule.getInstance().topColor.getValue().getRGB(); - context.fill(this.x, this.y - 1, this.x + this.width, this.y + this.height - 6, ClickGuiModule.getInstance().rainbow.getValue() ? ColorUtil.rainbow(ClickGuiModule.getInstance().rainbowHue.getValue()).getRGB() : color); + boolean rainbow = ClickGuiModule.getInstance().rainbow.getValue(); + int headerColor = rainbow + ? ColorUtil.rainbow(ClickGuiModule.getInstance().rainbowHue.getValue()).getRGB() + : ClickGuiModule.getInstance().topColor.getValue().getRGB(); + int accent = rainbow + ? ColorUtil.rainbow(ClickGuiModule.getInstance().rainbowHue.getValue()).getRGB() + : Fros.colorManager.getColorAsInt(); + + int headerTop = this.y - 1; + int headerBottom = this.y + this.height - 6; + int panelBottom = this.open ? Math.round(this.y + this.height + totalItemHeight) : headerBottom; + + // drop shadow behind the whole panel + context.fill(this.x + 2, headerTop + 2, this.x + this.width + 2, panelBottom + 2, 0x50000000); + + context.fill(this.x, headerTop, this.x + this.width, headerBottom, headerColor); if (this.open) { - RenderUtil.rect(context, this.x, (float) this.y + 12.5f, this.x + this.width, (float) (this.y + this.height) + totalItemHeight, 0x77000000); + RenderUtil.rect(context, this.x, headerBottom, this.x + this.width, panelBottom, 0xE6141414); } + + // frame the panel and separate the header with an accent line + RenderUtil.rect(context, this.x, headerTop, this.x + this.width, panelBottom, 0x99000000, 1.0f); + context.fill(this.x, headerBottom - 1, this.x + this.width, headerBottom, accent); + drawString(this.getName(), (float) this.x + 3.0f, (float) this.y - 4.0f - (float) FrosGui.getClickGui().getTextOffset(), -1); ScissorUtil.enable(context, x, 0, x + width, mc.getWindow().getGuiScaledHeight()); @@ -195,6 +215,6 @@ public class Widget } protected void drawString(String text, double x, double y, int color) { - FrosFont.draw(context, text, (int) x, (int) y, color); + FrosFont.draw(context, text, (int) x, (int) y, color, true); } } \ No newline at end of file diff --git a/src/main/java/cc/fros/features/gui/items/Item.java b/src/main/java/cc/fros/features/gui/items/Item.java index 52d1832..6713921 100644 --- a/src/main/java/cc/fros/features/gui/items/Item.java +++ b/src/main/java/cc/fros/features/gui/items/Item.java @@ -80,7 +80,7 @@ public class Item } protected void drawString(GuiGraphics context, String text, double x, double y, int color) { - FrosFont.draw(context, text, (int) x, (int) y, color); + FrosFont.draw(context, text, (int) x, (int) y, color, true); } public boolean isHovering(int mouseX, int mouseY) { diff --git a/src/main/java/cc/fros/features/modules/client/HudModule.java b/src/main/java/cc/fros/features/modules/client/HudModule.java index ea2926e..28a533c 100644 --- a/src/main/java/cc/fros/features/modules/client/HudModule.java +++ b/src/main/java/cc/fros/features/modules/client/HudModule.java @@ -100,7 +100,7 @@ public abstract class HudModule extends Module { textX = x - 5 - textWidth; } FrosFont.draw(e.getContext(), getName(), - (int) textX, (int) (y + height / 2f - textHeight / 2f), -1); + (int) textX, (int) (y + height / 2f - textHeight / 2f), -1, true); HudEditorScreen.getInstance().anyHover = true; }