Fixed minor GUI issues, recipe type interface is now a GuiElement
Oh, I'm not dead btw
|
@ -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++)
|
||||
|
|
69
common/mekanism/client/gui/GuiRecipeType.java
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
BIN
resources/assets/mekanism/gui/GuiRecipeType.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.3 KiB |