예제 #1
0
  @Override
  public void update() {
    activeItem = null;
    activeStackInstance = null; // reset before updating stack
    restoreOldZones();

    final FCollectionView<StackItemView> stack = MatchController.instance.getGameView().getStack();
    if (stackSize != stack.size()) {
      int oldStackSize = stackSize;
      stackSize = stack.size();
      getMenuTab().setText("Stack (" + stackSize + ")");

      if (stackSize > 0) {
        if (!isVisible()) {
          if (stackSize
              > oldStackSize) { // don't re-show stack if user hid it and then resolved an item on
                                // the stack
            show();
          }
          return; // don't call super.update() either way since show handles this
        }
      } else {
        hide();
        return; // super.update() isn't needed if hidden
      }
    }
    super.update();
  }
예제 #2
0
  protected void updateSizeAndPosition() {
    if (!getRotate90()) {
      super.updateSizeAndPosition();
      return;
    }

    FMenuTab menuTab = getMenuTab();
    float screenHeight = Forge.getScreenHeight();
    float width = (screenHeight - 2 * VPrompt.HEIGHT - 2 * VAvatar.HEIGHT) * 4f / 6f;
    float maxVisibleHeight = menuTab.screenPos.x;
    paneSize =
        updateAndGetPaneSize(
            width
                + MatchController.getView()
                    .getTopPlayerPanel()
                    .getTabs()
                    .iterator()
                    .next()
                    .getRight(),
            maxVisibleHeight);

    // round width and height so borders appear properly
    paneSize = new ScrollBounds(Math.round(paneSize.getWidth()), Math.round(paneSize.getHeight()));

    setBounds(
        Math.round(menuTab.screenPos.x - width),
        Math.round((screenHeight + width) / 2),
        paneSize.getWidth(),
        Math.min(paneSize.getHeight(), maxVisibleHeight));
  }
예제 #3
0
 @Override
 protected void setScrollPositionsAfterLayout(float scrollLeft0, float scrollTop0) {
   super.setScrollPositionsAfterLayout(0, 0); // always scroll to top after layout
 }