Search in sources :

Example 6 with GuiCheckBox

use of logisticspipes.utils.gui.GuiCheckBox in project LogisticsPipes by RS485.

the class GuiOrderer method initGui.

@SuppressWarnings("unchecked")
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    // Request
    buttonList.add(new GuiButton(0, right - 55, bottom - 25, 50, 20, "Request"));
    // Next page
    buttonList.add(new SmallGuiButton(1, right - 15, guiTop + 5, 10, 10, ">"));
    // Prev page
    buttonList.add(new SmallGuiButton(2, right - 90, guiTop + 5, 10, 10, "<"));
    // -64
    buttonList.add(new SmallGuiButton(10, xCenter - 51, bottom - 15, 26, 10, "---"));
    // -10
    buttonList.add(new SmallGuiButton(4, xCenter - 51, bottom - 26, 15, 10, "--"));
    // -1
    buttonList.add(new SmallGuiButton(5, xCenter - 35, bottom - 26, 10, 10, "-"));
    // +1
    buttonList.add(new SmallGuiButton(6, xCenter + 26, bottom - 26, 10, 10, "+"));
    // +10
    buttonList.add(new SmallGuiButton(7, xCenter + 38, bottom - 26, 15, 10, "++"));
    // +64
    buttonList.add(new SmallGuiButton(11, xCenter + 26, bottom - 15, 26, 10, "+++"));
    // Popup
    buttonList.add(new GuiCheckBox(8, guiLeft + 9, bottom - 60, 14, 14, Configs.DISPLAY_POPUP));
    // Sort
    buttonList.add(new SmallGuiButton(20, xCenter - 13, bottom - 41, 26, 10, "Sort"));
    if (search == null) {
        search = new SearchBar(mc.fontRenderer, this, guiLeft + 30, bottom - 78, right - guiLeft - 58, 15);
    }
    search.reposition(guiLeft + 30, bottom - 78, right - guiLeft - 58, 15);
    if (itemDisplay == null) {
        itemDisplay = new ItemDisplay(this, mc.fontRenderer, this, this, guiLeft + 10, guiTop + 18, xSize - 20, ySize - 100, new int[] { 1, 10, 64, 64 }, true);
    }
    itemDisplay.reposition(guiLeft + 10, guiTop + 18, xSize - 20, ySize - 100);
}
Also used : SmallGuiButton(logisticspipes.utils.gui.SmallGuiButton) GuiButton(net.minecraft.client.gui.GuiButton) SmallGuiButton(logisticspipes.utils.gui.SmallGuiButton) ItemDisplay(logisticspipes.utils.gui.ItemDisplay) SearchBar(logisticspipes.utils.gui.SearchBar) GuiCheckBox(logisticspipes.utils.gui.GuiCheckBox)

Example 7 with GuiCheckBox

use of logisticspipes.utils.gui.GuiCheckBox in project LogisticsPipes by RS485.

the class GuiRequestTable method initGui.

@Override
@SuppressWarnings("unchecked")
public void initGui() {
    boolean reHide = false;
    if (!showRequest) {
        guiLeft = startLeft;
        xSize = startXSize;
        showRequest = true;
        reHide = true;
    }
    super.initGui();
    buttonList.clear();
    // Request
    buttonList.add(hideWhileSmall.addChain(new GuiButton(0, right - 55, bottom - 25, 50, 20, "Request")));
    // Next page
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(1, right - 15, guiTop + 5, 10, 10, ">")));
    // Prev page
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(2, right - 90, guiTop + 5, 10, 10, "<")));
    // -64
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(10, right - 148, bottom - 15, 26, 10, "---")));
    // -10
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(4, right - 148, bottom - 26, 15, 10, "--")));
    // -1
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(5, right - 132, bottom - 26, 10, 10, "-")));
    // +1
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(6, right - 86, bottom - 26, 10, 10, "+")));
    // +10
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(7, right - 74, bottom - 26, 15, 10, "++")));
    // +64
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(11, right - 86, bottom - 15, 26, 10, "+++")));
    // Popup
    buttonList.add(hideWhileSmall.addChain(new GuiCheckBox(8, guiLeft + 209, bottom - 60, 14, 14, Configs.DISPLAY_POPUP)));
    // Refresh
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(3, guiLeft + 210, bottom - 15, 46, 10, "Refresh")));
    // Component
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(13, guiLeft + 210, bottom - 28, 46, 10, "Content")));
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(9, guiLeft + 210, bottom - 41, 46, 10, "Both")));
    // Sort
    buttonList.add(hideWhileSmall.addChain(new SmallGuiButton(20, right - 116, bottom - 41, 26, 10, "Sort")));
    // +1
    buttonList.add(moveWhileSmall.addChain(new SmallGuiButton(14, guiLeft + 96, guiTop + 53, 10, 10, "+")));
    // +10
    buttonList.add(moveWhileSmall.addChain(new SmallGuiButton(15, guiLeft + 108, guiTop + 53, 15, 10, "++")));
    // +64
    buttonList.add(moveWhileSmall.addChain(new SmallGuiButton(16, guiLeft + 96, guiTop + 64, 26, 10, "+++")));
    // x
    buttonList.add(moveWhileSmall.addChain(new SmallGuiButton(30, guiLeft + 96 + 2, guiTop + 18, 10, 10, "X")));
    // ~
    buttonList.add(moveWhileSmall.addChain(new SmallGuiButton(31, guiLeft + 108 + 2, guiTop + 18, 10, 10, "~", 3)));
    // Hide
    buttonList.add(hideShowButton = new SmallGuiButton(17, guiLeft + 173, guiTop + 5, 36, 10, "Hide"));
    buttonList.add(Macrobutton = new SmallGuiButton(18, right - 55, bottom - 60, 50, 10, "Disk"));
    Macrobutton.enabled = false;
    (sycleButtons[0] = addButton(new SmallGuiButton(21, guiLeft + 124, guiTop + 30, 15, 10, "/\\"))).visible = false;
    (sycleButtons[1] = addButton(new SmallGuiButton(22, guiLeft + 124, guiTop + 42, 15, 10, "\\/"))).visible = false;
    if (search == null) {
        search = new SearchBar(mc.fontRenderer, this, guiLeft + 205, bottom - 78, 200, 15);
    }
    search.reposition(guiLeft + 205, bottom - 78, 200, 15);
    if (itemDisplay == null) {
        itemDisplay = new ItemDisplay(this, mc.fontRenderer, this, this, guiLeft + 205, guiTop + 18, 200, ySize - 100, new int[] { 1, 10, 64, 64 }, true);
    }
    itemDisplay.reposition(guiLeft + 205, guiTop + 18, 200, ySize - 100);
    startLeft = guiLeft;
    startXSize = xSize;
    if (reHide) {
        showRequest = false;
        xSize = startXSize - 210;
        guiLeft = startLeft + 105;
        for (GuiButton button : moveWhileSmall) {
            button.xPosition += 105;
        }
        hideShowButton.xPosition += 90;
        hideShowButton.displayString = "Show";
        for (GuiButton button : hideWhileSmall) {
            button.visible = false;
        }
        Macrobutton.visible = false;
    }
}
Also used : SmallGuiButton(logisticspipes.utils.gui.SmallGuiButton) GuiButton(net.minecraft.client.gui.GuiButton) SmallGuiButton(logisticspipes.utils.gui.SmallGuiButton) ItemDisplay(logisticspipes.utils.gui.ItemDisplay) SearchBar(logisticspipes.utils.gui.SearchBar) GuiCheckBox(logisticspipes.utils.gui.GuiCheckBox)

Example 8 with GuiCheckBox

use of logisticspipes.utils.gui.GuiCheckBox in project LogisticsPipes by RS485.

the class GuiSecurityStation method initGui.

@SuppressWarnings("unchecked")
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    buttonList.add(new GuiButton(0, guiLeft + 10, guiTop + 179, 30, 20, "--"));
    ((GuiButton) buttonList.get(0)).visible = false;
    buttonList.add(new GuiButton(1, guiLeft + 10, guiTop + 139, 30, 20, "-"));
    buttonList.add(new GuiButton(2, guiLeft + 45, guiTop + 139, 30, 20, "+"));
    buttonList.add(new GuiButton(3, guiLeft + 140, guiTop + 179, 30, 20, "++"));
    ((GuiButton) buttonList.get(3)).visible = false;
    buttonList.add(new SmallGuiButton(4, guiLeft + 241, guiTop + 217, 30, 10, StringUtils.translate(GuiSecurityStation.PREFIX + "Open")));
    buttonList.add(new GuiCheckBox(5, guiLeft + 160, guiTop + 42, 16, 16, _tile.allowCC));
    buttonList.add(new SmallGuiButton(6, guiLeft + 162, guiTop + 60, 60, 10, StringUtils.translate(GuiSecurityStation.PREFIX + "EditTable")));
    if (!SimpleServiceLocator.ccProxy.isCC() && !LPConstants.DEBUG) {
        ((GuiButton) buttonList.get(5)).visible = false;
        ((GuiButton) buttonList.get(6)).visible = false;
    }
    buttonList.add(new GuiButton(7, guiLeft + 55, guiTop + 95, 70, 20, StringUtils.translate(GuiSecurityStation.PREFIX + "Authorize")));
    buttonList.add(new GuiButton(8, guiLeft + 175, guiTop + 95, 70, 20, StringUtils.translate(GuiSecurityStation.PREFIX + "Deauthorize")));
    buttonList.add(new GuiCheckBox(9, guiLeft + 160, guiTop + 74, 16, 16, _tile.allowAutoDestroy));
    MainProxy.sendPacketToServer(PacketHandler.getPacket(PlayerListRequest.class));
}
Also used : SmallGuiButton(logisticspipes.utils.gui.SmallGuiButton) GuiButton(net.minecraft.client.gui.GuiButton) SmallGuiButton(logisticspipes.utils.gui.SmallGuiButton) PlayerListRequest(logisticspipes.network.packets.PlayerListRequest) GuiCheckBox(logisticspipes.utils.gui.GuiCheckBox)

Example 9 with GuiCheckBox

use of logisticspipes.utils.gui.GuiCheckBox in project LogisticsPipes by RS485.

the class GuiAddTracking method actionPerformed.

@Override
protected void actionPerformed(GuiButton guibutton) {
    if (guibutton.id == 0 && itemDisplay.getSelectedItem() != null) {
        boolean found = false;
        for (TrackingTask task : tile.tasks) {
            if (task.item.equals(itemDisplay.getSelectedItem().getItem())) {
                found = true;
                break;
            }
        }
        if (found) {
            setSubGui(new GuiMessagePopup(StringUtils.translate(PREFIX + "alreadytracked")));
        } else {
            MainProxy.sendPacketToServer(PacketHandler.getPacket(AddItemToTrackPacket.class).setItem(itemDisplay.getSelectedItem().getItem()).setTilePos(tile));
            TrackingTask task = new TrackingTask();
            task.item = itemDisplay.getSelectedItem().getItem();
            tile.tasks.add(task);
            exitGui();
        }
    } else if (guibutton.id == 1) {
        itemDisplay.nextPage();
    } else if (guibutton.id == 2) {
        itemDisplay.prevPage();
    } else if (guibutton.id == 3) {
        refreshItems();
    } else if (guibutton.id == 8) {
        GuiCheckBox button = (GuiCheckBox) guibutton;
        Configs.DISPLAY_POPUP = button.change();
        Configs.savePopupState();
    } else if (guibutton.id == 20) {
        itemDisplay.cycle();
    }
    super.actionPerformed(guibutton);
}
Also used : AddItemToTrackPacket(logisticspipes.network.packets.block.AddItemToTrackPacket) GuiCheckBox(logisticspipes.utils.gui.GuiCheckBox) TrackingTask(logisticspipes.blocks.stats.TrackingTask)

Aggregations

GuiCheckBox (logisticspipes.utils.gui.GuiCheckBox)9 SmallGuiButton (logisticspipes.utils.gui.SmallGuiButton)6 GuiButton (net.minecraft.client.gui.GuiButton)5 RequestComponentPacket (logisticspipes.network.packets.orderer.RequestComponentPacket)3 ArrayList (java.util.ArrayList)2 GuiDiskPopup (logisticspipes.gui.popup.GuiDiskPopup)2 RequestMonitorPopup (logisticspipes.gui.popup.RequestMonitorPopup)2 ClearCraftingGridPacket (logisticspipes.network.packets.block.ClearCraftingGridPacket)2 CraftingCycleRecipe (logisticspipes.network.packets.block.CraftingCycleRecipe)2 RequestSubmitListPacket (logisticspipes.network.packets.orderer.RequestSubmitListPacket)2 ChainAddArrayList (logisticspipes.utils.ChainAddArrayList)2 ItemDisplay (logisticspipes.utils.gui.ItemDisplay)2 SearchBar (logisticspipes.utils.gui.SearchBar)2 ItemIdentifier (logisticspipes.utils.item.ItemIdentifier)2 ItemIdentifierStack (logisticspipes.utils.item.ItemIdentifierStack)2 ItemStack (net.minecraft.item.ItemStack)2 BitSet (java.util.BitSet)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1