fix bug where there is light on side btns
This commit is contained in:
@@ -72,7 +72,9 @@ public abstract class GuiBase extends GuiContainer
|
||||
|
||||
for (SideButton sideButton : sideButtons)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
sideButton.draw(this, sideButton.getX() + 2, sideButton.getY() + 1);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
if (inBounds(sideButton.getX(), sideButton.getY(), SIDE_BUTTON_WIDTH, SIDE_BUTTON_HEIGHT, mouseX, mouseY))
|
||||
{
|
||||
@@ -194,6 +196,11 @@ public abstract class GuiBase extends GuiContainer
|
||||
renderToolTip(stack, x, y);
|
||||
}
|
||||
|
||||
public void drawTexture(int x, int y, int textureX, int textureY, int width, int height)
|
||||
{
|
||||
this.drawTexturedModalRect(x, y, textureX, textureY, width, height);
|
||||
}
|
||||
|
||||
public String t(String name, Object... format)
|
||||
{
|
||||
return StatCollector.translateToLocalFormatted(name, format);
|
||||
|
@@ -36,7 +36,7 @@ public class GuiConstructor extends GuiBase
|
||||
{
|
||||
bindTexture("gui/constructor.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -36,11 +36,11 @@ public class GuiController extends GuiBase
|
||||
{
|
||||
bindTexture("gui/controller.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
|
||||
int barHeightNew = (int) ((float) controller.getEnergyStored(null) / (float) controller.getMaxEnergyStored(null) * (float) barHeight);
|
||||
|
||||
drawTexturedModalRect(x + barX, y + barY + barHeight - barHeightNew, 178, 0 + (barHeight - barHeightNew), barWidth, barHeightNew);
|
||||
drawTexture(x + barX, y + barY + barHeight - barHeightNew, 178, 0 + (barHeight - barHeightNew), barWidth, barHeightNew);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -31,7 +31,7 @@ public class GuiDestructor extends GuiBase
|
||||
{
|
||||
bindTexture("gui/destructor.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package storagecraft.gui;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
import java.io.IOException;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import storagecraft.StorageCraft;
|
||||
import storagecraft.container.ContainerDetector;
|
||||
@@ -10,8 +11,6 @@ import storagecraft.network.MessageDetectorAmountUpdate;
|
||||
import storagecraft.tile.TileDetector;
|
||||
import storagecraft.util.InventoryUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class GuiDetector extends GuiBase
|
||||
{
|
||||
private TileDetector detector;
|
||||
@@ -52,7 +51,7 @@ public class GuiDetector extends GuiBase
|
||||
{
|
||||
bindTexture("gui/detector.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
|
||||
amountField.drawTextBox();
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ public class GuiDrive extends GuiBase
|
||||
{
|
||||
bindTexture("gui/drive.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -36,7 +36,7 @@ public class GuiExporter extends GuiBase
|
||||
{
|
||||
bindTexture("gui/exporter.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -31,7 +31,7 @@ public class GuiExternalStorage extends GuiBase
|
||||
{
|
||||
bindTexture("gui/external_storage.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,5 +1,10 @@
|
||||
package storagecraft.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -21,12 +26,6 @@ import storagecraft.storage.StorageItem;
|
||||
import storagecraft.tile.TileController;
|
||||
import storagecraft.tile.TileGrid;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiGrid extends GuiBase
|
||||
{
|
||||
public static final int SORTING_DIRECTION_ASCENDING = 0;
|
||||
@@ -139,7 +138,7 @@ public class GuiGrid extends GuiBase
|
||||
bindTexture("gui/grid.png");
|
||||
}
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
|
||||
searchField.drawTextBox();
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ public class GuiImporter extends GuiBase
|
||||
{
|
||||
bindTexture("gui/importer.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -31,11 +31,11 @@ public class GuiSolderer extends GuiBase
|
||||
{
|
||||
bindTexture("gui/solderer.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
|
||||
if (solderer.isWorking())
|
||||
{
|
||||
drawTexturedModalRect(x + 83, y + 40 - 1, 177, 0, solderer.getProgressScaled(22), 15);
|
||||
drawTexture(x + 83, y + 40 - 1, 177, 0, solderer.getProgressScaled(22), 15);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,13 +31,13 @@ public class GuiWirelessTransmitter extends GuiBase
|
||||
{
|
||||
bindTexture("gui/wireless_transmitter.png");
|
||||
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
drawTexture(x, y, 0, 0, xSize, ySize);
|
||||
|
||||
if (wirelessTransmitter.isWorking())
|
||||
{
|
||||
int progress = (int) ((float) wirelessTransmitter.getProgress() / (float) TileWirelessTransmitter.TOTAL_PROGRESS * 14f);
|
||||
|
||||
drawTexturedModalRect(x + 36 - 1, y + 21 - 1 + progress, 178, 0 + progress, 14, 14);
|
||||
drawTexture(x + 36 - 1, y + 21 - 1 + progress, 178, 0 + progress, 14, 14);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,7 @@ public class SideButtonCompare extends SideButton
|
||||
|
||||
int tx = (setting.getCompare() & mask) == mask ? 0 : 16;
|
||||
|
||||
gui.drawTexturedModalRect(x, y + 2, tx, ty, 16, 16);
|
||||
gui.drawTexture(x, y + 2, tx, ty, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,7 +22,7 @@ public class SideButtonGridSortingDirection extends SideButton
|
||||
public void draw(GuiBase gui, int x, int y)
|
||||
{
|
||||
gui.bindTexture("icons.png");
|
||||
gui.drawTexturedModalRect(x, y + 2, GuiGrid.SORTING_DIRECTION * 16, 16, 16, 16);
|
||||
gui.drawTexture(x, y + 2, GuiGrid.SORTING_DIRECTION * 16, 16, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,7 +22,7 @@ public class SideButtonGridSortingType extends SideButton
|
||||
public void draw(GuiBase gui, int x, int y)
|
||||
{
|
||||
gui.bindTexture("icons.png");
|
||||
gui.drawTexturedModalRect(x, y + 2, GuiGrid.SORTING_TYPE * 16, 32, 16, 16);
|
||||
gui.drawTexture(x, y + 2, GuiGrid.SORTING_TYPE * 16, 32, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -31,7 +31,7 @@ public class SideButtonImporterMode extends SideButton
|
||||
public void draw(GuiBase gui, int x, int y)
|
||||
{
|
||||
gui.bindTexture("icons.png");
|
||||
gui.drawTexturedModalRect(x, y + 1, importer.getMode() * 16, 64, 16, 16);
|
||||
gui.drawTexture(x, y + 1, importer.getMode() * 16, 64, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -31,7 +31,7 @@ public class SideButtonRedstoneMode extends SideButton
|
||||
public void draw(GuiBase gui, int x, int y)
|
||||
{
|
||||
gui.bindTexture("icons.png");
|
||||
gui.drawTexturedModalRect(x, y + 1, setting.getRedstoneMode().id * 16, 0, 16, 16);
|
||||
gui.drawTexture(x, y + 1, setting.getRedstoneMode().id * 16, 0, 16, 16);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user