diff --git a/common/mekanism/client/gui/GuiItemStackFilter.java b/common/mekanism/client/gui/GuiItemStackFilter.java index 4d1bf2882..e398da19a 100644 --- a/common/mekanism/client/gui/GuiItemStackFilter.java +++ b/common/mekanism/client/gui/GuiItemStackFilter.java @@ -53,12 +53,6 @@ public class GuiItemStackFilter extends GuiMekanism filter.color = TransporterUtils.colors.get(0); } - @Override - public boolean doesGuiPauseGame() - { - return false; - } - @Override public void initGui() { @@ -110,7 +104,7 @@ public class GuiItemStackFilter extends GuiMekanism { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_LIGHTING); - itemRenderer.renderItemIntoGUI(fontRenderer, mc.getTextureManager(), filter.itemType, 12, 19); + itemRenderer.renderItemAndEffectIntoGUI(fontRenderer, mc.getTextureManager(), filter.itemType, 12, 19); GL11.glDisable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } diff --git a/common/mekanism/client/gui/GuiLogisticalSorter.java b/common/mekanism/client/gui/GuiLogisticalSorter.java index 384ba0aa9..5a6d8000f 100644 --- a/common/mekanism/client/gui/GuiLogisticalSorter.java +++ b/common/mekanism/client/gui/GuiLogisticalSorter.java @@ -26,6 +26,12 @@ public class GuiLogisticalSorter extends GuiMekanism { public TileEntityLogisticalSorter tileEntity; + public boolean isDragging = false; + + public int dragOffset = 0; + + public float scroll; + public GuiLogisticalSorter(EntityPlayer player, TileEntityLogisticalSorter tentity) { super(new ContainerNull(player, tentity)); @@ -33,10 +39,55 @@ public class GuiLogisticalSorter extends GuiMekanism guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiLogisticalSorter.png"))); } - @Override - public boolean doesGuiPauseGame() + public int getScroll() { - return false; + return Math.max(Math.min((int)(scroll*125), 125), 0); + } + + public int getFilterIndex() + { + return 0; + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int button) + { + super.mouseClicked(mouseX, mouseY, button); + + int xAxis = (mouseX - (width - xSize) / 2); + int yAxis = (mouseY - (height - ySize) / 2); + + if(xAxis >= 154 && xAxis <= 166 && yAxis >= getScroll()+18 && yAxis <= getScroll()+18+15) + { + dragOffset = yAxis - (getScroll()+18); + isDragging = true; + } + } + + @Override + protected void mouseClickMove(int mouseX, int mouseY, int button, long ticks) + { + super.mouseClickMove(mouseX, mouseY, button, ticks); + + int xAxis = (mouseX - (width - xSize) / 2); + int yAxis = (mouseY - (height - ySize) / 2); + + if(isDragging) + { + scroll = (float)(yAxis-18-dragOffset)/123F; + } + } + + @Override + protected void mouseMovedOrUp(int x, int y, int type) + { + super.mouseMovedOrUp(x, y, type); + + if(type == 0 && isDragging) + { + dragOffset = 0; + isDragging = false; + } } @Override @@ -76,10 +127,10 @@ public class GuiLogisticalSorter extends GuiMekanism int yAxis = (mouseY - (height - ySize) / 2); fontRenderer.drawString("Logistical Sorter", 43, 6, 0x404040); - fontRenderer.drawString("Filters:", 11, 17, 0x00CD00); - fontRenderer.drawString("T: " + tileEntity.filters.size(), 11, 26, 0x00CD00); - fontRenderer.drawString("IS: " + getItemStackFilters().size(), 11, 35, 0x00CD00); - fontRenderer.drawString("OD: " + getOreDictFilters().size(), 11, 44, 0x00CD00); + fontRenderer.drawString("Filters:", 11, 19, 0x00CD00); + fontRenderer.drawString("T: " + tileEntity.filters.size(), 11, 28, 0x00CD00); + fontRenderer.drawString("IS: " + getItemStackFilters().size(), 11, 37, 0x00CD00); + fontRenderer.drawString("OD: " + getOreDictFilters().size(), 11, 46, 0x00CD00); super.drawGuiContainerForegroundLayer(mouseX, mouseY); } @@ -94,6 +145,17 @@ public class GuiLogisticalSorter extends GuiMekanism int guiWidth = (width - xSize) / 2; int guiHeight = (height - ySize) / 2; drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize); + + drawTexturedModalRect(guiWidth + 154, guiHeight + 18 + getScroll(), 232, 0, 12, 15); + + for(int i = 0; i < 4; i++) + { + if(tileEntity.filters.get(getFilterIndex()+i) != null) + { + TransporterFilter filter = tileEntity.filters.get(getFilterIndex()+i); + int yStart = i*29 + 18; + } + } } public ArrayList getItemStackFilters() diff --git a/common/mekanism/client/gui/GuiOreDictFilter.java b/common/mekanism/client/gui/GuiOreDictFilter.java index 6620fbeaa..8a0867dbc 100644 --- a/common/mekanism/client/gui/GuiOreDictFilter.java +++ b/common/mekanism/client/gui/GuiOreDictFilter.java @@ -67,12 +67,6 @@ public class GuiOreDictFilter extends GuiMekanism filter.color = TransporterUtils.colors.get(0); } - @Override - public boolean doesGuiPauseGame() - { - return false; - } - @Override public void initGui() { @@ -146,7 +140,7 @@ public class GuiOreDictFilter extends GuiMekanism { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_LIGHTING); - itemRenderer.renderItemIntoGUI(fontRenderer, mc.getTextureManager(), renderStack, 12, 19); + itemRenderer.renderItemAndEffectIntoGUI(fontRenderer, mc.getTextureManager(), renderStack, 12, 19); GL11.glDisable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } diff --git a/common/mekanism/client/render/block/MachineRenderingHandler.java b/common/mekanism/client/render/block/MachineRenderingHandler.java index 7a9f47f3f..25e415cd3 100644 --- a/common/mekanism/client/render/block/MachineRenderingHandler.java +++ b/common/mekanism/client/render/block/MachineRenderingHandler.java @@ -28,7 +28,6 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler public ModelTheoreticalElementizer theoreticalElementizer = new ModelTheoreticalElementizer(); public ModelElectricPump electricPump = new ModelElectricPump(); public ModelMetallurgicInfuser metallurgicInfuser = new ModelMetallurgicInfuser(); - public ModelChest electricChest = new ModelChest(); public ModelChargepad chargepad = new ModelChargepad(); @Override diff --git a/common/mekanism/common/HashList.java b/common/mekanism/common/HashList.java index dbb4e3e65..98403b187 100644 --- a/common/mekanism/common/HashList.java +++ b/common/mekanism/common/HashList.java @@ -19,6 +19,11 @@ public class HashList implements Iterable public T get(int index) { + if(index > size()-1) + { + return null; + } + return list.get(index); } diff --git a/common/mekanism/common/transporter/TransporterFilter.java b/common/mekanism/common/transporter/TransporterFilter.java index fe1b8e5d7..5cfe19451 100644 --- a/common/mekanism/common/transporter/TransporterFilter.java +++ b/common/mekanism/common/transporter/TransporterFilter.java @@ -9,14 +9,11 @@ import net.minecraft.nbt.NBTTagCompound; import com.google.common.io.ByteArrayDataInput; -public class TransporterFilter +public abstract class TransporterFilter { public EnumColor color; - public boolean canFilter(ItemStack itemStack) - { - return false; - } + public abstract boolean canFilter(ItemStack itemStack); public void write(NBTTagCompound nbtTags) { diff --git a/resources/assets/mekanism/gui/GuiLogisticalSorter.png b/resources/assets/mekanism/gui/GuiLogisticalSorter.png index dc0a78021..07db177e3 100644 Binary files a/resources/assets/mekanism/gui/GuiLogisticalSorter.png and b/resources/assets/mekanism/gui/GuiLogisticalSorter.png differ diff --git a/resources/assets/mekanism/gui/GuiPasswordModify copy.png b/resources/assets/mekanism/gui/GuiPasswordModify copy.png deleted file mode 100644 index 48d456aaa..000000000 Binary files a/resources/assets/mekanism/gui/GuiPasswordModify copy.png and /dev/null differ