Package org.getspout.spoutapi.gui

Examples of org.getspout.spoutapi.gui.PopupScreen


  }

  public void run(int playerId) {
    SpoutPlayer p = SpoutManager.getPlayerFromId(playerId);
    InGameHUD mainScreen = p.getMainScreen();
    PopupScreen popup = mainScreen.getActivePopup();
    Screen current = p.getCurrentScreen();

    Screen in = null;
    if (mainScreen != null && screen.equals(mainScreen.getId())) {
      in = mainScreen;
    }
    if (popup != null && screen.equals(popup.getId())) {
      in = popup;
    }
    if (current != null && screen.equals(current.getId())) {
      in = current;
    }
View Full Code Here


        break;
      case Open:
        event = new ScreenOpenEvent(player, player.getMainScreen().getActivePopup(), ScreenType.getType(this.screen));
        Bukkit.getServer().getPluginManager().callEvent(event);
        if (event.isCancelled()) {
          PopupScreen screen = player.getMainScreen().getActivePopup();
          if (screen != null) {
            screen.setDirty(true);
            player.sendImmediatePacket(new PacketWidget(screen, screen.getId()));
          }
        } else {
          player.openScreen(ScreenType.getType(this.screen), false);
        }
        break;
View Full Code Here

    }
  }

  private void handleScreenCloseCancelled(SpoutPlayer player, ScreenCloseEvent e, boolean update) {
    this.action = (byte) ScreenAction.Close.getId();
    PopupScreen screen = player.getMainScreen().getActivePopup();
    if (screen != null) {
      if (update) {
        screen.onScreenClose(e);
      }
      if (!e.isCancelled() && ScreenType.getType(this.screen) == ScreenType.CUSTOM_SCREEN) {
        handleScreenClose(player, e, false);
        return;
      }
      screen.setDirty(true);
      player.sendImmediatePacket(new PacketWidget(screen, screen.getId()));
    }
  }
View Full Code Here

      player.sendImmediatePacket(new PacketWidget(screen, screen.getId()));
    }
  }

  private void handleScreenClose(SpoutPlayer player, ScreenCloseEvent e, boolean update) {
    PopupScreen p = player.getMainScreen().getActivePopup();
    if (update && p != null){
      p.onScreenClose(e);
    }
    if (e.isCancelled()) {
      handleScreenCloseCancelled(player, e, false);
      return;
    }
    player.getMainScreen().closePopup();
    if (player.getItemOnCursor() != null && p != null) {
      p.handleItemOnCursor(player.getItemOnCursor());
      player.setItemOnCursor(null);
    }
  }
View Full Code Here

  @Override
  public void run(int playerId) {
    SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
    if (player != null) {
      PopupScreen popup = player.getMainScreen().getActivePopup();
      if (popup != null) {
        Widget w = popup.getWidget(widgetId);
        if (w != null && w instanceof Control) {
          ((Control) w).setFocus(focus);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.gui.PopupScreen

Copyright © 2018 www.massapicom. 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.