| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- var SelGame = window.clientName + '_C_G'
- cc.Class({
- extends: cc.BaseClass,
- properties: {
- m_ldiamond: cc.Label,
- m_personT: [cc.Toggle],
- },
- ctor: function () {
- this.m_RoomType = 0;// 0普通 1俱乐部
- this.m_personIndex = 1;
- this.m_playMethod = 0;
- },
- onLoad: function () {
- this._Sub = [];
- this._Sub.push(this.$('NewNode/Sub1'));
- // this._Sub.push(this.$('NewNode/Sub2'));
- // this._Sub.push(this.$('NewNode/Sub3'));
- this.updateDiamond()
- this.m_personIndex = cc.sys.localStorage.getItem("personIndex",1);
- if(this.m_personIndex==null||this.m_personIndex == undefined){
- this.m_personIndex = 1;
- }
- console.log("人数m_personIndex",this.m_personIndex)
- this.m_personT[this.m_personIndex].isChecked = true;
- },
-
- OnShowView: function () {
- if (this.m_FirstCtrl == null) {
- this.m_FirstCtrl = this.$('LeftBG/Layout/T0@Toggle');
- this.m_FirstCtrl.isChecked = false;
- this.m_FirstCtrl.check();
- }
- return
- },
- OnSetRoomType: function (type) {
- this.m_RoomType = type;
- this.FilterGame(type);
- },
- FilterGame: function (type) {
- // this.$('NewNode/Sub2/view/content/63500').active = type>0;
- },
- OnTogClick: function (tag, data) {
- // console.log('data:'+data);
- // for(let i =0;i<3;i++){
- // this._Sub[i].active = false;
- // }
- // this._Sub[data].active = true;
- },
- onClickPlayMethod: function (data, tag) {
- console.log("点击玩法", tag)
- this.m_playMethod = tag;
- },
- OnClickButtonPerson: function (data, tag) {
- console.log("点击Person", tag)
- this.m_personIndex = tag;
- cc.sys.localStorage.setItem("personIndex", this.m_personIndex)
- },
- OnClickButtonMatch: function (data, tag) {
- console.log("点击data", tag)
- this.m_Hook.matchRoom(this.m_personIndex, tag,this.m_playMethod)
- // this.ShowPrefabDLG('CreateRoom2',null,(Js)=>{
- // Js.OnSetGameID(tag.currentTarget.name);
- // Js.OnClubAutoView(this.m_RoomType);
- // });
- },
- OnCreateRoom: function (KindID, dwRules, dwServerRules, Name) {
- this.m_Hook.OnCreateRoom(KindID, dwRules, dwServerRules, Name, 0, 0);
- this.HideView();
- },
- updateDiamond: function () {
- let diamond = g_GlobalUserInfo.GetGlobalUserData().llUserIngot;
- this.m_ldiamond.string = diamond;
- },
- });
|