Example #1
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);
 }