From 43c014a8db9ad4d44c19190718835a7596dc0a2d Mon Sep 17 00:00:00 2001 From: Albi <12825442+Flanisch@users.noreply.github.com> Date: Mon, 15 Aug 2022 21:27:24 +0200 Subject: Overriding GUI colors with .mcmeta (#1261) * Implemented gui textcolor override with .mcmeta files * cleanup * Added shared class to reduce code duplication * Moved #drawLine back to GT_NEI_DefaultHandler --- src/main/java/gregtech/common/GT_Client.java | 8 +++---- .../java/gregtech/common/covers/GT_Cover_Arm.java | 3 +-- .../common/covers/GT_Cover_ControlsWork.java | 3 +-- .../gregtech/common/covers/GT_Cover_Conveyor.java | 3 +-- .../gregtech/common/covers/GT_Cover_DoesWork.java | 3 +-- .../gregtech/common/covers/GT_Cover_EUMeter.java | 3 +-- .../common/covers/GT_Cover_FacadeBase.java | 10 +++++---- .../common/covers/GT_Cover_FluidLimiter.java | 4 ++-- .../common/covers/GT_Cover_FluidRegulator.java | 7 +++--- .../common/covers/GT_Cover_Fluidfilter.java | 11 +++++----- .../common/covers/GT_Cover_ItemFilter.java | 3 +-- .../gregtech/common/covers/GT_Cover_ItemMeter.java | 3 +-- .../common/covers/GT_Cover_LiquidMeter.java | 3 +-- .../common/covers/GT_Cover_NeedMaintainance.java | 3 +-- .../common/covers/GT_Cover_PlayerDetector.java | 3 +-- .../java/gregtech/common/covers/GT_Cover_Pump.java | 3 +-- .../covers/GT_Cover_RedstoneWirelessBase.java | 3 +-- .../gregtech/common/covers/GT_Cover_Shutter.java | 3 +-- .../common/gui/GT_GUIContainer_Boiler.java | 3 +-- .../gui/GT_GUIContainer_BronzeBlastFurnace.java | 3 +-- .../common/gui/GT_GUIContainer_FusionReactor.java | 25 ++++++++++++---------- .../gui/GT_GUIContainer_IndustrialApiary.java | 13 +++++------ ...GT_GUIContainer_MicrowaveEnergyTransmitter.java | 7 +++--- .../common/gui/GT_GUIContainer_OutputHatch.java | 20 +++++++---------- .../gui/GT_GUIContainer_PrimitiveBlastFurnace.java | 3 +-- .../common/gui/GT_GUIContainer_QuantumChest.java | 12 +++++------ .../common/gui/GT_GUIContainer_Regulator.java | 3 +-- .../common/gui/GT_GUIContainer_Teleporter.java | 7 +++--- .../render/GT_FluidDisplayStackRenderer.java | 5 +---- .../common/render/GT_PollutionRenderer.java | 5 +---- 30 files changed, 81 insertions(+), 104 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 0d2a76731b..f849da7594 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -27,6 +27,8 @@ import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.net.GT_Packet_ClientPreference; import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.ColorsMetadataSection; +import gregtech.api.util.ColorsMetadataSectionSerializer; import gregtech.api.util.GT_ClientPreference; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_PlayedSound; @@ -39,7 +41,6 @@ import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.net.MessageUpdateFluidDisplayItem; import gregtech.common.render.*; import gregtech.loaders.ExtraIcons; -import gregtech.loaders.misc.GT_JsonLoader; import gregtech.loaders.preload.GT_PreLoad; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; @@ -401,10 +402,7 @@ public class GT_Client extends GT_Proxy super.onPreLoad(); MinecraftForge.EVENT_BUS.register(new ExtraIcons()); - GT_Mod.jsonGuiColors = new GT_JsonLoader("textures/guiColors.json"); - for (GuiColors value : GuiColors.values()) { - GT_Mod.jsonGuiColors.registerReloadListener(l -> value.reload(l::getString)); - } + Minecraft.getMinecraft().getResourcePackRepository().rprMetadataSerializer.registerMetadataSectionType(new ColorsMetadataSectionSerializer(), ColorsMetadataSection.class); final String[] arr = { "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", "leagris", diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index 8a33007caa..23802851c7 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -1,7 +1,6 @@ package gregtech.common.covers; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiFakeItemButton; import gregtech.api.gui.widgets.GT_GuiIcon; @@ -247,7 +246,7 @@ public class GT_Cover_Arm extends GT_CoverBehavior { private final int maxIntSlot, maxAdjSlot; - private final int textColor = GuiColors.coverArm.getColor(); + private final int textColor = this.getTextColorOrDefault("text", 0xFF555555); public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index fce84264ee..dd2b17df05 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -1,7 +1,6 @@ package gregtech.common.covers; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; @@ -162,7 +161,7 @@ public class GT_Cover_ControlsWork extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; - private final int textColor = GuiColors.coverControlsWork.getColor(); + private final int textColor = this.getTextColorOrDefault("text", 0xFF555555); public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 2d9a59116b..9e0fd84a6c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -1,7 +1,6 @@ package gregtech.common.covers; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; @@ -161,7 +160,7 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; - private final int textColor = GuiColors.coverPlayerDetector.getColor(); + private final int textColor = this.getTextColorOrDefault("text", 0xFF555555); public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index b64ba83fe1..366b896d45 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -1,7 +1,6 @@ package gregtech.common.covers; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; @@ -121,7 +120,7 @@ public class GT_Cover_DoesWork extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; - private final int textColor = GuiColors.coverDoesWork.getColor(); + private final int textColor = this.getTextColorOrDefault("text", 0xFF555555); public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index 0c99f8b4c8..1f59049828 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -2,7 +2,6 @@ package gregtech.common.covers; import com.google.common.io.ByteArrayDataInput; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; @@ -373,7 +372,7 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase 160000000 && this.mContainer.mEnergy < 160010000) - fontRendererObj.drawString("160,000,000 EU", 50, 155, textColor); + fontRendererObj.drawString("160,000,000 EU", 50, 155, textColorValue); else if(this.mContainer.mEnergy > 320000000 && this.mContainer.mEnergy < 320010000) - fontRendererObj.drawString("320,000,000 EU", 50, 155, textColor); + fontRendererObj.drawString("320,000,000 EU", 50, 155, textColorValue); else if(this.mContainer.mEnergy > 640000000 && this.mContainer.mEnergy < 640010000) - fontRendererObj.drawString("640,000,000 EU", 50, 155, textColor); + fontRendererObj.drawString("640,000,000 EU", 50, 155, textColorValue); else if(this.mContainer.mEnergyLong > 5120000000L && this.mContainer.mEnergyLong < 5120080000L) - fontRendererObj.drawString("5,120,000,000 EU", 50, 155, textColor); + fontRendererObj.drawString("5,120,000,000 EU", 50, 155, textColorValue); else - fontRendererObj.drawString(GT_Utility.formatNumbers(this.mContainer.mEnergyLong) + " EU", 50, 155, textColor); + fontRendererObj.drawString(GT_Utility.formatNumbers(this.mContainer.mEnergyLong) + " EU", 50, 155, textColorValue); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java index 18909b7013..9b0de5ba81 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java @@ -2,7 +2,6 @@ package gregtech.common.gui; import forestry.api.apiculture.*; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.gui.widgets.GT_GuiSlotTooltip; import gregtech.api.gui.widgets.GT_GuiTooltip; @@ -19,7 +18,6 @@ import java.util.Arrays; public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Machine { - private static final String BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", @@ -32,9 +30,12 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma INFO_TOOLTIP = "GT5U.machines.industrialapiary.info.tooltip", INFO_WITH_BEE_TOOLTIP = "GT5U.machines.industrialapiary.infoextended.tooltip", UPGRADE_TOOLTIP = "GT5U.machines.industrialapiary.upgradeslot.tooltip" - ; + ; - private final int textColor = GuiColors.industrialApiary.getColor(); + private final int + textColor = this.getTextColorOrDefault("text", 0x404040), + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0x404040); GT_GuiTooltip mErrorStatesTooltip; GT_GuiTooltip mSpeedToggleTooltip; @@ -117,9 +118,9 @@ public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Ma @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRendererObj.drawString("Ind. Apiary", 8, 4, textColor); + this.fontRendererObj.drawString("Ind. Apiary", 8, 4, textColorTitle); this.fontRendererObj.drawString("x", 30, 63, textColor); - this.fontRendererObj.drawString((1 << getContainer().mSpeed) + "", 26, 72, textColor); + this.fontRendererObj.drawString((1 << getContainer().mSpeed) + "", 26, 72, textColorValue); } @Override diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java index d75ea5c9ec..9421441f22 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java @@ -1,6 +1,5 @@ package gregtech.common.gui; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -10,7 +9,9 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_MicrowaveEnergyTransmitter extends GT_GUIContainerMetaTile_Machine { - private final int textColor = GuiColors.microwaveEnergyTransmitter.getColor(); + private final int + textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); public GT_GUIContainer_MicrowaveEnergyTransmitter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_MicrowaveEnergyTransmitter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); @@ -18,7 +19,7 @@ public class GT_GUIContainer_MicrowaveEnergyTransmitter extends GT_GUIContainerM @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - this.fontRendererObj.drawString("Teleporter", 46, 8, 16448255); + this.fontRendererObj.drawString("Teleporter", 46, 8, textColorTitle); if (this.mContainer != null) { this.fontRendererObj.drawString("X: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetX), 46, 16, textColor); this.fontRendererObj.drawString("Y: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter) this.mContainer).mTargetY), 46, 24, textColor); diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java index 33bac13be6..789e11e6f1 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java @@ -5,7 +5,6 @@ import codechicken.nei.api.INEIGuiHandler; import codechicken.nei.api.TaggedInventoryArea; import cpw.mods.fml.common.Optional; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.net.GT_Packet_SetLockedFluid; @@ -26,12 +25,9 @@ public class GT_GUIContainer_OutputHatch extends GT_GUIContainerMetaTile_Machine private final String mName; private final int - textColorTitle = GuiColors.outputHatchTitle.getColor(), - textColorInventory = GuiColors.outputHatchInventory.getColor(), - textColorAmount = GuiColors.outputHatchAmount.getColor(), - textColorAmountValue = GuiColors.outputHatchValue.getColor(), - textColorFluidName = GuiColors.outputHatchFluidName.getColor(), - textColorLockedFluid = GuiColors.outputHatchLockedFluid.getColor(); + textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); public GT_GUIContainer_OutputHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super(new GT_Container_OutputHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "OutputHatch.png"); @@ -40,15 +36,15 @@ public class GT_GUIContainer_OutputHatch extends GT_GUIContainerMetaTile_Machine @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorInventory); + fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); fontRendererObj.drawString(mName, 8, 6, textColorTitle); if (mContainer != null) { - fontRendererObj.drawString("Liquid Amount", 10, 20, textColorAmount); - fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_OutputHatch) mContainer).mContent), 10, 30, textColorAmountValue); - fontRendererObj.drawString("Locked Fluid", 101, 20, textColorAmount); + fontRendererObj.drawString("Liquid Amount", 10, 20, textColor); + fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_OutputHatch) mContainer).mContent), 10, 30, textColorValue); + fontRendererObj.drawString("Locked Fluid", 101, 20, textColor); ItemStack tLockedDisplayStack = (ItemStack) mContainer.getInventory().get(3); String fluidName = tLockedDisplayStack == null ? "None" : tLockedDisplayStack.getDisplayName(); - fontRendererObj.drawString(fluidName, 101, 30, textColorFluidName); + fontRendererObj.drawString(fluidName, 101, 30, textColorValue); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java index dfd1e61aa9..eff12be29a 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java @@ -1,6 +1,5 @@ package gregtech.common.gui; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiTabLine.GT_GuiTabIconSet; @@ -18,7 +17,7 @@ public class GT_GUIContainer_PrimitiveBlastFurnace extends GT_GUIContainerMetaTi GT_GuiIcon.TAB_NORMAL_BRICK, GT_GuiIcon.TAB_HIGHLIGHT_BRICK, GT_GuiIcon.TAB_DISABLED_BRICK); - private final int textColor = GuiColors.primitiveBlastFurnace.getColor(); + private final int textColor = this.getTextColorOrDefault("title", 0x404040); public GT_GUIContainer_PrimitiveBlastFurnace(InventoryPlayer inventoryPlayer, IGregTechTileEntity tileEntity, String name, String aNEI) { diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java index 370c71fed9..51086d3cfd 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java @@ -1,6 +1,5 @@ package gregtech.common.gui; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -12,9 +11,10 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_QuantumChest extends GT_GUIContainerMetaTile_Machine { private final String mName; - private final int - textColorTitle = GuiColors.quantumChestTitle.getColor(), - textColorAmount = GuiColors.quantumChestAmount.getColor(); + private final int + textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); public GT_GUIContainer_QuantumChest(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { @@ -27,8 +27,8 @@ public class GT_GUIContainer_QuantumChest extends GT_GUIContainerMetaTile_Machin fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); fontRendererObj.drawString(mName, 8, 6, textColorTitle); if (mContainer != null) { - fontRendererObj.drawString("Item Amount", 10, 20, textColorAmount); - fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_QuantumChest) mContainer).mContent), 10, 30, textColorAmount); + fontRendererObj.drawString("Item Amount", 10, 20, textColor); + fontRendererObj.drawString(GT_Utility.parseNumberToString(((GT_Container_QuantumChest) mContainer).mContent), 10, 30, textColorValue); } } diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java index 09fb48121e..6a02fc8bca 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java @@ -1,13 +1,12 @@ package gregtech.common.gui; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; public class GT_GUIContainer_Regulator extends GT_GUIContainerMetaTile_Machine { - private final int textColor = GuiColors.regulator.getColor(); + private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF); public GT_GUIContainer_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Regulator(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/Regulator.png"); diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java index efc4771b22..3d6aa6f966 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java @@ -1,6 +1,5 @@ package gregtech.common.gui; -import gregtech.api.enums.GuiColors; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -10,7 +9,9 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_Teleporter extends GT_GUIContainerMetaTile_Machine { - private final int textColor = GuiColors.teleporter.getColor(); + private final int + textColor = this.getTextColorOrDefault("text", 0xFAFAFF), + textColorTitle = this.getTextColorOrDefault("text", 0xFAFAFF); public GT_GUIContainer_Teleporter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_Teleporter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); @@ -18,7 +19,7 @@ public class GT_GUIContainer_Teleporter extends GT_GUIContainerMetaTile_Machine @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - this.fontRendererObj.drawString("Teleporter", 46, 8, 16448255); + this.fontRendererObj.drawString("Teleporter", 46, 8, textColorTitle); if (this.mContainer != null) { this.fontRendererObj.drawString("X: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetX), 46, 16, textColor); this.fontRendererObj.drawString("Y: " + GT_Utility.parseNumberToString(((GT_Container_Teleporter) this.mContainer).mTargetY), 46, 24, textColor); diff --git a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java index 76a475a1a5..c4e23eab6e 100644 --- a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java +++ b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java @@ -1,7 +1,6 @@ package gregtech.common.render; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GuiColors; import gregtech.api.enums.ItemList; import gregtech.common.items.GT_FluidDisplayItem; import net.minecraft.client.Minecraft; @@ -17,8 +16,6 @@ import org.lwjgl.opengl.GL11; @SideOnly(cpw.mods.fml.relauncher.Side.CLIENT) public class GT_FluidDisplayStackRenderer implements IItemRenderer { - private final GuiColors textColor = GuiColors.fluidDisplayStackRenderer; - public GT_FluidDisplayStackRenderer() { MinecraftForgeClient.registerItemRenderer(ItemList.Display_Fluid.getItem(), this); } @@ -92,7 +89,7 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { GL11.glDisable(GL11.GL_BLEND); GL11.glScalef(smallTextScale, smallTextScale, 1.0f); - fontRender.drawString( amountString, 0, (int) (16/smallTextScale) - fontRender.FONT_HEIGHT + 1, textColor.getColor(), true); + fontRender.drawString( amountString, 0, (int) (16/smallTextScale) - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true); GL11.glScalef(1f, 1f, 1f); GL11.glDisable(GL11.GL_ALPHA_TEST); } diff --git a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java index e385bd7686..5128af1c36 100644 --- a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -7,7 +7,6 @@ import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; -import gregtech.api.enums.GuiColors; import gregtech.common.entities.GT_EntityFXPollution; import gregtech.common.misc.GT_ClientPollutionMap; import net.minecraft.block.Block; @@ -47,8 +46,6 @@ public class GT_PollutionRenderer { private static final short[] liquidColor = {160, 200, 10}; private static final short[] foliageColor = {160, 80, 15}; - private final GuiColors textColor = GuiColors.pollutionRenderer; - //TODO need to soft update some blocks, grass and leaves does more often than liquid it looks like. public GT_PollutionRenderer() { @@ -248,7 +245,7 @@ public class GT_PollutionRenderer { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); - Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, 0, off, textColor.getColor()); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, 0, off, 0xFFFFFFFF); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); } -- cgit