Skip to content

Commit b8f6e6a

Browse files
Implement new modal button design
1 parent e51eff4 commit b8f6e6a

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

src/main/java/gg/essential/ad/modal/ButtonColor.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
public class ButtonColor {
44

55
public static final ButtonColor GRAY = new ButtonColor(
6-
0xFF383838,
7-
0xFF595959,
8-
0xFF2B2B2B,
9-
0xFF595959,
10-
0xFF7F7F7F,
11-
0xFF424242
6+
0xFF323232,
7+
0xFF5C5C5C,
8+
0xFF000000,
9+
0xFF474747,
10+
0xFF757575,
11+
0xFF000000
1212
);
1313

1414
public static final ButtonColor BLUE = new ButtonColor(
15-
0xFF274673,
16-
0xFF507BBA,
17-
0xFF1B3151,
18-
0xFF164995,
19-
0xFF3073D4,
20-
0xFF0A2E62
15+
0xFF223F69,
16+
0xFF3671C7,
17+
0xFF000000,
18+
0xFF2A5695,
19+
0xFF5490E8,
20+
0xFF000000
2121
);
2222

2323
public static final ButtonColor RED = new ButtonColor(
24-
0xFF9F4444,
25-
0xFFE96D6D,
2624
0xFF461F1F,
27-
0xFFC02525,
28-
0xFFE55252,
29-
0xFF642626
25+
0xFF8B3636,
26+
0xFF000000,
27+
0xFF642626,
28+
0xFF9F4444,
29+
0xFF000000
3030
);
3131

3232
private final int buttonColor;

src/main/java/gg/essential/ad/modal/ModalButton.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,12 @@ public ModalButton(int x, int y, int width, ButtonColor color, String text, Runn
3232
public void draw(Draw draw) {
3333
boolean hovered = draw.hovered(x, y, width, height);
3434

35+
// shadow
36+
draw.rect(x + 1, y + 1, x + 1 + width, y + 1 + height, color.getShadowColor(hovered));
3537
// outline
36-
draw.rect(x, y, x + width, y + height, hovered ? 0xFFe5e5e5 : 0xFF000000);
38+
draw.rect(x, y, x + width, y + height, color.getHighlightColor(hovered));
3739
// main background
3840
draw.rect(x + 1, y + 1, x + width - 1, y + height - 1, color.getButtonColor(hovered));
39-
// highlight
40-
draw.rect(x + 1, y + 1, x + 2, y + height - 3, color.getHighlightColor(hovered));
41-
draw.rect(x + 2, y + 1, x + width - 2, y + 2, color.getHighlightColor(hovered));
42-
// shadow
43-
draw.rect(x + 2, y + height - 3, x + width - 1, y + height - 1, color.getShadowColor(hovered));
44-
draw.rect(x + width - 2, y + 2, x + width - 1, y + height - 3, color.getShadowColor(hovered));
4541

4642
if (!text.isEmpty()) {
4743
int textX = x + width / 2 - Minecraft.getMinecraft().fontRenderer.getStringWidth(text) / 2;

0 commit comments

Comments
 (0)