You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 line
2.2 KiB

  1. local MJRoomToolView = require("mj.luaScript.Views.Room.MJRoomToolView");
  2. local ncmajRoomToolView = class("ncmajRoomToolView", MJRoomToolView);
  3. function ncmajRoomToolView:ctor ()
  4. ncmajRoomToolView.super.ctor(self);
  5. end
  6. function ncmajRoomToolView:onEnter( )
  7. ncmajRoomToolView.super.onEnter(self);
  8. if app.room.roomInfo.isEapCreate == 1 then
  9. self.ui.Items.Button_Voice:setVisible(false)
  10. self.ui.Items.Button_Face:setVisible(false)
  11. self.ui.Items.Layout_Rule:stopAllActions();
  12. --隐藏解散和退出按钮
  13. self.ui.Items.Button_Dismiss:setVisible(false)
  14. self.ui.Items.Button_Leave:setVisible(false)
  15. self.ui.Items.ImageView_cdfgx_2:setVisible(false)
  16. end
  17. end
  18. function ncmajRoomToolView:hideRule()
  19. if self.ui.Items.Layout_Rule then
  20. self.ui.Items.Layout_Rule:stopAllActions()
  21. self.ui.Items.Layout_Rule:setVisible(false)
  22. end
  23. if self.ui.Items.Button_Rule then
  24. self.ui.Items.Button_Rule:setVisible(true)
  25. end
  26. if app.room.roomInfo.isEapCreate == 1 then
  27. self.ui.Items.Button_Rule:setVisible(false)
  28. end
  29. end
  30. function ncmajRoomToolView:updateButton()
  31. ncmajRoomToolView.super.updateButton(self)
  32. if app.room.roomInfo.isEapCreate == 1 then
  33. if self.ui.Items.Button_Leave then
  34. self.ui.Items.Button_Leave:setEnabled(false)
  35. end
  36. end
  37. end
  38. function ncmajRoomToolView:checkCanDismiss( )
  39. local onCanDismissCallback = function (info)
  40. local nUserId = app.room:getMyUserId()
  41. local roomInfo = app.room.roomInfo or {}
  42. local canDismiss = (tonumber(info.canDismiss or 1) == 1) or roomInfo.nRoomOwnedUid == nUserId or dd.IClub.isAdmin()
  43. if roomInfo.nGameStartCount == 0 and roomInfo.nRoomOwnedUid ~= nUserId then
  44. canDismiss = false
  45. end
  46. if roomInfo.isEapCreate == 1 then
  47. canDismiss = false
  48. end
  49. self:onCanDismissCallback(canDismiss)
  50. end
  51. if dd.IClub.getCanDismiss then
  52. local canDismiss = dd.IClub.getCanDismiss(onCanDismissCallback)
  53. if canDismiss then
  54. onCanDismissCallback({canDismiss = canDismiss})
  55. end
  56. end
  57. end
  58. function ncmajRoomToolView:setWetChatVisible(bVisible)
  59. ncmajRoomToolView.super.setWetChatVisible(self, bVisible)
  60. if app.room.roomInfo.isEapCreate == 1 then
  61. self.ui.Items.Button_Invite:getParent():setVisible(false)
  62. end
  63. end
  64. return ncmajRoomToolView;