/** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   if (this.mc.playerController.isInCreativeMode()) {
     super.initGui();
     this.controlList.clear();
     Keyboard.enableRepeatEvents(true);
     this.searchField =
         new GuiTextField(
             this.fontRenderer,
             this.guiLeft + 82,
             this.guiTop + 6,
             89,
             this.fontRenderer.FONT_HEIGHT);
     this.searchField.setMaxStringLength(15);
     this.searchField.setEnableBackgroundDrawing(false);
     this.searchField.setVisible(false);
     this.searchField.setTextColor(16777215);
     int var1 = selectedTabIndex;
     selectedTabIndex = -1;
     this.func_74227_b(CreativeTabs.creativeTabArray[var1]);
     this.field_82324_x = new CreativeCrafting(this.mc);
     this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
     int tabCount = CreativeTabs.creativeTabArray.length;
     if (tabCount > 12) {
       controlList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
       controlList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
       tabPage = 0;
       maxPages = ((tabCount - 12) / 10) + 1;
     }
   } else {
     this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
   }
 }
Beispiel #2
0
  /** Called when the screen is unloaded. Used to disable keyboard repeat events */
  public void onGuiClosed() {
    // Spout start
    entitySign.lineBeingEdited = -1;
    entitySign.columnBeingEdited = -1;
    entitySign.recalculateText();
    // Colorize text
    if (sendAsUnicode()) {
      boolean allow = Spoutcraft.hasPermission("spout.client.signcolors");
      for (int i = 0; i < entitySign.signText.length; i++) {
        if (entitySign.signText[i] != null)
          entitySign.signText[i] =
              entitySign.signText[i].replaceAll("(&([a-fA-F0-9]))", allow ? "\u00A7$2" : "");
      }
    } else {
      for (int i = 0; i < entitySign.signText.length; i++) {
        if (entitySign.signText[i] != null)
          entitySign.signText[i] = entitySign.signText[i].replaceAll("(&([a-fA-F0-9]))", "");
      }
    }
    // Spout end
    Keyboard.enableRepeatEvents(false);

    if (mc.theWorld.isRemote) {
      mc.getSendQueue()
          .addToSendQueue(
              new Packet130UpdateSign(
                  entitySign.xCoord, entitySign.yCoord, entitySign.zCoord, entitySign.signText));
    }
  }
  public void func_73866_w_() {
    this.field_73887_h.clear();
    Keyboard.enableRepeatEvents(true);
    if (this.field_74168_c) {
      this.field_73887_h.add(
          this.field_74183_x =
              new GuiButton(
                  3,
                  this.field_73880_f / 2 - 100,
                  4 + this.field_74180_p,
                  98,
                  20,
                  I18n.func_135053_a("book.signButton")));
      this.field_73887_h.add(
          this.field_74173_w =
              new GuiButton(
                  0,
                  this.field_73880_f / 2 + 2,
                  4 + this.field_74180_p,
                  98,
                  20,
                  I18n.func_135053_a("gui.done")));
      this.field_73887_h.add(
          this.field_74182_y =
              new GuiButton(
                  5,
                  this.field_73880_f / 2 - 100,
                  4 + this.field_74180_p,
                  98,
                  20,
                  I18n.func_135053_a("book.finalizeButton")));
      this.field_73887_h.add(
          this.field_74181_z =
              new GuiButton(
                  4,
                  this.field_73880_f / 2 + 2,
                  4 + this.field_74180_p,
                  98,
                  20,
                  I18n.func_135053_a("gui.cancel")));
    } else {
      this.field_73887_h.add(
          this.field_74173_w =
              new GuiButton(
                  0,
                  this.field_73880_f / 2 - 100,
                  4 + this.field_74180_p,
                  200,
                  20,
                  I18n.func_135053_a("gui.done")));
    }

    int var1 = (this.field_73880_f - this.field_74171_o) / 2;
    byte var2 = 2;
    this.field_73887_h.add(
        this.field_74175_u = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true));
    this.field_73887_h.add(
        this.field_74174_v = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false));
    this.func_74161_g();
  }
Beispiel #4
0
 @Override
 protected void elementClicked(GUIElement element) {
   if (element instanceof GUITextField) {
     for (GUIElement subElement : subElements)
       if (subElement instanceof GUITextField && subElement != element)
         ((GUITextField) subElement).setFocus(false);
     ((GUITextField) element).setFocus(true);
     focusedFieldID = subElements.indexOf(element);
     Keyboard.enableRepeatEvents(true);
   } else {
     Keyboard.enableRepeatEvents(false);
     game.login(
         ((GUITextField) subElements.get(0)).getText(),
         ((GUITextField) subElements.get(1)).getText());
   }
 }
  @Override
  public void initGui() {
    Keyboard.enableRepeatEvents(true);

    buttonList.clear();
    buttonList.add(
        doneButton =
            new GuiButton(
                1,
                width / 2 - 40,
                height / 2 - 10,
                80,
                20,
                MCA.getInstance().getLanguageLoader().getString("gui.button.done")));
    buttonList.add(
        randomButton =
            new GuiButton(
                2,
                width / 2 + 105,
                height / 2 - 60,
                60,
                20,
                MCA.getInstance().getLanguageLoader().getString("gui.button.random")));

    babyNameTextField =
        new GuiTextField(fontRendererObj, width / 2 - 100, height / 2 - 60, 200, 20);
    babyNameTextField.setMaxStringLength(32);
  }
  /** Adds the buttons (and other controls) to the screen in question. */
  public void initGui() {

    super.initGui();
    this.buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    this.searchField =
        new GuiTextField(
            this.fontRendererObj,
            this.guiLeft + 82 + 100,
            this.guiTop + 6,
            89,
            this.fontRendererObj.FONT_HEIGHT);
    this.searchField.setMaxStringLength(15);
    this.searchField.setEnableBackgroundDrawing(false);
    this.searchField.setVisible(false);
    this.searchField.setTextColor(16777215);
    int i = selectedTabIndex;
    selectedTabIndex = -1;
    this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
    this.field_147059_E = new CreativeCrafting(this.mc);
    this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E);
    int tabCount = CreativeTabs.creativeTabArray.length;
    if (tabCount > 12) {
      buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
      buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
      maxPages = ((tabCount - 12) / 10) + 1;
    }
  }
Beispiel #7
0
  @Override
  public void initGui() {
    Keyboard.enableRepeatEvents(true);

    super.initGui();

    if (prevButton == null) {
      prevButton = new GuiButton(0, 0, 0, 20, 20, "<");
      prevButton.visible = false;
    }

    prevButton.xPosition = guiLeft + 107;
    prevButton.yPosition = guiTop + 60;

    if (nextButton == null) {
      nextButton = new GuiButton(1, 0, 0, prevButton.width, prevButton.height, ">");
      nextButton.visible = false;
    }

    nextButton.xPosition = prevButton.xPosition + prevButton.width + 10;
    nextButton.yPosition = prevButton.yPosition;

    buttonList.add(prevButton);
    buttonList.add(nextButton);

    if (prevHover == null) {
      prevHover = new HoverChecker(prevButton, 0);
    }

    if (nextHover == null) {
      nextHover = new HoverChecker(nextButton, 0);
    }
  }
Beispiel #8
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   this.buttonList.clear();
   Keyboard.enableRepeatEvents(true);
   this.buttonList.add(
       this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done"));
   this.entitySign.setEditable(false);
 }
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   if (this.mc.playerController.isInCreativeMode()) {
     super.initGui();
     this.controlList.clear();
     Keyboard.enableRepeatEvents(true);
     this.searchField =
         new GuiTextField(
             this.fontRenderer,
             this.guiLeft + 82,
             this.guiTop + 6,
             89,
             this.fontRenderer.FONT_HEIGHT);
     this.searchField.setMaxStringLength(15);
     this.searchField.setEnableBackgroundDrawing(false);
     this.searchField.setVisible(false);
     this.searchField.setTextColor(16777215);
     int var1 = selectedTabIndex;
     selectedTabIndex = -1;
     this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]);
     this.field_82324_x = new CreativeCrafting(this.mc);
     this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
   } else {
     this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer));
   }
 }
Beispiel #10
0
  @SuppressWarnings("unchecked")
  @Override
  public void initGui() {
    if (noShow) {
      TPPITweaks.logger.info("not opening GUI");
      this.mc.displayGuiScreen(this.parentScreen);
      return;
    }

    // Unsure exactly what this does but...it seems necessary
    Keyboard.enableRepeatEvents(true);

    this.buttonList.clear();

    this.buttonList.add(
        new GuiButton(-1, this.width / 2 - 150, this.height / 2 + 30, 300, 20, "Continue"));
    this.buttonList.add(
        new GuiButton(
            11,
            this.width / 2 - 150,
            this.height / 2 + 65,
            300,
            20,
            "Skip the downloads completely"));
  }
 public void func_73874_b() {
   Keyboard.enableRepeatEvents(false);
   if (this.field_74040_y != null) {
     this.field_74040_y.interrupt();
     this.field_74040_y = null;
   }
 }
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   this.func_98063_a(this.field_98065_b.field_96408_a);
   StringTranslate var1 = StringTranslate.getInstance();
   Keyboard.enableRepeatEvents(true);
   this.buttonList.add(
       new GuiButton(
           0, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.cancel")));
 }
 public void onGuiClosed() {
   Keyboard.enableRepeatEvents(false);
   if (mc.theWorld.multiplayerWorld) {
     mc.getSendQueue()
         .addToSendQueue(
             new Packet130UpdateSign(
                 entitySign.xCoord, entitySign.yCoord, entitySign.zCoord, entitySign.signText));
   }
 }
 @SuppressWarnings("unchecked")
 public void initGui() {
   Keyboard.enableRepeatEvents(true);
   controlList.clear();
   controlList.add(
       new GuiButton(10, width / 2 - 100, height / 2 - 20, "Switch To Another Pokemon"));
   if (!bc.isTrainerVsTrainer())
     controlList.add(new GuiButton(10, width / 2 - 100, height / 2 + 20, "Run"));
 }
  /** Called when the screen is unloaded. Used to disable keyboard repeat events */
  public void onGuiClosed() {
    super.onGuiClosed();

    if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) {
      this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_82324_x);
    }

    Keyboard.enableRepeatEvents(false);
  }
Beispiel #16
0
 @Override
 public void initGui() {
   super.initGui();
   state.switchTo(
       NORMAL); // TODO: his causes the Export PNG progress bar to disappear when resizing game
                // window
   Keyboard.enableRepeatEvents(true);
   screenScale = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight).getScaleFactor();
   setCentered();
 }
Beispiel #17
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   Keyboard.enableRepeatEvents(true);
   this.sentHistoryCursor = this.mc.ingameGUI.getChatGUI().getSentMessages().size();
   this.inputField = new GuiTextField(this.fontRenderer, 4, this.height - 12, this.width - 4, 12);
   this.inputField.setMaxStringLength(100);
   this.inputField.setEnableBackgroundDrawing(false);
   this.inputField.setFocused(true);
   this.inputField.setText(this.defaultInputFieldText);
   this.inputField.setCanLoseFocus(false);
 }
Beispiel #18
0
 @Override
 public boolean mousePressed(int button, int x, int y) {
   if (!super.mousePressed(button, x, y)) {
     Keyboard.enableRepeatEvents(false);
     ((GUITextField) subElements.get(0)).setFocus(false);
     ((GUITextField) subElements.get(1)).setFocus(false);
     return false;
   }
   return true;
 }
  @Override
  public void initGui() {
    initGuiComponents();

    nameBox =
        new GuiTextField(mc.fontRenderer, spacing, 80 + spacing, width - spacing * 2, buttonHeight);
    nameBox.setText(clone.getFullEditedName());
    lastTickName = clone.getFullEditedName();
    Keyboard.enableRepeatEvents(true);
  }
  public void func_73866_w_() {
    Keyboard.enableRepeatEvents(true);
    this.field_73887_h.clear();
    this.field_73887_h.add(
        new GuiButton(
            field_96253_d,
            this.field_73880_f / 2 - 100,
            this.field_73881_g / 4 + 120 + 17,
            97,
            20,
            I18n.func_135053_a("mco.create.world")));
    this.field_73887_h.add(
        new GuiButton(
            field_96261_n,
            this.field_73880_f / 2 + 5,
            this.field_73881_g / 4 + 120 + 17,
            95,
            20,
            I18n.func_135053_a("gui.cancel")));
    this.field_96257_c =
        new GuiTextField(this.field_73886_k, this.field_73880_f / 2 - 100, 65, 200, 20);
    this.field_96257_c.func_73796_b(true);
    if (this.field_98108_c != null) {
      this.field_96257_c.func_73782_a(this.field_98108_c);
    }

    this.field_96255_b =
        new GuiTextField(this.field_73886_k, this.field_73880_f / 2 - 100, 111, 200, 20);
    if (this.field_98109_n != null) {
      this.field_96255_b.func_73782_a(this.field_98109_n);
    }

    if (this.field_110356_u == null) {
      this.field_73887_h.add(
          new GuiButton(
              field_110357_r,
              this.field_73880_f / 2 - 100,
              147,
              200,
              20,
              I18n.func_135053_a("mco.template.default.name")));
    } else {
      this.field_96255_b.func_73782_a("");
      this.field_96255_b.func_82265_c(false);
      this.field_96255_b.func_73796_b(false);
      this.field_73887_h.add(
          new GuiButton(
              field_110357_r,
              this.field_73880_f / 2 - 100,
              147,
              200,
              20,
              I18n.func_135053_a("mco.template.name") + ": " + this.field_110356_u.field_110732_b));
    }
  }
Beispiel #21
0
 @Override
 public void onGuiClosed() {
   super.onGuiClosed();
   removeChild(markerFinalizer);
   removeChild(blinkingIcon);
   Keyboard.enableRepeatEvents(false);
   biomeData.setBrowsingPosition(mapOffsetX, mapOffsetY, mapScale);
   PacketDispatcher.sendToServer(
       new BrowsingPositionPacket(
           stack.getItemDamage(), player.dimension, mapOffsetX, mapOffsetY, mapScale));
 }
Beispiel #22
0
 @Override
 public void initGui() {
   if (oldScale != 1) {
     oldScale = Minecraft.getMinecraft().gameSettings.guiScale;
     Minecraft.getMinecraft().gameSettings.guiScale = 1;
     ScaledResolution scaledresolution =
         new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
     this.width = scaledresolution.getScaledWidth();
     this.height = scaledresolution.getScaledHeight();
   }
   Keyboard.enableRepeatEvents(true);
 }
Beispiel #23
0
 public void func_73866_w_() {
   Keyboard.enableRepeatEvents(true);
   this.field_73899_c = this.field_73882_e.field_71456_v.func_73827_b().func_73756_b().size();
   this.field_73901_a =
       new GuiTextField(
           this.field_73886_k, 4, this.field_73881_g - 12, this.field_73880_f - 4, 12);
   this.field_73901_a.func_73804_f(100);
   this.field_73901_a.func_73786_a(false);
   this.field_73901_a.func_73796_b(true);
   this.field_73901_a.func_73782_a(this.field_73900_q);
   this.field_73901_a.func_73805_d(false);
 }
Beispiel #24
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   this.buttonList.clear();
   Keyboard.enableRepeatEvents(true);
   this.buttonList.add(
       this.doneBtn =
           new GuiButton(
               0,
               this.width / 2 - 100,
               this.height / 4 + 120,
               I18n.format("gui.done", new Object[0])));
   this.tileSign.setEditable(false);
 }
Beispiel #25
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   super.initGui();
   Keyboard.enableRepeatEvents(true);
   int var1 = (this.width - this.xSize) / 2;
   int var2 = (this.height - this.ySize) / 2;
   this.nameField = new GuiTextField(0, this.fontRenderer, var1 + 62, var2 + 24, 103, 12);
   this.nameField.setTextColor(-1);
   this.nameField.setDisabledTextColour(-1);
   this.nameField.setEnableBackgroundDrawing(false);
   this.nameField.setMaxStringLength(40);
   this.container.removeCrafter(this);
   this.container.didOpenCraftingGUI(this);
 }
Beispiel #26
0
  @Override
  public void initGui() {
    super.initGui();

    if (stand == null) {
      mc.displayGuiScreen(null);
    } else {
      Keyboard.enableRepeatEvents(true);

      buttonList.clear();

      this.guiLeft = (this.width - this.xSize) / 2;
      this.guiTop = (this.height - this.ySize) / 2;

      buttonList.add(new GuiButton(ID_PAGE_LEFT, width / 2 - 6, height / 2 + 54, 20, 20, "<"));
      buttonList.add(new GuiButton(ID_PAGE_RIGHT, width / 2 + 62, height / 2 + 54, 20, 20, ">"));
      buttonList.add(
          new GuiButton(
              ID_DONE_SELECT, width / 2 + 16, height / 2 + 54, 44, 20, I18n.format("gui.done")));

      // 4, 5, 6, 7, 8 = taken.

      addToolButton(ID_NONE, 0);
      addToolButton(ID_HAT_COLOUR_SWAP, 1);
      addToolButton(ID_RANDOM, 2);

      buttonList.add(new GuiButton(ID_CLOSE, width - 22, 2, 20, 20, "X"));

      pageNumber = 0;

      if (!stand.hatName.equalsIgnoreCase("")) {
        for (int i = 0; i < hatsToShow.size(); i++) {
          String hatName = (String) hatsToShow.get(i);
          if (hatName.equalsIgnoreCase(stand.hatName)) {
            i -= i % 6;
            pageNumber = i / 6;
            break;
          }
        }
      }

      updateButtonList();

      searchBar =
          new GuiTextField(0, this.fontRendererObj, this.width / 2 - 65, height - 24, 150, 20);
      searchBar.setMaxStringLength(255);
      searchBar.setText(StatCollector.translateToLocal("hats.gui.search"));
      searchBar.setTextColor(0xAAAAAA);
      searchBar.setVisible(enabledSearchBar);
    }
  }
Beispiel #27
0
  /** Called when the screen is unloaded. Used to disable keyboard repeat events */
  public void onGuiClosed() {
    Keyboard.enableRepeatEvents(false);
    NetClientHandler var1 = this.mc.getSendQueue();

    if (var1 != null) {
      var1.addToSendQueue(
          new Packet130UpdateSign(
              this.entitySign.xCoord,
              this.entitySign.yCoord,
              this.entitySign.zCoord,
              this.entitySign.signText));
    }

    this.entitySign.setEditable(true);
  }
Beispiel #28
0
  /** Called when the screen is unloaded. Used to disable keyboard repeat events */
  public void onGuiClosed() {
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getNetHandler();

    if (nethandlerplayclient != null) {
      nethandlerplayclient.addToSendQueue(
          new C12PacketUpdateSign(
              this.tileSign.xCoord,
              this.tileSign.yCoord,
              this.tileSign.zCoord,
              this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
  }
Beispiel #29
0
 public void initGui() {
   Keyboard.enableRepeatEvents(true);
   if (!Util.hunger) {
     size -= 10;
   }
   if (!Util.armour) {
     size -= 10;
   }
   if (!Util.coords) {
     size -= 10;
   }
   if (size < 20) {
     size = 20;
   }
 }
Beispiel #30
0
 /** Adds the buttons (and other controls) to the screen in question. */
 public void initGui() {
   controlList.clear();
   Keyboard.enableRepeatEvents(true);
   controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 120, "Done"));
   // Spout start
   controlList.add(
       unicode = new GuiButton(1, width / 2 - 100, height / 4 + 142, "Send As Unicode"));
   if (!ConfigReader.sendColorsAsUnicode) {
     unicode.displayString = "Send As Plain Text";
   }
   if (!this.mc.theWorld.isRemote) {
     unicode.drawButton = false;
     unicode.enabled = false;
   }
   // Spout end
 }