cc.Class({ extends: cc.BaseClass, properties: { m_TabNode:cc.Node, m_SubNode:cc.Node, }, ctor:function(){ this.m_nNeedUpdate = 0; this.SHOW_RANK = 4; this.HIDE_ID = 1; this.NORMAL_GAME = 2; }, OnShowView:function(){ this.$('NoUse').active = this.m_Hook.m_SelClubInfo.cbClubLevel<=CLUB_LEVEL_MEMBER; this.$('Sub/Sub_0').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_PARTNER; this.$('Sub/Sub_0/ClubName').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('Sub/Sub_0/ClubRank').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('Sub/Sub_0/ClubCheck').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('Sub/Sub_0/ClubNoitce1').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('Sub/Sub_0/ClubClose').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('Sub/Sub_0/ClubSecret').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('Sub/Sub_0/ClubNoitce2').active = this.m_Hook.m_SelClubInfo.wKindID > CLUB_KIND_0 && this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_PARTNER; this.$('Sub/Sub_0/BtNode/BtRemit').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_PARTNER; this.$('Sub/Sub_0/BtNode/BtLeaveClub').active = this.m_Hook.m_SelClubInfo.wKindID=CLUB_LEVEL_MANAGER; this.$('ToggleContainer/2').active = this.m_Hook.m_SelClubInfo.cbClubLevel>=CLUB_LEVEL_MANAGER; this.$('ToggleContainer/0/Background/Label@Label').string = this.m_Hook.m_SelClubInfo.wKindID 0) { this.m_nNeedUpdate--; } else { return; } for(var i in this.$('ToggleContainer').children) { var pNode = this.$('ToggleContainer').children[i]; var pToggle = this.$('@Toggle', pNode); if(!pToggle) continue; if(pToggle.isChecked) { if(this.$('Sub').children[i]) { this.$('Sub').children[i].active = true; if(i==3){ this.$('NoUse').active = false; } else{ this.$('NoUse').active = this.m_Hook.m_SelClubInfo.cbClubLevel<=CLUB_LEVEL_MEMBER; } } } else { if(this.$('Sub').children[i]) this.$('Sub').children[i].active = false; } } if(this.m_BlockedUser.node.active) { this.m_BlockedUser.Refresh(); } else if(this.m_ClubGroup.node.active) { this.m_ClubGroup.Refresh(); } }, OnBtSure:function(){ var reg = /^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/; if ( this.m_EdClubName.string.length < 1 || !reg.test( this.m_EdClubName.string )) { this.ShowAlert("請輸入有效名稱!"); return; } var TempRules = this.m_Hook.m_SelClubInfo.dwRules; if(this.$('Sub/Sub_0/ClubRank/toggle1@Toggle').isChecked){ TempRules = (TempRules|this.SHOW_RANK); }else{ if( TempRules & this.SHOW_RANK ) TempRules -= this.SHOW_RANK; } if(this.$('Sub/Sub_0/ClubSecret/toggle1@Toggle').isChecked){ TempRules = (TempRules|this.HIDE_ID); }else{ if( TempRules & this.HIDE_ID ) TempRules -= this.HIDE_ID; } var Joinlimit = 0; if(this.$('Sub/Sub_0/ClubCheck/toggle1@Toggle').isChecked){ Joinlimit = 1; } var CloseStatus = 0; if(this.$('Sub/Sub_0/ClubClose/toggle1@Toggle').isChecked){ CloseStatus = 1; } if(this.m_EdClubName.string == this.m_Hook.m_SelClubInfo.szClubName && this.m_EdClubNoitce.string == this.m_Hook.m_SelClubInfo.szNotice && this.m_EdClubNoitce2.string == this.m_Hook.m_SelClubInfo.szNotice2 && this.m_Hook.m_SelClubInfo.dwRules == TempRules && Joinlimit == this.m_Hook.m_SelClubInfo.cbJoinLimit && CloseStatus == this.m_Hook.m_SelClubInfo){ g_Lobby.ShowTips('沒有修改,不能保存'); return; } var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData(); var Obj = new CMD_GC_SaveClubSet(); Obj.dwUserID = pGlobalUserData.dwUserID; Obj.szPassWord = pGlobalUserData.szPassword; Obj.dwClubID = this.m_Hook.m_SelClubInfo.dwClubID; //俱乐部ID Obj.szClubName = this.m_EdClubName.string;//[31]; //俱乐部名字 Obj.cbJoinLimit = Joinlimit; // Obj.dwRules = TempRules; // Obj.szNotice = this.m_EdClubNoitce.string;//[256]; //俱乐部公告 Obj.szNotice2 = this.m_EdClubNoitce2.string;//[256]; //专属公告 Obj.cbCloseStatus = CloseStatus; window.gClubClientKernel.onSendSaveClubSet(this,Obj); }, OnClick_ComNoChat:function(){ this.m_Hook.OnOpNoChat( this.TgNoChat.isChecked ); this.HideView(); }, OnChangeClubSet:function(){ this.m_Hook.SendClubConfig( this.m_Toggle[0].isChecked,this.m_Toggle[1].isChecked); this.HideView(); }, OnClick_ClubJoinLimit:function(){ }, OnClick_SetHideRank:function(){ }, OnClick_SetHideID:function(){ }, OnClick_SetNormalGame:function(){ }, OnClick_ExitClub:function(){ this.m_Hook.OnBtExitClub(); }, OnClick_ClubClose:function(target){ }, });