1 package com.irtimaled.bbor.client.gui;
5 public abstract class BoolButton extends AbstractButton {
6 private static final Color OVERLAY_COLOR = new Color(0, 255, 0, 48);
10 BoolButton(int width, String label, boolean enabled) {
11 super(0, 0, width, label, enabled);
14 BoolButton(int width, String label) {
15 super(0, 0, width, label);
19 protected int getState() {
20 return enabled ? super.getState() : 0;
23 protected boolean getValue() {
27 protected void setValue(boolean value) {
32 protected void renderBackground(int mouseX, int mouseY) {
33 int left = this.x + 1;
35 int right = left + this.width - 2;
36 int bottom = top + this.height - 2;
37 if (this.getValue()) {
38 drawRectangle(left, top, right, bottom, OVERLAY_COLOR);