Search in sources :

Example 1 with GuiProgWidgetCondition

use of me.desht.pneumaticcraft.client.gui.programmer.GuiProgWidgetCondition 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)

Aggregations

GuiProgWidgetCondition (me.desht.pneumaticcraft.client.gui.programmer.GuiProgWidgetCondition)1 GuiCheckBox (me.desht.pneumaticcraft.client.gui.widget.GuiCheckBox)1 IGuiWidget (me.desht.pneumaticcraft.client.gui.widget.IGuiWidget)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1