Esempio n. 1
0
 private void addEffectLoopButton() {
   GenericButton effectLoopButton = new GenericButton("Manage EffectLoops");
   effectLoopButton.setAnchor(WidgetAnchor.BOTTOM_LEFT);
   effectLoopButton.setWidth(120).setHeight(20);
   effectLoopButton.shiftXPos(10).shiftYPos(-nextSongButton.getHeight() - 10);
   this.attachWidget(AmbientSpout.callback, effectLoopButton);
 }
Esempio n. 2
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);
  }
Esempio n. 3
0
 public void openVotingScreen(String[] options) {
   GenericPopup voting = new GenericPopup();
   for (int i = 0; i < 3; i++) {
     GenericButton button = new ZVotingButton((i + 1) + ":" + options[i]);
     button.setHeight(24);
     button.setWidth(128);
     button.setAlign(WidgetAnchor.CENTER_CENTER);
     button.setAnchor(WidgetAnchor.CENTER_CENTER);
     button.shiftYPos(-24 + i * 24);
     button.shiftXPos(button.getWidth() / -2);
     voting.attachWidget(ZArena.getInstance(), button);
   }
   ((SpoutPlayer) Bukkit.getPlayer(player)).getMainScreen().attachPopupScreen(voting);
 }
Esempio n. 4
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);
  }