aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2021-07-14 11:19:21 +0800
committerGlease <4586901+Glease@users.noreply.github.com>2021-07-14 11:20:36 +0800
commit6ecf806dab6ffdb99d69c6add11492e6a7d866a4 (patch)
tree15e2ead4ef5afba9926f8aad132e1b0a5e7970ab /src/main
parent6fb3d7f43d91dfc18a303335ae30360eb08903b0 (diff)
downloadGT5-Unofficial-6ecf806dab6ffdb99d69c6add11492e6a7d866a4.tar.gz
GT5-Unofficial-6ecf806dab6ffdb99d69c6add11492e6a7d866a4.tar.bz2
GT5-Unofficial-6ecf806dab6ffdb99d69c6add11492e6a7d866a4.zip
Add option to not change GUI color based on paint
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gregtech/GT_Mod.java1
-rw-r--r--src/main/java/gregtech/api/GregTech_API.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java7
3 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index 525da2dd08..c601130ab9 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -308,6 +308,7 @@ public class GT_Mod implements IGT_Mod {
GregTech_API.sMachineThunderExplosions = tMainConfig.get("machines", "lightning_causes_explosions", true).getBoolean(false);
GregTech_API.sConstantEnergy = tMainConfig.get("machines", "constant_need_of_energy", true).getBoolean(false);
GregTech_API.sColoredGUI = tMainConfig.get("machines", "colored_guis_when_painted", true).getBoolean(false);
+ GregTech_API.sMachineMetalGUI = tMainConfig.get("machines", "guis_in_consistent_machine_metal_color", false).getBoolean(false);
// Implementation for this is actually handled in NewHorizonsCoreMod in MainRegistry.java!
GregTech_API.sUseMachineMetal = tMainConfig.get("machines", "use_machine_metal_tint", true).getBoolean(true);
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java
index ba7e3ab43e..ac9b1bfb5a 100644
--- a/src/main/java/gregtech/api/GregTech_API.java
+++ b/src/main/java/gregtech/api/GregTech_API.java
@@ -277,6 +277,7 @@ public class GregTech_API {
sMultiThreadedSounds = false,
sDoShowAllItemsInCreative = false,
sColoredGUI = true,
+ sMachineMetalGUI = false,
sConstantEnergy = true,
sMachineExplosions = true,
sMachineFlammable = true,
diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
index a54aa2e526..7fd4f9f0b2 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
@@ -27,7 +27,9 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer {
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) {
+ if (GregTech_API.sMachineMetalGUI) {
+ GL11.glColor3ub((byte) Dyes.MACHINE_METAL.mRGBa[0], (byte) Dyes.MACHINE_METAL.mRGBa[1], (byte) Dyes.MACHINE_METAL.mRGBa[2]);
+ } else if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) {
byte colorByte = mContainer.mTileEntity.getColorization();
Dyes color;
if (colorByte != -1)
@@ -35,7 +37,8 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer {
else
color = Dyes.MACHINE_METAL;
GL11.glColor3ub((byte) color.mRGBa[0], (byte) color.mRGBa[1], (byte) color.mRGBa[2]);
- } else
+ } else {
GL11.glColor3ub((byte) 255, (byte) 255, (byte) 255);
+ }
}
}