@Override public void initGui() { super.initGui(); int maxEnergyStored = tileEntity.getMaxEnergyStored(ForgeDirection.DOWN); energyBar = new EnergyBar(mc, this) .setVertical() .setMaxValue(maxEnergyStored) .setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)) .setShowText(false); energyBar.setValue(tileEntity.getCurrentRF()); Panel toplevel = new Panel(mc, this) .setBackground(iconLocation) .setLayout(new PositionalLayout()) .addChild(energyBar); for (int i = 0; i < 4; i++) { global[i] = new ImageChoiceLabel(mc, this); final int finalI = i; global[i].addChoiceEvent( new ChoiceEvent() { @Override public void choiceChanged(Widget parent, String newChoice) { changeGlobal(finalI); } }); global[i].addChoice("off" + i, "Inter-dimensional access only", guiElements, 0, 32); global[i].addChoice("on" + i, "Cross-dimension access enabled", guiElements, 16, 32); global[i].setLayoutHint( new PositionalLayout.PositionalHint( i < 2 ? (43 - 18) : (120 - 18), (i % 2) == 0 ? 9 : 36, 16, 16)); global[i].setCurrentChoice(tileEntity.isGlobal(i) ? 1 : 0); toplevel.addChild(global[i]); } toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize)); window = new Window(this, toplevel); }
@Override protected void drawGuiContainerBackgroundLayer(float v, int i, int i2) { drawWindow(); energyBar.setValue(tileEntity.getCurrentRF()); tileEntity.requestRfFromServer(); }