aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java7
-rw-r--r--src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java9
-rw-r--r--src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java52
-rw-r--r--src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java37
4 files changed, 57 insertions, 48 deletions
diff --git a/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java b/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java
index 1638080ace..09fb0a9b67 100644
--- a/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java
+++ b/src/main/java/kubatech/api/implementations/KubaTechGTMultiBlockBase.java
@@ -223,8 +223,7 @@ public abstract class KubaTechGTMultiBlockBase<T extends GT_MetaTileEntity_Exten
}
protected final Function<Widget, Boolean> isFixed = widget -> getIdealStatus() == getRepairStatus() && mMachine;
- protected static final Function<Integer, IDrawable[]> toggleButtonBackgroundGetter = val -> {
- if (val == 0) return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS };
- else return new IDrawable[] { GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CHECKMARK };
- };
+ protected static final Function<Integer, IDrawable> toggleButtonTextureGetter = val -> val == 0
+ ? GT_UITextures.OVERLAY_BUTTON_CROSS
+ : GT_UITextures.OVERLAY_BUTTON_CHECKMARK;
}
diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java
index 2da9e85ffe..db3dc4ff44 100644
--- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java
+++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeExterminationChamber.java
@@ -684,7 +684,8 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
})
.addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
.addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
+ .setTextureGetter(toggleButtonTextureGetter)
+ .setBackground(GT_UITextures.BUTTON_STANDARD)
.setSize(18, 18)
.addTooltip("Working status"))
.widget(configurationElements.setEnabled(widget -> !getBaseMetaTileEntity().isActive()))
@@ -721,7 +722,8 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
else GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Can't connect to the ritual");
}
})
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
+ .setTextureGetter(toggleButtonTextureGetter)
+ .setBackground(GT_UITextures.BUTTON_STANDARD)
.setSize(18, 18)
.addTooltip("Ritual mode"));
configurationElements.widget(new CycleButtonWidget().setToggle(() -> mIsProducingInfernalDrops, v -> {
@@ -737,7 +739,8 @@ public class GT_MetaTileEntity_ExtremeExterminationChamber
.sendChatToPlayer(buildContext.getPlayer(), "Mobs will now be prevented from spawning infernal");
else GT_Utility.sendChatToPlayer(buildContext.getPlayer(), "Mobs can spawn infernal now");
})
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
+ .setTextureGetter(toggleButtonTextureGetter)
+ .setBackground(GT_UITextures.BUTTON_STANDARD)
.setSize(18, 18)
.addTooltip("Is allowed to spawn infernal mobs")
.addTooltip(new Text("Does not affect mobs that are always infernal !").color(Color.GRAY.normal)));
diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java
index 99578f4088..5f8cfde43e 100644
--- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java
+++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_ExtremeIndustrialGreenhouse.java
@@ -625,7 +625,8 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse
})
.addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
.addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
+ .setTextureGetter(toggleButtonTextureGetter)
+ .setBackground(GT_UITextures.BUTTON_STANDARD)
.setSize(18, 18)
.addTooltip("Working status"))
.widget(
@@ -810,15 +811,16 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse
.addTooltip(0, new Text("Operating").color(Color.GREEN.dark(3)))
.addTooltip(1, new Text("Input").color(Color.YELLOW.dark(3)))
.addTooltip(2, new Text("Output").color(Color.YELLOW.dark(3)))
- .setVariableBackgroundGetter(
- i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), i
- == 0 ? new Text("Operating").color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : i == 1 ? new Text("Input").color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Output").color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0) })
+ .setTextureGetter(
+ i -> i == 0 ? new Text("Operating").color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : i == 1 ? new Text("Input").color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Output").color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0))
+ .setBackground(
+ ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18))
.setSize(70, 18)
.addTooltip("Setup mode"))
.widget(
@@ -845,13 +847,14 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse
})
.addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
.addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(
- i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), i
- == 0 ? new Text("Disabled").color(Color.RED.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Enabled").color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0) })
+ .setTextureGetter(
+ i -> i == 0 ? new Text("Disabled").color(Color.RED.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Enabled").color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0))
+ .setBackground(
+ ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18))
.setSize(70, 18)
.addTooltip("IC2 mode"))
.widget(
@@ -864,13 +867,14 @@ public class GT_MetaTileEntity_ExtremeIndustrialGreenhouse
})
.addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
.addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(
- i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), i
- == 0 ? new Text("Disabled").color(Color.RED.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Enabled").color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0) })
+ .setTextureGetter(
+ i -> i == 0 ? new Text("Disabled").color(Color.RED.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Enabled").color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0))
+ .setBackground(
+ ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18))
.setSize(70, 18)
.addTooltip("No Humidity mode"))
.setEnabled(widget -> !getBaseMetaTileEntity().isActive())
diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java
index 9a238e2bc1..f68e7ad986 100644
--- a/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java
+++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/GT_MetaTileEntity_MegaIndustrialApiary.java
@@ -699,7 +699,8 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
})
.addTooltip(0, new Text("Disabled").color(Color.RED.dark(3)))
.addTooltip(1, new Text("Enabled").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(toggleButtonBackgroundGetter)
+ .setTextureGetter(toggleButtonTextureGetter)
+ .setBackground(GT_UITextures.BUTTON_STANDARD)
.setSize(18, 18)
.addTooltip("Working status"))
.widget(
@@ -896,15 +897,16 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
.addTooltip(0, new Text("Input").color(Color.YELLOW.dark(3)))
.addTooltip(1, new Text("Output").color(Color.YELLOW.dark(3)))
.addTooltip(2, new Text("Operating").color(Color.GREEN.dark(3)))
- .setVariableBackgroundGetter(
- i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), i
- == 0 ? new Text("Input").color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : i == 1 ? new Text("Output").color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Operating").color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0) })
+ .setTextureGetter(
+ i -> i == 0 ? new Text("Input").color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : i == 1 ? new Text("Output").color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Operating").color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0))
+ .setBackground(
+ ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18))
.setSize(70, 18)
.addTooltip("Primary mode"))
.widget(
@@ -930,13 +932,14 @@ public class GT_MetaTileEntity_MegaIndustrialApiary
})
.addTooltip(0, new Text("Normal").color(Color.GREEN.dark(3)))
.addTooltip(1, new Text("Swarmer").color(Color.YELLOW.dark(3)))
- .setVariableBackgroundGetter(
- i -> new IDrawable[] { ModularUITextures.VANILLA_BACKGROUND,
- GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18), i
- == 0 ? new Text("Normal").color(Color.GREEN.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0)
- : new Text("Swarmer").color(Color.YELLOW.dark(3))
- .withFixedSize(70 - 18, 18, 15, 0) })
+ .setTextureGetter(
+ i -> i == 0 ? new Text("Normal").color(Color.GREEN.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0)
+ : new Text("Swarmer").color(Color.YELLOW.dark(3))
+ .withFixedSize(70 - 18, 18, 15, 0))
+ .setBackground(
+ ModularUITextures.VANILLA_BACKGROUND,
+ GT_UITextures.OVERLAY_BUTTON_CYCLIC.withFixedSize(18, 18))
.setSize(70, 18)
.addTooltip("Secondary mode"))
.setEnabled(widget -> !getBaseMetaTileEntity().isActive())