GameSetMenu.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. m_BtSit: cc.Node,
  5. m_BtCheckOut: cc.Node,
  6. m_BtChangeTable: cc.Node,
  7. },
  8. onLoad: function () {
  9. this.InitView();
  10. this.m_BtSit.active = false;
  11. this.m_BtReturn.active = false;
  12. this.m_BtCheckOut.active = false;
  13. this.m_BtLookOnUser.active = false;
  14. this.m_BtSet.active = false;
  15. },
  16. start: function () {
  17. this.InitView();
  18. },
  19. update: function () {
  20. if (this.m_Hook && this.m_Hook.m_wGameProgress > 0 && this.m_Hook.m_cbGameStatus == 0 && GameDef.m_dwGameRuleArr[3] > 0) {
  21. this.m_BtReturn.active = true;
  22. this.m_BtChangeTable.active = true;
  23. } else if (this.m_Hook && this.m_Hook.m_wGameProgress > 0){
  24. this.m_BtReturn.active = false;
  25. this.m_BtChangeTable.active = false;
  26. }
  27. },
  28. InitView: function () {
  29. if (!this.m_BtSit) this.m_BtSit = this.$('New Node/Layout/BtSit');
  30. if (!this.m_BtReturn) this.m_BtReturn = this.$('New Node/Layout/BtReturn');
  31. if (!this.m_BtCheckOut) this.m_BtCheckOut = this.$('New Node/Layout/BtCheckOut');
  32. if (!this.m_BtLookOnUser) this.m_BtLookOnUser = this.$('New Node/Layout/BtLookOnUser');
  33. if (!this.m_BtSet) this.m_BtSet = this.$('New Node/Layout/BtSet');
  34. },
  35. OnShowView: function () {
  36. this.InitView();
  37. this.m_BtSit.active = false;
  38. this.m_BtReturn.active = false;
  39. this.m_BtCheckOut.active = false;
  40. this.m_BtLookOnUser.active = false;
  41. this.m_BtSet.active = false;
  42. if (this.m_Hook.IsLookonMode()) {
  43. this.m_BtSit.active = true;
  44. this.m_BtReturn.active = true;
  45. this.m_BtCheckOut.active = false;
  46. //this.m_BtLookOnUser.active = true;
  47. this.m_BtSet.active = true;
  48. } else {
  49. this.m_BtSit.active = false;
  50. this.m_BtReturn.active = true;
  51. var bCreater = this.m_Hook.m_dwCreater == this.m_Hook.GetMeUserItem().GetUserID();
  52. if ((bCreater || this.m_Hook.m_wGameProgress > 0)) this.m_BtCheckOut.active = true;
  53. console.log("显示界面", bCreater, this.m_Hook.m_wGameProgress)
  54. //this.m_BtLookOnUser.active = true;
  55. this.m_BtSet.active = true;
  56. if (bCreater) {
  57. this.m_BtReturn.active = false;
  58. }
  59. }
  60. if (GameDef.m_dwGameRuleArr[3] > 0) {
  61. this.m_BtCheckOut.active = false;
  62. }else{
  63. this.m_BtChangeTable.active = false;
  64. }
  65. },
  66. OnClick_BtChangeTable:function(){
  67. this.HideView();
  68. this.m_Hook.OnBtChangeTable();
  69. },
  70. OnClick_BtSet: function () {
  71. this.m_Hook.OnClicked_GameSetting();
  72. this.HideView();
  73. },
  74. OnClick_BtSit: function () {
  75. this.m_Hook.OnBtLookOnSit();
  76. this.HideView();
  77. },
  78. OnClick_BtLeave: function () {
  79. this.m_Hook.OnBtReturn();
  80. this.HideView();
  81. },
  82. OnClick_BtCheckOut: function () {
  83. this.m_Hook.OnClick_CheckOut();
  84. this.HideView();
  85. },
  86. OnClick_BtLookOnUser: function () {
  87. this.m_Hook.OnClick_BtLookOnList();
  88. this.HideView();
  89. },
  90. });