diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-08-14 14:54:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-14 08:54:42 +0200 |
commit | cb9274cacbed31df2169438c2d0ffcb2bb9471b6 (patch) | |
tree | 607e4e6955c72364eaf45fe5a49824111f57baa6 /src/main | |
parent | 35c9f23b9c7667250ebd589a52c2f2b1cc01bb62 (diff) | |
download | GT5-Unofficial-cb9274cacbed31df2169438c2d0ffcb2bb9471b6.tar.gz GT5-Unofficial-cb9274cacbed31df2169438c2d0ffcb2bb9471b6.tar.bz2 GT5-Unofficial-cb9274cacbed31df2169438c2d0ffcb2bb9471b6.zip |
do not cache result of GuiColors if the object is not short-lived (#1254)
Diffstat (limited to 'src/main')
21 files changed, 62 insertions, 63 deletions
diff --git a/src/main/java/gregtech/api/enums/GuiColors.java b/src/main/java/gregtech/api/enums/GuiColors.java index a78dee5cf3..8c0a32954a 100644 --- a/src/main/java/gregtech/api/enums/GuiColors.java +++ b/src/main/java/gregtech/api/enums/GuiColors.java @@ -78,6 +78,7 @@ public enum GuiColors { GuiColors(final int hex) { this.defaultColor = hex; + this.color = hex; } public void reload(Function<String, String> l) { 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 4fd00840ae..8a33007caa 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -28,8 +28,6 @@ public class GT_Cover_Arm extends GT_CoverBehavior { protected static final int SLOT_ID_MIN = 0; protected static final int CONVERTED_BIT = 0x80000000; - private final int textColor = GuiColors.coverArm.getColor(); - public GT_Cover_Arm(int aTickRate) { this.mTickRate = aTickRate; } @@ -249,6 +247,8 @@ public class GT_Cover_Arm extends GT_CoverBehavior { private final int maxIntSlot, maxAdjSlot; + private final int textColor = GuiColors.coverArm.getColor(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; 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 3a4fb3a50a..fce84264ee 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -18,9 +18,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class GT_Cover_ControlsWork extends GT_CoverBehavior { - - private final int textColor = GuiColors.coverControlsWork.getColor(); - @Override public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { if (!makeSureOnlyOne(aSide, aTileEntity)) return 0; @@ -165,6 +162,8 @@ 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(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; 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 4c41909b14..2d9a59116b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -21,8 +21,6 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { public final int mTickRate; private final int mMaxStacks; - private final int textColor = GuiColors.coverPlayerDetector.getColor(); - public GT_Cover_Conveyor(int aTickRate) { this.mTickRate = aTickRate; this.mMaxStacks = 1; @@ -163,6 +161,8 @@ 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(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; 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 6043ccb472..b64ba83fe1 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -16,9 +16,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; public class GT_Cover_DoesWork extends GT_CoverBehavior { - - private final int textColor = GuiColors.coverDoesWork.getColor(); - @Override public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; @@ -124,6 +121,8 @@ 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(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; 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 292697be38..0c99f8b4c8 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -30,9 +30,6 @@ import javax.annotation.Nullable; import java.util.function.Function; public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMeterData> { - - private final int textColor = GuiColors.coverEUMeter.getColor(); - public GT_Cover_EUMeter() { super(EUMeterData.class); } @@ -376,6 +373,8 @@ public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMe private final String INVERTED = GT_Utility.trans("INVERTED", "Inverted"); private final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); + private final int textColor = GuiColors.coverEUMeter.getColor(); + public GUI(byte aSide, int aCoverID, EUMeterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java index 1051539314..c8828aa026 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java @@ -50,9 +50,6 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehaviorBase<GT_Cover_Fluid private static final int TICK_RATE_BITMASK = (TICK_RATE_MAX - TICK_RATE_MIN) << SPEED_LENGTH; public final int mTransferRate; - private final int - textColor = GuiColors.coverFluidRegulator.getColor(), - textColorWarn = GuiColors.coverFluidRegulatorWarn.getColor(); private boolean allowFluid = false; public GT_Cover_FluidRegulator(int aTransferRate) { @@ -360,6 +357,10 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehaviorBase<GT_Cover_Fluid private boolean warn = false; + private final int + textColor = GuiColors.coverFluidRegulator.getColor(), + textColorWarn = GuiColors.coverFluidRegulatorWarn.getColor(); + public GUI(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index a809ebd206..004d459bad 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -41,10 +41,6 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil private final int ANY_INPUT_FILTER_OUTPUT = 6; // 110 private final int ANY_INPUT_INVERT_OUTPUT = 7; // 111 - private final int - textColor = GuiColors.coverFluidFilter.getColor(), - textColorFluidFilterName = GuiColors.coverFluidFilterName.getColor(); - public GT_Cover_Fluidfilter() { super(FluidFilterData.class); } @@ -209,6 +205,10 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil private static final int spaceX = 18; private static final int spaceY = 18; + private final int + textColor = GuiColors.coverFluidFilter.getColor(), + textColorFluidFilterName = GuiColors.coverFluidFilterName.getColor(); + public GT_FluidFilterGUICover(byte aSide, int aCoverID, FluidFilterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java index d1130c35ed..ef13e7c0aa 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java @@ -35,7 +35,6 @@ import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilter.ItemFilterData> { private final boolean mExport; - private final int textColor = GuiColors.coverItemFilter.getColor(); public GT_Cover_ItemFilter(boolean isExport) { super(ItemFilterData.class); @@ -221,6 +220,8 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte private static final int spaceX = 18; private static final int spaceY = 18; + private final int textColor = GuiColors.coverItemFilter.getColor(); + public GUI(byte aSide, int aCoverID, ItemFilterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index b51ffff486..a157377315 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -39,8 +39,6 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. private static final int CONVERTED_BIT = 0x80000000; private static final int INVERT_BIT = 0x40000000; - private final int textColor = GuiColors.coverItemMeter.getColor(); - public GT_Cover_ItemMeter() { super(ItemMeterData.class); } @@ -290,6 +288,8 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. private final String INVERTED = GT_Utility.trans("INVERTED", "Inverted"); private final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); + private final int textColor = GuiColors.coverItemMeter.getColor(); + public GUI(byte aSide, int aCoverID, ItemMeterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index a9590d8c5c..40a10ad28b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -30,8 +30,6 @@ import java.util.Arrays; public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMeter.LiquidMeterData> { - private final int textColor = GuiColors.coverLiquidMeter.getColor(); - public GT_Cover_LiquidMeter() { super(LiquidMeterData.class); } @@ -234,6 +232,8 @@ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMe private final String INVERTED = GT_Utility.trans("INVERTED", "Inverted"); private final String NORMAL = GT_Utility.trans("NORMAL", "Normal"); + private final int textColor = GuiColors.coverLiquidMeter.getColor(); + public GUI(byte aSide, int aCoverID, LiquidMeterData aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index ef2fb2e23b..e7b3f15c86 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -19,9 +19,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { - - private final int textColor = GuiColors.coverMaintenance.getColor(); - private boolean isRotor(ItemStack aRotor) { return !(aRotor == null || !(aRotor.getItem() instanceof GT_MetaGenerated_Tool) || aRotor.getItemDamage() < 170 || aRotor.getItemDamage() > 176); } @@ -210,6 +207,8 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; + private final int textColor = GuiColors.coverMaintenance.getColor(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index dca0e826bf..1ba0a97c50 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -19,8 +19,6 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { private String placer = ""; private int range = 8; - private final int textColor = GuiColors.coverPlayerDetector.getColor(); - @Override public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { @@ -145,6 +143,8 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; + private final int textColor = GuiColors.coverPlayerDetector.getColor(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index 96ea7b205e..ba71d7bd52 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -19,7 +19,6 @@ import net.minecraftforge.fluids.IFluidHandler; public class GT_Cover_Pump extends GT_CoverBehavior{ public final int mTransferRate; - private final int textColor = GuiColors.coverPump.getColor(); public GT_Cover_Pump(int aTransferRate) { this.mTransferRate = aTransferRate; @@ -187,6 +186,8 @@ public class GT_Cover_Pump extends GT_CoverBehavior{ private static final int spaceX = 18; private static final int spaceY = 18; + private final int textColor = GuiColors.coverPump.getColor(); + public GT_PumpGUICover(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index edfd8c51fb..1f6f40a008 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -24,8 +24,6 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { private static final int PUBLIC_MASK = 0x0000FFFF; private static final int CHECKBOX_MASK = 0x00010000; - private final int textColor = GuiColors.coverRedstoneWirelessBase.getColor(); - @Override public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { GregTech_API.sWirelessRedstone.put(aCoverVariable, (byte) 0); @@ -162,6 +160,7 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; + private final int textColor = GuiColors.coverRedstoneWirelessBase.getColor(); 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_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index 48c8846cd6..06c31f7ffe 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -17,8 +17,6 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_Shutter extends GT_CoverBehavior { - private final int textColor = GuiColors.coverShutter.getColor(); - @Override public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { return false; @@ -129,6 +127,8 @@ public class GT_Cover_Shutter extends GT_CoverBehavior { private static final int spaceX = 18; private static final int spaceY = 18; + private final int textColor = GuiColors.coverShutter.getColor(); + public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { super(aTileEntity, 176, 107, GT_Utility.intToStack(aCoverID)); this.side = aSide; diff --git a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java index 92921ecbe9..76a475a1a5 100644 --- a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java +++ b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java @@ -17,7 +17,7 @@ import org.lwjgl.opengl.GL11; @SideOnly(cpw.mods.fml.relauncher.Side.CLIENT) public class GT_FluidDisplayStackRenderer implements IItemRenderer { - private final int textColor = GuiColors.fluidDisplayStackRenderer.getColor(); + private final GuiColors textColor = GuiColors.fluidDisplayStackRenderer; public GT_FluidDisplayStackRenderer() { MinecraftForgeClient.registerItemRenderer(ItemList.Display_Fluid.getItem(), this); @@ -92,7 +92,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, true); + fontRender.drawString( amountString, 0, (int) (16/smallTextScale) - fontRender.FONT_HEIGHT + 1, textColor.getColor(), 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 e8478913a1..e385bd7686 100644 --- a/src/main/java/gregtech/common/render/GT_PollutionRenderer.java +++ b/src/main/java/gregtech/common/render/GT_PollutionRenderer.java @@ -47,7 +47,7 @@ public class GT_PollutionRenderer { private static final short[] liquidColor = {160, 200, 10}; private static final short[] foliageColor = {160, 80, 15}; - private final int textColor = GuiColors.pollutionRenderer.getColor(); + private final GuiColors textColor = GuiColors.pollutionRenderer; //TODO need to soft update some blocks, grass and leaves does more often than liquid it looks like. @@ -248,7 +248,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); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, 0, off, textColor.getColor()); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); } diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index df4c61dee7..35da96918f 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -47,7 +47,7 @@ public class GT_NEI_AssLineHandler extends RecipeMapHandler { * Can be referenced from cached recipes. */ public static int cycleTicksStatic = Math.abs((int) System.currentTimeMillis()); - private final int textColor = GuiColors.NEIText.getColor(); + private final GuiColors textColor = GuiColors.NEIText; static { GuiContainerManager.addInputHandler(new GT_RectHandler()); @@ -245,66 +245,66 @@ public class GT_NEI_AssLineHandler extends RecipeMapHandler { String[] recipeDesc = recipe.getNeiDesc(); if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, 73, trans("152","Total: ") + GT_Utility.formatNumbers((long) tDuration * tEUt) + " EU", textColor); - drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", textColor); + drawText(10, 73, trans("152","Total: ") + GT_Utility.formatNumbers((long) tDuration * tEUt) + " EU", textColor.getColor()); + drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", textColor.getColor()); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { int voltage = tEUt / this.mRecipeMap.mAmperage; byte tier = GT_Utility.getTier(voltage); if (tier < 0 || tier >= 16) { - drawText(10, 93, trans("154", "Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU", textColor); + drawText(10, 93, trans("154", "Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU", textColor.getColor()); } else { - drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU (" + GT_Values.VN[tier] + ")", textColor); + drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU (" + GT_Values.VN[tier] + ")", textColor.getColor()); } - drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), textColor); + drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), textColor.getColor()); } else { - drawText(10, 93, trans("156","Voltage: unspecified"), textColor); - drawText(10, 103, trans("157","Amperage: unspecified"), textColor); + drawText(10, 93, trans("156","Voltage: unspecified"), textColor.getColor()); + drawText(10, 103, trans("157","Amperage: unspecified"), textColor.getColor()); } } if (tDuration > 0) { - drawText(10, 113, trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + trans("161"," secs"), textColor); + drawText(10, 113, trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + trans("161"," secs"), textColor.getColor()); } int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; boolean specialDrew = false; if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) { - drawText(10, 123, trans("159","Needs Low Gravity"), textColor); + drawText(10, 123, trans("159","Needs Low Gravity"), textColor.getColor()); specialDrew = true; } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, 123, trans("160","Needs Cleanroom"), textColor); + drawText(10, 123, trans("160","Needs Cleanroom"), textColor.getColor()); specialDrew = true; } else if (tSpecial == -201) { - drawText(10, 123, trans("206","Scan for Assembly Line"), textColor); + drawText(10, 123, trans("206","Scan for Assembly Line"), textColor.getColor()); specialDrew = true; } else if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, textColor); + drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, textColor.getColor()); specialDrew = true; } int y = 123 + (specialDrew ? 10 : 0); if (GT_Mod.gregtechproxy.mNEIRecipeOwner) { if (recipe.owners.size() > 1) { - drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("226", "Original Recipe by: ") + recipe.owners.get(0).getName(), textColor); + drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("226", "Original Recipe by: ") + recipe.owners.get(0).getName(), textColor.getColor()); y += 10; for (int i = 1; i < recipe.owners.size(); i++) { - drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("227", "Modified by: ") + recipe.owners.get(i).getName(), textColor); + drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("227", "Modified by: ") + recipe.owners.get(i).getName(), textColor.getColor()); y += 10; } } else if (recipe.owners.size() > 0) { - drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("225", "Recipe by: ") + recipe.owners.get(0).getName(), textColor); + drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("225", "Recipe by: ") + recipe.owners.get(0).getName(), textColor.getColor()); y += 10; } } if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null && !recipe.stackTraces.isEmpty()) { - drawText(10, y, "stackTrace:", textColor); + drawText(10, y, "stackTrace:", textColor.getColor()); y += 10; for (StackTraceElement stackTrace : recipe.stackTraces.get(0)) { - drawText(10, y, stackTrace.toString(), textColor); + drawText(10, y, stackTrace.toString(), textColor.getColor()); y += 10; } } } else { int i = 0; for (String descLine : recipeDesc) { - drawText(10, 73 + 10 * i, descLine, textColor); + drawText(10, 73 + 10 * i, descLine, textColor.getColor()); i++; } } diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java index af40dcadd2..bda4ac8c31 100644 --- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -69,7 +69,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { private String mRecipeName; // Name of the handler displayed on top private NEIHandlerAbsoluteTooltip mRecipeNameTooltip; private static final int RECIPE_NAME_WIDTH = 140; - private final int textColor = GuiColors.NEIText.getColor(); + private final GuiColors textColor = GuiColors.NEIText; /** * Static version of {@link TemplateRecipeHandler#cycleticks}. @@ -524,7 +524,7 @@ public class GT_NEI_DefaultHandler extends RecipeMapHandler { } protected void drawLine(int lineNumber, String line) { - drawText(10, getDescriptionYOffset() + lineNumber * 10, line, textColor); + drawText(10, getDescriptionYOffset() + lineNumber * 10, line, textColor.getColor()); } protected int getDescriptionYOffset() { diff --git a/src/main/resources/assets/gregtech/textures/guiColors.json b/src/main/resources/assets/gregtech/textures/guiColors.json index e8fe4f7701..7f11786e4f 100644 --- a/src/main/resources/assets/gregtech/textures/guiColors.json +++ b/src/main/resources/assets/gregtech/textures/guiColors.json @@ -32,7 +32,7 @@ "GT5U.gui.color.boiler": "404040", "GT5U.gui.color.bronzeBlastFurnace": "404040", - "GT5U.gui.color.fusionReactor": "FF00000", + "GT5U.gui.color.fusionReactor": "FF0000", "GT5U.gui.color.industrialApiary": "404040", "GT5U.gui.color.microwaveEnergyTransmitter": "FAFAFF", "GT5U.gui.color.primitiveBlastFurnace": "404040", @@ -48,7 +48,7 @@ "GT5U.gui.color.screenText": "FF222222", "GT5U.gui.color.NEIText": "FF000000", - + "GT5U.gui.color.coverArm": "FF555555", "GT5U.gui.color.coverControlsWork": "FF555555", "GT5U.gui.color.coverConveyor": "FF555555", @@ -66,4 +66,4 @@ "GT5U.gui.color.coverPump": "FF555555", "GT5U.gui.color.coverRedstoneWirelessBase": "FF555555", "GT5U.gui.color.coverShutter": "FF555555" -}
\ No newline at end of file +} |