Search in sources :

Example 11 with GuiCheckBox

use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.

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, 0xFF000000, I18n.format("gui.progWidget.conditionBlock.checkForAir")).setChecked(checkingForAir).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForAir.tooltip")));
            addWidget(new GuiCheckBox(501, guiLeft + 5, guiTop + 72, 0xFF000000, 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) {
            if (widget.getID() == 500)
                checkingForAir = !checkingForAir;
            if (widget.getID() == 501)
                checkingForLiquids = !checkingForLiquids;
            else
                super.actionPerformed(widget);
        }
    };
}
Also used : IGuiWidget(pneumaticCraft.client.gui.widget.IGuiWidget) GuiProgWidgetCondition(pneumaticCraft.client.gui.programmer.GuiProgWidgetCondition) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 12 with GuiCheckBox

use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.

the class GuiLogisticsBase method initGui.

@Override
public void initGui() {
    super.initGui();
    if (searchGui != null) {
        inventorySlots.getSlot(editingSlot).putStack(searchGui.getSearchStack());
        NetworkHandler.sendToServer(new PacketSetLogisticsFilterStack(logistics, searchGui.getSearchStack(), editingSlot));
        searchGui = null;
    }
    if (fluidSearchGui != null && fluidSearchGui.getFilter() != null) {
        FluidStack filter = new FluidStack(fluidSearchGui.getFilter(), 1000);
        logistics.setFilter(editingSlot, filter);
        NetworkHandler.sendToServer(new PacketSetLogisticsFluidFilterStack(logistics, filter, editingSlot));
        fluidSearchGui = null;
    }
    String invisibleText = I18n.format("gui.logisticFrame.invisible");
    addWidget(invisible = new GuiCheckBox(9, guiLeft + xSize - 15 - fontRendererObj.getStringWidth(invisibleText), guiTop + 7, 0xFF000000, invisibleText));
    invisible.setTooltip(Arrays.asList(WordUtils.wrap(I18n.format("gui.logisticFrame.invisible.tooltip"), 40).split(System.getProperty("line.separator"))));
    addWidget(new WidgetLabel(guiLeft + 8, guiTop + 18, I18n.format(String.format("gui.%s.filters", SemiBlockManager.getKeyForSemiBlock(logistics)))));
    addWidget(new WidgetLabel(guiLeft + 8, guiTop + 90, I18n.format("gui.logisticFrame.liquid")));
    for (int i = 0; i < 9; i++) {
        addWidget(new WidgetFluidStack(i, guiLeft + i * 18 + 8, guiTop + 101, logistics.getTankFilter(i)));
    }
    addInfoTab(I18n.format("gui.tab.info." + SemiBlockManager.getKeyForSemiBlock(logistics)));
}
Also used : WidgetLabel(pneumaticCraft.client.gui.widget.WidgetLabel) PacketSetLogisticsFilterStack(pneumaticCraft.common.network.PacketSetLogisticsFilterStack) PacketSetLogisticsFluidFilterStack(pneumaticCraft.common.network.PacketSetLogisticsFluidFilterStack) WidgetFluidStack(pneumaticCraft.client.gui.widget.WidgetFluidStack) FluidStack(net.minecraftforge.fluids.FluidStack) WidgetFluidStack(pneumaticCraft.client.gui.widget.WidgetFluidStack) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox)

Example 13 with GuiCheckBox

use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.

the class GuiPressureModule method initGui.

@Override
public void initGui() {
    super.initGui();
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    addLabel("lower", guiLeft + 10, guiTop + 30);
    addLabel("bar", guiLeft + 45, guiTop + 42);
    addLabel("higher", guiLeft + 140, guiTop + 30);
    String title = I18n.format("item." + module.getType() + ".name");
    addLabel(title, width / 2 - fontRendererObj.getStringWidth(title) / 2, guiTop + 5);
    lowerBoundField = new GuiTextField(fontRendererObj, xStart + 10, yStart + 41, 30, 10);
    lowerBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.lowerBound, 1));
    higherBoundField = new GuiTextField(fontRendererObj, xStart + 140, yStart + 41, 30, 10);
    higherBoundField.setText(PneumaticCraftUtils.roundNumberTo(module.higherBound, 1));
    graphLowY = guiTop + 153;
    graphHighY = guiTop + 93;
    graphLeft = guiLeft + 22;
    graphRight = guiLeft + 172;
    addWidget(new WidgetTooltipArea(graphLeft - 20, graphHighY, 25, graphLowY - graphHighY, "gui.redstone"));
    addWidget(new WidgetTooltipArea(graphLeft, graphLowY - 5, graphRight - graphLeft, 25, "gui.threshold"));
    addWidget((IGuiWidget) new GuiAnimatedStat(this, "gui.tab.info", Textures.GUI_INFO_LOCATION, xStart, yStart + 5, 0xFF8888FF, null, true).setText("gui.tab.info.tubeModule"));
    advancedMode = new GuiCheckBox(0, guiLeft + 6, guiTop + 15, 0xFF000000, "gui.tubeModule.advancedConfig").setTooltip(I18n.format("gui.tubeModule.advancedConfig.tooltip"));
    advancedMode.checked = true;
    addWidget(advancedMode);
}
Also used : GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox) WidgetTooltipArea(pneumaticCraft.client.gui.widget.WidgetTooltipArea) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat)

Example 14 with GuiCheckBox

use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetImportExport method initGui.

@Override
public void initGui() {
    super.initGui();
    if (showSides()) {
        for (int i = 0; i < 6; i++) {
            String sideName = PneumaticCraftUtils.getOrientationName(ForgeDirection.getOrientation(i));
            GuiCheckBox checkBox = new GuiCheckBox(i, guiLeft + 4, guiTop + 30 + i * 12, 0xFF000000, sideName);
            checkBox.checked = ((ProgWidgetInventoryBase) widget).getSides()[i];
            addWidget(checkBox);
        }
    }
    useItemCount = new GuiCheckBox(6, guiLeft + 4, guiTop + (showSides() ? 115 : 30), 0xFF000000, I18n.format("gui.progWidget.itemFilter.useItemCount"));
    useItemCount.setTooltip("gui.progWidget.itemFilter.useItemCount.tooltip");
    useItemCount.checked = ((ICountWidget) widget).useCount();
    addWidget(useItemCount);
    textField = new WidgetTextFieldNumber(Minecraft.getMinecraft().fontRenderer, guiLeft + 7, guiTop + (showSides() ? 128 : 43), 50, 11);
    textField.setValue(((ICountWidget) widget).getCount());
    textField.setEnabled(useItemCount.checked);
    addWidget(textField);
}
Also used : ProgWidgetInventoryBase(pneumaticCraft.common.progwidgets.ProgWidgetInventoryBase) WidgetTextFieldNumber(pneumaticCraft.client.gui.widget.WidgetTextFieldNumber) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox)

Example 15 with GuiCheckBox

use of pneumaticCraft.client.gui.widget.GuiCheckBox in project PneumaticCraft by MineMaarten.

the class GuiProgWidgetItemFilter method actionPerformed.

@Override
public void actionPerformed(IGuiWidget guiWidget) {
    if (guiWidget instanceof GuiCheckBox) {
        GuiCheckBox checkBox = (GuiCheckBox) guiWidget;
        switch(checkBox.getID()) {
            case 0:
                widg.useMetadata = checkBox.checked;
                incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
                decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
                break;
            case 2:
                widg.useNBT = checkBox.checked;
                break;
            case 3:
                widg.useOreDict = checkBox.checked;
                checkBoxUseDamage.enabled = !checkBox.checked;
                checkBoxUseNBT.enabled = !checkBox.checked;
                checkBoxUseModSimilarity.enabled = !checkBox.checked;
                incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
                decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
                break;
            case 4:
                widg.useModSimilarity = checkBox.checked;
                checkBoxUseDamage.enabled = !checkBox.checked;
                checkBoxUseNBT.enabled = !checkBox.checked;
                checkBoxUseOreDict.enabled = !checkBox.checked;
                incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
                decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
                break;
        }
    }
    super.actionPerformed(guiWidget);
}
Also used : GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox)

Aggregations

GuiCheckBox (pneumaticCraft.client.gui.widget.GuiCheckBox)19 GuiRadioButton (pneumaticCraft.client.gui.widget.GuiRadioButton)4 ArrayList (java.util.ArrayList)3 ItemStack (net.minecraft.item.ItemStack)3 GuiAnimatedStat (pneumaticCraft.client.gui.widget.GuiAnimatedStat)3 WidgetTextFieldNumber (pneumaticCraft.client.gui.widget.WidgetTextFieldNumber)3 Point (java.awt.Point)2 GuiButton (net.minecraft.client.gui.GuiButton)2 WidgetComboBox (pneumaticCraft.client.gui.widget.WidgetComboBox)2 WidgetTextField (pneumaticCraft.client.gui.widget.WidgetTextField)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1 Item (net.minecraft.item.Item)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)1 FluidStack (net.minecraftforge.fluids.FluidStack)1 GuiButtonSpecial (pneumaticCraft.client.gui.GuiButtonSpecial)1 GuiProgWidgetCondition (pneumaticCraft.client.gui.programmer.GuiProgWidgetCondition)1 IGuiWidget (pneumaticCraft.client.gui.widget.IGuiWidget)1 WidgetFluidStack (pneumaticCraft.client.gui.widget.WidgetFluidStack)1