Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.PopupScreen


      e.printStackTrace();
    }
    if (widget != null) {
      allWidgets.put(widgetId, widget);
      InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen();
      PopupScreen popup = mainScreen.getActivePopup();
      Screen overlay = null;

      if (SpoutClient.getHandle().currentScreen != null) {
        overlay = SpoutClient.getHandle().currentScreen.getScreen();
      }
      // Determine if this is a popup screen and if we need to update it
      if (widget instanceof PopupScreen) {
        if (popup != null) {
          if (widget.getId().equals(popup.getId())) {
            if (SpoutClient.getHandle().currentScreen instanceof CustomScreen) {
              ((CustomScreen)SpoutClient.getHandle().currentScreen).update((PopupScreen)widget);
            }
          } else {
            mainScreen.closePopup();
            mainScreen.attachPopupScreen((PopupScreen)widget);
          }
        } else {
          mainScreen.attachPopupScreen((PopupScreen)widget);
        }
      } else if (widget instanceof OverlayScreen) { // Determine if this screen overrides another screen
        if (SpoutClient.getHandle().currentScreen != null) {
          SpoutClient.getHandle().currentScreen.update((OverlayScreen)widget);
          overlay = (OverlayScreen)widget;
        }
      } else if (screen.equals(mainScreen.getId())) { // Determine if this is a widget on the main screen
        if (mainScreen.containsWidget(widget.getId())) {
          mainScreen.updateWidget(widget);
          widget.setScreen(mainScreen);
        } else {
          widget.setScreen(mainScreen);
          mainScreen.attachWidget(widget.getAddon(), widget);
        }
      } else if (popup != null && screen.equals(popup.getId())) { // Determine if this is a widget on the popup screen
        if (popup.containsWidget(widget.getId())) {
          popup.updateWidget(widget);
          widget.setScreen(popup);
        } else {
          widget.setScreen(popup);
          popup.attachWidget(widget.getAddon(), widget);
        }
      } else if (overlay != null && screen.equals(overlay.getId())) { // Determine if this is a widget on an overlay screen
        if (overlay.containsWidget(widget.getId())) {
          overlay.updateWidget(widget);
          widget.setScreen(overlay);
View Full Code Here


    output.writeUUID(widget);
  }

  public void run(int playerId) {
    InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen();
    PopupScreen popup = mainScreen.getActivePopup();

    Widget w = PacketWidget.allWidgets.get(widget);

    if (w != null && w.getScreen() != null && !(w instanceof Screen)) {
      w.getScreen().removeWidget(w);
    }

    if (w instanceof PopupScreen && popup.getId().equals(w.getId())) {
      // Determine if this is a popup screen and if we need to update it
      mainScreen.closePopup();
    }

    PacketWidget.allWidgets.remove(widget);
View Full Code Here

      activePopup = null;
    }
    if (activePopup != null) {
      activePopup.onTick();
    } else {
      PopupScreen queued = queuedScreens.poll();
      if (queued != null) {
        attachPopupScreen(queued);
      }
    }
    super.onTick();
View Full Code Here

    output.writeBoolean(focus);
  }

  public void run(int playerId) {
    InGameHUD screen = SpoutClient.getInstance().getActivePlayer().getMainScreen();
    PopupScreen popup = screen.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.spoutcraft.api.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.