GameEndView_21201.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. ctor:function(){
  6. this.m_ItemControl = new Array();
  7. },
  8. // use this for initialization
  9. onLoad: function () {
  10. this.m_pEndInfo = null;
  11. },
  12. SetEndInfo(pRoomEnd){
  13. this.m_pEndInfo = pRoomEnd;
  14. if(this.m_ListCtrl == null) this.m_ListCtrl = this.node.getComponent('CustomListCtrl');
  15. this.m_ListCtrl.InitList(0, 'BigResultItem_'+GameDef.KIND_ID);
  16. for(var i=0;i<GameDef.GAME_PLAYER;++i) {
  17. if(pRoomEnd.UserID[i] == null) continue;
  18. this.m_ListCtrl.InsertListInfo(0, [i, pRoomEnd]);
  19. }
  20. },
  21. //分享信息
  22. GetShareInfo: function() {
  23. var ShareInfo = new Object();
  24. ShareInfo.title = '【對局記錄】';
  25. ShareInfo.desc = '';
  26. for(var i = 0;i<GameDef.GAME_PLAYER;i++){
  27. if(this.m_pEndInfo.UserID[i] == null) continue;
  28. if(ShareInfo.desc != '') ShareInfo.desc += '/'
  29. ShareInfo.desc += '【'+ g_GlobalUserInfo.m_UserInfoMap[this.m_pEndInfo.UserID[i]].NickName+'】';
  30. ShareInfo.desc += (this.m_pEndInfo.lTotalScore[i] >= 0?'+':'')+this.m_pEndInfo.lTotalScore[i];
  31. }
  32. ShareInfo.link = cc.share.MakeLink_GameEnd();
  33. return ShareInfo;
  34. },
  35. });