SelectGame.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var SelGame = window.clientName+'_C_G'
  2. cc.Class({
  3. extends: cc.BaseClass,
  4. properties: {
  5. },
  6. ctor:function(){
  7. this.m_RoomType = 0;// 0普通 1俱乐部
  8. },
  9. onLoad:function(){
  10. this._Sub = [];
  11. this._Sub.push(this.$('NewNode/Sub1'));
  12. // this._Sub.push(this.$('NewNode/Sub2'));
  13. // this._Sub.push(this.$('NewNode/Sub3'));
  14. },
  15. OnShowView:function(){
  16. if(this.m_FirstCtrl == null){
  17. this.m_FirstCtrl = this.$('LeftBG/Layout/T0@Toggle');
  18. this.m_FirstCtrl.isChecked = false;
  19. this.m_FirstCtrl.check();
  20. }
  21. return
  22. },
  23. OnSetRoomType:function(type){
  24. this.m_RoomType = type;
  25. this.FilterGame(type);
  26. },
  27. FilterGame:function(type){
  28. // this.$('NewNode/Sub2/view/content/63500').active = type>0;
  29. },
  30. OnTogClick:function(tag,data){
  31. // console.log('data:'+data);
  32. // for(let i =0;i<3;i++){
  33. // this._Sub[i].active = false;
  34. // }
  35. // this._Sub[data].active = true;
  36. },
  37. OnClickButton:function(tag,_){
  38. this.ShowPrefabDLG('CreateRoom2',null,(Js)=>{
  39. Js.OnSetGameID(tag.currentTarget.name);
  40. Js.OnClubAutoView(this.m_RoomType);
  41. });
  42. },
  43. OnCreateRoom:function(KindID, dwRules, dwServerRules, Name){
  44. this.m_Hook.OnCreateRoom(KindID, dwRules, dwServerRules, Name, 0, 0);
  45. this.HideView();
  46. },
  47. });