public boolean hideOverlays() { for (IGuiOverlay overlay : overlays) { if (overlay.isVisible()) { overlay.setIsVisible(false); return true; } } return false; }
@Override public void onGuiClosed() { for (IGuiOverlay overlay : overlays) { overlay.guiClosed(); } }
@Override protected boolean isPointInRegion(int p_146978_1_, int p_146978_2_, int p_146978_3_, int p_146978_4_, int p_146978_5_, int p_146978_6_) { int x = Mouse.getEventX() * this.width / this.mc.displayWidth; int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; for (IGuiOverlay overlay : overlays) { if (overlay != null && overlay.isVisible() && overlay.isMouseInBounds(x, y)) { return false; } } return super.isPointInRegion(p_146978_1_, p_146978_2_, p_146978_3_, p_146978_4_, p_146978_5_, p_146978_6_); }
@Override public void handleMouseInput() throws IOException { int x = Mouse.getEventX() * this.width / this.mc.displayWidth; int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; int b = Mouse.getEventButton(); for (IGuiOverlay overlay : overlays) { if (overlay != null && overlay.isVisible() && overlay.handleMouseInput(x, y, b)) { return; } } int delta = Mouse.getEventDWheel(); if (delta != 0) { mouseWheel(x, y, delta); } super.handleMouseInput(); }
@Override protected final void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { drawForegroundImpl(mouseX, mouseY); GlStateManager.pushMatrix(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableDepth(); zLevel = 300.0F; itemRender.zLevel = 300.0F; for (IGuiOverlay overlay : overlays) { if (overlay != null && overlay.isVisible()) { overlay.draw(realMx, realMy, mc.getRenderPartialTicks()); } } zLevel = 0F; itemRender.zLevel = 0F; GlStateManager.enableDepth(); GlStateManager.popMatrix(); }
@Override public void initGui() { super.initGui(); fixupGuiPosition(); for (IGuiOverlay overlay : overlays) { overlay.init(this); } for (TextFieldEnder f : textFields) { f.init(this); } }
@Override public void initGui() { super.initGui(); int x = getGuiLeft() + 36; int y = getGuiTop() + 43; buttonList.add(createLockButton(TileFarmStation.minSupSlot + 0, x, y)); buttonList.add(createLockButton(TileFarmStation.minSupSlot + 1, x + 52, y)); buttonList.add(createLockButton(TileFarmStation.minSupSlot + 2, x, y + 20)); buttonList.add(createLockButton(TileFarmStation.minSupSlot + 3, x + 52, y + 20)); ((FarmStationContainer) inventorySlots).createGhostSlots(getGhostSlotHandler()); showRangeB.onGuiInit(); showRangeB.setSelected(getTileEntity().isShowingRange()); for (IGuiOverlay overlay : overlays) { if (overlay instanceof GuiOverlayIoConfig) { overlay.getBounds().width -= EXTRA_WITH; } } }
@Override protected void keyTyped(char par1, int par2) { if (par2 == 1) { for (IGuiOverlay overlay : overlays) { if (overlay.isVisible()) { overlay.setIsVisible(false); return; } } mc.player.closeScreen(); } for (int i = 0; i < tabs.size(); i++) { if (i == activeTab) { tabs.get(i).keyTyped(par1, par2); return; } } }