use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiSecurityManager method initGui.
@Override
public void initGui() {
super.initGui();
players = new WidgetList(mc, this);
Slider allowedPlayerSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(players);
Panel allowedPlayersPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(players).addChild(allowedPlayerSlider).setLayoutHint(new PositionalLayout.PositionalHint(72, 5, SECURITYMANAGER_WIDTH - 76, 96));
nameField = new TextField(mc, this).setDesiredHeight(15);
addButton = new Button(mc, this).setText("Add").setDesiredHeight(14).setDesiredWidth(34).setTooltips("Add a player to the access list").addButtonEvent(parent -> addPlayer());
delButton = new Button(mc, this).setText("Del").setDesiredHeight(14).setDesiredWidth(34).setTooltips("Remove the selected player", "from the access list").addButtonEvent(parent -> delPlayer());
Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(nameField).addChild(addButton).addChild(delButton).setDesiredHeight(16).setLayoutHint(new PositionalLayout.PositionalHint(72, 100, SECURITYMANAGER_WIDTH - 76, 14));
channelNameField = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(8, 27, 60, 14)).addTextEvent((parent, newText) -> updateChannelName());
blacklistMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(10, 44, 16, 16)).setTooltips("Black or whitelist mode").addChoiceEvent((parent, newChoice) -> updateSettings());
blacklistMode.addChoice("White", "Whitelist players", guiElements, 15 * 16, 32);
blacklistMode.addChoice("Black", "Blacklist players", guiElements, 14 * 16, 32);
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(allowedPlayersPanel).addChild(buttonPanel).addChild(channelNameField).addChild(blacklistMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
Keyboard.enableRepeatEvents(true);
channelFromServer = null;
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiDevelopersDelight method initGui.
@Override
public void initGui() {
super.initGui();
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
tabbedPanel = new TabbedPanel(mc, this);
Panel tab1 = createBlockClassesPage();
Panel tab2 = createTeClassesPage();
Panel tab3 = createNbtDataPage();
tabbedPanel.addPage("Block", tab1).addPage("TE", tab2).addPage("NBT", tab3);
ToggleButton tab1Button = createToggleButton("Block");
ToggleButton tab2Button = createToggleButton("TE");
ToggleButton tab3Button = createToggleButton("NBT");
clientServerMode = new ChoiceLabel(mc, this).setDesiredWidth(60).addChoices("Server", "Client").setChoice("Server").addChoiceEvent((parent, newChoice) -> requestNewLists()).setDesiredHeight(16).setTooltips("Switch between client", "and server information");
metaData = new TextField(mc, this).setDesiredHeight(14).setTooltips("Metadata for this block");
Panel buttonPanel = new Panel(mc, this).setLayout(new VerticalLayout()).setDesiredWidth(62).addChild(tab1Button).addChild(tab2Button).addChild(tab3Button).addChild(new Label(mc, this).setDynamic(true)).addChild(clientServerMode).addChild(metaData).addChild(new Label(mc, this).setDynamic(true));
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new HorizontalLayout()).addChild(buttonPanel).addChild(tabbedPanel);
toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
window = new Window(this, toplevel);
requestNewLists();
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiAdvancedPorter method initGui.
@Override
public void initGui() {
super.initGui();
int k = (this.width - xSize) / 2;
int l = (this.height - ySize) / 2;
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout().setSpacing(0));
for (int i = 0; i < AdvancedChargedPorterItem.MAXTARGETS; i++) {
destinations[i] = new TextField(mc, this);
panels[i] = createPanel(destinations[i], i);
toplevel.addChild(panels[i]);
}
toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
window = new Window(this, toplevel);
updateInfoFromServer();
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiModifier method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(iconLocation);
mode = new ChoiceLabel(mc, this).addChoices(ModifierFilterType.FILTER_SLOT.getCode(), ModifierFilterType.FILTER_ORE.getCode(), ModifierFilterType.FILTER_LIQUID.getCode(), ModifierFilterType.FILTER_TILEENTITY.getCode());
mode.setLayoutHint(new PositionalLayout.PositionalHint(30, 9, 45, 14));
toplevel.addChild(mode);
op = new ChoiceLabel(mc, this).addChoices(ModifierFilterOperation.OPERATION_SLOT.getCode(), ModifierFilterOperation.OPERATION_VOID.getCode());
op.setLayoutHint(new PositionalLayout.PositionalHint(110, 9, 40, 14));
toplevel.addChild(op);
add = new Button(mc, this).setText("Add");
add.setLayoutHint(new PositionalLayout.PositionalHint(10, 30, 40, 13));
add.addButtonEvent(parent -> addOp());
toplevel.addChild(add);
del = new Button(mc, this).setText("Del");
del.setLayoutHint(new PositionalLayout.PositionalHint(52, 30, 40, 13));
del.addButtonEvent(parent -> delOp());
toplevel.addChild(del);
up = new Button(mc, this).setText("Up");
up.setLayoutHint(new PositionalLayout.PositionalHint(110, 30, 30, 13));
up.addButtonEvent(parent -> upOp());
toplevel.addChild(up);
down = new Button(mc, this).setText("Down");
down.setLayoutHint(new PositionalLayout.PositionalHint(142, 30, 30, 13));
down.addButtonEvent(parent -> downOp());
toplevel.addChild(down);
list = new WidgetList(mc, this);
list.setLayoutHint(new PositionalLayout.PositionalHint(9, 45, 153, 95));
toplevel.addChild(list);
Slider slider = new Slider(mc, this).setVertical().setScrollable(list);
slider.setLayoutHint(new PositionalLayout.PositionalHint(162, 45, 10, 95));
toplevel.addChild(slider);
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 GuiBuilder 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, 6, 8, 59)).setShowText(false);
energyBar.setValue(getCurrentRF());
initRedstoneMode();
configButton = new Button(mc, this).setText("?");
configButton.setLayoutHint(new PositionalLayout.PositionalHint(83, 12, 13, 12));
configButton.addButtonEvent(parent -> openCardGui());
configButton.setTooltips("Click to open the card gui");
currentLevel = new Button(mc, this);
currentLevel.setText("Y:").setTooltips("Current level the builder is at", TextFormatting.YELLOW + "Press to restart!").setLayoutHint(new PositionalLayout.PositionalHint(81, 31, 45, 13)).addButtonEvent(parent -> restart());
Panel positionPanel = setupPositionPanel();
Panel modePanel = setupModePanel();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(modePanel).addChild(positionPanel).addChild(configButton).addChild(currentLevel).addChild(redstoneMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
tileEntity.requestCurrentLevel();
}
Aggregations