Пример #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);
 }
Пример #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);
  }