mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 15:46:01 +00:00
Changed Metallurgic Infuser infuse system to use icons for textures
This commit is contained in:
1 parent
06dc2227f2
commit
88cfee2ab2
14 files changed
+55
-64
No files matched your search
@@ -2,7 +2,6 @@ package mekanism.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.util.ListUtils;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo.IInfoHandler;
|
||||
@@ -19,6 +18,7 @@ import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -92,48 +92,30 @@ public class GuiFactory extends GuiMekanism
|
||||
displayInt = tileEntity.getScaledEnergyLevel(52);
|
||||
drawTexturedModalRect(guiWidth + 165, guiHeight + 17 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
|
||||
|
||||
if(tileEntity.tier == FactoryTier.BASIC)
|
||||
int xOffset = tileEntity.tier == FactoryTier.BASIC ? 59 : (tileEntity.tier == FactoryTier.ADVANCED ?
|
||||
39 : 33);
|
||||
int xDistance = tileEntity.tier == FactoryTier.BASIC ? 38 : (tileEntity.tier == FactoryTier.ADVANCED ?
|
||||
26 : 19);
|
||||
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
int xPos = 59 + (i*38);
|
||||
int xPos = xOffset + (i*xDistance);
|
||||
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
}
|
||||
else if(tileEntity.tier == FactoryTier.ADVANCED)
|
||||
{
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
int xPos = 39 + (i*26);
|
||||
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
}
|
||||
else if(tileEntity.tier == FactoryTier.ELITE)
|
||||
{
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
int xPos = 33 + (i*19);
|
||||
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
|
||||
if(tileEntity.getScaledGasLevel(160) > 0)
|
||||
{
|
||||
displayGauge(8, 78, tileEntity.getScaledGasLevel(160), 5, tileEntity.gasTank.getGas());
|
||||
displayGauge(8, 78, tileEntity.getScaledGasLevel(160), 5, tileEntity.gasTank.getGas().getGas().getIcon());
|
||||
}
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
}
|
||||
|
||||
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, GasStack gas)
|
||||
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, IIcon icon)
|
||||
{
|
||||
if(gas == null)
|
||||
if(icon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -142,6 +124,6 @@ public class GuiFactory extends GuiMekanism
|
||||
int guiHeight = (height - ySize) / 2;
|
||||
|
||||
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, gas.getGas().getIcon(), sizeX, sizeY);
|
||||
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, icon, sizeX, sizeY);
|
||||
}
|
||||
}
|
||||
@@ -9,15 +9,16 @@ import mekanism.client.gui.element.GuiEnergyInfo;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo.IInfoHandler;
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiProgress;
|
||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||
import mekanism.client.gui.element.GuiSideConfigurationTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.gui.element.GuiTransporterConfigTab;
|
||||
import mekanism.client.gui.element.GuiUpgradeTab;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.inventory.container.ContainerMetallurgicInfuser;
|
||||
@@ -100,9 +101,9 @@ public class GuiMetallurgicInfuser extends GuiMekanism
|
||||
|
||||
if(tileEntity.infuseStored.type != null)
|
||||
{
|
||||
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
int displayInt = tileEntity.getScaledInfuseLevel(52);
|
||||
mc.renderEngine.bindTexture(tileEntity.infuseStored.type.texture);
|
||||
drawTexturedModalRect(guiWidth + 7, guiHeight + 17 + 52 - displayInt, tileEntity.infuseStored.type.texX, tileEntity.infuseStored.type.texY + 52 - displayInt, 4, displayInt);
|
||||
drawTexturedRectFromIcon(guiWidth + 7, guiHeight + 17 + 52 - displayInt, tileEntity.infuseStored.type.icon, 4, displayInt);
|
||||
}
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
|
||||
Reference in new issue
Block a user