1 package com.irtimaled.bbor.client.gui;
3 import com.irtimaled.bbor.client.config.BoundingBoxTypeHelper;
4 import com.irtimaled.bbor.common.BoundingBoxType;
5 import net.minecraft.client.util.math.MatrixStack;
9 public class BoundingBoxTypeButton extends BoolSettingButton {
10 private final BoundingBoxType type;
12 BoundingBoxTypeButton(int width, String label, BoundingBoxType type) {
13 super(width, label, BoundingBoxTypeHelper.renderSetting(type));
18 protected void renderBackground(MatrixStack matrixStack, int mouseX, int mouseY) {
19 super.renderBackground(matrixStack, mouseX, mouseY);
23 int right = left + width - 2;
24 int bottom = top + height - 2;
26 Color color = BoundingBoxTypeHelper.getColor(type);
29 drawRectangle(matrixStack, left, top, right, top + 1, color);
30 drawRectangle(matrixStack, left, top, left + 1, bottom, color);
32 Color darker = color.darker();
33 // bottom left & top right
34 drawRectangle(matrixStack, left, bottom - 2, left + 1, bottom, darker);
35 drawRectangle(matrixStack, right - 1, top, right, top + 1, darker);
37 Color darkest = darker.darker();
39 drawRectangle(matrixStack, left + 1, bottom - 2, right, bottom, darkest);
40 drawRectangle(matrixStack, right - 1, top + 1, right, bottom, darkest);