]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/commitdiff
Allow BoundingBoxType buttons to be disabled
authorirtimaled <irtimaled@gmail.com>
Mon, 8 Jul 2019 08:43:32 +0000 (01:43 -0700)
committerirtimaled <irtimaled@gmail.com>
Mon, 8 Jul 2019 08:43:32 +0000 (01:43 -0700)
src/main/java/com/irtimaled/bbor/client/gui/BoolSettingButton.java
src/main/java/com/irtimaled/bbor/client/gui/BoundingBoxTypeButton.java

index 2a97868a8bf73d97967603643c2f447c3b8ea651..363e67bcdb8970ac1b3b3dc6632ba9ace016e3e2 100644 (file)
@@ -12,7 +12,7 @@ public class BoolSettingButton extends AbstractButton {
 
     @Override
     protected int getState() {
-        return setting.get() ? 2 : 1;
+        return enabled ? setting.get() ? 2 : 1 : 0;
     }
 
     @Override
index b3e9d06667096b21d59f88a7faf69383ebd5292a..28af129c0e1b83530098860fc4be7a819b47cb85 100644 (file)
@@ -12,8 +12,15 @@ public class BoundingBoxTypeButton extends BoolSettingButton {
         color = type.getColor();
     }
 
+    public BoundingBoxTypeButton(int id, int x, int y, int width, String label, BoundingBoxType type, boolean enabled) {
+        this(id, x, y, width, label, type);
+        this.enabled = enabled;
+    }
+
     @Override
     protected void renderBackground() {
+        if(!enabled) return;
+
         int left = x + 1;
         int top = y + 1;
         int right = left + width - 2;