Work on un-screwing up NEI recipe GUIs.

This commit is contained in:
Ben Spiers 2014-04-19 01:41:48 +01:00
parent 3bde351458
commit 15a8cfe9db
54 changed files with 381 additions and 191 deletions

View file

@ -41,12 +41,12 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK));
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, tileEntity.guiLocation));
}, this, tileEntity.guiLocation));
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, tileEntity.guiLocation, 30, 34).with(SlotOverlay.POWER));
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 GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 30, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity.guiLocation, 55, 52));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -55,7 +55,7 @@ public class GuiAdvancedElectricMachine extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37));
}, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37));
}
@Override

View file

@ -10,9 +10,9 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiBucketIO extends GuiElement
{
public GuiBucketIO(GuiMekanism gui, TileEntity tile, ResourceLocation def)
public GuiBucketIO(IGuiWrapper gui, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiBucket.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiBucket.png"), gui, def);
}
@Override
@ -20,7 +20,7 @@ public class GuiBucketIO extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 4, 0, 0, 26, 57);
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 4, 0, 0, 26, 57);
mc.renderEngine.bindTexture(defaultLocation);
}

View file

@ -38,11 +38,11 @@ public class GuiChanceMachine extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK));
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, tileEntity.guiLocation));
}, this, tileEntity.guiLocation));
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, tileEntity.guiLocation, 55, 16));
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 GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, tileEntity.guiLocation, 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -51,7 +51,7 @@ public class GuiChanceMachine extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37));
}, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37));
}
@Override

View file

@ -64,17 +64,17 @@ public class GuiChemicalCrystallizer extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 4));
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));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 4));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 5, 64).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 130, 56));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -83,7 +83,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 51, 60));
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalCrystallizer.png"), 51, 60));
}
@Override

View file

@ -39,26 +39,26 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.injectTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 4));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 133, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 133, 13));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 4).with(SlotOverlay.POWER));
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 GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 25, 35));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 154, 24).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 5, 64).with(SlotOverlay.MINUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -67,7 +67,7 @@ public class GuiChemicalDissolutionChamber extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 62, 39));
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 62, 39));
}
@Override

View file

@ -47,33 +47,33 @@ public class GuiChemicalInfuser extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.leftTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 25, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 25, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.centerTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.rightTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 133, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.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, "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 GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 154, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 4, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 79, 64).with(SlotOverlay.PLUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -82,7 +82,7 @@ public class GuiChemicalInfuser extends GuiMekanism
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.SMALL_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 45, 38));
}, ProgressBar.SMALL_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 45, 38));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
@ -90,7 +90,7 @@ public class GuiChemicalInfuser extends GuiMekanism
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.SMALL_LEFT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 99, 38));
}, ProgressBar.SMALL_LEFT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalInfuser.png"), 99, 38));
}
@Override

View file

@ -39,18 +39,18 @@ public class GuiChemicalOxidizer extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.gasTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 133, 13));
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 GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 25, 35));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 154, 24).with(SlotOverlay.PLUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -59,7 +59,7 @@ public class GuiChemicalOxidizer extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 62, 39));
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalOxidizer.png"), 62, 39));
}
@Override

View file

@ -43,7 +43,7 @@ public class GuiChemicalWasher extends GuiMekanism
tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiBucketIO(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiBucketIO(this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiEnergyInfo(new IInfoHandler() {
@Override
public List<String> getInfo()
@ -51,7 +51,7 @@ public class GuiChemicalWasher extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(tileEntity.ENERGY_USAGE);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler()
{
@Override
@ -59,24 +59,24 @@ public class GuiChemicalWasher extends GuiMekanism
{
return tileEntity.fluidTank;
}
}, Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 5, 4));
}, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 5, 4));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 26, 13));
}, GuiGauge.Type.STANDARD, this, 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, "GuiChemicalWasher.png"), 133, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 133, 13));
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 GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 154, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -85,7 +85,7 @@ public class GuiChemicalWasher extends GuiMekanism
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 62, 38));
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalWasher.png"), 62, 38));
}
@Override

View file

@ -15,9 +15,13 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiConfigurationTab extends GuiElement
{
public GuiConfigurationTab(GuiMekanism gui, TileEntity tile, ResourceLocation def)
TileEntity tileEntity;
public GuiConfigurationTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiConfigurationTab.png"), gui, def);
tileEntity = tile;
}
@Override
@ -25,14 +29,14 @@ public class GuiConfigurationTab extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 6, 0, 0, 26, 26);
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 6, 0, 0, 26, 26);
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
{
guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 10, 26, 0, 18, 18);
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 0, 18, 18);
}
else {
guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 10, 26, 18, 18, 18);
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 10, 26, 18, 18, 18);
}
mc.renderEngine.bindTexture(defaultLocation);

View file

@ -54,10 +54,10 @@ public class GuiDigitalMiner extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_USAGE));
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 151, 5).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 143, 26));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 151, 5).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiDigitalMiner.png"), 143, 26));
ySize+=64;

View file

@ -41,11 +41,11 @@ public class GuiElectricMachine extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK));
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, tileEntity.guiLocation));
}, this, tileEntity.guiLocation));
guiElements.add(new GuiSlot(SlotType.INPUT, this, tileEntity, tileEntity.guiLocation, 55, 16));
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 GuiSlot(SlotType.INPUT, this, tileEntity.guiLocation, 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity.guiLocation, 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, tileEntity.guiLocation, 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -54,7 +54,7 @@ public class GuiElectricMachine extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, tileEntity.getProgressType(), this, tileEntity, tileEntity.guiLocation, 77, 37));
}, tileEntity.getProgressType(), this, tileEntity.guiLocation, 77, 37));
}
@Override

View file

@ -30,9 +30,9 @@ public class GuiElectricPump extends GuiMekanism
super(new ContainerElectricPump(inventory, tentity));
tileEntity = tentity;
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, guiLocation, 27, 19));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, guiLocation, 27, 50));
guiElements.add(new GuiSlot(SlotType.POWER, this, tileEntity, guiLocation, 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 19));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, guiLocation, 27, 50));
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiPowerBar(this, tileEntity, guiLocation, 164, 15));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
@ -40,7 +40,7 @@ public class GuiElectricPump extends GuiMekanism
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, guiLocation, 6, 13));
}, GuiGauge.Type.STANDARD, this, guiLocation, 6, 13));
}

View file

@ -47,34 +47,34 @@ public class GuiElectrolyticSeparator extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(Mekanism.FROM_H2*2);
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 5, 10));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.leftTank;
}
}, GuiGauge.Type.SMALL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18));
}, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 18));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.rightTank;
}
}, GuiGauge.Type.SMALL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
}, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 25, 34));
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 GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 25, 34));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 51));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 51));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -83,7 +83,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
{
return tileEntity.isActive ? 1 : 0;
}
}, ProgressBar.BI, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 78, 29));
}, ProgressBar.BI, this, MekanismUtils.getResource(ResourceType.GUI, "GuiChemicalDissolutionChamber.png"), 78, 29));
}
@Override

View file

@ -19,28 +19,25 @@ public abstract class GuiElement
protected ResourceLocation RESOURCE;
public GuiMekanism guiObj;
public TileEntity tileEntity;
public IGuiWrapper guiObj;
public ResourceLocation defaultLocation;
public GuiElement(ResourceLocation resource, GuiMekanism gui, TileEntity tile, ResourceLocation def)
public GuiElement(ResourceLocation resource, IGuiWrapper gui, ResourceLocation def)
{
RESOURCE = resource;
guiObj = gui;
tileEntity = tile;
defaultLocation = def;
}
protected void displayTooltip(String s, int xAxis, int yAxis)
{
guiObj.drawCreativeTabHoveringText(s, xAxis, yAxis);
guiObj.displayTooltip(s, xAxis, yAxis);
}
protected void displayTooltips(List<String> list, int xAxis, int yAxis)
{
guiObj.func_102021_a(list, xAxis, yAxis);
guiObj.displayTooltips(list, xAxis, yAxis);
}
protected void offsetX(int xSize)
@ -67,7 +64,7 @@ public abstract class GuiElement
protected FontRenderer getFontRenderer()
{
return guiObj.getFontRenderer();
return guiObj.getFont();
}
public abstract void renderBackground(int xAxis, int yAxis, int guiWidth, int guiHeight);

View file

@ -36,7 +36,7 @@ public class GuiEnergyCube extends GuiMekanism
{
return tileEntity;
}
}, GuiEnergyGauge.Type.WIDE, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 55, 18));
}, GuiEnergyGauge.Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 55, 18));
guiElements.add(new GuiEnergyInfo(new IInfoHandler()
{
@Override
@ -46,9 +46,9 @@ public class GuiEnergyCube extends GuiMekanism
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 16, 34).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 142, 34).with(SlotOverlay.PLUS));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 16, 34).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiEnergyCube.png"), 142, 34).with(SlotOverlay.PLUS));
}
@Override

View file

@ -12,9 +12,9 @@ public class GuiEnergyGauge extends GuiGauge
{
IEnergyInfoHandler infoHandler;
public GuiEnergyGauge(IEnergyInfoHandler handler, Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
public GuiEnergyGauge(IEnergyInfoHandler handler, Type type, IGuiWrapper gui, ResourceLocation def, int x, int y)
{
super(type, gui, tile, def, x, y);
super(type, gui, def, x, y);
infoHandler = handler;
}

View file

@ -14,9 +14,9 @@ public class GuiEnergyInfo extends GuiElement
{
public IInfoHandler infoHandler;
public GuiEnergyInfo(IInfoHandler handler, GuiMekanism gui, TileEntity tile, ResourceLocation def)
public GuiEnergyInfo(IInfoHandler handler, IGuiWrapper gui, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiEnergyInfo.png"), gui, def);
infoHandler = handler;
}
@ -31,7 +31,7 @@ public class GuiEnergyInfo extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26);
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26);
mc.renderEngine.bindTexture(defaultLocation);
}

View file

@ -42,7 +42,7 @@ public class GuiFactory extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK));
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, tileEntity.tier.guiLocation));
}, this, tileEntity.tier.guiLocation));
}
@Override

View file

@ -11,9 +11,9 @@ public class GuiFluidGauge extends GuiGauge
{
IFluidInfoHandler infoHandler;
public GuiFluidGauge(IFluidInfoHandler handler, Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
public GuiFluidGauge(IFluidInfoHandler handler, Type type, IGuiWrapper gui, ResourceLocation def, int x, int y)
{
super(type, gui, tile, def, x, y);
super(type, gui, def, x, y);
infoHandler = handler;
}

View file

@ -11,9 +11,9 @@ public class GuiGasGauge extends GuiGauge
{
IGasInfoHandler infoHandler;
public GuiGasGauge(IGasInfoHandler handler, Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
public GuiGasGauge(IGasInfoHandler handler, Type type, IGuiWrapper gui, ResourceLocation def, int x, int y)
{
super(type, gui, tile, def, x, y);
super(type, gui, def, x, y);
infoHandler = handler;
}

View file

@ -20,9 +20,9 @@ public abstract class GuiGauge extends GuiElement
protected int number;
public GuiGauge(Type type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
public GuiGauge(Type type, IGuiWrapper gui, ResourceLocation def, int x, int y)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, type.textureLocation), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, type.textureLocation), gui, def);
xLocation = x;
yLocation = y;
@ -46,7 +46,7 @@ public abstract class GuiGauge extends GuiElement
int scale = getScaledLevel();
int start = 0;
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height);
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height);
while(scale > 0)
{
@ -66,7 +66,7 @@ public abstract class GuiGauge extends GuiElement
for(int i = 0; i < number; i++)
{
guiObj.drawTexturedModelRectFromIcon(guiWidth + xLocation + 16*i + 1, guiHeight + yLocation + height - renderRemaining - start - 1, getIcon(), 16, renderRemaining);
guiObj.drawTexturedRectFromIcon(guiWidth + xLocation + 16*i + 1, guiHeight + yLocation + height - renderRemaining - start - 1, getIcon(), 16, renderRemaining);
}
start+=16;
@ -78,7 +78,7 @@ public abstract class GuiGauge extends GuiElement
}
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, width, 0, width, height);
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, width, 0, width, height);
mc.renderEngine.bindTexture(defaultLocation);
}
@ -88,7 +88,7 @@ public abstract class GuiGauge extends GuiElement
{
if(xAxis >= xLocation + 1 && xAxis <= xLocation + width - 1 && yAxis >= yLocation + 1 && yAxis <= yLocation + height - 1)
{
guiObj.drawCreativeTabHoveringText(getTooltipText(), xAxis, yAxis);
guiObj.displayTooltip(getTooltipText(), xAxis, yAxis);
}
}

View file

@ -15,10 +15,11 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import org.lwjgl.opengl.GL11;
public abstract class GuiMekanism extends GuiContainer
public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
{
public Set<GuiElement> guiElements = new HashSet<GuiElement>();
@ -151,6 +152,36 @@ public abstract class GuiMekanism extends GuiContainer
GL11.glPopAttrib();
}
@Override
public void drawTexturedRect(int x, int y, int u, int v, int w, int h)
{
drawTexturedModalRect(x, y, u, v, w, h);
}
@Override
public void drawTexturedRectFromIcon(int x, int y, Icon icon, int w, int h)
{
drawTexturedModelRectFromIcon(x, y, icon, w, h);
}
@Override
public void displayTooltip(String s, int x, int y)
{
drawCreativeTabHoveringText(s, x, y);
}
@Override
public void displayTooltips(List<String> list, int xAxis, int yAxis)
{
func_102021_a(list, xAxis, yAxis);
}
@Override
public FontRenderer getFont()
{
return fontRenderer;
}
protected FontRenderer getFontRenderer()
{
return fontRenderer;

View file

@ -45,12 +45,12 @@ public class GuiMetallurgicInfuser extends GuiMekanism
String multiplier = MekanismUtils.getEnergyDisplay(MekanismUtils.getEnergyPerTick(tileEntity.getSpeedMultiplier(), tileEntity.getEnergyMultiplier(), tileEntity.ENERGY_PER_TICK));
return ListUtils.asList("Using: " + multiplier + "/t", "Needed: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()-tileEntity.getEnergy()));
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")));
guiElements.add(new GuiSlot(SlotType.EXTRA, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 16, 34));
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 GuiSlot(SlotType.EXTRA, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 16, 34));
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 50, 42));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 108, 42));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -59,7 +59,7 @@ public class GuiMetallurgicInfuser extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.MEDIUM, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 70, 46));
}, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png"), 70, 46));
}
@Override

View file

@ -32,26 +32,26 @@ public class GuiPRC extends GuiMekanism
{
return tileEntity.inputFluidTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 5, 10));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 5, 10));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.inputGasTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 28, 10));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 28, 10));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.outputGasTank;
}
}, GuiGauge.Type.SMALL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 40));
}, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 40));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 164, 15));
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 GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 53, 34));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 140, 18).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 115, 34));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -60,7 +60,7 @@ public class GuiPRC extends GuiMekanism
{
return tileEntity.getScaledProgress();
}
}, ProgressBar.MEDIUM, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37));
}, ProgressBar.MEDIUM, this, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png"), 75, 37));
}
@Override

View file

@ -19,9 +19,9 @@ public class GuiPowerBar extends GuiElement
private TileEntityElectricBlock tileEntityElectric;
public GuiPowerBar(GuiMekanism gui, TileEntityElectricBlock tile, ResourceLocation def, int x, int y)
public GuiPowerBar(IGuiWrapper gui, TileEntityElectricBlock tile, ResourceLocation def, int x, int y)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiPowerBar.png"), gui, def);
tileEntityElectric = tile;
xLocation = x;
yLocation = y;
@ -32,9 +32,9 @@ public class GuiPowerBar extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height);
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, 0, 0, width, height);
int displayInt = tileEntityElectric.getScaledEnergyLevel(52) + innerOffsetY;
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt);
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation + height - displayInt, 6, height - displayInt, width, displayInt);
mc.renderEngine.bindTexture(defaultLocation);
}

View file

@ -20,10 +20,9 @@ public class GuiProgress extends GuiElement
private ProgressBar type;
private IProgressInfoHandler handler;
public GuiProgress(IProgressInfoHandler handler, ProgressBar type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
public GuiProgress(IProgressInfoHandler handler, ProgressBar type, IGuiWrapper gui, ResourceLocation def, int x, int y)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiProgress.png"), gui, tile, def);
tileEntity = tile;
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiProgress.png"), gui, def);
xLocation = x;
yLocation = y;
@ -37,9 +36,9 @@ public class GuiProgress extends GuiElement
mc.renderEngine.bindTexture(RESOURCE);
if(handler.isActive())
{
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, type.textureX, type.textureY, type.width, type.height);
guiObj.drawTexturedRect(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);
guiObj.drawTexturedRect(guiWidth + xLocation + innerOffsetX, guiHeight + yLocation, type.textureX + type.width + innerOffsetX, type.textureY, displayInt, type.height);
}
mc.renderEngine.bindTexture(defaultLocation);
}

View file

@ -9,9 +9,13 @@ import net.minecraft.util.ResourceLocation;
public class GuiRecipeType extends GuiElement
{
public GuiRecipeType(GuiMekanism gui, TileEntity tile, ResourceLocation def)
TileEntityFactory tileEntity;
public GuiRecipeType(IGuiWrapper gui, TileEntityFactory tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRecipeType.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRecipeType.png"), gui, def);
tileEntity = tile;
}
@Override
@ -19,12 +23,12 @@ public class GuiRecipeType extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth + 176, guiHeight + 70, 0, 0, 26, 63);
guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 70, 0, 0, 26, 63);
TileEntityFactory factory = (TileEntityFactory)tileEntity;
TileEntityFactory factory = tileEntity;
int displayInt = factory.getScaledRecipeProgress(15);
guiObj.drawTexturedModalRect(guiWidth + 181, guiHeight + 94, 26, 0, 10, displayInt);
guiObj.drawTexturedRect(guiWidth + 181, guiHeight + 94, 26, 0, 10, displayInt);
mc.renderEngine.bindTexture(defaultLocation);
}

View file

@ -14,9 +14,13 @@ import net.minecraft.util.ResourceLocation;
public class GuiRedstoneControl extends GuiElement
{
public GuiRedstoneControl(GuiMekanism gui, TileEntity tile, ResourceLocation def)
TileEntity tileEntity;
public GuiRedstoneControl(IGuiWrapper gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiRedstoneControl.png"), gui, def);
tileEntity = tile;
}
@Override
@ -24,17 +28,17 @@ public class GuiRedstoneControl extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth + 176, guiHeight + 138, 0, 0, 26, 26);
guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 138, 0, 0, 26, 26);
IRedstoneControl control = (IRedstoneControl)tileEntity;
int renderX = 26 + (18*control.getControlType().ordinal());
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
{
guiObj.drawTexturedModalRect(guiWidth + 179, guiHeight + 142, renderX, 0, 18, 18);
guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 0, 18, 18);
}
else {
guiObj.drawTexturedModalRect(guiWidth + 179, guiHeight + 142, renderX, 18, 18, 18);
guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 18, 18, 18);
}
mc.renderEngine.bindTexture(defaultLocation);

View file

@ -39,13 +39,13 @@ public class GuiRotaryCondensentrator extends GuiMekanism
tileEntity = tentity;
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 24).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 24).with(SlotOverlay.PLUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 4, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 24));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 55));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 24));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 55));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 154, 4).with(SlotOverlay.POWER));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
@ -53,14 +53,14 @@ public class GuiRotaryCondensentrator extends GuiMekanism
{
return tileEntity.fluidTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 133, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 133, 13));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.gasTank;
}
}, GuiGauge.Type.STANDARD, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13));
}, GuiGauge.Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 25, 13));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@ -75,7 +75,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism
{
return tileEntity.mode == 0;
}
}, ProgressBar.LARGE_RIGHT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38));
}, ProgressBar.LARGE_RIGHT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
@ -89,7 +89,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism
{
return tileEntity.mode == 1;
}
}, ProgressBar.LARGE_LEFT, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38));
}, ProgressBar.LARGE_LEFT, this, MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png"), 62, 38));
}

View file

@ -26,7 +26,7 @@ public class GuiSeismicVibrator extends GuiMekanism
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSeismicVibrator.png"), 142, 34).with(SlotOverlay.POWER));
}
@Override

View file

@ -19,9 +19,9 @@ public class GuiSlot extends GuiElement
protected SlotOverlay overlay = null;
public GuiSlot(SlotType type, GuiMekanism gui, TileEntity tile, ResourceLocation def, int x, int y)
public GuiSlot(SlotType type, IGuiWrapper gui, ResourceLocation def, int x, int y)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSlot.png"), gui, def);
xLocation = x;
yLocation = y;
@ -44,7 +44,7 @@ public class GuiSlot extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth + xLocation, guiHeight + yLocation, textureX, textureY, width, height);
guiObj.drawTexturedRect(guiWidth + xLocation, guiHeight + yLocation, textureX, textureY, width, height);
if(overlay != null)
{
@ -53,7 +53,7 @@ public class GuiSlot extends GuiElement
int xLocationOverlay = xLocation + (width-w)/2;
int yLocationOverlay = yLocation + (height-h)/2;
guiObj.drawTexturedModalRect(guiWidth + xLocationOverlay, guiHeight + yLocationOverlay, overlay.textureX, overlay.textureY, w, h);
guiObj.drawTexturedRect(guiWidth + xLocationOverlay, guiHeight + yLocationOverlay, overlay.textureX, overlay.textureY, w, h);
}
mc.renderEngine.bindTexture(defaultLocation);

View file

@ -17,9 +17,13 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiSortingTab extends GuiElement
{
public GuiSortingTab(GuiMekanism gui, TileEntity tile, ResourceLocation def)
TileEntityFactory tileEntity;
public GuiSortingTab(IGuiWrapper gui, TileEntityFactory tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSortingTab.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSortingTab.png"), gui, def);
tileEntity = tile;
}
@Override
@ -27,14 +31,14 @@ public class GuiSortingTab extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth - 26, guiHeight + 34, 0, 0, 26, 35);
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 34, 0, 0, 26, 35);
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 38 && yAxis <= 56)
{
guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 38, 26, 0, 18, 18);
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 38, 26, 0, 18, 18);
}
else {
guiObj.drawTexturedModalRect(guiWidth - 21, guiHeight + 38, 26, 18, 18, 18);
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 38, 26, 18, 18, 18);
}
mc.renderEngine.bindTexture(defaultLocation);

View file

@ -30,7 +30,7 @@ public class GuiTeleporter extends GuiMekanism
tileEntity = tentity;
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 26, 13).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiTeleporter.png"), 26, 13).with(SlotOverlay.POWER));
}
@Override

View file

@ -13,9 +13,13 @@ import net.minecraft.util.ResourceLocation;
public class GuiUpgradeManagement extends GuiElement
{
public GuiUpgradeManagement(GuiMekanism gui, TileEntity tile, ResourceLocation def)
TileEntity tileEntity;
public GuiUpgradeManagement(IGuiWrapper gui, TileEntity tile, ResourceLocation def)
{
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, tile, def);
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, def);
tileEntity = tile;
}
@Override
@ -23,12 +27,12 @@ public class GuiUpgradeManagement extends GuiElement
{
mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedModalRect(guiWidth + 176, guiHeight + 6, 0, 0, 26, 63);
guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 6, 0, 0, 26, 63);
IUpgradeTile upgradeTile = (IUpgradeTile)tileEntity;
int displayInt = upgradeTile.getComponent().getScaledUpgradeProgress(14);
guiObj.drawTexturedModalRect(guiWidth + 180, guiHeight + 30, 26, 0, 10, displayInt);
guiObj.drawTexturedRect(guiWidth + 180, guiHeight + 30, 26, 0, 10, displayInt);
mc.renderEngine.bindTexture(defaultLocation);
}

View file

@ -0,0 +1,19 @@
package mekanism.client.gui;
import java.util.List;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.util.Icon;
public interface IGuiWrapper
{
public void drawTexturedRect(int x, int y, int u, int v, int w, int h);
public void drawTexturedRectFromIcon(int x, int y, Icon icon, int w, int h);
public void displayTooltip(String s, int xAxis, int yAxis);
public void displayTooltips(List<String> list, int xAxis, int yAxis);
public FontRenderer getFont();
}

View file

@ -221,6 +221,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
return super.mouseClicked(gui, button, recipe);
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public List<ItemStack> fuelStacks;

View file

@ -1,17 +1,35 @@
package mekanism.client.nei;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static codechicken.core.gui.GuiDraw.changeTexture;
import static codechicken.core.gui.GuiDraw.drawTexturedModalRect;
import static codechicken.core.gui.GuiDraw.gui;
import mekanism.api.gas.GasStack;
import mekanism.client.gui.GuiElement;
import mekanism.client.gui.IGuiWrapper;
import mekanism.client.render.MekanismRenderer;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.util.Icon;
import net.minecraftforge.fluids.FluidStack;
import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
public abstract class BaseRecipeHandler extends TemplateRecipeHandler
public abstract class BaseRecipeHandler extends TemplateRecipeHandler implements IGuiWrapper
{
public BaseRecipeHandler()
{
addGuiElements();
}
public Set<GuiElement> guiElements = new HashSet<GuiElement>();
public abstract void addGuiElements();
public void displayGauge(int length, int xPos, int yPos, int overlayX, int overlayY, int scale, FluidStack fluid, GasStack gas)
{
if(fluid == null && gas == null)
@ -122,4 +140,21 @@ public abstract class BaseRecipeHandler extends TemplateRecipeHandler
return false;
}
public void drawTexturedRect(int x, int y, int u, int v, int w, int h)
{
drawTexturedModalRect(x, y, u, v, w, h);
}
public void drawTexturedRectFromIcon(int x, int y, Icon icon, int w, int h)
{
gui.drawTexturedModelRectFromIcon(x, y, icon, w, h);
}
public void displayTooltip(String s, int xAxis, int yAxis) {}
public void displayTooltips(List<String> list, int xAxis, int yAxis) {}
public FontRenderer getFont() { return null; }
}

View file

@ -243,6 +243,12 @@ public class ChemicalCrystallizerRecipeHandler extends BaseRecipeHandler
}
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public GasStack inputStack;

View file

@ -252,6 +252,12 @@ public class ChemicalDissolutionChamberRecipeHandler extends BaseRecipeHandler
}
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public PositionedStack inputStack;

View file

@ -276,6 +276,12 @@ public class ChemicalInfuserRecipeHandler extends BaseRecipeHandler
return 1;
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public ChemicalPair chemicalInput;

View file

@ -225,6 +225,12 @@ public class ChemicalOxidizerRecipeHandler extends BaseRecipeHandler
}
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public PositionedStack inputStack;

View file

@ -318,6 +318,12 @@ public class ChemicalWasherRecipeHandler extends BaseRecipeHandler
return 1;
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public GasStack inputStack;

View file

@ -3,8 +3,11 @@ package mekanism.client.nei;
import java.util.Set;
import mekanism.client.gui.GuiCrusher;
import mekanism.client.gui.GuiSlot;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
public class CrusherRecipeHandler extends MachineRecipeHandler
{
@ -32,12 +35,6 @@ public class CrusherRecipeHandler extends MachineRecipeHandler
return Recipe.CRUSHER.get().entrySet();
}
@Override
public String getGuiTexture()
{
return "mekanism:gui/GuiCrusher.png";
}
@Override
public Class getGuiClass()
{

View file

@ -311,6 +311,12 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
return 1;
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public FluidStack fluidInput;

View file

@ -32,12 +32,6 @@ public class EnrichmentChamberRecipeHandler extends MachineRecipeHandler
return Recipe.ENRICHMENT_CHAMBER.get().entrySet();
}
@Override
public String getGuiTexture()
{
return "mekanism:gui/GuiChamber.png";
}
@Override
public Class getGuiClass()
{

View file

@ -2,12 +2,23 @@ package mekanism.client.nei;
import static codechicken.core.gui.GuiDraw.changeTexture;
import static codechicken.core.gui.GuiDraw.drawTexturedModalRect;
import static codechicken.core.gui.GuiDraw.gui;
import java.awt.Rectangle;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import mekanism.client.gui.GuiElement;
import mekanism.client.gui.GuiProgress;
import mekanism.client.gui.GuiProgress.IProgressInfoHandler;
import mekanism.client.gui.GuiProgress.ProgressBar;
import mekanism.client.gui.GuiSlot;
import mekanism.client.gui.GuiSlot.SlotOverlay;
import mekanism.client.gui.GuiSlot.SlotType;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
@ -24,12 +35,33 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler
public abstract Set<Entry<ItemStack, ItemStack>> getRecipes();
@Override
public void addGuiElements()
{
guiElements.add(new GuiSlot(SlotType.INPUT, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 16));
guiElements.add(new GuiSlot(SlotType.POWER, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 55, 52).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.OUTPUT_LARGE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 111, 30));
guiElements.add(new GuiProgress(new IProgressInfoHandler()
{
@Override
public double getProgress()
{
return ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F;
}
}, ProgressBar.BLUE, this, MekanismUtils.getResource(ResourceType.GUI, getGuiTexture()), 77, 37));
}
@Override
public void drawBackground(int i)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
changeTexture(getGuiTexture());
drawTexturedModalRect(12, 0, 28, 5, 144, 68);
for(GuiElement e : guiElements)
{
e.renderBackground(0, 0, -16, -5);
}
}
@Override
@ -81,6 +113,12 @@ public abstract class MachineRecipeHandler extends BaseRecipeHandler
}
}
@Override
public String getGuiTexture()
{
return "mekanism:gui/GuiBasicMachine.png";
}
@Override
public void loadUsageRecipes(ItemStack ingredient)
{

View file

@ -164,6 +164,12 @@ public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler
}
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public List<ItemStack> infuseStacks;

View file

@ -316,6 +316,12 @@ public class RotaryCondensentratorRecipeHandler extends BaseRecipeHandler
return 1;
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public GasStack gasStack;

View file

@ -260,6 +260,12 @@ public class SalinationControllerRecipeHandler extends BaseRecipeHandler
return 1;
}
@Override
public void addGuiElements()
{
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public FluidStack fluidInput;

View file

@ -43,10 +43,10 @@ public class GuiBioGenerator extends GuiMekanism
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 16, 34));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 16, 34));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBioGenerator.png"), 142, 34).with(SlotOverlay.POWER));
}
@Override

View file

@ -50,17 +50,17 @@ public class GuiHeatGenerator extends GuiMekanism
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png")));
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
@Override
public FluidTank getTank()
{
return tileEntity.lavaTank;
}
}, Type.WIDE, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 55, 18));
}, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 55, 18));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 16, 34));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 16, 34));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHeatGenerator.png"), 142, 34).with(SlotOverlay.POWER));
}
@Override

View file

@ -45,17 +45,17 @@ public class GuiHydrogenGenerator extends GuiMekanism
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png")));
guiElements.add(new GuiGasGauge(new IGasInfoHandler() {
@Override
public GasTank getTank()
{
return tileEntity.fuelTank;
}
}, Type.WIDE, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 55, 18));
}, Type.WIDE, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 55, 18));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 16, 34).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 16, 34).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiHydrogenGenerator.png"), 142, 34).with(SlotOverlay.POWER));
}
@Override

View file

@ -43,9 +43,9 @@ public class GuiSolarGenerator extends GuiMekanism
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiSolarGenerator.png"), 142, 34).with(SlotOverlay.POWER));
}
@Override

View file

@ -44,9 +44,9 @@ public class GuiWindTurbine extends GuiMekanism
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
}
}, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png")));
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png")));
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"), 164, 15));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"), 142, 34).with(SlotOverlay.POWER));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiWindTurbine.png"), 142, 34).with(SlotOverlay.POWER));
}
@Override