diff --git a/common/mekanism/client/gui/GuiFactory.java b/common/mekanism/client/gui/GuiFactory.java index a5b4f67ce..e26ee7faa 100644 --- a/common/mekanism/client/gui/GuiFactory.java +++ b/common/mekanism/client/gui/GuiFactory.java @@ -21,11 +21,11 @@ public class GuiFactory extends GuiMekanism public GuiFactory(InventoryPlayer inventory, TileEntityFactory tentity) { super(new ContainerFactory(inventory, tentity)); - xSize+=26; tileEntity = tentity; guiElements.add(new GuiRedstoneControl(this, tileEntity, tileEntity.tier.guiLocation)); guiElements.add(new GuiUpgradeManagement(this, tileEntity, tileEntity.tier.guiLocation)); + guiElements.add(new GuiRecipeType(this, tileEntity, tileEntity.tier.guiLocation)); } @Override @@ -42,7 +42,7 @@ public class GuiFactory extends GuiMekanism if(xAxis >= 165 && xAxis <= 169 && yAxis >= 17 && yAxis <= 69) { - drawCreativeTabHoveringText(ElectricityDisplay.getDisplayShort((float)tileEntity.electricityStored, ElectricUnit.JOULES), xAxis, yAxis); + drawCreativeTabHoveringText(ElectricityDisplay.getDisplayShort(tileEntity.getEnergyStored(), ElectricUnit.JOULES), xAxis, yAxis); } } @@ -65,9 +65,6 @@ public class GuiFactory extends GuiMekanism displayInt = tileEntity.getScaledEnergyLevel(52); drawTexturedModalRect(guiWidth + 165, guiHeight + 17 + 52 - displayInt, 176 + 26, 52 - displayInt, 4, displayInt); - displayInt = tileEntity.getScaledRecipeProgress(15); - drawTexturedModalRect(guiWidth + 181, guiHeight + 94, 176 + 26, 86, 10, displayInt); - if(tileEntity.tier == FactoryTier.BASIC) { for(int i = 0; i < tileEntity.tier.processes; i++) diff --git a/common/mekanism/client/gui/GuiRecipeType.java b/common/mekanism/client/gui/GuiRecipeType.java new file mode 100644 index 000000000..99d20cbb4 --- /dev/null +++ b/common/mekanism/client/gui/GuiRecipeType.java @@ -0,0 +1,69 @@ +package mekanism.client.gui; + +import mekanism.common.tileentity.TileEntityFactory; +import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +public class GuiRecipeType extends GuiElement +{ + public GuiRecipeType(GuiContainer gui, TileEntity tile, ResourceLocation def) + { + super(MekanismUtils.getResource(ResourceType.GUI, "GuiRecipeType.png"), gui, tile, def); + } + + @Override + public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight) + { + mc.renderEngine.bindTexture(RESOURCE); + + guiContainer.drawTexturedModalRect(guiWidth + 176, guiHeight + 70, 0, 0, 26, 63); + + TileEntityFactory factory = (TileEntityFactory)tileEntity; + int displayInt = factory.getScaledRecipeProgress(15); + + guiContainer.drawTexturedModalRect(guiWidth + 181, guiHeight + 94, 26, 0, 10, displayInt); + + mc.renderEngine.bindTexture(defaultLocation); + } + + @Override + public void renderForeground(int xAxis, int yAxis) + { + + } + + @Override + public void preMouseClicked(int xAxis, int yAxis, int button) + { + if(button == 0) + { + if(xAxis >= 180 && xAxis <= 196 && yAxis >= 75 && yAxis <= 91) + { + offsetX(26); + } + else if(xAxis >= 180 && xAxis <= 196 && yAxis >= 112 && yAxis <= 128) + { + offsetX(26); + } + } + } + + @Override + public void mouseClicked(int xAxis, int yAxis, int button) + { + if(button == 0) + { + if(xAxis >= 180 && xAxis <= 196 && yAxis >= 75 && yAxis <= 91) + { + offsetX(-26); + } + else if(xAxis >= 180 && xAxis <= 196 && yAxis >= 112 && yAxis <= 128) + { + offsetX(-26); + } + } + } +} diff --git a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java index 6bc89fba6..e484e4428 100644 --- a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java +++ b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java @@ -86,13 +86,13 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler InfuseType type = ((CachedIORecipe)arecipes.get(i)).infusionType; float f = ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F; - drawProgressBar(67, 32, 176 + 26, 52, 32, 8, f, 0); + drawProgressBar(67, 32, 176, 52, 32, 8, f, 0); f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F; if(ticksPassed < 20) f = 0.0F; f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; - drawProgressBar(160, 2, 176 + 26, 0, 4, 52, f, 3); + drawProgressBar(160, 2, 176, 0, 4, 52, f, 3); changeTexture(type.texture); drawProgressBar(2, 2, type.texX, type.texY, 4, 52, f, 3); diff --git a/resources/assets/mekanism/gui/GuiRecipeType.png b/resources/assets/mekanism/gui/GuiRecipeType.png new file mode 100644 index 000000000..eeaf1d895 Binary files /dev/null and b/resources/assets/mekanism/gui/GuiRecipeType.png differ diff --git a/resources/assets/mekanism/gui/factory/GuiAdvancedFactory.png b/resources/assets/mekanism/gui/factory/GuiAdvancedFactory.png index 01cf54bed..0cc4ae859 100644 Binary files a/resources/assets/mekanism/gui/factory/GuiAdvancedFactory.png and b/resources/assets/mekanism/gui/factory/GuiAdvancedFactory.png differ diff --git a/resources/assets/mekanism/gui/factory/GuiBasicFactory.png b/resources/assets/mekanism/gui/factory/GuiBasicFactory.png index 013e62974..efec70a85 100644 Binary files a/resources/assets/mekanism/gui/factory/GuiBasicFactory.png and b/resources/assets/mekanism/gui/factory/GuiBasicFactory.png differ diff --git a/resources/assets/mekanism/gui/factory/GuiEliteFactory.png b/resources/assets/mekanism/gui/factory/GuiEliteFactory.png index 1dc546e0e..b88894cbf 100644 Binary files a/resources/assets/mekanism/gui/factory/GuiEliteFactory.png and b/resources/assets/mekanism/gui/factory/GuiEliteFactory.png differ