1
0
Fork 0

inv button drawing change

This commit is contained in:
Sen 2025-09-03 12:50:43 +02:00
parent 9683b18337
commit c704acbaa1
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
2 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,6 @@ package client.gui.element;
import client.Client;
import client.renderer.Drawing;
import common.inventory.Slot;
import common.util.Util;
public class InventoryButton extends Element {
private final boolean bordered;
@ -30,8 +29,8 @@ public class InventoryButton extends Element {
public static void drawButton(Client gm, int x, int y, int w, int h, boolean border) {
if(border)
Drawing.drawDoubleRect(x, y, w, h, Util.mixColor(gm.style.fill_top, gm.style.fill_btm), gm.style.brdr_top, gm.style.brdr_btm);
Drawing.drawDoubleRect(x, y, w, h, gm.style.fill_top, gm.style.fill_btm, gm.style.brdr_top, gm.style.brdr_btm);
else
Drawing.drawRect(x, y, w, h, Util.mixColor(gm.style.fill_top, gm.style.fill_btm), gm.style.brdr_top, gm.style.brdr_btm);
Drawing.drawGradient(x, y, w, h, gm.style.fill_top, gm.style.fill_btm, gm.style.brdr_top, gm.style.brdr_btm);
}
}

View file

@ -495,7 +495,7 @@ public abstract class Drawing {
drawRect(x + 1, y + 1, w - 2, h - 2, color);
}
public static void drawDoubleRect(int x, int y, int w, int h, int color, int topleft, int btmright) {
public static void drawDoubleRect(int x, int y, int w, int h, int top, int bottom, int topleft, int btmright) {
int corner = Util.mixColor(topleft, btmright);
drawRect(x, y, w - 2, 2, topleft);
drawRect(x, y + 2, 2, h - 2, topleft);
@ -503,7 +503,7 @@ public abstract class Drawing {
drawRect(x, y + h - 2, 2, 2, corner);
drawRect(x + w - 2, y + 2, 2, h - 2, btmright);
drawRect(x + 2, y + h - 2, w - 4, 2, btmright);
drawRect(x + 2, y + 2, w - 4, h - 4, color);
drawGradient(x + 2, y + 2, w - 4, h - 4, top, bottom);
}
public static void drawGradient(int x, int y, int w, int h, int top, int bottom, int topleft, int btmright) {