BigResultItem_21201.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. m_LbScore:cc.Label,
  5. m_BGSprite:cc.Sprite,
  6. m_Win:cc.Node,
  7. m_Pao:cc.Node,
  8. m_labHuPai:cc.Label,
  9. m_labDianPao:cc.Label,
  10. m_labMingGang:cc.Label,
  11. m_labAnGang:cc.Label,
  12. m_labZiMo:cc.Label,
  13. m_Font:[cc.Font],
  14. // m_BGFrame:[cc.SpriteFrame],
  15. },
  16. // LIFE-CYCLE CALLBACKS:
  17. InitPre:function(){
  18. this.node.active = false;
  19. },
  20. SetPreInfo:function(ParaArr) {
  21. this.node.active = true;
  22. this.SetEndInfo(ParaArr[0], ParaArr[1]);
  23. },
  24. SetEndInfo:function(wChair, pRoomEnd){
  25. this.m_dwUserID = pRoomEnd.dwUserID[wChair];
  26. this.node.getComponent('UserCtrl').SetUserByID( this.m_dwUserID);
  27. this.node.getComponent('UserCtrl').SetShowFullName(false, 5);
  28. var Score = pRoomEnd.lTotalScore[wChair];
  29. var MaxScore = 0;
  30. var MaxPao = 0;
  31. for (let i = 0; i < GameDef.GAME_PLAYER; i++) {
  32. if( pRoomEnd.lTotalScore[i] > MaxScore )
  33. {
  34. MaxScore = pRoomEnd.lTotalScore[i]
  35. }
  36. if(pRoomEnd.cbDianPaoCount[i] > MaxPao)
  37. {
  38. MaxPao = pRoomEnd.cbDianPaoCount[i];
  39. }
  40. }
  41. //大赢家
  42. var Score = pRoomEnd.lTotalScore[wChair];
  43. if( MaxScore == Score && MaxScore > 0 ){
  44. this.m_Win.active = true;
  45. }else{
  46. this.m_Win.active = false;
  47. }
  48. //炮王
  49. var Pao = pRoomEnd.cbDianPaoCount[wChair];
  50. if(MaxPao == Pao && MaxPao > 0)
  51. {
  52. this.m_Pao.active = true;
  53. }
  54. else
  55. {
  56. this.m_Pao.active = false;
  57. }
  58. this.m_LbScore.string='';
  59. if( Score > 0 ){
  60. this.m_LbScore.string = Score;//'+' + Score2Str(Score);
  61. this.m_LbScore.font = this.m_Font[0];
  62. // this.m_BGSprite.spriteFrame = this.m_BGFrame[0];
  63. }
  64. else{
  65. this.m_LbScore.string = Score;//Score2Str(Score);
  66. this.m_LbScore.font = this.m_Font[1];
  67. // this.m_BGSprite.spriteFrame = this.m_BGFrame[1];
  68. }
  69. this.m_labZiMo.string = ''+pRoomEnd.cbZiMoCount[wChair];
  70. this.m_labHuPai.string = ''+pRoomEnd.cbHuCount[wChair];
  71. this.m_labDianPao.string = ''+pRoomEnd.cbDianPaoCount[wChair];
  72. this.m_labMingGang.string = pRoomEnd.cbMGangCount[wChair]+pRoomEnd.cbAGangCount[wChair];
  73. //this.m_labAnGang.string = ''+pRoomEnd.cbAGangCount[wChair];
  74. },
  75. // update (dt) {},
  76. });