use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiRelay method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
toplevel.addChild(createRedstonePanel());
for (int i = 0; i < 6; i++) {
toplevel.addChild(createSidePanel(i));
}
toplevel.setBounds(new Rectangle(guiLeft, guiTop, RELAY_WIDTH, RELAY_HEIGHT));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiMatterTransmitter method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setFilledRectThickness(1).setHorizontal().setDesiredHeight(12).setDesiredWidth(80).setMaxValue(maxEnergyStored).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
TextField textField = new TextField(mc, this).setTooltips("Use this name to", "identify this transmitter", "in the dialer").addTextEvent((parent, newText) -> setTransmitterName(newText));
textField.setText(tileEntity.getName());
Panel namePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(textField).setDesiredHeight(16);
privateSetting = new ChoiceLabel(mc, this).addChoices(ACCESS_PUBLIC, ACCESS_PRIVATE).setDesiredHeight(14).setDesiredWidth(60).setChoiceTooltip(ACCESS_PUBLIC, "Everyone can access this transmitter", "and change the dialing destination").setChoiceTooltip(ACCESS_PRIVATE, "Only people in the access list below", "can access this transmitter").addChoiceEvent((parent, newChoice) -> changeAccessMode(newChoice));
if (tileEntity.isPrivateAccess()) {
privateSetting.setChoice(ACCESS_PRIVATE);
} else {
privateSetting.setChoice(ACCESS_PUBLIC);
}
beamToggle = new ToggleButton(mc, this).setText("Hide").setCheckMarker(true).setDesiredHeight(14).setDesiredWidth(49).setTooltips("Hide the teleportation beam").addButtonEvent(parent -> changeBeamState()).setPressed(tileEntity.isBeamHidden());
Panel privatePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Access:")).addChild(privateSetting).addChild(beamToggle).setDesiredHeight(16);
allowedPlayers = new WidgetList(mc, this);
Slider allowedPlayerSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(allowedPlayers);
Panel allowedPlayersPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(allowedPlayers).addChild(allowedPlayerSlider).setFilledBackground(0xff9e9e9e);
nameField = new TextField(mc, this);
addButton = new Button(mc, this).setText("Add").setDesiredHeight(13).setDesiredWidth(34).setTooltips("Add a player to the access list").addButtonEvent(parent -> addPlayer());
delButton = new Button(mc, this).setText("Del").setDesiredHeight(13).setDesiredWidth(34).setTooltips("Remove the selected player", "from the access list").addButtonEvent(parent -> delPlayer());
Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(nameField).addChild(addButton).addChild(delButton).setDesiredHeight(16);
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout().setHorizontalMargin(3).setVerticalMargin(3).setSpacing(1)).addChild(energyBar).addChild(namePanel).addChild(privatePanel).addChild(allowedPlayersPanel).addChild(buttonPanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, MATTER_WIDTH, MATTER_HEIGHT));
window = new Window(this, toplevel);
Keyboard.enableRepeatEvents(true);
listDirty = 0;
requestPlayers();
tileEntity.requestRfFromServer(RFTools.MODID);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiRemoteStorage 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);
for (int i = 0; i < 4; i++) {
global[i] = new ImageChoiceLabel(mc, this);
final int finalI = i;
global[i].addChoiceEvent((parent, newChoice) -> changeGlobal(finalI));
global[i].addChoice("off" + i, "Cross-dimension access disabled", 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);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiElevator 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 floor").addTextEvent((parent, newText) -> updateName());
nameField.setText(tileEntity.getName());
Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(nameField);
toplevel.addChild(bottomPanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, WIDTH, HEIGHT));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiEnderMonitor method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
Label label = new Label(mc, this).setText("Mode:");
initGuiMode();
Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(label).addChild(mode);
toplevel.addChild(bottomPanel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, MONITOR_WIDTH, MONITOR_HEIGHT));
window = new Window(this, toplevel);
}
Aggregations