Examples of GenericButton


Examples of org.spoutcraft.api.gui.GenericButton

    switchToSimpleCheck.setAlign(WidgetAnchor.CENTER_CENTER);
    switchToSimpleCheck.setX(5).setY(3).setWidth(100).setHeight(20);
    switchToSimpleCheck.setPriority(RenderPriority.Low);
    getScreen().attachWidget("Spoutcraft", switchToSimpleCheck);

    doneButton = new GenericButton("Done");
    doneButton.setAlign(WidgetAnchor.CENTER_CENTER);
    doneButton.setX(right).setY(height - 25);
    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericButton

    switchToAdvancedCheck.setChecked(false);
    switchToAdvancedCheck.setX(5).setY(3).setWidth(100).setHeight(20);
    switchToAdvancedCheck.setPriority(RenderPriority.Low);
    getScreen().attachWidget("Spoutcraft", switchToAdvancedCheck);

    doneButton = new GenericButton("Done");
    doneButton.setAlign(WidgetAnchor.CENTER_CENTER);
    doneButton.setX(right).setY(height - 25);
    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericButton

  }

  @Override
  protected void createInstances() {
    title = new GenericLabel("About");
    buttonDone = new GenericButton("Main Menu");
    scroll = new GenericScrollArea();
   
    labelSpoutcraftVersion = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild() + "\nLicensed under LGPLv3");
    labelMinecraftVersion = new GenericLabel("Copyright Mojang AB");
    labelSpoutcraftVersion.setAlign(WidgetAnchor.TOP_RIGHT);
View Full Code Here

Examples of org.spoutcraft.api.gui.GenericButton

    control = new ResetButton(this).setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", control);

    doneButton = new GenericButton("Done");
    doneButton.setAlign(WidgetAnchor.CENTER_CENTER);
    doneButton.setX(right).setY(height - 25);
    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);

    int top = 5;
    final Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F);

    label = new GenericLabel("Minimap Position");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
    label.setTextColor(grey);
    screen.attachWidget("Spoutcraft", label);

    top += 11;

    Gradient linebreak = new GenericGradient();
    linebreak.setBottomColor(grey);
    linebreak.setTopColor(grey);
    linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318);
    screen.attachWidget("Spoutcraft", linebreak);

    top += 6;

    positionButton = new GenericButton("Move Minimap");
    positionButton.setGeometry(width / 2 - 75, top, 150, 20);
    screen.attachWidget("Spoutcraft", positionButton);

    top += 27;

    label = new GenericLabel("Minimap Configuration");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
    label.setTextColor(grey);
    screen.attachWidget("Spoutcraft", label);

    top += 11;

    linebreak = new GenericGradient();
    linebreak.setBottomColor(grey);
    linebreak.setTopColor(grey);
    linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318);
    screen.attachWidget("Spoutcraft", linebreak);

    top += 6;

    toggleCheckBox = new MinimapToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    toggleCheckBox.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", toggleCheckBox);

    control = new ColorToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    control.setEnabled(false);
    control.setTooltip("Feature broken.");

    top += 22;

    control = new CoordsToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new SquareToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new ScaleToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new DirectionsToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new MinimapModeButton().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    control.setEnabled(false);
    control.setTooltip("Feature broken.");

    control = new ZoomModeButton().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new DeathpointsCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new BackgroundCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new HeightMapCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new ScanRadiusSlider().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new ShowEntitiesCheckbox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    advancedMobsButton = new GenericButton("Filter Mobs").setAlign(WidgetAnchor.TOP_CENTER);
    advancedMobsButton.setWidth(150).setHeight(20).setX(right).setY(top);
    advancedMobsButton.setTooltip("Select which mobs are shown on the minimap");
    screen.attachWidget("Spoutcraft", advancedMobsButton);

    hideable.add(advancedMobsButton);
View Full Code Here

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

Examples of org.spoutcraft.api.gui.GenericButton

    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

Examples of org.spoutcraft.api.gui.GenericButton

    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

Examples of org.spoutcraft.api.gui.GenericButton

    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

Examples of org.spoutcraft.api.gui.GenericButton

  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

Examples of org.spoutcraft.api.gui.GenericButton

  }

  @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
TOP
Copyright © 2018 www.massapi.com. 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.