Package net.minecraft.src

Examples of net.minecraft.src.GuiButton


                    var6 += 105;
                }

                int var7 = var5 + 150 + 150;
                int var8 = var6 + 84 + 10;
                GuiButton var9 = this.getSelectedButton(par1, par2);

                if (var9 != null)
                {
                    String var10 = this.getButtonName(var9.displayString);
                    String[] var11 = this.getTooltipLines(var10, var9.id);
View Full Code Here


  }

  @Override
  public void initGui() {
    this.buttonList.clear();
    buttonList.add(new GuiButton(1, this.width / 2 - 50, this.height - 25, 100, 20, "Main Menu"));
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void initGui() {
        super.initGui();
        int guiX = (width - this.xSize) / 2;
        int guiY = (height - this.ySize) / 2;
        controlList.add(this.buttons[0] new GuiButton(1, guiX + 8, guiY + 40, 140, 20, "These items are required"));
    }
View Full Code Here

    public void initGui() {
     
        super.initGui();
        int bw = this.xSize - 20;

        controlList.add(this.buttons[0] new GuiButton(1, (width - this.xSize) / 2 + 10, (height - this.ySize) / 2 + 20, bw / 6, 20, "-100"));
        controlList.add(this.buttons[1] new GuiButton(2, (width - this.xSize) / 2 + 12 + bw / 6, (height - this.ySize) / 2 + 20, bw / 6, 20, "-10"));
        controlList.add(this.buttons[2] new GuiButton(3, (width - this.xSize) / 2 + 12 + bw * 2 / 6, (height - this.ySize) / 2 + 20, bw / 6, 20, "-1"));
        controlList.add(this.buttons[3] new GuiButton(4, (width - this.xSize) / 2 + 12 + bw * 3 / 6, (height - this.ySize) / 2 + 20, bw / 6, 20, "+1"));
        controlList.add(this.buttons[4] new GuiButton(5, (width - this.xSize) / 2 + 12 + bw * 4 / 6, (height - this.ySize) / 2 + 20, bw / 6, 20, "+10"));
        controlList.add(this.buttons[5] new GuiButton(6, (width - this.xSize) / 2 + 16 + bw * 5 / 6, (height - this.ySize) / 2 + 20, bw / 6, 20, "+100"));
        controlList.add(this.buttons[6] new GuiButton(7, (width - this.xSize) / 2 + 16, (height - this.ySize) / 2 + 52, bw / 6, 20, "Switch"));
    }
View Full Code Here

        super.initGui();
        //int bw = this.xSize - 20;
        int guiX = (width - this.xSize) / 2 + 30;
        int guiY = (height - this.ySize) / 2 - 7;

        controlList.add(this.buttons[0] new GuiButton(1, guiX + 1,           guiY + 24, 20, 17, "-"));
        controlList.add(this.buttons[1] new GuiButton(2, guiX + 3 + 20,      guiY + 24, 30, 17, "1000"));
        controlList.add(this.buttons[2] new GuiButton(3, guiX + 5 + 50,      guiY + 24, 20, 17, "+"));

        controlList.add(this.buttons[3] new GuiButton(4, guiX + 1,           guiY + 25 + 17, 20, 17, "-"));
        controlList.add(this.buttons[4] new GuiButton(5, guiX + 3 + 20,      guiY + 25 + 17, 30, 17, "1000"));
        controlList.add(this.buttons[5] new GuiButton(6, guiX + 5 + 50,      guiY + 25 + 17, 20, 17, "+"));

        controlList.add(this.buttons[6] new GuiButton(7, guiX + 1,           guiY + 26 + 17 * 2, 20, 17, "-"));
        controlList.add(this.buttons[7] new GuiButton(8, guiX + 3 + 20,      guiY + 26 + 17 * 2, 30, 17, "1000"));
        controlList.add(this.buttons[8] new GuiButton(9, guiX + 5 + 50,      guiY + 26 + 17 * 2, 20, 17, "+"));

        controlList.add(this.buttons[9] new GuiButton(10, guiX + 1,          guiY + 27 + 17 * 3, 20, 17, "-"));
        controlList.add(this.buttons[10] new GuiButton(11, guiX + 3 + 20,     guiY + 27 + 17 * 3, 30, 17, "1000"));
        controlList.add(this.buttons[11] new GuiButton(12, guiX + 5 + 50,     guiY + 27 + 17 * 3, 20, 17, "+"));

        controlList.add(this.buttons[12] new GuiButton(13, guiX + 1,          guiY + 28 + 17 * 4, 20, 17, "-"));
        controlList.add(this.buttons[13] new GuiButton(14, guiX + 3 + 20,     guiY + 28 + 17 * 4, 30, 17, "1000"));
        controlList.add(this.buttons[14] new GuiButton(15, guiX + 5 + 50,     guiY + 28 + 17 * 4, 20, 17, "+"));

        controlList.add(this.buttons[15] new GuiButton(16, guiX + 1,          guiY + 29 + 17 * 5, 20, 17, "-"));
        controlList.add(this.buttons[16] new GuiButton(17, guiX + 3 + 20,     guiY + 29 + 17 * 5, 30, 17, "1000"));
        controlList.add(this.buttons[17] new GuiButton(18, guiX + 5 + 50,     guiY + 29 + 17 * 5, 20, 17, "+"));

    }
View Full Code Here

  /**
   * Adds the buttons (and other controls) to the screen in question.
   */
  public void initGui() {
    this.buttonList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.buttonText1));
    this.buttonList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.copyLinkButtonText));
    this.buttonList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.buttonText2));
  }
View Full Code Here

            // Look for the mods buttons
            boolean customButtonsAdded = false;
            List<Object> controlList = getControlList(guiScreen);
            for (Object o : controlList) {
                if (isGuiButton(o)) {
                  GuiButton button = asGuiButton(o);
                    if (getId(button) == InvTweaksConst.JIMEOWAN_ID) {
                        customButtonsAdded = true;
                        break;
                    }
                }
            }

            if (!customButtonsAdded) {

                // Check for custom button texture
              // Disabled because the current implementation requires reflection, which is difficult to manage
              // in a MCP environment - TODO find a workaround to access the texture packs data
                boolean customTextureAvailable = false;//hasTexture("/gui/button10px.png");

                // Inventory button
                if (!isValidChest) {
                    controlList.add(new InvTweaksGuiSettingsButton(
                            cfgManager, InvTweaksConst.JIMEOWAN_ID,
                            getGuiX(guiContainer) + getGuiWidth(guiContainer) - 15,
                            getGuiY(guiContainer) + 5,
                            w, h, "...",
                            InvTweaksLocalization.get("invtweaks.button.settings.tooltip"),
                            customTextureAvailable));
                }

                // Chest buttons
                else {
                    // Reset sorting algorithm selector
                    chestAlgorithmClickTimestamp = 0;

                    int id = InvTweaksConst.JIMEOWAN_ID,
                        x = getGuiX(guiContainer) + getGuiWidth(guiContainer) - 16,
                        y = getGuiY(guiContainer) + 5;
                    boolean isChestWayTooBig = mods.isChestWayTooBig(guiScreen);

                    // NotEnoughItems compatibility
                    if (isChestWayTooBig && classExists("mod_NotEnoughItems")) {
                      if (isNotEnoughItemsEnabled()) {
                          x = getGuiX(guiContainer) + getGuiWidth(guiContainer) - 35;
                          y += 50;
                      }
                    }

                    // Settings button
                    controlList.add(new InvTweaksGuiSettingsButton(
                            cfgManager, id++,
                            (isChestWayTooBig) ? x + 22 : x - 1,
                            (isChestWayTooBig) ? y - 3 : y,
                            w, h, "...",
                            InvTweaksLocalization.get("invtweaks.button.settings.tooltip"),
                            customTextureAvailable));

                    // Sorting buttons
                    if (!config.getProperty(InvTweaksConfig.PROP_SHOW_CHEST_BUTTONS).equals("false")) {

                        int rowSize = getContainerRowSize(guiContainer);

                        InvTweaksObfuscationGuiButton button = new InvTweaksGuiSortingButton(
                                cfgManager, id++,
                                (isChestWayTooBig) ? x + 22 : x - 13,
                                (isChestWayTooBig) ? y + 12 : y,
                                w, h, "h", InvTweaksLocalization.get("invtweaks.button.chest3.tooltip"),
                                InvTweaksHandlerSorting.ALGORITHM_HORIZONTAL,
                                rowSize,
                                customTextureAvailable);
                        controlList.add(button);

                        button = new InvTweaksGuiSortingButton(
                                cfgManager, id++,
                                (isChestWayTooBig) ? x + 22 : x - 25,
                                (isChestWayTooBig) ? y + 25 : y,
                                w, h, "v", InvTweaksLocalization.get("invtweaks.button.chest2.tooltip"),
                                InvTweaksHandlerSorting.ALGORITHM_VERTICAL,
                                rowSize,
                                customTextureAvailable);
                        controlList.add(button);

                        button = new InvTweaksGuiSortingButton(
                                cfgManager, id++,
                                (isChestWayTooBig) ? x + 22 : x - 37,
                                (isChestWayTooBig) ? y + 38 : y,
                                w, h, "s", InvTweaksLocalization.get("invtweaks.button.chest1.tooltip"),
                                InvTweaksHandlerSorting.ALGORITHM_DEFAULT,
                                rowSize,
                                customTextureAvailable);
                        controlList.add(button);

                    }
                }
            }
        }

        else {
            // Remove "..." button from non-survival tabs of the creative screen
            if (isGuiInventoryCreative(guiScreen)) {
                List<Object> controlList = getControlList(guiScreen);
                GuiButton buttonToRemove = null;
                for (Object o : controlList) {
                    if (isGuiButton(o)) {
                        if (getId(asGuiButton(o)) == InvTweaksConst.JIMEOWAN_ID) {
                            buttonToRemove = asGuiButton(o);
                            break;
View Full Code Here

        int i = 0;

        // Create large buttons

        moveToButtonCoords(1, p);
        controlList.add(new GuiButton(ID_EDITRULES, p.getX() + 55, obf.getWindowHeight(this) / 6 + 96, InvTweaksLocalization.get("invtweaks.settings.rulesfile")));
        controlList.add(new GuiButton(ID_EDITTREE, p.getX() + 55, obf.getWindowHeight(this) / 6 + 120, InvTweaksLocalization.get("invtweaks.settings.treefile")));
        controlList.add(new GuiButton(ID_HELP, p.getX() + 55, obf.getWindowHeight(this) / 6 + 144, InvTweaksLocalization.get("invtweaks.settings.onlinehelp")));

        // Create settings buttons

        moveToButtonCoords(i++, p);
        controlList.add(new InvTweaksGuiTooltipButton(ID_SHORTCUTS_HELP,
                p.getX() + 130, p.getY(), 20, 20, "?", "Shortcuts help"));
        String shortcuts = config.getProperty(InvTweaksConfig.PROP_ENABLE_SHORTCUTS);
        InvTweaksGuiTooltipButton shortcutsBtn = new InvTweaksGuiTooltipButton(ID_SHORTCUTS, p.getX(), p.getY(), 130, 20, computeBooleanButtonLabel(
                InvTweaksConfig.PROP_ENABLE_SHORTCUTS, labelShortcuts), InvTweaksLocalization.get("invtweaks.settings.shortcuts.tooltip"));
        controlList.add(shortcutsBtn);
        if (shortcuts.equals(InvTweaksConfig.VALUE_CI_COMPATIBILITY)) {
            // Convenient Inventory compatibility: shortcuts not available
            obf.setEnabled(shortcutsBtn, false);
            shortcutsBtn.setTooltip(shortcutsBtn.getTooltip() + "\n(" + InvTweaksLocalization.get("invtweaks.settings.disableci.tooltip") + ")");
        }
       
        moveToButtonCoords(i++, p);
        sortMappingButton = new InvTweaksGuiTooltipButton(ID_SORTING_KEY, p.getX(), p.getY(),
                InvTweaksLocalization.get("invtweaks.settings.key") + " " + config.getProperty(InvTweaksConfig.PROP_KEY_SORT_INVENTORY));
        controlList.add(sortMappingButton);

        moveToButtonCoords(i++, p);
        InvTweaksGuiTooltipButton beforeBreakBtn = new InvTweaksGuiTooltipButton(ID_BEFORE_BREAK, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_AUTO_REFILL_BEFORE_BREAK, labelAutoRefillBeforeBreak),InvTweaksLocalization.get("invtweaks.settings.beforebreak.tooltip"));
        controlList.add(beforeBreakBtn);

        moveToButtonCoords(i++, p);
        InvTweaksGuiTooltipButton autoRefillBtn = new InvTweaksGuiTooltipButton(ID_AUTO_REFILL, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_ENABLE_AUTO_REFILL, labelAutoRefill), InvTweaksLocalization.get("invtweaks.settings.autorefill.tooltip"));
        controlList.add(autoRefillBtn);

        moveToButtonCoords(i++, p);
        controlList.add(new InvTweaksGuiTooltipButton(ID_MORE_OPTIONS, p.getX(), p.getY(), labelMoreOptions, InvTweaksLocalization.get("invtweaks.settings.moreoptions.tooltip")));
   
        controlList.add(new InvTweaksGuiTooltipButton(ID_BUG_SORTING, 5, this.height - 20, 100, 20, labelBugSorting, null, false));
   
        String middleClick = config.getProperty(InvTweaksConfig.PROP_ENABLE_MIDDLE_CLICK);
        moveToButtonCoords(i++, p);
        InvTweaksGuiTooltipButton middleClickBtn = new InvTweaksGuiTooltipButton(ID_MIDDLE_CLICK, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_ENABLE_MIDDLE_CLICK, labelMiddleClick), InvTweaksLocalization.get("invtweaks.settings.middleclick.tooltip"));
        controlList.add(middleClickBtn);
        if (middleClick.equals(InvTweaksConfig.VALUE_CI_COMPATIBILITY)) {
            // Convenient Inventory compatibility: middle click not available
            obf.setEnabled(middleClickBtn, false);
            middleClickBtn.setTooltip(middleClickBtn.getTooltip() + "\n(" + InvTweaksLocalization.get("invtweaks.settings.disableci.tooltip"));
        }
       
        // Check if links to files are supported, if not disable the buttons
        if (!Desktop.isDesktopSupported()) {
            for (Object o : controlList) {
              if (obf.isGuiButton(o)) {
                GuiButton guiButton = obf.asGuiButton(o);
                  if (obf.getId(guiButton) >= ID_EDITRULES && obf.getId(guiButton) <= ID_HELP) {
                      obf.setEnabled(guiButton, false);
                  }
              }
            }
View Full Code Here

    public void initGui() {

        List<Object> controlList = obf.getControlList(this);
        Point p = new Point();
        moveToButtonCoords(1, p);
        controlList.add(new GuiButton(ID_DONE, p.getX() + 55, obf.getWindowHeight(this) / 6 + 168, LABEL_DONE)); // GuiButton

        // Save control list
        obf.setControlList(this, controlList);

    }
View Full Code Here

        int i = 0;

        // Create large buttons

        moveToButtonCoords(1, p);
        controlList.add(new GuiButton(ID_EDITSHORTCUTS, p.getX() + 55, obf.getWindowHeight(this) / 6 + 144, InvTweaksLocalization.get("invtweaks.settings.advanced.mappingsfile")));

        // Create settings buttons
       
        i += 2;
        moveToButtonCoords(i++, p);
        InvTweaksGuiTooltipButton sortOnPickupBtn = new InvTweaksGuiTooltipButton(ID_SORT_ON_PICKUP, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_ENABLE_SORTING_ON_PICKUP, labelSortOnPickup), InvTweaksLocalization.get("invtweaks.settings.advanced.sortonpickup.tooltip"));
        controlList.add(sortOnPickupBtn);

        moveToButtonCoords(i++, p);
        InvTweaksGuiTooltipButton enableSoundsBtn = new InvTweaksGuiTooltipButton(ID_ENABLE_SOUNDS, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_ENABLE_SOUNDS, labelEnableSounds),
                InvTweaksLocalization.get("invtweaks.settings.advanced.sounds.tooltip"));
        controlList.add(enableSoundsBtn);
       
        moveToButtonCoords(i++, p);
        controlList.add(new InvTweaksGuiTooltipButton(ID_CHESTS_BUTTONS, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_SHOW_CHEST_BUTTONS, labelChestButtons), InvTweaksLocalization.get("invtweaks.settings.chestbuttons.tooltip")));

        moveToButtonCoords(i++, p);
        InvTweaksGuiTooltipButton autoEquipArmorBtn = new InvTweaksGuiTooltipButton(ID_AUTO_EQUIP_ARMOR, p.getX(), p.getY(), computeBooleanButtonLabel(
                InvTweaksConfig.PROP_ENABLE_AUTO_EQUIP_ARMOR, labelEquipArmor), InvTweaksLocalization.get("invtweaks.settings.advanced.autoequip.tooltip"));
        controlList.add(autoEquipArmorBtn);

        // Check if links to files are supported, if not disable the buttons
        if (!Desktop.isDesktopSupported()) {
            for (Object o : controlList) {
              if (obf.isGuiButton(o)) {
                  GuiButton button = obf.asGuiButton(o);
                  if (obf.getId(button) == ID_EDITSHORTCUTS) {
                      obf.setEnabled(button, false);
                  }
              }
            }
View Full Code Here

TOP

Related Classes of net.minecraft.src.GuiButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.