use of mcjty.lib.gui.Window in project RFToolsDimensions by McJty.
the class GuiRFToolsManual 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(RFToolsDim.instance, mc, this).setText(manualText).setArrowImage(iconGuiElements, 144, 0).setCraftingGridImage(iconGuiElements, 0, 192);
prevButton = new Button(mc, this).setText("<").addButtonEvent(new ButtonEvent() {
@Override
public void buttonClicked(Widget parent) {
textPage.prevPage();
window.setTextFocus(textPage);
}
});
pageLabel = new Label(mc, this).setText("0 / 0");
nextButton = new Button(mc, this).setText(">").addButtonEvent(new ButtonEvent() {
@Override
public void buttonClicked(Widget parent) {
textPage.nextPage();
window.setTextFocus(textPage);
}
});
Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(16).addChild(prevButton).addChild(pageLabel).addChild(nextButton);
Widget 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;
}
}
use of mcjty.lib.gui.Window in project RFToolsDimensions by McJty.
the class GuiDimensionEnscriber method initGui.
@Override
public void initGui() {
super.initGui();
extractButton = new Button(mc, this).setText("Extract").setLayoutHint(new PositionalLayout.PositionalHint(13, 164, 60, 16)).addButtonEvent(new ButtonEvent() {
@Override
public void buttonClicked(Widget parent) {
extractDimlets();
}
}).setTooltips("Extract the dimlets out of", "a realized dimension tab");
storeButton = new Button(mc, this).setText("Store").setLayoutHint(new PositionalLayout.PositionalHint(13, 182, 60, 16)).addButtonEvent(new ButtonEvent() {
@Override
public void buttonClicked(Widget parent) {
storeDimlets();
}
}).setTooltips("Store dimlets in a", "empty dimension tab");
nameField = new TextField(mc, this).addTextEvent(new TextEvent() {
@Override
public void textChanged(Widget parent, String newText) {
storeName(newText);
}
}).setLayoutHint(new PositionalLayout.PositionalHint(13, 200, 60, 16));
validateField = new Label(mc, this).setText("Val");
validateField.setTooltips("Hover here for errors...");
validateField.setLayoutHint(new PositionalLayout.PositionalHint(35, 142, 38, 16));
setNameFromDimensionTab();
Widget toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(extractButton).addChild(storeButton).addChild(nameField).addChild(validateField);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFToolsDimensions by McJty.
the class GuiDimletWorkbench method initGui.
@Override
public void initGui() {
super.initGui();
searchBar = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(120, 7, 128, 16)).addTextEvent((widget, string) -> {
itemList.setSelected(-1);
listDirty = true;
});
itemList = new WidgetList(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(120, 25, 118, 108)).setLeftMargin(0).setRowheight(-1).addSelectionEvent(new SelectionEvent() {
@Override
public void select(Widget widget, int i) {
}
@Override
public void doubleClick(Widget widget, int i) {
suggestParts();
}
});
slider = new Slider(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(239, 25, 9, 108)).setDesiredWidth(11).setVertical().setScrollable(itemList);
int maxEnergyStored = tileEntity.getMaxEnergyStored(EnumFacing.DOWN);
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(80, 9, 38, 10)).setShowText(false).setHorizontal();
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
extractButton = new Button(mc, this).setText("Extract").setLayoutHint(new PositionalLayout.PositionalHint(30, 7, 48, 14)).addButtonEvent(parent -> extractDimlet()).setTooltips("Deconstruct a dimlet into its parts");
Widget toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(extractButton).addChild(energyBar).addChild(itemList).addChild(slider).addChild(searchBar);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
listDirty = true;
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiScreenController 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());
Button scanButton = new Button(mc, this).setText("Scan").setTooltips("Find all nearby screens", "and connect to them").setLayoutHint(new PositionalLayout.PositionalHint(30, 7, 50, 14));
scanButton.addButtonEvent(parent -> sendServerCommand(RFToolsMessages.INSTANCE, ScreenControllerTileEntity.CMD_SCAN));
Button detachButton = new Button(mc, this).setText("Detach").setTooltips("Detach from all screens").setLayoutHint(new PositionalLayout.PositionalHint(90, 7, 50, 14));
detachButton.addButtonEvent(parent -> sendServerCommand(RFToolsMessages.INSTANCE, ScreenControllerTileEntity.CMD_DETACH));
infoLabel = new Label(mc, this);
infoLabel.setLayoutHint(new PositionalLayout.PositionalHint(30, 25, 140, 14));
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(scanButton).addChild(detachButton).addChild(infoLabel);
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 GuiPowerCell method initGui.
@Override
public void initGui() {
super.initGui();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(1000).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(0);
Button allNone = new Button(mc, this).setText("None").setTooltips("Set all sides to 'none'").setLayoutHint(new PositionalLayout.PositionalHint(140, 10, 32, 15)).addButtonEvent(e -> sendServerCommand(RFToolsMessages.INSTANCE, PowerCellTileEntity.CMD_SETNONE));
Button allInput = new Button(mc, this).setText("In").setTooltips("Set all sides to", "accept energy").setLayoutHint(new PositionalLayout.PositionalHint(140, 27, 32, 15)).addButtonEvent(e -> sendServerCommand(RFToolsMessages.INSTANCE, PowerCellTileEntity.CMD_SETINPUT));
Button allOutput = new Button(mc, this).setText("Out").setTooltips("Set all sides to", "send energy").setLayoutHint(new PositionalLayout.PositionalHint(140, 44, 32, 15)).addButtonEvent(e -> sendServerCommand(RFToolsMessages.INSTANCE, PowerCellTileEntity.CMD_SETOUTPUT));
stats = new Button(mc, this).setText("Stats").setTooltips("Power statistics. Press to clear:").setLayoutHint(new PositionalLayout.PositionalHint(100, 10, 32, 15)).addButtonEvent(e -> sendServerCommand(RFToolsMessages.INSTANCE, PowerCellTileEntity.CMD_CLEARSTATS));
Label label = new Label(mc, this);
label.setText("Link:").setTooltips("Link a powercard to card", "on the left").setLayoutHint(new PositionalLayout.PositionalHint(26, 30, 40, 18));
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(allNone).addChild(allInput).addChild(allOutput).addChild(label).addChild(stats);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
requestRF();
}
Aggregations