More gui work. I've just noticed this all has screwed up NEI. I'll try to sort that later.

This commit is contained in:
Ben Spiers 2014-04-18 02:34:19 +01:00
parent e92843dccb
commit 95e8d2c5bb
47 changed files with 390 additions and 384 deletions

View file

@ -5,6 +5,8 @@ import java.util.List;
import mekanism.api.ListUtils;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
@ -46,6 +48,14 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity, tileEntity.guiLocation, 55, 52));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity, tileEntity.guiLocation, 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37));
}
@Override
@ -74,14 +84,8 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
int xAxis = mouseX - guiWidth;
int yAxis = mouseY - guiHeight;
int displayInt;
displayInt = tileEntity.getScaledProgress(24);
drawTexturedModalRect(guiWidth + 79, guiHeight + 39, 176, 0, displayInt + 1, 7);
if(tileEntity.getScaledGasLevel(12) > 0)
{
displayInt = tileEntity.getScaledGasLevel(12);

View file

@ -4,6 +4,7 @@ import java.util.List;
import mekanism.api.ListUtils;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.inventory.container.ContainerChanceMachine;
@ -43,14 +44,19 @@ public class GuiChanceMachine extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, tileEntity, tileEntity.guiLocation, 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37));
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
int xAxis = (mouseX - (width - xSize) / 2);
int yAxis = (mouseY - (height - ySize) / 2);
fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);

View file

@ -11,6 +11,8 @@ import mekanism.api.gas.GasTank;
import mekanism.api.gas.OreGas;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
@ -73,6 +75,15 @@ public class GuiChemicalCrystallizer extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 64).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 130, 56));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 51, 60));
}
@Override
@ -116,19 +127,6 @@ public class GuiChemicalCrystallizer extends GuiMekanism
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
int xAxis = mouseX - guiWidth;
int yAxis = mouseY - guiHeight;
int displayInt;
displayInt = tileEntity.getScaledProgress(48);
drawTexturedModalRect(guiWidth + 53, guiHeight + 61, 176, 63, displayInt, 8);
if(tileEntity.getScaledInputGasLevel(58) > 0)
{
displayGauge(6, 5, tileEntity.getScaledInputGasLevel(58), null, tileEntity.inputTank.getGas());
}
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
@ -218,55 +216,6 @@ public class GuiChemicalCrystallizer extends GuiMekanism
}
}
public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
if(fluid != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining));
}
else if(gas != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, gas.getGas().getIcon(), 16, 16 - (16 - renderRemaining));
}
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"));
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 4, 16, 59);
}
private void updateStackList(String oreName)
{
if(iterStacks == null)

View file

@ -3,19 +3,18 @@ package mekanism.client.gui;
import java.util.List;
import mekanism.api.ListUtils;
import mekanism.api.gas.GasStack;
import mekanism.api.gas.GasTank;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.inventory.container.ContainerChemicalDissolutionChamber;
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
@ -60,6 +59,15 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 25, 35));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 24).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 64).with(SlotOverlay.MINUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 62, 39));
}
@Override
@ -94,53 +102,4 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
if(fluid != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining));
}
else if(gas != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, gas.getGas().getIcon(), 16, 16 - (16 - renderRemaining));
}
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"));
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 4, 16, 59);
}
}

View file

@ -9,6 +9,8 @@ import mekanism.api.gas.GasStack;
import mekanism.api.gas.GasTank;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
@ -57,7 +59,7 @@ public class GuiChemicalInfuser extends GuiMekanism
@Override
public GasTank getTank()
{
return tileEntity.rightTank;
return tileEntity.centerTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@ -73,6 +75,22 @@ public class GuiChemicalInfuser extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 4, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 64).with(SlotOverlay.PLUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.SMALL_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 45, 38));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.SMALL_LEFT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 99, 38));
}
@Override
@ -96,12 +114,6 @@ public class GuiChemicalInfuser extends GuiMekanism
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
if(tileEntity.isActive)
{
drawTexturedModalRect(guiWidth + 47, guiHeight + 39, 176, 71, 28, 8);
drawTexturedModalRect(guiWidth + 101, guiHeight + 39, 176, 63, 28, 8);
}
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
@ -133,53 +145,4 @@ public class GuiChemicalInfuser extends GuiMekanism
}
}
}
public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
if(fluid != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining));
}
else if(gas != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, gas.getGas().getIcon(), 16, 16 - (16 - renderRemaining));
}
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"));
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 4, 16, 59);
}
}

View file

@ -6,6 +6,8 @@ import mekanism.api.ListUtils;
import mekanism.api.gas.GasTank;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.inventory.container.ContainerChemicalOxidizer;
@ -49,6 +51,15 @@ public class GuiChemicalOxidizer extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 25, 35));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 24).with(SlotOverlay.PLUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 62, 39));
}
@Override

View file

@ -11,6 +11,8 @@ import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiFluidGauge.IFluidInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiGauge.Type;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
@ -64,18 +66,26 @@ public class GuiChemicalWasher extends GuiMekanism
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 26, 13));
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 26, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 133, 13));
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 62, 38));
}
@Override
@ -95,11 +105,6 @@ public class GuiChemicalWasher extends GuiMekanism
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
if(tileEntity.isActive)
{
drawTexturedModalRect(guiWidth + 61, guiHeight + 39, 176, 63, 55, 8);
}
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
@ -124,52 +129,4 @@ public class GuiChemicalWasher extends GuiMekanism
}
}
public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
if(fluid != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining));
}
else if(gas != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, gas.getGas().getIcon(), 16, 16 - (16 - renderRemaining));
}
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"));
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 4, 16, 59);
}
}

View file

@ -4,6 +4,8 @@ import java.util.List;
import mekanism.api.ListUtils;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.inventory.container.ContainerElectricMachine;
@ -45,14 +47,19 @@ public class GuiElectricMachine extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity, tileEntity.guiLocation, 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37));
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
int xAxis = (mouseX - (width - xSize) / 2);
int yAxis = (mouseY - (height - ySize) / 2);
fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
@ -68,14 +75,6 @@ public class GuiElectricMachine extends GuiMekanism
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
int xAxis = mouseX - guiWidth;
int yAxis = mouseY - guiHeight;
int displayInt;
displayInt = tileEntity.getScaledProgress(24);
drawTexturedModalRect(guiWidth + 79, guiHeight + 39, 176, 0, displayInt + 1, 7);
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
}

View file

@ -47,9 +47,6 @@ public class GuiElectricPump extends GuiMekanism
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
int xAxis = (mouseX - (width - xSize) / 2);
int yAxis = (mouseY - (height - ySize) / 2);
fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 94) + 2, 0x404040);
fontRenderer.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
@ -67,51 +64,6 @@ public class GuiElectricPump extends GuiMekanism
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
if(tileEntity.getScaledFluidLevel(58) > 0)
{
displayGauge(7, 14, tileEntity.getScaledFluidLevel(58), tileEntity.fluidTank.getFluid());
}
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid)
{
if(fluid == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining));
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
mc.renderEngine.bindTexture(guiLocation);
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 52, 16, 60);
}
}

View file

@ -9,6 +9,8 @@ import mekanism.api.gas.GasTank;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiFluidGauge.IFluidInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.Mekanism;
@ -73,6 +75,15 @@ public class GuiElectrolyticSeparator extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 51));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 51));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.BI, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 78, 29));
}
@Override

View file

@ -33,7 +33,7 @@ public class GuiGasGauge extends GuiGauge
@Override
public String getTooltipText()
{
return (infoHandler.getTank().getGas() != null && infoHandler.getTank().getStored() != 0) ? infoHandler.getTank().getGas().getGas().getLocalizedName() + ": " + infoHandler.getTank().getStored() + "mB" : MekanismUtils.localize("gui.empty");
return (infoHandler.getTank().getGas() != null) ? infoHandler.getTank().getGas().getGas().getLocalizedName() + ": " + infoHandler.getTank().getStored() + "mB" : MekanismUtils.localize("gui.empty");
}
public static interface IGasInfoHandler

View file

@ -6,6 +6,8 @@ import java.util.List;
import mekanism.api.Coord4D;
import mekanism.api.ListUtils;
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.PacketHandler;
@ -49,6 +51,15 @@ public class GuiMetallurgicInfuser extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 50, 42));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 108, 42));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.MEDIUM, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 70, 46));
}
@Override

View file

@ -3,6 +3,8 @@ package mekanism.client.gui;
import mekanism.api.gas.GasTank;
import mekanism.client.gui.GuiFluidGauge.IFluidInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.inventory.container.ContainerPRC;
@ -50,6 +52,15 @@ public class GuiPRC extends GuiMekanism
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 53, 34));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 18).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 115, 34));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.MEDIUM, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37));
}
@Override

View file

@ -0,0 +1,97 @@
package mekanism.client.gui;
import mekanism.common.tile.TileEntityElectricBlock;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiProgress extends GuiElement
{
private int xLocation;
private int yLocation;
private int innerOffsetX = 2;
private ProgressBar type;
private IProgressInfoHandler handler;
public GuiProgress(IProgressInfoHandler handler, ProgressBar type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiProgress.png"), gui, tile, def);
tileEntity = tile;
xLocation = x;
yLocation = y;
this.type = type;
this.handler = handler;
}
@Override
public void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight)
{
mc.renderEngine.bindTexture(RESOURCE);
if(handler.isActive())
{
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height);
int displayInt = (int)(handler.getProgress() * (type.width-2*innerOffsetX));
guiObj.drawTexturedModalRect(guiWidth + xLocation + innerOffsetX, guiHeight + yLocation, type.textureX + type.width + innerOffsetX, type.textureY, displayInt, type.height);
}
mc.renderEngine.bindTexture(defaultLocation);
}
@Override
public void renderForeground(int xAxis, int yAxis) {}
@Override
public void preMouseClicked(int xAxis, int yAxis, int button) {}
@Override
public void mouseClicked(int xAxis, int yAxis, int button) {}
public static abstract class IProgressInfoHandler
{
public abstract double getProgress();
public boolean isActive()
{
return true;
}
}
public enum ProgressBar
{
BLUE(28, 11, 0, 0),
YELLOW(28, 11, 0, 11),
RED(28, 11, 0, 22),
GREEN(28, 11, 0, 33),
PURPLE(28, 11, 0, 44),
STONE(28, 11, 0, 55),
CRUSH(28, 11, 0, 66),
LARGE_RIGHT(52, 10, 128, 0),
LARGE_LEFT(52, 10, 128, 10),
MEDIUM(36, 10, 128, 20),
SMALL_RIGHT(32, 10, 128, 30),
SMALL_LEFT(32, 10, 128, 40),
BI(20, 8, 128, 50);
public int width;
public int height;
public int textureX;
public int textureY;
private ProgressBar(int w, int h, int u, int v)
{
width = w;
height = h;
textureX = u;
textureY = v;
}
}
}

View file

@ -7,6 +7,8 @@ import mekanism.api.gas.GasStack;
import mekanism.api.gas.GasTank;
import mekanism.client.gui.GuiFluidGauge.IFluidInfoHandler;
import mekanism.client.gui.GuiGasGauge.IGasInfoHandler;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.client.render.MekanismRenderer;
@ -60,6 +62,34 @@ public class GuiRotaryCondensentrator extends GuiMekanism
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.isActive ? 1 : 0;
}
@Override
public boolean isActive()
{
return tileEntity.mode == 0;
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return tileEntity.isActive ? 1 : 0;
}
@Override
public boolean isActive()
{
return tileEntity.mode == 1;
}
}, ProgressBar.LARGE_LEFT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38));
}
@ -109,15 +139,6 @@ public class GuiRotaryCondensentrator extends GuiMekanism
drawTexturedModalRect(guiWidth + 4, guiHeight + 4, 176, 18, 18, 18);
}
if(tileEntity.mode == 0)
{
drawTexturedModalRect(guiWidth + 64, guiHeight + 39, 176, tileEntity.isActive ? 123 : 107, 48, 8);
}
else if(tileEntity.mode == 1)
{
drawTexturedModalRect(guiWidth + 64, guiHeight + 39, 176, tileEntity.isActive ? 115 : 99, 48, 8);
}
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
@ -141,53 +162,4 @@ public class GuiRotaryCondensentrator extends GuiMekanism
}
}
}
public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
{
return;
}
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
int start = 0;
while(true)
{
int renderRemaining = 0;
if(scale > 16)
{
renderRemaining = 16;
scale -= 16;
}
else {
renderRemaining = scale;
scale = 0;
}
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
if(fluid != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining));
}
else if(gas != null)
{
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, gas.getGas().getIcon(), 16, 16 - (16 - renderRemaining));
}
start+=16;
if(renderRemaining == 0 || scale == 0)
{
break;
}
}
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"));
drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 40, 16, 59);
}
}

View file

@ -18,6 +18,7 @@ import mekanism.common.tile.component.TileComponentUpgrade;
import mekanism.common.util.ChargeUtils;
import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mekanism.common.util.StackUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -45,16 +46,14 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
*
* @param soundPath - location of the sound effect
* @param name - full name of this machine
* @param location - GUI texture path of this machine
* @param perTick - how much energy this machine uses per tick.
* @param secondaryPerTick - how much secondary energy (fuel) this machine uses per tick.
* @param ticksRequired - how many ticks it takes to smelt an item.
* @param maxEnergy - maximum amount of energy this machine can hold.
* @param maxSecondaryEnergy - maximum amount of secondary energy (fuel) this machine can hold.
*/
public TileEntityAdvancedElectricMachine(String soundPath, String name, ResourceLocation location, double perTick, int secondaryPerTick, int ticksRequired, double maxEnergy)
public TileEntityAdvancedElectricMachine(String soundPath, String name, double perTick, int secondaryPerTick, int ticksRequired, double maxEnergy)
{
super(soundPath, name, location, perTick, ticksRequired, maxEnergy);
super(soundPath, name, MekanismUtils.getResource(ResourceType.GUI, "GuiAdvancedMachine.png"), perTick, ticksRequired, maxEnergy);
sideOutputs.add(new SideData(EnumColor.GREY, InventoryUtils.EMPTY));
sideOutputs.add(new SideData(EnumColor.DARK_RED, new int[] {0}));

View file

@ -3,6 +3,7 @@ package mekanism.common.tile;
import java.util.ArrayList;
import mekanism.api.Coord4D;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.sound.IHasSound;
import mekanism.common.IActiveState;
import mekanism.common.IInvConfiguration;
@ -71,7 +72,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
* The foundation of all machines - a simple tile entity with a facing, active state, initialized state, sound effect, and animated texture.
* @param soundPath - location of the sound effect
* @param name - full name of this machine
* @param path - GUI texture path of this machine
* @param location - GUI texture path of this machine
* @param perTick - the energy this machine consumes every tick in it's active state
* @param ticksRequired - how many ticks it takes to run a cycle
* @param maxEnergy - how much energy this machine can store
@ -86,6 +87,8 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
isActive = false;
}
public abstract ProgressBar getProgressType();
@Override
public void onUpdate()
{
@ -212,6 +215,15 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
return operatingTicks*i / MekanismUtils.getTicks(getSpeedMultiplier(), TICKS_REQUIRED);
}
/**
* Gets the scaled progress level for the GUI.
* @return
*/
public double getScaledProgress()
{
return ((double)operatingTicks) / ((double)MekanismUtils.getTicks(getSpeedMultiplier(), TICKS_REQUIRED));
}
@Override
public double getMaxEnergy()
{

View file

@ -17,7 +17,7 @@ import net.minecraft.util.ResourceLocation;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.lua.ILuaContext;
public class TileEntityChanceMachine extends TileEntityBasicMachine
public abstract class TileEntityChanceMachine extends TileEntityBasicMachine
{
public TileEntityChanceMachine(String soundPath, String name, ResourceLocation location, double perTick, int ticksRequired, double maxEnergy)
{

View file

@ -325,6 +325,11 @@ public class TileEntityChemicalCrystallizer extends TileEntityElectricBlock impl
return operatingTicks*i / TICKS_REQUIRED;
}
public double getScaledProgress()
{
return ((double)operatingTicks) / ((double)TICKS_REQUIRED);
}
@Override
public void setActive(boolean active)
{

View file

@ -218,6 +218,11 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityElectricBloc
return operatingTicks*i / TICKS_REQUIRED;
}
public double getScaledProgress()
{
return ((double)operatingTicks) / ((double)TICKS_REQUIRED);
}
public boolean canOperate()
{
if(inventory[1] == null)

View file

@ -9,6 +9,7 @@ import mekanism.api.gas.GasTransmission;
import mekanism.api.gas.IGasHandler;
import mekanism.api.gas.IGasItem;
import mekanism.api.gas.ITubeConnection;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
@ -21,7 +22,7 @@ public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectr
{
public TileEntityChemicalInjectionChamber()
{
super("ChemicalInjectionChamber.ogg", "ChemicalInjectionChamber", new ResourceLocation("mekanism", "gui/GuiChemicalInjectionChamber.png"), Mekanism.chemicalInjectionChamberUsage, 1, 200, MachineType.CHEMICAL_INJECTION_CHAMBER.baseEnergy);
super("ChemicalInjectionChamber.ogg", "ChemicalInjectionChamber", Mekanism.chemicalInjectionChamberUsage, 1, 200, MachineType.CHEMICAL_INJECTION_CHAMBER.baseEnergy);
}
@Override
@ -87,4 +88,10 @@ public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectr
{
return gas == GasRegistry.getGas("sulfuricAcid") || gas == GasRegistry.getGas("water") || gas == GasRegistry.getGas("hydrogenChloride");
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.YELLOW;
}
}

View file

@ -198,6 +198,11 @@ public class TileEntityChemicalOxidizer extends TileEntityElectricBlock implemen
return operatingTicks*i / TICKS_REQUIRED;
}
public double getScaledProgress()
{
return ((double)operatingTicks) / ((double)TICKS_REQUIRED);
}
public boolean canOperate()
{
if(inventory[0] == null)

View file

@ -5,6 +5,7 @@ import java.util.Map;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasRegistry;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
@ -17,7 +18,7 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
{
public TileEntityCombiner()
{
super("Combiner.ogg", "Combiner", new ResourceLocation("mekanism", "gui/GuiCombiner.png"), Mekanism.combinerUsage, 1, 200, MachineType.COMBINER.baseEnergy);
super("Combiner.ogg", "Combiner", Mekanism.combinerUsage, 1, 200, MachineType.COMBINER.baseEnergy);
}
@Override
@ -42,4 +43,10 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
{
return false;
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.STONE;
}
}

View file

@ -3,6 +3,7 @@ package mekanism.common.tile;
import java.util.EnumSet;
import java.util.Map;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
@ -15,7 +16,7 @@ public class TileEntityCrusher extends TileEntityElectricMachine
public TileEntityCrusher()
{
super("Crusher.ogg", "Crusher", new ResourceLocation("mekanism", "gui/GuiCrusher.png"), Mekanism.crusherUsage, 200, MachineType.CRUSHER.baseEnergy);
super("Crusher.ogg", "Crusher", Mekanism.crusherUsage, 200, MachineType.CRUSHER.baseEnergy);
}
@Override
@ -59,4 +60,10 @@ public class TileEntityCrusher extends TileEntityElectricMachine
{
return 0.5F;
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.CRUSH;
}
}

View file

@ -9,6 +9,8 @@ import mekanism.common.tile.component.TileComponentUpgrade;
import mekanism.common.util.ChargeUtils;
import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import dan200.computercraft.api.peripheral.IComputerAccess;
@ -22,14 +24,13 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
*
* @param soundPath - location of the sound effect
* @param name - full name of this machine
* @param location - GUI texture path of this machine
* @param perTick - energy used per tick.
* @param ticksRequired - ticks required to operate -- or smelt an item.
* @param maxEnergy - maximum energy this machine can hold.
*/
public TileEntityElectricMachine(String soundPath, String name, ResourceLocation location, double perTick, int ticksRequired, double maxEnergy)
public TileEntityElectricMachine(String soundPath, String name, double perTick, int ticksRequired, double maxEnergy)
{
super(soundPath, name, location, perTick, ticksRequired, maxEnergy);
super(soundPath, name, MekanismUtils.getResource(ResourceType.GUI, "GuiBasicMachine.png"), perTick, ticksRequired, maxEnergy);
sideOutputs.add(new SideData(EnumColor.GREY, InventoryUtils.EMPTY));
sideOutputs.add(new SideData(EnumColor.DARK_RED, new int[] {0}));

View file

@ -64,6 +64,8 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
/** Type type of gas this block is dumping. */
public boolean dumpRight = false;
public boolean isActive = false;
public TileEntityElectrolyticSeparator()
{
super("ElectrolyticSeparator", MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy);
@ -122,9 +124,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(canOperate())
{
setActive(true);
fillTanks(RecipeHandler.getElectrolyticSeparatorOutput(fluidTank, true));
setEnergy(getEnergy() - Mekanism.FROM_H2*2);
}
else {
setActive(false);
}
if(leftTank.getGas() != null)
{
@ -401,6 +407,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
dumpLeft = dataStream.readBoolean();
dumpRight = dataStream.readBoolean();
isActive = dataStream.readBoolean();
}
else if(type == 1)
{
@ -447,6 +454,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
data.add(dumpLeft);
data.add(dumpRight);
data.add(isActive);
return data;
}
@ -654,4 +662,9 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
return false;
}
public void setActive(boolean active)
{
isActive = active;
}
}

View file

@ -1,22 +1,23 @@
package mekanism.common.tile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.util.ResourceLocation;
import com.sun.javaws.progress.Progress;
public class TileEntityEnergizedSmelter extends TileEntityElectricMachine
{
public static Map<ItemStack, ItemStack> furnaceRecipes = new HashMap<ItemStack, ItemStack>();
public TileEntityEnergizedSmelter()
{
super("Smelter.ogg", "EnergizedSmelter", new ResourceLocation("mekanism", "gui/GuiEnergizedSmelter.png"), Mekanism.energizedSmelterUsage, 200, MachineType.ENERGIZED_SMELTER.baseEnergy);
super("Smelter.ogg", "EnergizedSmelter", Mekanism.energizedSmelterUsage, 200, MachineType.ENERGIZED_SMELTER.baseEnergy);
}
@Override
@ -24,4 +25,10 @@ public class TileEntityEnergizedSmelter extends TileEntityElectricMachine
{
return furnaceRecipes;
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.GREEN;
}
}

View file

@ -2,6 +2,7 @@ package mekanism.common.tile;
import java.util.Map;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
@ -11,7 +12,7 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
{
public TileEntityEnrichmentChamber()
{
super("Chamber.ogg", "EnrichmentChamber", new ResourceLocation("mekanism", "gui/GuiChamber.png"), Mekanism.enrichmentChamberUsage, 200, MachineType.ENRICHMENT_CHAMBER.baseEnergy);
super("Chamber.ogg", "EnrichmentChamber", Mekanism.enrichmentChamberUsage, 200, MachineType.ENRICHMENT_CHAMBER.baseEnergy);
}
@Override
@ -25,4 +26,10 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
{
return 0.3F;
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.BLUE;
}
}

View file

@ -321,6 +321,11 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
return operatingTicks*i / MekanismUtils.getTicks(getSpeedMultiplier(), TICKS_REQUIRED);
}
public double getScaledProgress()
{
return ((double)operatingTicks) / ((double)MekanismUtils.getTicks(getSpeedMultiplier(), TICKS_REQUIRED));
}
@Override
public void invalidate()
{

View file

@ -5,6 +5,7 @@ import java.util.Map;
import mekanism.api.gas.Gas;
import mekanism.api.gas.GasRegistry;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
@ -16,7 +17,7 @@ public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachin
{
public TileEntityOsmiumCompressor()
{
super("Compressor.ogg", "OsmiumCompressor", new ResourceLocation("mekanism", "gui/GuiCompressor.png"), Mekanism.osmiumCompressorUsage, 1, 200, MachineType.OSMIUM_COMPRESSOR.baseEnergy);
super("Compressor.ogg", "OsmiumCompressor", Mekanism.osmiumCompressorUsage, 1, 200, MachineType.OSMIUM_COMPRESSOR.baseEnergy);
}
@Override
@ -54,4 +55,10 @@ public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachin
{
return false;
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.RED;
}
}

View file

@ -14,6 +14,7 @@ import mekanism.api.gas.GasTank;
import mekanism.api.gas.GasTransmission;
import mekanism.api.gas.IGasHandler;
import mekanism.api.gas.ITubeConnection;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.SideData;
import mekanism.common.block.BlockMachine.MachineType;
@ -127,6 +128,12 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl
}
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.MEDIUM;
}
@Override
public boolean isItemValidForSlot(int slotID, ItemStack itemstack)
{
@ -195,9 +202,9 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl
}
}
if(products.getGasOutput() != null)
if(products.getGasOutput() != null && outputGasTank.getGas() != null)
{
products.getGasOutput().isGasEqual(outputGasTank.getGas());
return products.getGasOutput().isGasEqual(outputGasTank.getGas()) && products.getGasOutput().amount <= outputGasTank.getNeeded();
}
return true;

View file

@ -2,16 +2,20 @@ package mekanism.common.tile;
import java.util.Map;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.util.ResourceLocation;
public class TileEntityPrecisionSawmill extends TileEntityChanceMachine
{
public TileEntityPrecisionSawmill()
{
super("PrecisionSawmill.ogg", "PrecisionSawmill", new ResourceLocation("mekanism", "gui/GuiPrecisionSawmill.png"), Mekanism.precisionSawmillUsage, 200, MachineType.PRECISION_SAWMILL.baseEnergy);
super("PrecisionSawmill.ogg", "PrecisionSawmill", MekanismUtils.getResource(ResourceType.GUI, "GuiBasicMachine.png"), Mekanism.precisionSawmillUsage, 200, MachineType.PRECISION_SAWMILL.baseEnergy);
}
@Override
@ -25,4 +29,10 @@ public class TileEntityPrecisionSawmill extends TileEntityChanceMachine
{
return 0.7F;
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.PURPLE;
}
}

View file

@ -9,6 +9,7 @@ import mekanism.api.gas.GasTransmission;
import mekanism.api.gas.IGasHandler;
import mekanism.api.gas.IGasItem;
import mekanism.api.gas.ITubeConnection;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.recipe.RecipeHandler.Recipe;
@ -21,7 +22,7 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
{
public TileEntityPurificationChamber()
{
super("PurificationChamber.ogg", "PurificationChamber", new ResourceLocation("mekanism", "gui/GuiPurificationChamber.png"), Mekanism.purificationChamberUsage, 1, 200, MachineType.PURIFICATION_CHAMBER.baseEnergy);
super("PurificationChamber.ogg", "PurificationChamber", Mekanism.purificationChamberUsage, 1, 200, MachineType.PURIFICATION_CHAMBER.baseEnergy);
}
@Override
@ -81,4 +82,10 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
{
return gas == GasRegistry.getGas("oxygen");
}
@Override
public ProgressBar getProgressType()
{
return ProgressBar.RED;
}
}

View file

@ -214,13 +214,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
{
super.readFromNBT(nbtTags);
String gasName = nbtTags.getString("gasName");
int stored = nbtTags.getInteger("gasStored");
if(stored > 0 && !gasName.equals("none"))
{
fuelTank.setGas(new GasStack(GasRegistry.getGas(gasName), stored));
}
fuelTank.read(nbtTags.getCompoundTag("fuelTank"));
}
@Override
@ -228,8 +222,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
{
super.writeToNBT(nbtTags);
nbtTags.setString("gasName", fuelTank.getGas() == null ? "none" : fuelTank.getGas().getGas().getName());
nbtTags.setInteger("gasStored", fuelTank.getStored());
nbtTags.setCompoundTag("fuelTank", fuelTank.write(new NBTTagCompound()));
}
@Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 5 KiB