|
-
- local MJRoomToolView = require("mj.luaScript.Views.Room.MJRoomToolView");
- local ncmajRoomToolView = class("ncmajRoomToolView", MJRoomToolView);
-
- function ncmajRoomToolView:ctor ()
- ncmajRoomToolView.super.ctor(self);
-
- end
-
- function ncmajRoomToolView:onEnter( )
- ncmajRoomToolView.super.onEnter(self);
-
- if app.room.roomInfo.isEapCreate == 1 then
- self.ui.Items.Button_Voice:setVisible(false)
- self.ui.Items.Button_Face:setVisible(false)
- self.ui.Items.Layout_Rule:stopAllActions();
-
- --隐藏解散和退出按钮
- self.ui.Items.Button_Dismiss:setVisible(false)
- self.ui.Items.Button_Leave:setVisible(false)
- self.ui.Items.ImageView_cdfgx_2:setVisible(false)
- end
- end
-
- function ncmajRoomToolView:hideRule()
- if self.ui.Items.Layout_Rule then
- self.ui.Items.Layout_Rule:stopAllActions()
- self.ui.Items.Layout_Rule:setVisible(false)
- end
- if self.ui.Items.Button_Rule then
- self.ui.Items.Button_Rule:setVisible(true)
- end
-
- if app.room.roomInfo.isEapCreate == 1 then
- self.ui.Items.Button_Rule:setVisible(false)
- end
- end
-
- function ncmajRoomToolView:updateButton()
- ncmajRoomToolView.super.updateButton(self)
-
- if app.room.roomInfo.isEapCreate == 1 then
- if self.ui.Items.Button_Leave then
- self.ui.Items.Button_Leave:setEnabled(false)
- end
- end
- end
-
- function ncmajRoomToolView:checkCanDismiss( )
- local onCanDismissCallback = function (info)
- local nUserId = app.room:getMyUserId()
- local roomInfo = app.room.roomInfo or {}
- local canDismiss = (tonumber(info.canDismiss or 1) == 1) or roomInfo.nRoomOwnedUid == nUserId or dd.IClub.isAdmin()
- if roomInfo.nGameStartCount == 0 and roomInfo.nRoomOwnedUid ~= nUserId then
- canDismiss = false
- end
- if roomInfo.isEapCreate == 1 then
- canDismiss = false
- end
- self:onCanDismissCallback(canDismiss)
- end
-
- if dd.IClub.getCanDismiss then
- local canDismiss = dd.IClub.getCanDismiss(onCanDismissCallback)
- if canDismiss then
- onCanDismissCallback({canDismiss = canDismiss})
- end
- end
- end
-
- function ncmajRoomToolView:setWetChatVisible(bVisible)
- ncmajRoomToolView.super.setWetChatVisible(self, bVisible)
- if app.room.roomInfo.isEapCreate == 1 then
- self.ui.Items.Button_Invite:getParent():setVisible(false)
- end
- end
-
- return ncmajRoomToolView;
|