diff options
Diffstat (limited to 'src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java')
-rw-r--r-- | src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index 35da96918f..3fdefd07d9 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -12,7 +12,6 @@ import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.GuiColors; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; @@ -23,14 +22,17 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_WithAlt; import gregtech.api.util.GT_Utility; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.IResource; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import org.lwjgl.opengl.GL11; import java.awt.*; +import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -47,7 +49,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 GuiColors textColor = GuiColors.NEIText; + private String mRecipeName; static { GuiContainerManager.addInputHandler(new GT_RectHandler()); @@ -65,10 +67,6 @@ public class GT_NEI_AssLineHandler extends RecipeMapHandler { return result; } - public static void drawText(int aX, int aY, String aString, int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); - } - @Override public TemplateRecipeHandler newInstance() { NEI_GT_Config.ALH=new GT_NEI_AssLineHandler(this.mRecipeMap); @@ -201,7 +199,11 @@ public class GT_NEI_AssLineHandler extends RecipeMapHandler { @Override public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); + if (mRecipeName == null) { + mRecipeName = GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); + updateOverrideTextColor(); + } + return mRecipeName; } @Override @@ -245,66 +247,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.getColor()); - drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", textColor.getColor()); + drawText(10, 73, trans("152","Total: ") + GT_Utility.formatNumbers((long) tDuration * tEUt) + " EU", 0xFF000000); + drawText(10, 83, trans("153","Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", 0xFF000000); 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.getColor()); + drawText(10, 93, trans("154", "Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU", 0xFF000000); } else { - drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU (" + GT_Values.VN[tier] + ")", textColor.getColor()); + drawText(10, 93, trans("154","Voltage: ") + GT_Utility.formatNumbers(voltage) + " EU (" + GT_Values.VN[tier] + ")", 0xFF000000); } - drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), textColor.getColor()); + drawText(10, 103, trans("155","Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), 0xFF000000); } else { - drawText(10, 93, trans("156","Voltage: unspecified"), textColor.getColor()); - drawText(10, 103, trans("157","Amperage: unspecified"), textColor.getColor()); + drawText(10, 93, trans("156","Voltage: unspecified"), 0xFF000000); + drawText(10, 103, trans("157","Amperage: unspecified"), 0xFF000000); } } if (tDuration > 0) { - drawText(10, 113, trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + trans("161"," secs"), textColor.getColor()); + drawText(10, 113, trans("158","Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + trans("161"," secs"), 0xFF000000); } 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.getColor()); + drawText(10, 123, trans("159","Needs Low Gravity"), 0xFF000000); specialDrew = true; } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) { - drawText(10, 123, trans("160","Needs Cleanroom"), textColor.getColor()); + drawText(10, 123, trans("160","Needs Cleanroom"), 0xFF000000); specialDrew = true; } else if (tSpecial == -201) { - drawText(10, 123, trans("206","Scan for Assembly Line"), textColor.getColor()); + drawText(10, 123, trans("206","Scan for Assembly Line"), 0xFF000000); 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.getColor()); + drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, 0xFF000000); 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.getColor()); + drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("226", "Original Recipe by: ") + recipe.owners.get(0).getName(), 0xFF000000); 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.getColor()); + drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("227", "Modified by: ") + recipe.owners.get(i).getName(), 0xFF000000); 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.getColor()); + drawText(10, y, EnumChatFormatting.ITALIC + GT_Utility.trans("225", "Recipe by: ") + recipe.owners.get(0).getName(), 0xFF000000); y += 10; } } if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null && !recipe.stackTraces.isEmpty()) { - drawText(10, y, "stackTrace:", textColor.getColor()); + drawText(10, y, "stackTrace:", 0xFF000000); y += 10; for (StackTraceElement stackTrace : recipe.stackTraces.get(0)) { - drawText(10, y, stackTrace.toString(), textColor.getColor()); + drawText(10, y, stackTrace.toString(), 0xFF000000); y += 10; } } } else { int i = 0; for (String descLine : recipeDesc) { - drawText(10, 73 + 10 * i, descLine, textColor.getColor()); + drawText(10, 73 + 10 * i, descLine, 0xFF000000); i++; } } |