示例#1
0
    var init = function() {
      if (inited) {
        return;
      }
      inited = true;

      $hpBar = $('#mainPanel .m-player .u-levbar span.outer');
      $mpBar = $('#mainPanel .m-player .u-levbar-1 span.outer');
      $level = $('#mainPanel .m-player .name span').eq(1);
      $exp = $('#mainPanel .m-asset .pos6 span');
      $expBar = $('#mainPanel .m-asset .icon-ll');
      $li = $('.m-nav li');

      initNav();

      var player = app.getCurPlayer();
      $('#mainPanel .avatar img').attr('src', config.IMAGE_URL + 'character/' + player.characterData.id + '/60.png');
      $('#mainPanel .m-player .name span').eq(0).text(player.name);
      setLevel(player.level);
      setHpBar(player.hp, player.maxHp);
      setMpBar(player.mp, player.maxMp);
      setExp(player.experience, player.nextLevelExp);

      initSkillPanel(player.fightSkills);
      bindHotkeys();
      playerPanel.init();
      equipmentsPanel.init();
      bagPanel.init();
      taskPanel.init();
      dialogPanel.init();

    };
示例#2
0
    var init = function() {
      if (inited) {
        return;
      }
      inited = true;

      $hpBar = $('#mainPanel .m-player .u-levbar span.outer');
      $mpBar = $('#mainPanel .m-player .u-levbar-1 span.outer');
      $level = $('#mainPanel .m-player .name span').eq(1);
      $exp = $('#mainPanel .m-asset .pos6 span');
      $expBar = $('#mainPanel .m-asset .icon-ll');
      $avatarImg = $('#mainPanel .m-player .avatar img');
      $teamMenu = $('#mainPanel .m-player .teamMenu');
      $createTeam = $('#mainPanel .m-player .teamMenu .menuItem #createTeam');
      $disbandTeam = $('#mainPanel .m-player .teamMenu .menuItem #disbandTeam');
      $leaveTeam = $('#mainPanel .m-player .teamMenu .menuItem #leaveTeam');

      // TeamMate-1 ~ Begin
      $teamMate1 = $('#mainPanel .m-team-mate-1');
      $name4TM1 = $('#mainPanel .m-team-mate-1 .name span').eq(0);
      $level4TM1 = $('#mainPanel .m-team-mate-1 .name span').eq(1);
      $playerId4TM1 = $('#mainPanel .m-team-mate-1 .name span').eq(2);
      $hpBar4TM1 = $('#mainPanel .m-team-mate-1 .u-levbar span.outer');
      $mpBar4TM1 = $('#mainPanel .m-team-mate-1 .u-levbar-1 span.outer');
      $avatarImg4TM1 = $('#mainPanel .m-team-mate-1 .avatar img');
      $playerId4TM1.hide();
      $teamMate1.hide();
      $teamMenu4TM1 = $('#mainPanel .m-team-mate-1 .teamMenu');
      $kickOut4TM1 = $('#mainPanel .m-team-mate-1 .teamMenu .menuItem #kickOut');
      // TeamMate-1 ~ End

      // TeamMate-2 ~ Begin
      $teamMate2 = $('#mainPanel .m-team-mate-2');
      $name4TM2 = $('#mainPanel .m-team-mate-2 .name span').eq(0);
      $level4TM2 = $('#mainPanel .m-team-mate-2 .name span').eq(1);
      $playerId4TM2 = $('#mainPanel .m-team-mate-2 .name span').eq(2);
      $hpBar4TM2 = $('#mainPanel .m-team-mate-2 .u-levbar span.outer');
      $mpBar4TM2 = $('#mainPanel .m-team-mate-2 .u-levbar-1 span.outer');
      $avatarImg4TM2 = $('#mainPanel .m-team-mate-2 .avatar img');
      $playerId4TM2.hide();
      $teamMate2.hide();
      $teamMenu4TM2 = $('#mainPanel .m-team-mate-2 .teamMenu');
      $kickOut4TM2 = $('#mainPanel .m-team-mate-2 .teamMenu .menuItem #kickOut');
      // TeamMate-2 ~ End

      $li = $('.m-nav li');

      initNav();

      var player = app.getCurPlayer();
      console.log('player.characterData.id = ', player.characterData.id);
      $('#mainPanel .avatar img').attr('src', config.IMAGE_URL + 'character/' + player.characterData.id + '.png');
      $('#mainPanel .m-player .name span').eq(0).text(player.name);
      setLevel(player.level);
      setHpBar(player.hp, player.maxHp);
      setMpBar(player.mp, player.maxMp);
      setExp(player.experience, player.nextLevelExp);
      initTeamMenu();

      initSkillPanel();
      bindHotkeys();
      playerPanel.init();
      equipmentsPanel.init();
      bagPanel.init();
      taskPanel.init();
      teamPanel.init();
      kickOutPanel.init();
      dialogPanel.init();
      playerDialogPanel.init();
      applyJoinTeamPanel.init();
      inviteJoinTeamPanel.init();

    };