| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- cc.Class({
- extends: cc.BaseClass,
- properties: {
- m_LbScore:cc.Label,
- m_BGSprite:cc.Sprite,
- m_Win:cc.Node,
- m_Pao:cc.Node,
- m_labHuPai:cc.Label,
- m_labDianPao:cc.Label,
- m_labMingGang:cc.Label,
- m_labAnGang:cc.Label,
- m_labZiMo:cc.Label,
- m_Font:[cc.Font],
- // m_BGFrame:[cc.SpriteFrame],
- },
- // LIFE-CYCLE CALLBACKS:
- InitPre:function(){
- this.node.active = false;
- },
- SetPreInfo:function(ParaArr) {
- this.node.active = true;
- this.SetEndInfo(ParaArr[0], ParaArr[1]);
- },
- SetEndInfo:function(wChair, pRoomEnd){
- this.m_dwUserID = pRoomEnd.dwUserID[wChair];
- this.node.getComponent('UserCtrl').SetUserByID( this.m_dwUserID);
- this.node.getComponent('UserCtrl').SetShowFullName(false, 5);
-
- var Score = pRoomEnd.lTotalScore[wChair];
- var MaxScore = 0;
- var MaxPao = 0;
- for (let i = 0; i < GameDef.GAME_PLAYER; i++) {
- if( pRoomEnd.lTotalScore[i] > MaxScore )
- {
- MaxScore = pRoomEnd.lTotalScore[i]
- }
- if(pRoomEnd.cbDianPaoCount[i] > MaxPao)
- {
- MaxPao = pRoomEnd.cbDianPaoCount[i];
- }
- }
- //大赢家
- var Score = pRoomEnd.lTotalScore[wChair];
- if( MaxScore == Score && MaxScore > 0 ){
- this.m_Win.active = true;
- }else{
- this.m_Win.active = false;
- }
- //炮王
- var Pao = pRoomEnd.cbDianPaoCount[wChair];
- if(MaxPao == Pao && MaxPao > 0)
- {
- this.m_Pao.active = true;
- }
- else
- {
- this.m_Pao.active = false;
- }
- this.m_LbScore.string='';
- if( Score > 0 ){
- this.m_LbScore.string = Score;//'+' + Score2Str(Score);
- this.m_LbScore.font = this.m_Font[0];
- // this.m_BGSprite.spriteFrame = this.m_BGFrame[0];
- }
- else{
- this.m_LbScore.string = Score;//Score2Str(Score);
- this.m_LbScore.font = this.m_Font[1];
- // this.m_BGSprite.spriteFrame = this.m_BGFrame[1];
- }
- this.m_labZiMo.string = ''+pRoomEnd.cbZiMoCount[wChair];
- this.m_labHuPai.string = ''+pRoomEnd.cbHuCount[wChair];
- this.m_labDianPao.string = ''+pRoomEnd.cbDianPaoCount[wChair];
- this.m_labMingGang.string = pRoomEnd.cbMGangCount[wChair]+pRoomEnd.cbAGangCount[wChair];
- //this.m_labAnGang.string = ''+pRoomEnd.cbAGangCount[wChair];
-
- },
-
- // update (dt) {},
- });
|