use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiBooster method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(8, 101, 10, 76)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
initRedstoneMode();
toplevel.addChild(energyBar).addChild(redstoneMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
Keyboard.enableRepeatEvents(true);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiCrafter method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(12, 141, 10, 76)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
initKeepMode();
initInternalRecipe();
Slider listSlider = initRecipeList();
applyButton = new Button(mc, this).setText("Apply").setTooltips("Press to apply the", "recipe to the crafter").addButtonEvent(parent -> applyRecipe()).setEnabled(false).setLayoutHint(new PositionalLayout.PositionalHint(212, 65, 34, 16));
Button rememberButton = new Button(mc, this).setText("R").setTooltips("Remember the current items", "in the internal and", "external buffers").addButtonEvent(widget -> rememberItems()).setLayoutHint(new PositionalLayout.PositionalHint(148, 74, 18, 16));
Button forgetButton = new Button(mc, this).setText("F").setTooltips("Forget the remembered layout").addButtonEvent(widget -> forgetItems()).setLayoutHint(new PositionalLayout.PositionalHint(168, 74, 18, 16));
initRedstoneMode();
initSpeedMode();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(keepItem).addChild(internalRecipe).addChild(recipeList).addChild(listSlider).addChild(applyButton).addChild(redstoneMode).addChild(speedMode).addChild(rememberButton).addChild(forgetButton);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
if (lastSelected != -1 && lastSelected < tileEntity.getSizeInventory()) {
recipeList.setSelected(lastSelected);
}
// sendChangeToServer(-1, null, null, false, CraftingRecipe.CraftMode.EXT);
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFTools.MODID);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiMatterReceiver 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 receiver", "in the dialer").addTextEvent((parent, newText) -> setReceiverName(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 dial to this receiver").setChoiceTooltip(ACCESS_PRIVATE, "Only people in the access list below", "can dial to this receiver").addChoiceEvent((parent, newChoice) -> changeAccessMode(newChoice));
if (tileEntity.isPrivateAccess()) {
privateSetting.setChoice(ACCESS_PRIVATE);
} else {
privateSetting.setChoice(ACCESS_PUBLIC);
}
Panel privatePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Access:")).addChild(privateSetting).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 GuiCraftingGrid method initGui.
public void initGui(final ModBase modBase, final SimpleNetworkWrapper network, final Minecraft mc, GenericGuiContainer<?> gui, BlockPos pos, CraftingGridProvider provider, int guiLeft, int guiTop, int xSize, int ySize) {
this.mc = mc;
this.gui = gui;
SimpleNetworkWrapper network1 = network;
this.provider = provider;
this.pos = pos;
recipeList = new WidgetList(mc, gui).setLayoutHint(new PositionalLayout.PositionalHint(5, 5, 56, 102));
recipeList.addSelectionEvent(new DefaultSelectionEvent() {
@Override
public void select(Widget parent, int index) {
}
@Override
public void doubleClick(Widget parent, int index) {
selectRecipe();
}
});
craft1Button = new Button(mc, gui).setText("1").setLayoutHint(new PositionalLayout.PositionalHint(29, 183, 14, 10)).setTooltips("Craft one").addButtonEvent(parent -> craft(1));
craft4Button = new Button(mc, gui).setText("4").setLayoutHint(new PositionalLayout.PositionalHint(45, 183, 14, 10)).setTooltips("Craft four").addButtonEvent(parent -> craft(4));
craft8Button = new Button(mc, gui).setText("8").setLayoutHint(new PositionalLayout.PositionalHint(29, 195, 14, 10)).setTooltips("Craft eight").addButtonEvent(parent -> craft(8));
craftSButton = new Button(mc, gui).setText("*").setLayoutHint(new PositionalLayout.PositionalHint(45, 195, 14, 10)).setTooltips("Craft a stack").addButtonEvent(parent -> craft(-1));
storeButton = new Button(mc, gui).setText("Store").setLayoutHint(new PositionalLayout.PositionalHint(5, 109, 56, 14)).setTooltips("Store the current recipe").addButtonEvent(parent -> store());
Panel sidePanel = new Panel(mc, gui).setLayout(new PositionalLayout()).addChild(craft1Button).addChild(craft4Button).addChild(craft8Button).addChild(craftSButton).addChild(storeButton).addChild(recipeList);
int sideLeft = guiLeft - CraftingGridInventory.GRID_WIDTH - 2;
int sideTop = guiTop;
sidePanel.setBounds(new Rectangle(sideLeft, sideTop, CraftingGridInventory.GRID_WIDTH, CraftingGridInventory.GRID_HEIGHT));
sidePanel.setBackground(iconLocation);
craftWindow = new Window(gui, sidePanel);
}
use of mcjty.lib.gui.Window in project RFToolsDimensions by McJty.
the class GuiDimensionBuilder method initGui.
@Override
public void initGui() {
super.initGui();
int maxEnergyStored = tileEntity.getMaxEnergyStored(EnumFacing.DOWN);
energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
stages = new ImageLabel(mc, this).setImage(iconStages, 0, 0);
stages.setLayoutHint(new PositionalLayout.PositionalHint(61, 9, 48, 48));
percentage = new Label(mc, this).setText("0%").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
percentage.setLayoutHint(new PositionalLayout.PositionalHint(115, 25, 50, 16));
error1 = new Label(mc, this).setText("").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setColor(0xff0000);
error1.setLayoutHint(new PositionalLayout.PositionalHint(115, 15, 60, 16));
error2 = new Label(mc, this).setText("").setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setColor(0xff0000);
error2.setLayoutHint(new PositionalLayout.PositionalHint(115, 28, 60, 16));
initRedstoneMode();
Widget toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(stages).addChild(percentage).addChild(error1).addChild(error2).addChild(redstoneMode);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
tileEntity.requestRfFromServer(RFToolsDim.MODID);
tileEntity.requestBuildingPercentage();
}
Aggregations