Search in sources :

Example 6 with GuiCheckBox

use of me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox in project pnc-repressurized by TeamPneumatic.

the class GuiProgWidgetLiquidExport method initGui.

@Override
public void initGui() {
    super.initGui();
    GuiCheckBox checkbox = new GuiCheckBox(300, guiLeft + 70, guiTop + 70, 0xFF404040, "gui.progWidget.liquidExport.placeFluidInWorld");
    checkbox.setChecked(widget.isPlacingFluidBlocks());
    addWidget(checkbox);
}
Also used : GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)

Example 7 with GuiCheckBox

use of me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox in project pnc-repressurized by TeamPneumatic.

the class GuiPlasticMixer method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTemperature(0, guiLeft + 55, guiTop + 25, 295, 500, te.getLogic(0)));
    addWidget(new WidgetTemperature(1, guiLeft + 82, guiTop + 25, 295, 500, te.getLogic(1), PneumaticValues.PLASTIC_MIXER_MELTING_TEMP));
    addWidget(new WidgetTank(3, guiLeft + 152, guiTop + 14, te.getTank()));
    GuiAnimatedStat stat = addAnimatedStat("gui.tab.plasticMixer.plasticSelection", new ItemStack(Itemss.PLASTIC, 1, 1), 0xFF005500, false);
    List<String> text = new ArrayList<>();
    for (int i = 0; i < 12; i++) {
        text.add("                      ");
    }
    stat.setTextWithoutCuttingString(text);
    buttons = new GuiButtonSpecial[16];
    for (int x = 0; x < 4; x++) {
        for (int y = 0; y < 4; y++) {
            int index = y * 4 + x;
            ItemStack plastic = new ItemStack(Itemss.PLASTIC, 1, index);
            buttons[index] = new GuiButtonSpecial(index + 1, x * 21 + 4, y * 21 + 30, 20, 20, "").setRenderStacks(plastic).setTooltipText(plastic.getDisplayName());
            stat.addWidget(buttons[index]);
        }
    }
    stat.addWidget(lockSelection = new GuiCheckBox(17, 4, 18, 0xFF000000, "gui.plasticMixer.lockSelection").setChecked(te.lockSelection).setTooltip(I18n.format("gui.plasticMixer.lockSelection.tooltip")));
}
Also used : WidgetTemperature(me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature) ArrayList(java.util.ArrayList) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank) GuiAnimatedStat(me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat) ItemStack(net.minecraft.item.ItemStack)

Example 8 with GuiCheckBox

use of me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox in project pnc-repressurized by TeamPneumatic.

the class ActionWidgetCheckBox method readFromNBT.

@Override
public void readFromNBT(NBTTagCompound tag, int guiLeft, int guiTop) {
    super.readFromNBT(tag, guiLeft, guiTop);
    widget = new GuiCheckBox(-1, tag.getInteger("x") + guiLeft, tag.getInteger("y") + guiTop, 0xFF404040, tag.getString("text"));
    setTooltip(tag.getString("tooltip"));
}
Also used : GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)

Example 9 with GuiCheckBox

use of me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox in project pnc-repressurized by TeamPneumatic.

the class ProgWidgetBlockCondition method getOptionWindow.

@Override
@SideOnly(Side.CLIENT)
public GuiScreen getOptionWindow(GuiProgrammer guiProgrammer) {
    return new GuiProgWidgetCondition(this, guiProgrammer) {

        @Override
        public void initGui() {
            super.initGui();
            addWidget(new GuiCheckBox(500, guiLeft + 5, guiTop + 60, 0xFF404040, I18n.format("gui.progWidget.conditionBlock.checkForAir")).setChecked(checkingForAir).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForAir.tooltip")));
            addWidget(new GuiCheckBox(501, guiLeft + 5, guiTop + 72, 0xFF404040, I18n.format("gui.progWidget.conditionBlock.checkForLiquids")).setChecked(checkingForLiquids).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForLiquids.tooltip")));
        }

        @Override
        protected boolean requiresNumber() {
            return false;
        }

        @Override
        protected boolean isSidedWidget() {
            return false;
        }

        @Override
        public void actionPerformed(IGuiWidget widget) {
            switch(widget.getID()) {
                case 500:
                    checkingForAir = !checkingForAir;
                    break;
                case 501:
                    checkingForLiquids = !checkingForLiquids;
                    break;
                default:
                    super.actionPerformed(widget);
                    break;
            }
        }
    };
}
Also used : IGuiWidget(me.desht.pneumaticcraft.client.gui.widget.IGuiWidget) GuiProgWidgetCondition(me.desht.pneumaticcraft.client.gui.programmer.GuiProgWidgetCondition) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 10 with GuiCheckBox

use of me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox in project pnc-repressurized by TeamPneumatic.

the class GuiProgrammer method initGui.

@Override
public void initGui() {
    if (pastebinGui != null && pastebinGui.outputTag != null) {
        te.readProgWidgetsFromNBT(pastebinGui.outputTag);
        pastebinGui = null;
        NetworkHandler.sendToServer(new PacketProgrammerUpdate(te));
    }
    super.initGui();
    if (programmerUnit != null) {
        te.translatedX = programmerUnit.getTranslatedX();
        te.translatedY = programmerUnit.getTranslatedY();
        te.zoomState = programmerUnit.getLastZoom();
    }
    programmerUnit = new GuiUnitProgrammer(te.progWidgets, fontRenderer, guiLeft, guiTop, xSize, width, height, PROGRAMMING_START_X, PROGRAMMING_START_Y, PROGRAMMING_WIDTH, PROGRAMMING_HEIGHT, te.translatedX, te.translatedY, te.zoomState);
    addWidget(programmerUnit.getScrollBar());
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    // addProgWidgetTabs(xStart, yStart);
    importButton = new GuiButtonSpecial(1, xStart + 301, yStart + 3, 20, 15, "<--");
    importButton.setTooltipText("Import program");
    buttonList.add(importButton);
    exportButton = new GuiButtonSpecial(2, xStart + 301, yStart + 20, 20, 15, "-->");
    buttonList.add(exportButton);
    buttonList.add(new GuiButton(3, xStart + 294, yStart + 174, 10, 10, "-"));
    buttonList.add(new GuiButton(4, xStart + 335, yStart + 174, 10, 10, "+"));
    allWidgetsButton = new GuiButtonSpecial(8, xStart + 321, yStart + 159, 10, 10, "<");
    allWidgetsButton.setTooltipText(I18n.format("gui.programmer.button.openPanel.tooltip"));
    addWidget(allWidgetsButton);
    difficultyButtons = new ArrayList<>();
    for (int i = 0; i < IProgWidget.WidgetDifficulty.values().length; i++) {
        GuiRadioButton radioButton = new GuiRadioButton(i, xStart + 263, yStart + 200 + i * 12, 0xFF000000, IProgWidget.WidgetDifficulty.values()[i].getLocalizedName());
        radioButton.checked = ConfigHandler.getProgrammerDifficulty() == i;
        addWidget(radioButton);
        difficultyButtons.add(radioButton);
        radioButton.otherChoices = difficultyButtons;
        if (i == 1)
            radioButton.setTooltip(I18n.format("gui.programmer.difficulty.medium.tooltip"));
        if (i == 2)
            radioButton.setTooltip(I18n.format("gui.programmer.difficulty.advanced.tooltip"));
    }
    buttonList.add(new GuiButton(5, xStart + 5, yStart + 175, 87, 20, I18n.format("gui.programmer.button.showStart")));
    buttonList.add(new GuiButton(6, xStart + 5, yStart + 197, 87, 20, I18n.format("gui.programmer.button.showLatest")));
    addWidget(showInfo = new GuiCheckBox(-1, xStart + 5, yStart + 220, 0xFF000000, "gui.programmer.checkbox.showInfo").setChecked(te.showInfo));
    addWidget(showFlow = new GuiCheckBox(-1, xStart + 5, yStart + 232, 0xFF000000, "gui.programmer.checkbox.showFlow").setChecked(te.showFlow));
    GuiButtonSpecial pastebinButton = new GuiButtonSpecial(7, guiLeft - 24, guiTop + 44, 20, 20, "");
    pastebinButton.setTooltipText(I18n.format("gui.remote.button.pastebinButton"));
    pastebinButton.setRenderedIcon(Textures.GUI_PASTEBIN_ICON_LOCATION);
    buttonList.add(pastebinButton);
    undoButton = new GuiButtonSpecial(9, guiLeft - 24, guiTop + 2, 20, 20, "");
    redoButton = new GuiButtonSpecial(10, guiLeft - 24, guiTop + 23, 20, 20, "");
    GuiButtonSpecial clearAllButton = new GuiButtonSpecial(11, guiLeft - 24, guiTop + 65, 20, 20, "");
    convertToRelativeButton = new GuiButtonSpecial(12, guiLeft - 24, guiTop + 86, 20, 20, "Rel");
    undoButton.setRenderedIcon(Textures.GUI_UNDO_ICON_LOCATION);
    redoButton.setRenderedIcon(Textures.GUI_REDO_ICON_LOCATION);
    clearAllButton.setRenderedIcon(Textures.GUI_DELETE_ICON_LOCATION);
    undoButton.setTooltipText(I18n.format("gui.programmer.button.undoButton.tooltip"));
    redoButton.setTooltipText(I18n.format("gui.programmer.button.redoButton.tooltip"));
    clearAllButton.setTooltipText(I18n.format("gui.programmer.button.clearAllButton.tooltip"));
    buttonList.add(undoButton);
    buttonList.add(redoButton);
    buttonList.add(clearAllButton);
    buttonList.add(convertToRelativeButton);
    String containerName = I18n.format(te.getName() + ".name");
    addLabel(containerName, guiLeft + 7, guiTop + 5, 0xFF404040);
    nameField = new WidgetTextField(fontRenderer, guiLeft + 200, guiTop + 5, 98, fontRenderer.FONT_HEIGHT);
    addWidget(nameField);
    filterField = new FilterTextField(fontRenderer, guiLeft + 78, guiTop + 26, 100, fontRenderer.FONT_HEIGHT);
    filterField.setListener(this);
    addWidget(filterField);
    String name = I18n.format("gui.programmer.name");
    addLabel(name, guiLeft + 197 - fontRenderer.getStringWidth(name), guiTop + 5, 0xFF404040);
    updateVisibleProgWidgets();
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) PacketGuiButton(me.desht.pneumaticcraft.common.network.PacketGuiButton) PacketProgrammerUpdate(me.desht.pneumaticcraft.common.network.PacketProgrammerUpdate) GuiRadioButton(me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton) GuiCheckBox(me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox) Point(java.awt.Point) WidgetTextField(me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)

Aggregations

GuiCheckBox (me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)19 GuiRadioButton (me.desht.pneumaticcraft.client.gui.widget.GuiRadioButton)4 ArrayList (java.util.ArrayList)3 GuiAnimatedStat (me.desht.pneumaticcraft.client.gui.widget.GuiAnimatedStat)3 WidgetTextFieldNumber (me.desht.pneumaticcraft.client.gui.widget.WidgetTextFieldNumber)3 ItemStack (net.minecraft.item.ItemStack)3 WidgetComboBox (me.desht.pneumaticcraft.client.gui.widget.WidgetComboBox)2 WidgetTextField (me.desht.pneumaticcraft.client.gui.widget.WidgetTextField)2 GuiButton (net.minecraft.client.gui.GuiButton)2 Point (java.awt.Point)1 GuiButtonSpecial (me.desht.pneumaticcraft.client.gui.GuiButtonSpecial)1 GuiProgWidgetCondition (me.desht.pneumaticcraft.client.gui.programmer.GuiProgWidgetCondition)1 IGuiWidget (me.desht.pneumaticcraft.client.gui.widget.IGuiWidget)1 WidgetFluidStack (me.desht.pneumaticcraft.client.gui.widget.WidgetFluidStack)1 WidgetLabel (me.desht.pneumaticcraft.client.gui.widget.WidgetLabel)1 WidgetTank (me.desht.pneumaticcraft.client.gui.widget.WidgetTank)1 WidgetTemperature (me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature)1 WidgetTooltipArea (me.desht.pneumaticcraft.client.gui.widget.WidgetTooltipArea)1 TubeModuleRedstoneReceiving (me.desht.pneumaticcraft.common.block.tubes.TubeModuleRedstoneReceiving)1 PacketGuiButton (me.desht.pneumaticcraft.common.network.PacketGuiButton)1