private void createScreen() {
   int objects = textlines.size() + 4;
   int part = !(textlines.size() <= 5) ? 195 / objects : 20;
   int h = 3 * part / 4, w = 8 * part;
   titleLbl = new GenericLabel();
   titleLbl
       .setText(title)
       .setTextColor(new Color(1.0F, 0, 0, 1.0F))
       .setAlign(WidgetAnchor.TOP_CENTER)
       .setHeight(h)
       .setWidth(w)
       .setX(maxWidth / 2)
       .setY(25);
   this.attachWidget(plugin, titleLbl);
   int ystart = 25 + h + part / 2;
   for (int x = 0; x < textlines.size(); x++) {
     textLbl = new GenericLabel();
     textLbl
         .setText(textlines.get(x))
         .setAlign(WidgetAnchor.TOP_CENTER)
         .setHeight(h)
         .setWidth(w)
         .setX(maxWidth / 2)
         .setY(ystart + x * part);
     this.attachWidget(plugin, textLbl);
   }
   passBox = new GenericTextField();
   passBox
       .setMaximumCharacters(18)
       .setMaximumLines(1)
       .setHeight(h - 2)
       .setWidth(w - 2)
       .setY(220 - h - 2 * part);
   passBox.setPasswordField(true);
   setXToMid(passBox);
   this.attachWidget(plugin, passBox);
   errorLbl = new GenericLabel();
   errorLbl
       .setText("")
       .setTextColor(new Color(1.0F, 0, 0, 1.0F))
       .setHeight(h)
       .setWidth(w)
       .setX(passBox.getX() + passBox.getWidth() + 2)
       .setY(passBox.getY());
   this.attachWidget(plugin, errorLbl);
   loginBtn = new CustomButton(this);
   loginBtn.setText(loginTxt).setHeight(h).setWidth(w).setY(220 - h - part);
   setXToMid(loginBtn);
   this.attachWidget(plugin, loginBtn);
   exitBtn = new CustomButton(this);
   exitBtn.setText(exitTxt).setHeight(h).setWidth(w).setY(220 - h);
   setXToMid(exitBtn);
   this.attachWidget(plugin, exitBtn);
   this.setPriority(RenderPriority.Highest);
 }
Example #2
0
 private void addCredit() {
   GenericLabel label =
       new GenericLabel(
           "AmbientSpout Free v"
               + AmbientSpout.callback.getDescription().getVersion()
               + " - By Rahazan.");
   label.setTextColor(new Color(0.4F, 0.4F, 0.4F));
   label.setAnchor(WidgetAnchor.TOP_LEFT);
   label.setWidth(180).setHeight(6);
   label.shiftXPos(1).shiftYPos(1);
   this.attachWidget(AmbientSpout.callback, label);
 }
Example #3
0
  @SuppressWarnings("deprecation")
  AnvilGUI2() {
    titleLabel.setX(5);
    titleLabel.setY(5);
    titleLabel.setText("Citizens Command GUI");
    /*    itemWidget = new GenericCustomItemWidget(SpoutManager.getItemManager().getCustomItemStack(new AnvilBlock(MoarStuph.instance), 3));
           itemWidget.setTooltip("Anvil");
           itemWidget.setHeight(10);
           itemWidget.setWidth(10);
           itemWidget.setX(10);
           itemWidget.setY(10);

          menuContainer.addChildren(titleLabel,itemWidget);
    menuContainer.setDirty(true);
    this.attachWidget(MoarStuph.instance, menuContainer); */
  }
Example #4
0
  public MainGUI(Player p) {
    this.p = p;
    nextSongButton = new GenericButton("Music On"); // The first button.
    nextSongButton.setAnchor(
        WidgetAnchor
            .CENTER_CENTER); // We are "sticking" it from the center_center, from there we will be
                             // shifting.
    nextSongButton.setWidth(90).setHeight(20); // Setting the width and height of the button.
    nextSongButton.shiftXPos(-90 / 2).shiftYPos(-nextSongButton.getHeight() / 2 + 5);

    stopMusicButton = new GenericButton("Music Off"); // The second button.
    stopMusicButton.setAnchor(WidgetAnchor.CENTER_CENTER);
    stopMusicButton.setWidth(90).setHeight(20);
    // stopMusicButton.shiftXPos(0).shiftYPos(stopMusicButton.getHeight()/2);
    stopMusicButton.shiftXPos(-90 / 2).shiftYPos((int) (stopMusicButton.getHeight() * 1.1));

    if (Settings.useBackgroundImage) addBackground();

    currentSongLabel = new GenericLabel("");
    currentSongLabel.setAnchor(WidgetAnchor.CENTER_CENTER);
    currentSongLabel.setWidth(200).setHeight(10);
    currentSongLabel.shiftXPos(-50).shiftYPos(50);
    currentSongLabel.setTextColor(new Color(200, 200, 200));
    if (Settings.showCurrentSong) this.attachWidget(AmbientSpout.callback, currentSongLabel);

    if (!AmbientSpout.callback.getConfig().getBoolean("Settings.Donation", false)) addCredit();

    if (Model.playerMusicEnabled.containsKey(p.getName())) {
      if (Model.playerMusicEnabled.get(p.getName())) {
        nextSongButton.setText("Next Song");
        updateCurrentSong();
      } else {
        stopMusicButton.setVisible(false);
      }
    }

    if (p.hasPermission("ambientspout.admin") || p.isOp()) {
      // System.out.println("Adding EffectLoopButton"); //TODO DebugOnly

      addEffectLoopButton();
    }

    this.attachWidget(AmbientSpout.callback, nextSongButton);
    this.attachWidget(AmbientSpout.callback, stopMusicButton);
  }
  private void attachColorLabels(PopupScreen popup) {

    int y = 5;

    for (ChatColor color : ChatColor.values()) {

      GenericLabel label = new GenericLabel();
      label.setText(
          color
              + color.name().replace('_', ' ').toLowerCase()
              + ChatColor.RESET
              + ": &"
              + color.getChar());
      label.setHeight(25).setWidth(80).setX(300).setY(y);
      popup.attachWidget(plugin, label);
      y += 10;
    }
  }
  public HeroesSelectGUI(HeroesHUD plugin, SpoutPlayer spoutp) {
    this.plugin = plugin;
    this.spoutp = spoutp;

    GenericTexture backgroundMain = new GenericTexture();

    int screenWidth = spoutp.getMainScreen().getWidth();
    int screenHeight = spoutp.getMainScreen().getHeight();
    int x = (screenWidth / 2) - 170;
    int y = (screenHeight / 2) - 100;

    // BackgroundMain!

    backgroundMain.setX(x).setY(y);
    backgroundMain.setWidth(340).setHeight(200);
    backgroundMain.setUrl(plugin.HeroesSelectGuiBackgroundMain);
    backgroundMain.setFixed(false);
    backgroundMain.setPriority(RenderPriority.Highest);

    // Button1 Main
    button1 = new GenericButton();
    button1.setText("Primary");
    button1
        .setWidth(GenericLabel.getStringWidth(button1.getText()) + 5 + 30)
        .setHeight(GenericLabel.getStringHeight(button1.getText()) + 5);
    button1.setX(backgroundMain.getX() + 20);
    button1.setY(backgroundMain.getY() + 65);
    button1.setDirty(true);
    button1.setAutoDirty(true);

    // Button2 Main
    button2 = new GenericButton();
    button2.setText("Profession");
    button2
        .setWidth(GenericLabel.getStringWidth(button2.getText()) + 5 + 30)
        .setHeight(GenericLabel.getStringHeight(button2.getText()) + 5);
    button2.setX(backgroundMain.getX() + 235);
    button2.setY(backgroundMain.getY() + 65);
    button2.setDirty(true);
    button2.setAutoDirty(true);

    super.attachWidgets(plugin, backgroundMain, button1, button2);
    super.setAnchor(WidgetAnchor.TOP_LEFT);
  }
  public void alignLabel(GenericLabel label, String text, int alignment) {
    int labelWidth =
        (int) ((float) GenericLabel.getStringWidth(text) * Conf.spoutTerritoryDisplaySize);
    if (labelWidth > SCREEN_WIDTH) {
      label.setX(0);
      return;
    }

    switch (alignment) {
      case 1: // left aligned
        label.setX(0);
        break;
      case 2: // center aligned
        label.setX((SCREEN_WIDTH - labelWidth) / 2);
        break;
      default: // right aligned
        label.setX(SCREEN_WIDTH - labelWidth);
    }
  }
  private void doOwnerList(
      FPlayer player, SpoutPlayer sPlayer, FLocation here, Faction factionHere) {
    // ----------
    // Owner list
    // ----------
    if (Conf.spoutTerritoryDisplayPosition > 0
        && Conf.spoutTerritoryDisplaySize > 0
        && Conf.spoutTerritoryOwnersShow
        && Conf.ownedAreasEnabled) {
      GenericLabel label;
      if (ownerLabels.containsKey(player.getName())) label = ownerLabels.get(player.getName());
      else {
        label = new GenericLabel();
        label
            .setWidth(1)
            .setHeight(1); // prevent Spout's questionable new "no default size" warning
        label.setScale(Conf.spoutTerritoryDisplaySize);
        label.setY((int) (10 * Conf.spoutTerritoryDisplaySize));
        sPlayer.getMainScreen().attachWidget(P.p, label);
        ownerLabels.put(player.getName(), label);
      }

      String msg = "";

      if (player.getFaction() == factionHere) {
        msg = factionHere.getOwnerListString(here);

        if (!msg.isEmpty()) msg = Conf.ownedLandMessage + msg;
      }

      label.setText(msg);
      alignLabel(label, msg);
      label.setDirty(true);
    }
  }
  public static void open(
      Plugin plugin, SpoutPlayer splayer) { // method used to open the GUI for a player
    GenericTexture face = new GenericTexture();

    int width = splayer.getCurrentScreen().getWidth();
    int height = splayer.getCurrentScreen().getHeight();
    face.setUrl(
        "http://landoflegend.net/forums/images/CoderGreen/site_logo.png"); // this must be a png
                                                                           // image
    face.setWidth(splayer.getCurrentScreen().getWidth() / 8)
        .setHeight(
            splayer.getCurrentScreen().getHeight()
                / 8); // you can manipulate the size of most widgets
    // face.setAnchor(WidgetAnchor.CENTER_CENTER); // the enum type WidgetAnchor provides a
    // convenience method for placing widgets
    face.setX(width / 2 - face.getWidth() / 2);
    face.setY(height - face.getHeight() - 5);

    //        GenericButton button = new GenericButton("The Drogans?!");
    //        button.setWidth(80);
    //        button.setHeight(20);
    //        button.setX(width/4);
    //        button.setY(height/2);
    //        button.setAnchor(WidgetAnchor.CENTER_LEFT);

    GenericListWidget scrollTry = new GenericListWidget();
    ListWidgetItem item = new ListWidgetItem("Drogans", "Drogans");
    scrollTry.addItem(item);

    scrollTry.setX(width / 4);
    scrollTry.setY(height / 2);

    GenericLabel label = new GenericLabel("Clans - First try");
    // label.setAnchor(WidgetAnchor.CENTER_RIGHT);
    label.setWidth(80);
    label.setHeight(40);
    label.setScale(1);
    label.setX(width / 2 - label.getWidth() / 2);
    label.setY(20);

    GenericPopup popup = new GenericPopup(); // create the popup (A popup will "free the mouse")
    popup.attachWidget(plugin, face); // attach any widgets we want to the popup
    popup.attachWidget(plugin, scrollTry);
    popup.attachWidget(plugin, label);

    //        button.set

    splayer.closeActiveWindow();
    splayer.getMainScreen().attachPopupScreen(popup); // attach the popup to the players screen
  }
  private void doLabels(FPlayer player, SpoutPlayer sPlayer, boolean notify) {
    FLocation here = player.getLastStoodAt();
    Faction factionHere = Board.getFactionAt(here);
    String tag = factionHere.getColorTo(player).toString() + factionHere.getTag();

    // ----------------------
    // Main territory display
    // ----------------------
    if (Conf.spoutTerritoryDisplayPosition > 0 && Conf.spoutTerritoryDisplaySize > 0) {
      GenericLabel label;
      if (territoryLabels.containsKey(player.getName()))
        label = territoryLabels.get(player.getName());
      else {
        label = new GenericLabel();
        label
            .setWidth(1)
            .setHeight(1); // prevent Spout's questionable new "no default size" warning
        label.setScale(Conf.spoutTerritoryDisplaySize);

        sPlayer.getMainScreen().attachWidget(P.p, label);
        territoryLabels.put(player.getName(), label);
      }

      String msg = tag;

      if (Conf.spoutTerritoryDisplayShowDescription && !factionHere.getDescription().isEmpty())
        msg += " - " + factionHere.getDescription();

      label.setText(msg);
      alignLabel(label, msg);
      label.setDirty(true);
    }

    // -----------------------
    // Fading territory notice
    // -----------------------
    if (notify && Conf.spoutTerritoryNoticeShow && Conf.spoutTerritoryNoticeSize > 0) {
      NoticeLabel label;
      if (territoryChangeLabels.containsKey(player.getName()))
        label = territoryChangeLabels.get(player.getName());
      else {
        label = new NoticeLabel(Conf.spoutTerritoryNoticeLeaveAfterSeconds);
        label
            .setWidth(1)
            .setHeight(1); // prevent Spout's questionable new "no default size" warning
        label.setScale(Conf.spoutTerritoryNoticeSize);
        label.setY(Conf.spoutTerritoryNoticeTop);
        sPlayer.getMainScreen().attachWidget(P.p, label);
        territoryChangeLabels.put(player.getName(), label);
      }

      String msg = tag;

      if (Conf.spoutTerritoryNoticeShowDescription && !factionHere.getDescription().isEmpty())
        msg += " - " + factionHere.getDescription();

      label.setText(msg);
      alignLabel(label, msg, 2);
      label.resetNotice();
      label.setDirty(true);
    }

    // and owner list, of course
    doOwnerList(player, sPlayer, here, factionHere);
  }
Example #11
0
  public Tree(MMOSkillTree plugin, GenericPopup popup, SpoutPlayer sPlayer, SkillSet skillSet) {
    this.plugin = plugin;
    skillTreePopup = popup;
    Player p = (Player) sPlayer;
    // System.out.println("tree skillSet:"+skillSet);
    SkillsPlayer mmoPlayer = MMOSkillTree.mmoPlayerManager.get(p);
    Set set = mmoPlayer.getSet(skillSet);

    label = new GenericLabel("You probably wish this did something, but it doesn't yet.");
    label.setAnchor(WidgetAnchor.TOP_CENTER);
    label.setWidth(168).setHeight(10).setX(-90).setY(10);
    label.setScale(0.7F);
    skillTreePopup.attachWidget(plugin, label);

    infoBox = new GenericContainer();
    infoBox.setLayout(ContainerType.VERTICAL);
    infoBox.setWidth(50).setHeight(230);
    infoBox.setAnchor(WidgetAnchor.TOP_CENTER);
    infoBox.setAlign(WidgetAnchor.TOP_CENTER);
    infoBox.setX(-150).setY(11);
    skillTreePopup.attachWidget(plugin, infoBox);
    GenericLabel infoLabel =
        new GenericLabel(
            set.string
                + " Skills\n\n"
                + "Exp:"
                + set.getCurLvlXp()
                + "/"
                + set.getNextLvlXp()
                + "\n\n"
                + "Skill Points:"
                + set.skillPoints);
    infoLabel.setScale(0.5F);
    infoLabel.setMargin(5);
    infoBox.addChild(infoLabel);

    box = new GenericContainer();
    box.setLayout(ContainerType.VERTICAL);
    box.setAnchor(WidgetAnchor.TOP_CENTER);
    box.setWidth(168)
        .setHeight(
            210); // This is taller than it should be so the top skills align right to the top, and
                  // bottom ones to the bottom, instead of having a big gap
    box.setX(-84).setY(30);
    box.setPriority(RenderPriority.High);
    box.setAuto(true);

    swordSkills = new Sword();

    for (Entry<String, TreeSkill> entry : swordSkills.map.entrySet()) {
      // String key = entry.getKey();
      TreeSkill skill = entry.getValue();
      int row = skill.getRow();
      int col = skill.getCol();
      skills[row][col] = skill;
    }
    for (int row = 0; row < numRows; row++) {
      Container rowBox = new GenericContainer();
      rowBox.setLayout(ContainerType.HORIZONTAL);
      rowBox.setWidth(300).setHeight(38);
      for (int col = 0; col < numCols; col++) {
        if (skills[row][col] == null) {
          skills[row][col] = new TreeSkill();
        }
        TreeSkill skill = skills[row][col];
        skillSlots[row][col] =
            new SkillSlot(rowBox).setName(skill.getName()).setType(skill.getType());
      }
      box.addChild(rowBox);
    }
    for (int row = 0; row < numRows; row++) {
      for (int col = 0; col < numCols; col++) {
        SkillSlot skillSlot = skillSlots[row][col];
        TreeSkill skill = skills[row][col];
        String[] children = skill.getChildren();
        for (int i = 0; i < children.length; i++) {
          TreeSkill childSkill = swordSkills.getSkill(children[i]);
          // System.out.println(skill.getName() + " has child " + childSkill.getName());
          int childRow = childSkill.getRow();
          int childCol = childSkill.getCol();
          // System.out.println( "childRow:"+childRow + " row:"+row );
          // System.out.println( "childCol:"+childCol + " col:"+col );
          if (childCol == col && childRow == row + 1) {
            skillSlot.arrowToB();
          }
          if (childCol == col + 1 && childRow == row) {
            skillSlot.arrowToR();
          }
          if (childCol == col - 1 && childRow == row) {
            // System.out.println(skill.getName() +" to left to "+ childSkill.getName());
            skillSlot.arrowToL();
          }
          if (childCol == col + 1 && childRow == row + 1) {
            skillSlot.arrowToBR();
          }
          if (childCol == col - 1 && childRow == row + 1) {
            skillSlot.arrowToBL();
          }
          int botIterations = childRow - row;
          int rightIterations = childCol - col;
          if (botIterations > 1) {
            for (int ii = 0; ii <= botIterations; ii++) {
              // System.out.println("longL botIterations:"+botIterations + " ii:"+ii);
              SkillSlot lowerSkillSlot = skillSlots[ii][col];
              if (ii < botIterations) {
                lowerSkillSlot.arrowToLongB();
              } else {
                lowerSkillSlot.arrowToB();
              }
            }
          }
          if (rightIterations > 1) {
            for (int ii = 0; ii <= botIterations; ii++) {
              SkillSlot lowerSkillSlot = skillSlots[ii][col];
              if (ii < rightIterations) {
                lowerSkillSlot.arrowToLongR();
              } else {
                lowerSkillSlot.arrowToR();
              }
            }
          }
          if (rightIterations > -1) {
            for (int ii = 0; ii >= botIterations; ii--) {
              SkillSlot lowerSkillSlot = skillSlots[ii][col];
              if (ii > rightIterations) {
                lowerSkillSlot.arrowToLongL();
              } else {
                lowerSkillSlot.arrowToL();
              }
            }
          }
        }
      }
    }

    skillTreePopup.attachWidget(plugin, box);
  }
Example #12
0
  /** Empty constructor for externalization. */
  public PlayerOptions() {
    waveCounter = new GenericTexture();
    waveCounter.setVisible(false);
    waveCounter.setDrawAlphaChannel(true);
    waveCounter.setUrl("http://i.imgur.com/fWiJl.png");
    waveCounter.setWidth(125);
    waveCounter.setHeight(125);
    waveCounter.setAnchor(WidgetAnchor.TOP_RIGHT);
    waveCounter.shiftXPos(-85);
    waveCounter.shiftYPos(-35);
    waveCounter.setPriority(RenderPriority.High);

    waveCounterWave = new GenericLabel("Wave: 0");
    waveCounterWave.setVisible(false);
    waveCounterWave.setAnchor(WidgetAnchor.TOP_RIGHT);
    waveCounterWave.setAlign(WidgetAnchor.CENTER_CENTER);
    waveCounterWave.shiftXPos(-35);
    waveCounterWave.shiftYPos(37);
    waveCounterWave.setTextColor(new Color(150, 0, 10));
    waveCounterWave.setHeight(10);
    waveCounterWave.setWidth(10);

    waveCounterZombies = new GenericLabel("0");
    waveCounterZombies.setVisible(false);
    waveCounterZombies.setAnchor(WidgetAnchor.TOP_RIGHT);
    waveCounterZombies.setAlign(WidgetAnchor.CENTER_CENTER);
    waveCounterZombies.shiftXPos(-40);
    waveCounterZombies.shiftYPos(18);
    waveCounterZombies.setTextColor(new Color(150, 0, 10));
    waveCounterZombies.setScale(2);
    waveCounterZombies.setHeight(20);
    waveCounterZombies.setWidth(20);
  }
Example #13
0
  public void openTabScreen() {
    tabHeader = new GenericTexture("http://i.imgur.com/t8CPF.png");
    tabHeader.setDrawAlphaChannel(true);
    tabHeader.setAnchor(WidgetAnchor.CENTER_CENTER);
    tabHeader.setWidth(212);
    tabHeader.setHeight(8);
    tabHeader.shiftYPos(-100);
    tabHeader.shiftXPos(tabHeader.getWidth() / -2 + 20);

    @SuppressWarnings({"unchecked", "rawtypes"})
    List<PlayerStats> sortedStats =
        new ArrayList(ZArena.getInstance().getGameHandler().getPlayerStats().values());
    Collections.sort(sortedStats);

    int index = 0;
    for (PlayerStats stats : sortedStats) {
      GenericTexture part = new GenericTexture("http://i.imgur.com/qvrX8.png");
      part.setDrawAlphaChannel(true);
      part.setAnchor(WidgetAnchor.CENTER_CENTER);
      part.setWidth(255);
      part.setHeight(15);
      part.shiftYPos(-90 + index * 15);
      part.shiftXPos(part.getWidth() / -2);
      part.setPriority(RenderPriority.Low);
      tabMain.add(part);

      Player player = stats.getPlayer();

      GenericLabel name = new GenericLabel(player.getName());
      name.setAnchor(WidgetAnchor.CENTER_CENTER);
      name.setAlign(WidgetAnchor.TOP_CENTER);
      name.setHeight(11);
      name.setWidth(10);
      name.shiftYPos(-86 + index * 15);
      name.shiftXPos(-75);

      GenericLabel kills = new GenericLabel(stats.getKills() + "");
      kills.setAnchor(WidgetAnchor.CENTER_CENTER);
      kills.setAlign(WidgetAnchor.TOP_CENTER);
      kills.setHeight(11);
      kills.setWidth(10);
      kills.shiftYPos(-86 + index * 15);

      GenericLabel money = new GenericLabel("$" + stats.getMoney());
      money.setAnchor(WidgetAnchor.CENTER_CENTER);
      money.setAlign(WidgetAnchor.TOP_CENTER);
      money.setHeight(11);
      money.setWidth(10);
      money.shiftYPos(-86 + index * 15);
      money.shiftXPos(50);

      GenericLabel health = new GenericLabel((stats.isAlive()) ? player.getHealth() + "" : "DEAD");
      health.setTextColor(
          (!stats.isAlive())
              ? new Color(150, 0, 0)
              : (player.getHealth() > 15)
                  ? new Color(0, 200, 0)
                  : (player.getHealth() > 10)
                      ? new Color(255, 255, 0)
                      : (player.getHealth() > 5) ? new Color(255, 140, 0) : new Color(200, 0, 0));
      health.setAnchor(WidgetAnchor.CENTER_CENTER);
      health.setAlign(WidgetAnchor.TOP_CENTER);
      health.setHeight(11);
      health.setWidth(10);
      health.shiftYPos(-86 + index * 15);
      health.shiftXPos(100);

      tabText.add(name);
      tabText.add(money);
      tabText.add(kills);
      tabText.add(health);

      index++;
    }

    ((SpoutPlayer) Bukkit.getPlayer(player))
        .getMainScreen()
        .attachWidget(ZArena.getInstance(), tabHeader);
    for (GenericTexture part : tabMain) {
      ((SpoutPlayer) Bukkit.getPlayer(player))
          .getMainScreen()
          .attachWidget(ZArena.getInstance(), part);
    }
    for (GenericLabel text : tabText) {
      ((SpoutPlayer) Bukkit.getPlayer(player))
          .getMainScreen()
          .attachWidget(ZArena.getInstance(), text);
    }
  }
Example #14
0
  public void createGUI(Player player) {

    GenericPopup pop = new GenericPopup();
    this.screenId = pop.getId();

    popcontainer.put(player, screenId);
    screencontainer.put(player, ms);

    GenericTexture label1 = new GenericTexture();
    label1.setUrl("http://dragontravel.phiwa.eu/images/DragonTravel-Banner_for_GUI.png");
    label1.setHeight(46).setWidth(230);
    label1.setPriority(RenderPriority.High);
    label1.setAnchor(WidgetAnchor.TOP_CENTER);
    label1.shiftXPos(-115);

    GenericLabel label2 = new GenericLabel();
    label2.setText(ChatColor.GOLD + "Destination");
    label2.setAnchor(WidgetAnchor.TOP_LEFT);
    label2.shiftXPos(40).shiftYPos(50);

    GenericLabel label3 = new GenericLabel();
    label3.setText(ChatColor.GOLD + "Travel to Destination");
    label3.setAnchor(WidgetAnchor.TOP_CENTER);
    label3.shiftXPos(40).shiftYPos(50);

    GenericLabel label4 = new GenericLabel();
    label4.setText(ChatColor.GOLD + "Station");
    label4.setAnchor(WidgetAnchor.TOP_LEFT);
    label4.shiftXPos(40).shiftYPos(110);

    GenericLabel label5 = new GenericLabel();
    label5.setText(ChatColor.GOLD + "Travel to Player");
    label5.setAnchor(WidgetAnchor.TOP_CENTER);
    label5.shiftXPos(40).shiftYPos(110);

    input1 = new GenericTextField();
    input1.setMaximumLines(15);
    input1.setHeight(15).setWidth(200);
    input1.setAnchor(WidgetAnchor.TOP_LEFT);
    input1.shiftXPos(40).setY(60);
    input1.setMaximumLines(1);
    input1.setFocus(false);

    input2 = new GenericTextField();
    input2.setMaximumLines(15);
    input2.setHeight(15).setWidth(200);
    input2.setAnchor(WidgetAnchor.TOP_CENTER);
    input2.shiftXPos(40).setY(60);
    input2.setMaximumLines(1);
    input2.setFocus(false);

    input3 = new GenericTextField();
    input3.setMaximumLines(15);
    input3.setHeight(15).setWidth(200);
    input3.setAnchor(WidgetAnchor.TOP_LEFT);
    input3.shiftXPos(40).setY(120);
    input3.setMaximumLines(1);
    input3.setFocus(false);

    input4 = new GenericTextField();
    input4.setMaximumLines(15);
    input4.setHeight(15).setWidth(200);
    input4.setAnchor(WidgetAnchor.TOP_CENTER);
    input4.shiftXPos(40).setY(120);
    input4.setMaximumLines(1);
    input4.setFocus(false);

    GenericButton button1 = new GenericButton("Create Destination");
    button1.setAlign(WidgetAnchor.CENTER_CENTER);
    button1.setAnchor(WidgetAnchor.TOP_LEFT);
    button1.shiftXPos(40).shiftYPos(80);
    button1.setHeight(15).setWidth(200);
    button1.setHoverColor(new Color(1.0F, 5, 0, 1.0F));

    GenericButton button2 = new GenericButton("Fly to Destination");
    button2.setAlign(WidgetAnchor.CENTER_CENTER);
    button2.setAnchor(WidgetAnchor.TOP_CENTER);
    button2.shiftXPos(40).shiftYPos(80);
    button2.setHeight(15).setWidth(200);
    button2.setHoverColor(new Color(1.0F, 5, 0, 1.0F));

    GenericButton button3 = new GenericButton("Create Station");
    button3.setAlign(WidgetAnchor.CENTER_CENTER);
    button3.setAnchor(WidgetAnchor.TOP_LEFT);
    button3.shiftXPos(40).shiftYPos(140);
    button3.setHeight(15).setWidth(200);
    button3.setHoverColor(new Color(1.0F, 5, 0, 1.0F));

    GenericButton button4 = new GenericButton("Fly to Player");
    button4.setAlign(WidgetAnchor.CENTER_CENTER);
    button4.setAnchor(WidgetAnchor.TOP_CENTER);
    button4.shiftXPos(40).shiftYPos(140);
    button4.setHeight(15).setWidth(200);
    button4.setHoverColor(new Color(1.0F, 5, 0, 1.0F));

    pop.attachWidget(instance, label1);
    pop.attachWidget(instance, label2);
    pop.attachWidget(instance, label3);
    pop.attachWidget(instance, label4);
    pop.attachWidget(instance, label5);

    pop.attachWidget(instance, input1);
    pop.attachWidget(instance, input2);
    pop.attachWidget(instance, input3);
    pop.attachWidget(instance, input4);

    pop.attachWidget(instance, button1);
    pop.attachWidget(instance, button2);
    pop.attachWidget(instance, button3);
    pop.attachWidget(instance, button4);

    ((SpoutPlayer) player).getMainScreen().attachPopupScreen(pop);
  }
Example #15
0
 public void updateCurrentSong() {
   currentSongLabel.setText(getCurrentSong());
 }