Make side buttons be left instead of right, fix some JEI stuff

This commit is contained in:
Raoul Van den Berge
2016-03-30 19:07:13 +02:00
parent 2dc0ed07ab
commit 8d40203f84
5 changed files with 13 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ public abstract class GuiBase extends GuiContainer {
private int lastButtonId = 0;
private int lastSideButtonY = 6;
private String sideButtonTooltip;
protected int width;
protected int height;
@@ -78,17 +79,21 @@ public abstract class GuiBase extends GuiContainer {
mouseX -= guiLeft;
mouseY -= guiTop;
sideButtonTooltip = null;
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)) {
drawTooltip(mouseX, mouseY, sideButton.getTooltip(this));
sideButtonTooltip = sideButton.getTooltip(this);
}
}
drawForeground(mouseX, mouseY);
if (sideButtonTooltip != null) {
drawTooltip(mouseX, mouseY, sideButtonTooltip);
}
}
@Override
@@ -115,7 +120,7 @@ public abstract class GuiBase extends GuiContainer {
}
public void addSideButton(SideButton button) {
button.setX(xSize - 1);
button.setX(-SIDE_BUTTON_WIDTH + 1);
button.setY(lastSideButtonY);
button.setId(addButton(guiLeft + button.getX(), guiTop + button.getY(), SIDE_BUTTON_WIDTH, SIDE_BUTTON_HEIGHT).id);

View File

@@ -293,7 +293,7 @@ public class GuiGrid extends GuiBase {
@Override
protected void keyTyped(char character, int keyCode) throws IOException {
if (!checkHotbarKeys(keyCode) && searchField.textboxKeyTyped(character, keyCode)) {
if (PluginRefinedStorage.isJeiLoaded()) {
if (PluginRefinedStorage.isJeiLoaded() && grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED) {
PluginRefinedStorage.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText());
}
} else {

View File

@@ -26,7 +26,7 @@ public class SideButtonGridSearchBoxMode extends SideButton {
@Override
public void draw(GuiBase gui, int x, int y) {
gui.bindTexture("icons.png");
gui.drawTexture(x - 1, y + 2 - 1, 0, 96, 16, 16);
gui.drawTexture(x, y + 2 - 1, 0, 96, 16, 16);
}
@Override