@Override protected void drawForeground() { drawTabIcon(CoreTextures.ICON_REDSTONE_ON); if (!isFullyOpened()) { return; } getFontRenderer().drawStringWithShadow(StringHelper.localize("info.cofh.redstoneControl"), sideOffset() + 18, 6, headerColor); getFontRenderer().drawStringWithShadow(StringHelper.localize("info.cofh.controlStatus") + ":", sideOffset() + 6, 42, subheaderColor); getFontRenderer().drawStringWithShadow(StringHelper.localize("info.cofh.signalRequired") + ":", sideOffset() + 6, 66, subheaderColor); if (myContainer.getControl().isDisabled()) { gui.drawButton(CoreTextures.ICON_REDSTONE_OFF, 28, 20, 1); gui.drawButton(CoreTextures.ICON_RS_TORCH_OFF, 48, 20, 0); gui.drawButton(CoreTextures.ICON_RS_TORCH_ON, 68, 20, 0); getFontRenderer().drawString(StringHelper.localize("info.cofh.disabled"), sideOffset() + 14, 54, textColor); getFontRenderer().drawString(StringHelper.localize("info.cofh.ignored"), sideOffset() + 14, 78, textColor); } else { getFontRenderer().drawString(StringHelper.localize("info.cofh.enabled"), sideOffset() + 14, 54, textColor); gui.drawButton(CoreTextures.ICON_REDSTONE_OFF, 28, 20, 0); if (myContainer.getControl().isLow()) { gui.drawButton(CoreTextures.ICON_RS_TORCH_OFF, 48, 20, 1); gui.drawButton(CoreTextures.ICON_RS_TORCH_ON, 68, 20, 0); getFontRenderer().drawString(StringHelper.localize("info.cofh.low"), sideOffset() + 14, 78, textColor); } else { gui.drawButton(CoreTextures.ICON_RS_TORCH_OFF, 48, 20, 0); gui.drawButton(CoreTextures.ICON_RS_TORCH_ON, 68, 20, 1); getFontRenderer().drawString(StringHelper.localize("info.cofh.high"), sideOffset() + 14, 78, textColor); } } 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 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(24, 16, 16, 20, 64, 24); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); }
@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)); } }
@Override public void addTooltip(List<String> list) { if (!isFullyOpened()) { list.add(StringHelper.localize("info.cofh.redstoneControl")); if (myContainer.getControl().isDisabled()) { list.add(StringHelper.YELLOW + StringHelper.localize("info.cofh.disabled")); return; } else if (myContainer.getControl().isLow()) { list.add(StringHelper.YELLOW + StringHelper.localize("info.cofh.enabled") + ", " + StringHelper.localize("info.cofh.low")); return; } list.add(StringHelper.YELLOW + StringHelper.localize("info.cofh.enabled") + ", " + StringHelper.localize("info.cofh.high")); return; } int x = gui.getMouseX() - currentShiftX; int y = gui.getMouseY() - currentShiftY; if (28 <= x && x < 44 && 20 <= y && y < 36) { list.add(StringHelper.localize("info.cofh.ignored")); } else if (48 <= x && x < 64 && 20 <= y && y < 36) { list.add(StringHelper.localize("info.cofh.low")); } else if (68 <= x && x < 84 && 20 <= y && y < 36) { list.add(StringHelper.localize("info.cofh.high")); } }
@Override public void initGui() { super.initGui(); // Right Side redstoneTab = addTab(new TabRedstoneControl(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)); } addElement(new ElementFluidTank(this, 80, 19, baseTile.getTank()).setMedium().setGauge(0).setAlwaysShow(true).setInfinite(baseTile.isCreative)); output = new ElementButton(this, 35, 41, "Output", 176, 0, 176, 16, 176, 32, 16, 16, TEX_PATH).setToolTipLocalized(true); lock = new ElementButton(this, 125, 41, "Lock", 176, 48, 176, 64, 176, 80, 16, 16, TEX_PATH).setToolTipLocalized(true); addElement(output); addElement(lock); }
@Override public boolean onMousePressed(int mouseX, int mouseY, int mouseButton) { if (!isFullyOpened()) { return false;
@Override public void initGui() { super.initGui(); addElement(new ElementEnergyStored(this, 80, 18, baseTile.getEnergyStorage())); // Right Side steamTab = (TabSteam) addTab(new TabSteam(this, baseTile, baseTile.isSteamProducer())); steamTab.setVisible(baseTile.showSteamTab()); augmentTab = addTab(new TabAugment(this, (IAugmentableContainer) inventorySlots)); redstoneTab = addTab(new TabRedstoneControl(this, baseTile)); redstoneTab.setVisible(baseTile.hasRedstoneControl()); // Left Side securityTab = addTab(new TabSecurity(this, baseTile, playerName)); securityTab.setVisible(baseTile.enableSecurity() && baseTile.isSecured()); energyTab = addTab(new TabEnergy(this, baseTile, true).displayStored(!baseTile.smallStorage())); energyTab.setVisible(baseTile.showEnergyTab()); if (!myInfo.isEmpty()) { addTab(new TabInfo(this, myInfo + "\n\n" + StringHelper.localize("tab.thermalexpansion.dynamo.0"))); } MinecraftForge.EVENT_BUS.register(this); }
addTab(new TabRedstoneControl(this, conBase));
@Override public void initGui() { super.initGui(); // Right Side redstoneTab = addTab(new TabRedstoneControl(this, baseTile)); 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)); } addElement(new ElementEnergyStored(this, 80, 18, baseTile.getEnergyStorage()).setInfinite(baseTile.isCreative)); ElementSimple infoInput = (ElementSimple) new ElementSimple(this, 33, 16).setToolTip("info.cofh.input").setSize(20, 20).setTexture(TEX_INFO_INPUT, 20, 20); ElementSimple infoOutput = (ElementSimple) new ElementSimple(this, 123, 16).setToolTip("info.cofh.output").setSize(20, 20).setTexture(TEX_INFO_OUTPUT, 20, 20); addElement(infoInput); addElement(infoOutput); decRecv = new ElementButton(this, 28, 56, "DecRecv", 176, 0, 176, 14, 176, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); incRecv = new ElementButton(this, 44, 56, "IncRecv", 190, 0, 190, 14, 190, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); decSend = new ElementButton(this, 118, 56, "DecSend", 176, 0, 176, 14, 176, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); incSend = new ElementButton(this, 134, 56, "IncSend", 190, 0, 190, 14, 190, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); addElement(decRecv); addElement(incRecv); addElement(decSend); addElement(incSend); }