Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.GenericButton


    labelTitle = new GenericLabel(title);
    textText = new GenericTextField();
    textText.setWidth(200);
    textText.setText(text);

    buttonCancel = new GenericButton("Cancel");
    buttonDone = new GenericButton("Done");

    getScreen().attachWidgets("Spoutcraft", labelTitle, textText, buttonCancel, buttonDone);
  }
View Full Code Here


    this.bindings = bindings;
  }

  protected void createInstances() {
    title = new GenericLabel("Ambigous bindings\n" + ChatColor.GRAY + "The key you pressed has multiple bindings assigned.\n" + ChatColor.GRAY + "Please choose which action you want to summon.");
    buttonCancel = new GenericButton("Cancel");
    list = new GenericListWidget();

    int i = 1;
    for (AbstractBinding binding:bindings) {
      list.addItem(new BindingItem(i, binding));
View Full Code Here

    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(106);
    label.setFixed(true).setPriority(RenderPriority.Lowest);
    getScreen().attachWidget("Spoutcraft", label);

    done = new GenericButton("Create");
    if (existed) {
      done.setText("Save");
    }
    done.setWidth(150).setHeight(20).setX(right).setY(200);
    getScreen().attachWidget("Spoutcraft", done);

    cancel = new GenericButton("Cancel");
    cancel.setWidth(150).setHeight(20).setX(left).setY(200);
    getScreen().attachWidget("Spoutcraft", cancel);

    if (existed) {
      delete = new GenericButton("Delete");
      delete.setGeometry(left, 175, 150, 20);
      getScreen().attachWidget("Spoutcraft", delete);
    }
  }
View Full Code Here

    int top = 10;
    int left = 10;
    int right = left + labelWidth + 10;
    int labelHeight = 20;

    recordButton = new GenericButton();
    recordButton.setGeometry(width - 160, top - 3, 150, labelHeight);
    getScreen().attachWidget("Spoutcraft", recordButton);
    updateRecordButton();

    titleLabel = new GenericLabel("Name:");
    titleLabel.setGeometry(left, top + 3, labelWidth, labelHeight);
    getScreen().attachWidget("Spoutcraft", titleLabel);

    commandName = new GenericTextField();
    commandName.setGeometry(right, top - 1, (int) (width - right - recordButton.getWidth() - 20), 16);
    commandName.setText(item.getTitle());
    commandName.setMaximumCharacters(0);
    commandName.setPlaceholder("Enter a name here");
    getScreen().attachWidget("Spoutcraft", commandName);

    top += 23;

    commandLabel = new GenericLabel("Command:");
    commandLabel.setGeometry(left, top + 3, labelWidth, labelHeight);
    getScreen().attachWidget("Spoutcraft", commandLabel);

    commandText = new GenericTextField();
    commandText.setGeometry(right, top - 1, width - right - 10, 16);
    commandText.setMaximumCharacters(0);
    commandText.setPlaceholder("Enter new command here, then click \"Add Command\"");
    getScreen().attachWidget("Spoutcraft", commandText);

    top += 23;

    delayLabel = new GenericLabel("Delay (ms)");
    delayLabel.setGeometry(left, top + 3, labelWidth, labelHeight);
    getScreen().attachWidget("Spoutcraft", delayLabel);

    delayText = new GenericTextField();
    delayText.setGeometry(right, top - 1, width - right - 10, 16);
    delayText.setText(item.getDelay() + "");
    delayText.setTextProcessor(new GenericTextProcessor() {
      protected boolean insert(char c) {
        if (c >= '0' && c <= '9') {
          return super.insert(c);
        }
        return false;
      };

      @Override
      protected boolean insert(String s) {
        for (int i = 0; i < s.length(); i++) {
          char c = s.charAt(i);
          if (!(c >= '0' && c <= '9')) {
            return false;
          }
        }
        return super.insert(s);
      }
    });
    getScreen().attachWidget("Spoutcraft", delayText);

    top += 23;

    slot = new GuiCommandsSlot(this);
    slot.setGeometry(0, top, width, this.height - top - 30);
    getScreen().attachWidget("Spoutcraft", slot);

    doneButton = new GenericButton("Done");
    doneButton.setHeight(20).setWidth(50);
    doneButton.setX(10).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", doneButton);

    addButton = new GenericButton("Add Command");
    addButton.setHeight(20).setWidth(100);
    addButton.setX(70).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", addButton);

    editButton = new GenericButton("Edit Command");
    editButton.setHeight(20).setWidth(100);
    editButton.setX(180).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", editButton);

    removeButton = new GenericButton("Remove Command");
    removeButton.setHeight(20).setWidth(100);
    removeButton.setX(290).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", removeButton);

    updateButtons();
View Full Code Here

  public void initGui() {
    int textWidth;

    StringTranslate translate = StringTranslate.getInstance();

    singleplayer = new GenericButton(translate.translateKey("menu.singleplayer"));
    singleplayer.setGeometry(width - 110, height - 155, 100, 20);

    multiplayer = new GenericButton(translate.translateKey("menu.multiplayer"));
    multiplayer.setGeometry(width - 110, height - 130, 100, 20);

    resources = new GenericButton(translate.translateKey("options.resourcepack"));
    resources.setGeometry(width - 110, height - 105, 100, 20);

    buildNumber = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild());   
    textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(buildNumber.getText());
    buildNumber.setTextColor(new Color(0x6CC0DC));
    buildNumber.setGeometry(Math.min(90 - textWidth, width - 296 - textWidth), height - 99, 75, 20);

    about = new GenericButton("About");
    about.setGeometry(Math.min(98, width - 288), height - 105, 51, 20);

    options = new GenericButton(translate.translateKey("menu.options"));
    options.setGeometry(Math.min(159, width - 227), height - 105, 51, 20);

    quit = new GenericButton(translate.translateKey("menu.quit"));
    quit.setGeometry(Math.min(220, width - 166), height - 105, 61, 20);

    background.setGeometry(0, 0, width, height);
    background.setPriority(RenderPriority.Highest);
    background.setAnchor(WidgetAnchor.TOP_LEFT);
View Full Code Here

  }

  @Override
  protected void createInstances() {
    title = new GenericLabel("Filter Mobs");
    buttonDone = new GenericButton("Done");
    scroll = new GenericScrollArea();
    for (Entry<Class<? extends Entity>, String> e : WatchedEntity.mobFaceTextures.entrySet()) {
      EntityVisibilityCheckbox ch = new EntityVisibilityCheckbox(e.getKey(), e.getValue());
      scroll.attachWidget("Spoutcraft", ch);
      checks.add(ch);
View Full Code Here

    this.parentScreen = parent;
  }

  protected void createInstances() {
    labelTitle = new GenericLabel("Controls");
    buttonDone = new GenericButton("Done");
    buttonAdd = new GenericButton("Add Shortcut");
    buttonEdit = new GenericButton("Edit");
    buttonEdit.setTooltip("Edit Shortcut");
    buttonRemove = new DeleteControlButton(this);
    buttonRemove.setTooltip("Remove Shortcut");
    labelDescription = new GenericLabel();
    labelDescription.setText("Double-click an item, then press the key (combination).");
View Full Code Here

  protected void createInstances() {
    title = new GenericLabel("Drag the minimap around");
    minimapDrag = new GenericGradient();
    minimapDrag.setTopColor(dragColor);
    minimapDrag.setBottomColor(dragColor);
    buttonDone = new GenericButton("Done");
    buttonReset = new GenericButton("Reset to Default");
    sliderScale = new GenericSlider();
    float scale = MinimapConfig.getInstance().getSizeAdjust();
    sliderScale.setSliderPosition(scale / 4);

    getScreen().attachWidgets("Spoutcraft", title, minimapDrag, buttonDone, buttonReset, sliderScale);
View Full Code Here

  @Override
  protected void createInstances() {
    title = new GenericLabel("Overview Map");
    noRenderLabel = new GenericLabel("The overview map will not work until the minimap is enabled.");
    minimapEnabled = MinimapConfig.getInstance().isEnabled();
    buttonDone = new GenericButton("Done");
    buttonZoomIn = new GenericButton("+");
    buttonZoomOut = new GenericButton("-");
    buttonShowPlayer = new GenericButton("Player");
    buttonReset = new GenericButton("Reset View");
    buttonSave = new GenericButton("Save to Desktop");
    buttonDeathpoints = new GenericCheckBox("Deathpoints");
    ((GenericCheckBox)buttonDeathpoints).setChecked(MinimapConfig.getInstance().isDeathpoints());
    map = new MapWidget(this);
    map.setGeometry(0, 0, width, height);
    map.scrollTo(map.getPlayerPosition(), false, 0);

    if (minimapEnabled == false) {
      getScreen().attachWidgets("Spoutcraft", noRenderLabel, buttonDone);
    } else {
      getScreen().attachWidgets("Spoutcraft", map, title, buttonDone, buttonZoomIn, buttonZoomOut, buttonShowPlayer, buttonReset, buttonSave, buttonDeathpoints);
    }

    hoverMenu = new GenericScrollArea();
    hoverMenu.setBackgroundColor(new Color(0x55ffffff));
    hoverMenu.setPriority(RenderPriority.Lowest);
    menuTitle = new GenericLabel("What do you want to do?");
    buttonWaypoint = new GenericButton("Add Waypoint");
    buttonFocus = new GenericButton("Set Focus");
    buttonFocus.setTooltip("If a waypoint is in focus, the direction\nto it will be drawn on the minimap.");
    buttonCloseMenu = new GenericButton("Close");
    hoverMenu.attachWidgets("Spoutcraft", buttonFocus, buttonWaypoint, buttonCloseMenu, menuTitle);

    setMenuVisible(false);
    getScreen().attachWidget("Spoutcraft", hoverMenu);
  }
View Full Code Here

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

    // Spout Start
    if (Spoutcraft.hasPermission("spout.plugin.sortinventory")) {
      orderByAlphabet = new GenericButton("A-Z");
      orderById = new GenericButton("Id");
      orderByAlphabet.setTooltip("Will sort the inventory contents by their name");
      orderById.setTooltip("Will sort the inventory contents by their id");
      ScreenType type = ScreenUtil.getType(this);

      if (type == ScreenType.PLAYER_INVENTORY) {
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.gui.GenericButton

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.