@Override public boolean onMousePressed(int mouseX, int mouseY, int mouseButton) throws IOException { if (!isFullyOpened()) { return false; handleTransferChange(0, mouseButton); } else if (8 <= mouseX && mouseX < 24 && 54 <= mouseY && mouseY < 68) { handleTransferChange(1, mouseButton); } else if (52 <= mouseX && mouseX < 68 && 24 <= mouseY && mouseY < 40) { handleSideChange(BlockHelper.SIDE_ABOVE[myTileFacing.getFacing()], mouseButton); } else if (32 <= mouseX && mouseX < 48 && 44 <= mouseY && mouseY < 60) { handleSideChange(BlockHelper.SIDE_LEFT[myTileFacing.getFacing()], mouseButton); } else if (52 <= mouseX && mouseX < 68 && 44 <= mouseY && mouseY < 60) { handleSideChange(myTileFacing.getFacing(), mouseButton); } else if (72 <= mouseX && mouseX < 88 && 44 <= mouseY && mouseY < 60) { handleSideChange(BlockHelper.SIDE_RIGHT[myTileFacing.getFacing()], mouseButton); } else if (52 <= mouseX && mouseX < 68 && 64 <= mouseY && mouseY < 80) { handleSideChange(BlockHelper.SIDE_BELOW[myTileFacing.getFacing()], mouseButton); } else if (72 <= mouseX && mouseX < 88 && 64 <= mouseY && mouseY < 80) { handleSideChange(BlockHelper.SIDE_OPPOSITE[myTileFacing.getFacing()], mouseButton);
@Override protected void drawForeground() { drawTabIcon(CoreTextures.ICON_CONFIG); if (!isFullyOpened()) { return; getFontRenderer().drawStringWithShadow(StringHelper.localize("info.cofh.configuration"), sideOffset() + 18, 6, headerColor); RenderHelper.setBlockTextureSheet();
@Override protected void drawBackground() { super.drawBackground(); if (!isFullyOpened()) { return; } float colorR = (backgroundColor >> 16 & 255) / 255.0F * 0.6F; float colorG = (backgroundColor >> 8 & 255) / 255.0F * 0.6F; float colorB = (backgroundColor & 255) / 255.0F * 0.6F; GlStateManager.color(colorR, colorG, colorB, 1.0F); gui.drawTexturedModalRect(28, 20, 16, 20, 64, 64); gui.drawTexturedModalRect(6, 32, 16, 20, 20, 40); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); }
@Override public void initGui() { super.initGui(); // Right Side redstoneTab = addTab(new TabRedstoneControl(this, baseTile)); if (baseTile.hasTransferIn() || baseTile.hasTransferOut()) { configTab = addTab(new TabConfigurationTransfer(this, baseTile)); } else { configTab = addTab(new TabConfiguration(this, baseTile)); } // Left Side securityTab = addTab(new TabSecurity(this, baseTile, playerName)); securityTab.setVisible(baseTile.enableSecurity() && baseTile.isSecured()); if (!myInfo.isEmpty()) { addTab(new TabInfo(this, myInfo)); } }
@Override public void addTooltip(List<String> list) { if (!isFullyOpened()) { list.add(StringHelper.localize("info.cofh.configuration")); return; } int x = gui.getMouseX() - currentShiftX; int y = gui.getMouseY() - currentShiftY; if (8 <= x && x < 24 && 34 <= y && y < 50) { if (myTileControl.hasTransferIn()) { list.add(myTileControl.getTransferIn() ? StringHelper.localize("gui.cofh.transferInEnabled") : StringHelper.localize("gui.cofh.transferInDisabled")); } else { list.add(StringHelper.localize("gui.cofh.transferInUnavailable")); } } else if (8 <= x && x < 24 && 54 <= y && y < 68) { if (myTileControl.hasTransferOut()) { list.add(myTileControl.getTransferOut() ? StringHelper.localize("gui.cofh.transferOutEnabled") : StringHelper.localize("gui.cofh.transferOutDisabled")); } else { list.add(StringHelper.localize("gui.cofh.transferOutUnavailable")); } } }
@Override public void initGui() { super.initGui(); // Right Side augmentTab = addTab(new TabAugment(this, (IAugmentableContainer) inventorySlots)); redstoneTab = addTab(new TabRedstoneControl(this, baseTile)); redstoneTab.setVisible(baseTile.hasRedstoneControl()); configTab = addTab(new TabConfigurationTransfer(this, baseTile)); // Left Side securityTab = addTab(new TabSecurity(this, baseTile, playerName)); securityTab.setVisible(baseTile.enableSecurity() && baseTile.isSecured()); if (baseTile.getMaxEnergyStored(null) > 0) { addTab(new TabEnergy(this, baseTile, false).displayStored(!baseTile.smallStorage())); } if (!myInfo.isEmpty()) { addTab(new TabInfo(this, myInfo)); } }