use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiMatterBeamer method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiSpawner method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
blocks[0] = new BlockRender(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(80, 5, 18, 18));
blocks[1] = new BlockRender(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(80, 25, 18, 18));
blocks[2] = new BlockRender(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(80, 45, 18, 18));
labels[0] = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
labels[0].setLayoutHint(new PositionalLayout.PositionalHint(100, 5, 74, 18));
labels[1] = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
labels[1].setLayoutHint(new PositionalLayout.PositionalHint(100, 25, 74, 18));
labels[2] = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
labels[2].setLayoutHint(new PositionalLayout.PositionalHint(100, 45, 74, 18));
name = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
name.setLayoutHint(new PositionalLayout.PositionalHint(22, 31, 78, 16));
rfTick = new Label(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
rfTick.setLayoutHint(new PositionalLayout.PositionalHint(22, 47, 78, 16));
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(blocks[0]).addChild(labels[0]).addChild(blocks[1]).addChild(labels[1]).addChild(blocks[2]).addChild(labels[2]).addChild(rfTick).addChild(name);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
}
use of mcjty.lib.gui.Window in project XNet by McJty.
the class GuiRouter method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackgrounds(sideBackground, mainBackground).setBackgroundLayout(true, SIDEWIDTH);
toplevel.setBounds(new Rectangle(guiLeft - SIDEWIDTH, guiTop, xSize + SIDEWIDTH, ySize));
toplevel.addChild(initLocalChannelListPanel());
toplevel.addChild(initRemoteChannelListPanel());
toplevel.addChild(new Label<>(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText("Local Channels").setColor(0xff2244aa).setLayoutHint(new PositionalLayout.PositionalHint(6, 8, 166, 13)));
toplevel.addChild(new Label<>(mc, this).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setText("Remote Channels").setColor(0xff2244aa).setLayoutHint(new PositionalLayout.PositionalHint(172, 8, 164, 13)));
window = new Window(this, toplevel);
refresh();
listDirty = 0;
}
use of mcjty.lib.gui.Window in project XNet by McJty.
the class GuiConnector method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
nameField = new TextField(mc, this).setTooltips("Set the name of this connector").addTextEvent((parent, newText) -> updateName());
nameField.setText(tileEntity.getConnectorName());
Panel namePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(nameField);
toplevel.addChild(namePanel);
Panel togglePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Directions:"));
for (EnumFacing facing : EnumFacing.VALUES) {
toggleButtons[facing.ordinal()] = new ToggleButton(mc, this).setText(facing.getName().substring(0, 1).toUpperCase()).addButtonEvent(parent -> {
sendServerCommand(XNetMessages.INSTANCE, ConnectorTileEntity.CMD_ENABLE, new Argument("facing", facing.ordinal()), new Argument("enabled", toggleButtons[facing.ordinal()].isPressed()));
});
toggleButtons[facing.ordinal()].setPressed(tileEntity.isEnabled(facing));
togglePanel.addChild(toggleButtons[facing.ordinal()]);
}
toplevel.addChild(togglePanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, WIDTH, HEIGHT));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project XNet by McJty.
the class GuiXNetManual method initGui.
@Override
public void initGui() {
super.initGui();
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
textPage = new TextPage(XNet.instance, mc, this).setText(manualText).setArrowImage(iconGuiElements, 144, 0).setCraftingGridImage(iconGuiElements, 0, 192);
prevButton = new Button(mc, this).setText("<").addButtonEvent(parent -> {
textPage.prevPage();
window.setTextFocus(textPage);
});
pageLabel = new Label(mc, this).setText("0 / 0");
nextButton = new Button(mc, this).setText(">").addButtonEvent(parent -> {
textPage.nextPage();
window.setTextFocus(textPage);
});
Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(16).addChild(prevButton).addChild(pageLabel).addChild(nextButton);
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout()).addChild(textPage).addChild(buttonPanel);
toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
window = new Window(this, toplevel);
window.setTextFocus(textPage);
if (locatePage != null) {
textPage.gotoNode(locatePage);
locatePage = null;
}
}
Aggregations