Search in sources :

Example 1 with Panel

use of mcjty.lib.gui.widgets.Panel in project RFToolsDimensions by McJty.

the class GuiDimensionBuilder 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());
    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();
    Panel 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();
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Label(mcjty.lib.gui.widgets.Label)

Example 2 with Panel

use of mcjty.lib.gui.widgets.Panel in project RFToolsDimensions by McJty.

the class GuiDimensionEditor 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());
    arrow = new ImageLabel(mc, this).setImage(iconGuiElements, 192, 0);
    arrow.setLayoutHint(new PositionalLayout.PositionalHint(90, 26, 16, 16));
    destroy = new Label(mc, this).setColor(0xff0000);
    destroy.setText("Destroying dimension!");
    destroy.setLayoutHint(new PositionalLayout.PositionalHint(30, 53, 150, 16));
    destroy.setVisible(false);
    percentage = new Label(mc, this).setText("0%");
    percentage.setLayoutHint(new PositionalLayout.PositionalHint(80, 43, 40, 16));
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(arrow).addChild(percentage).addChild(destroy);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    tileEntity.requestRfFromServer(RFToolsDim.MODID);
    tileEntity.requestBuildingPercentage();
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Label(mcjty.lib.gui.widgets.Label)

Example 3 with Panel

use of mcjty.lib.gui.widgets.Panel in project RFToolsDimensions by McJty.

the class GuiEssencePainter method initGui.

@Override
public void initGui() {
    super.initGui();
    extractButton = new Button(mc, this).setText("Extract").setLayoutHint(new PositionalLayout.PositionalHint(13, 164, 60, 16)).addButtonEvent(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(parent -> {
        storeDimlets();
    }).setTooltips("Store dimlets in a", "empty dimension tab");
    nameField = new TextField(mc, this).addTextEvent((parent, 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();
    Panel 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);
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) Label(mcjty.lib.gui.widgets.Label) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) TextField(mcjty.lib.gui.widgets.TextField)

Example 4 with Panel

use of mcjty.lib.gui.widgets.Panel in project RFToolsDimensions by McJty.

the class GuiDimletWorkbench method addItemToList.

private void addItemToList(DimletKey key) {
    Panel panel = new Panel(mc, this).setLayout(new PositionalLayout()).setDesiredWidth(116).setDesiredHeight(16);
    panel.setUserObject(key);
    itemList.addChild(panel);
    BlockRender blockRender = new BlockRender(mc, this).setRenderItem(KnownDimletConfiguration.getDimletStack(key)).setLayoutHint(new PositionalLayout.PositionalHint(1, 0, 16, 16)).setUserObject(key);
    panel.addChild(blockRender);
    String displayName = KnownDimletConfiguration.getDisplayName(key);
    AbstractWidget label = new Label(mc, this).setText(displayName).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(20, 0, 95, 16)).setUserObject(key);
    panel.addChild(label);
}
Also used : Panel(mcjty.lib.gui.widgets.Panel) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Label(mcjty.lib.gui.widgets.Label)

Example 5 with Panel

use of mcjty.lib.gui.widgets.Panel 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(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;
    }
}
Also used : mcjty.lib.gui.widgets(mcjty.lib.gui.widgets) IOException(java.io.IOException) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) Label(mcjty.lib.gui.widgets.Label) Mouse(org.lwjgl.input.Mouse) Window(mcjty.lib.gui.Window) java.awt(java.awt) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) GuiScreen(net.minecraft.client.gui.GuiScreen) Panel(mcjty.lib.gui.widgets.Panel) RFToolsDim(mcjty.rftoolsdim.RFToolsDim) Minecraft(net.minecraft.client.Minecraft) Locale(java.util.Locale) Button(mcjty.lib.gui.widgets.Button) ResourceLocation(net.minecraft.util.ResourceLocation) Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) Label(mcjty.lib.gui.widgets.Label) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout)

Aggregations

Label (mcjty.lib.gui.widgets.Label)8 Panel (mcjty.lib.gui.widgets.Panel)8 PositionalLayout (mcjty.lib.gui.layout.PositionalLayout)7 Window (mcjty.lib.gui.Window)6 Button (mcjty.lib.gui.widgets.Button)3 TextField (mcjty.lib.gui.widgets.TextField)3 java.awt (java.awt)2 mcjty.lib.gui.widgets (mcjty.lib.gui.widgets)2 RFToolsDim (mcjty.rftoolsdim.RFToolsDim)2 Minecraft (net.minecraft.client.Minecraft)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Mouse (org.lwjgl.input.Mouse)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Locale (java.util.Locale)1 StyleConfig (mcjty.lib.base.StyleConfig)1 GenericGuiContainer (mcjty.lib.container.GenericGuiContainer)1 GenericEnergyStorageTileEntity (mcjty.lib.entity.GenericEnergyStorageTileEntity)1 SelectionEvent (mcjty.lib.gui.events.SelectionEvent)1