Exemplo n.º 1
0
  @Override
  protected void mouseClicked(int x, int y, int mouseButton) {
    super.mouseClicked(x, y, mouseButton);

    int minX = textBoxFilter.xPosition;
    int minY = textBoxFilter.yPosition;
    int maxX = minX + textBoxFilter.width;
    int maxY = minY + textBoxFilter.height;

    if (mouseButton == 1 && x >= minX && x <= maxX && y <= maxY) {
      PacketHandler.sendToServer(new SearchUpdatePKT("", 0));
      inv.filter = "";
      inv.searchpage = 0;
      inv.updateOutputs();
      this.textBoxFilter.setText("");
    }

    this.textBoxFilter.mouseClicked(x, y, mouseButton);
  }
Exemplo n.º 2
0
  @Override
  protected void keyTyped(char par1, int par2) {
    if (this.textBoxFilter.isFocused()) {
      this.textBoxFilter.textboxKeyTyped(par1, par2);

      String srch = this.textBoxFilter.getText().toLowerCase();

      if (!inv.filter.equals(srch)) {
        PacketHandler.sendToServer(new SearchUpdatePKT(srch, 0));
        inv.filter = srch;
        inv.searchpage = 0;
        inv.updateOutputs();
      }
    }

    if (par2 == 1
        || par2 == this.mc.gameSettings.keyBindInventory.getKeyCode()
            && !this.textBoxFilter.isFocused()) {
      this.mc.thePlayer.closeScreen();
    }
  }