GameSetMenu.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. m_BtSit:cc.Node,
  5. m_BtCheckOut:cc.Node,
  6. },
  7. onLoad: function() {
  8. this.InitView();
  9. this.m_BtSit.active = false;
  10. this.m_BtReturn.active = false;
  11. this.m_BtCheckOut.active = false;
  12. this.m_BtLookOnUser.active = false;
  13. this.m_BtSet.active = false;
  14. },
  15. start: function() {
  16. this.InitView();
  17. },
  18. update: function() {
  19. if(this.m_Hook && this.m_Hook.m_wGameProgress > 0) {
  20. this.m_BtReturn.active = false;
  21. }
  22. },
  23. InitView: function() {
  24. if(!this.m_BtSit) this.m_BtSit = this.$('New Node/Layout/BtSit');
  25. if(!this.m_BtReturn) this.m_BtReturn = this.$('New Node/Layout/BtReturn');
  26. if(!this.m_BtCheckOut) this.m_BtCheckOut = this.$('New Node/Layout/BtCheckOut');
  27. if(!this.m_BtLookOnUser) this.m_BtLookOnUser = this.$('New Node/Layout/BtLookOnUser');
  28. if(!this.m_BtSet) this.m_BtSet = this.$('New Node/Layout/BtSet');
  29. },
  30. OnShowView:function() {
  31. this.InitView();
  32. this.m_BtSit.active = false;
  33. this.m_BtReturn.active = false;
  34. this.m_BtCheckOut.active = false;
  35. this.m_BtLookOnUser.active = false;
  36. this.m_BtSet.active = false;
  37. if(this.m_Hook.IsLookonMode()) {
  38. this.m_BtSit.active = true;
  39. this.m_BtReturn.active = true;
  40. this.m_BtCheckOut.active = false;
  41. this.m_BtLookOnUser.active = true;
  42. this.m_BtSet.active = true;
  43. } else {
  44. this.m_BtSit.active = false;
  45. this.m_BtReturn.active = true;
  46. var bCreater = this.m_Hook.m_dwCreater == this.m_Hook.GetMeUserItem().GetUserID();
  47. if((bCreater || this.m_Hook.m_wGameProgress > 0)) this.m_BtCheckOut.active = true;
  48. this.m_BtLookOnUser.active = true;
  49. this.m_BtSet.active = true;
  50. }
  51. },
  52. OnClick_BtSet:function(){
  53. this.m_Hook.OnClicked_GameSetting();
  54. this.HideView();
  55. },
  56. OnClick_BtSit:function(){
  57. this.m_Hook.OnBtLookOnSit();
  58. this.HideView();
  59. },
  60. OnClick_BtLeave:function(){
  61. this.m_Hook.OnBtReturn();
  62. this.HideView();
  63. },
  64. OnClick_BtCheckOut:function(){
  65. this.m_Hook.OnClick_CheckOut();
  66. this.HideView();
  67. },
  68. OnClick_BtLookOnUser:function(){
  69. this.m_Hook.OnClick_BtLookOnList();
  70. this.HideView();
  71. },
  72. });