cc.Class({ extends: cc.BaseClass, properties: { m_IconIp:cc.Sprite, m_IconDis:cc.Sprite, m_Frame:[cc.SpriteFrame], m_LabIPTitle:cc.Label, m_LabDisTitle:cc.Label, m_LabIPName:[cc.Label], m_LabIP:[cc.Label], m_LabDis:[cc.Label], }, OnShowView:function() { ShowS2N(this.node);//ShowS2N this.InitIP(); this.InitDis(); }, OnHideView:function() { HideN2S(this.node); }, InitIP:function() { var bHas = false; for(var i = 0; i < 4; i++) { this.m_LabIPName[i].string = ''; this.m_LabIP[i].string = ''; if(this.m_Hook.m_GameClientView.m_strCheckIP[i][0] != 0) { this.m_LabIPName[i].string = this.m_Hook.m_GameClientView.m_strCheckIP[i][1]; this.m_LabIP[i].string = '(IP:'+this.m_Hook.m_GameClientView.m_strCheckIP[i][2]+')'; bHas = true; } } if(bHas == true) { this.m_IconIp.spriteFrame = this.m_Frame[1]; this.m_LabIPTitle.string = '已發現同IP玩家' } else { this.m_IconIp.spriteFrame = this.m_Frame[0]; this.m_LabIPTitle.string = '未發現同IP玩家' } }, InitDis:function() { var bHas = false; for(var i = 0; i < 6; i++) { this.m_LabDis[i].string = ''; if(this.m_Hook.m_GameClientView.m_strCheckDistance[i] != null) { this.m_LabDis[i].string = this.m_Hook.m_GameClientView.m_strCheckDistance[i]; bHas = true; } } if(bHas == true) { this.m_IconDis.spriteFrame = this.m_Frame[1]; this.m_LabDisTitle.string = '已發現距離過近玩家' } else { this.m_IconDis.spriteFrame = this.m_Frame[0]; this.m_LabDisTitle.string = '未發現距離過近玩家' } }, });