]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/gui/BoundingBoxTypeButton.java
Change button ON state highlighting to make it more obvious in 1.15+
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / gui / BoundingBoxTypeButton.java
1 package com.irtimaled.bbor.client.gui;
2
3 import com.irtimaled.bbor.common.BoundingBoxType;
4
5 import java.awt.*;
6
7 public class BoundingBoxTypeButton extends BoolSettingButton {
8     private final Color color;
9
10     BoundingBoxTypeButton(int width, String label, BoundingBoxType type) {
11         super(width, label, type.shouldRenderSetting);
12         color = type.getColor();
13     }
14
15     @Override
16     protected void renderBackground(int mouseX, int mouseY) {
17         super.renderBackground(mouseX, mouseY);
18
19         int left = x + 1;
20         int top = y + 1;
21         int right = left + width - 2;
22         int bottom = top + height - 2;
23
24         // top & left
25         drawRectangle(left, top, right, top + 1, color);
26         drawRectangle(left, top, left + 1, bottom, color);
27
28         Color darker = color.darker();
29         // bottom left & top right
30         drawRectangle(left, bottom - 2, left + 1, bottom, darker);
31         drawRectangle(right - 1, top, right, top + 1, darker);
32
33         Color darkest = darker.darker();
34         // bottom & right
35         drawRectangle(left + 1, bottom - 2, right, bottom, darkest);
36         drawRectangle(right - 1, top + 1, right, bottom, darkest);
37     }
38 }