示例#1
0
 protected void createUploadInterface() {
   _upload = new AbsolutePanel();
   _upload.setStyleName("GetStuff");
   _upload.add(MsoyUI.createLabel(_msgs.getStuffTitle(), "GetStuffTitle"), 60, 10);
   _upload.add(MsoyUI.createHTML(_dmsgs.xlateGetStuffBuy(_type), "GetStuffBuy"), 165, 85);
   _upload.add(MsoyUI.createHTML(_dmsgs.xlateGetStuffCreate(_type), "GetStuffCreate"), 360, 85);
   _upload.add(
       new StretchButton(
           StretchButton.BLUE_THICK,
           _msgs.getStuffShop(),
           Link.createHandler(Pages.SHOP, _type + "")),
       10,
       90);
   _upload.add(
       MsoyUI.createButton(
           MsoyUI.MEDIUM_THICK, _msgs.getStuffUpload(), NaviUtil.onCreateItem(_type, 0)),
       535,
       90);
 }
示例#2
0
  public void setGameDetail(final GameDetail detail) {
    final GameInfo info = detail.info;
    CShell.frame.setTitle(info.name);

    // keep our requested game id around
    _gameId = detail.gameId;

    VerticalPanel shot = new VerticalPanel();
    shot.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
    shot.add(new ThumbBox(info.shotMedia, MediaDescSize.GAME_SHOT_SIZE));
    shot.add(WidgetUtil.makeShim(5, 5));
    Rating rating =
        new Rating(
            info.rating,
            info.ratingCount,
            detail.memberRating,
            false,
            new RateService() {
              public void handleRate(byte newRating, InfoCallback<RatingResult> callback) {
                _gamesvc.rateGame(_gameId, newRating, callback);
              }
            },
            null);

    shot.add(rating);
    HorizontalPanel mbits = new HorizontalPanel();
    mbits.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    mbits.add(
        MsoyUI.makeShareButton(
            Pages.GAMES,
            Args.compose("d", _gameId),
            _msgs.gdpGame(),
            info.name,
            info.description,
            info.shotMedia));
    shot.add(mbits);
    setWidget(0, 0, shot);
    getFlexCellFormatter().setRowSpan(0, 0, 2);
    getFlexCellFormatter().setVerticalAlignment(0, 0, HasAlignment.ALIGN_TOP);

    setWidget(0, 1, new GameNamePanel(info.name, info.genre, info.creator, info.description), 2);

    setWidget(1, 0, new GameBitsPanel(detail));

    FlowPanel play = new FlowPanel();
    play.setStyleName("playPanel");
    play.add(PlayButton.createLarge(_gameId));
    if (info.playersOnline > 0) {
      play.add(MsoyUI.createLabel(_msgs.featuredOnline("" + info.playersOnline), "Online"));
    }
    if (!info.integrated) {
      play.add(MsoyUI.createLabel(_msgs.gdpNoCoins(), null));
    }
    setWidget(1, 1, play, 1, "Play");
    getFlexCellFormatter().setHorizontalAlignment(1, 1, HasAlignment.ALIGN_CENTER);

    // add "Discussions" (if appropriate) and "Shop" button
    Widget buttons = null;
    if (info.groupId > 0) {
      ClickHandler onClick = Link.createHandler(Pages.GROUPS, "f", info.groupId);
      buttons = MsoyUI.createButton(MsoyUI.LONG_THIN, _msgs.gdpDiscuss(), onClick);
    }
    ClickHandler onShop = Link.createHandler(Pages.SHOP, "g", Math.abs(_gameId));
    PushButton shop = MsoyUI.createButton(MsoyUI.MEDIUM_THIN, _msgs.gdpShop(), onShop);
    buttons = (buttons == null) ? shop : MsoyUI.createButtonPair(buttons, shop);
    setWidget(2, 0, buttons);
    getFlexCellFormatter().setRowSpan(0, 0, 3);
    getFlexCellFormatter().setRowSpan(1, 1, 2);

    setWidget(
        3,
        0,
        _tabs =
            new NaviTabPanel(Pages.GAMES) {
              protected Args getTabArgs(int tabIdx) {
                return getTabCode(tabIdx).args(_gameId);
              }
            },
        3);

    // add the about/instructions tab
    addTab(GameDetails.INSTRUCTIONS, _msgs.tabInstructions(), new InstructionsPanel(detail));

    // add comments tab
    addTab(
        GameDetails.COMMENTS,
        _msgs.tabComments(),
        new LazyPanel() {
          protected Widget createWidget() {
            CommentsPanel comments = new CommentsPanel(CommentType.GAME, info.gameId, true);
            comments.expand();
            return comments;
          }
        });

    // add trophies tab, passing in the potentially negative gameId
    addTab(
        GameDetails.TROPHIES,
        _msgs.tabTrophies(),
        new LazyPanel() {
          protected Widget createWidget() {
            return new GameTrophyPanel(_gameId);
          }
        });

    // add top rankings tabs
    if (!CShell.isGuest()) {
      addTab(
          GameDetails.MYRANKINGS,
          _msgs.tabMyRankings(),
          new LazyPanel() {
            protected Widget createWidget() {
              return new TopRankingPanel(info.gameId, true);
            }
          });
    }
    addTab(
        GameDetails.TOPRANKINGS,
        _msgs.tabTopRankings(),
        new LazyPanel() {
          protected Widget createWidget() {
            return new TopRankingPanel(info.gameId, false);
          }
        });

    // if we're the creator of the game or support, add the metrics and logs tabs
    if (info.isCreator(CShell.getMemberId()) || CShell.isSupport()) {
      // addTab(GameDetails.METRICS, _msgs.tabMetrics(), new LazyPanel() {
      //     protected Widget createWidget () {
      //         return new GameMetricsPanel(detail);
      //     }
      // });
      addTab(
          GameDetails.LOGS,
          _msgs.tabLogs(),
          new LazyPanel() {
            protected Widget createWidget() {
              return new GameLogsPanel(info.gameId);
            }
          });
      addTab(
          GameDetails.DEV_LOGS,
          _msgs.tabDevLogs(),
          new LazyPanel() {
            protected Widget createWidget() {
              return new GameLogsPanel(GameInfo.toDevId(info.gameId));
            }
          });
    }
  }