|
-
- local MJRoomToolView = MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Room.MJRoomToolView")
- local MJDefine = MJFramework.MJImport("mj.luaScript.MJDefine")
- local MJMessage = MJFramework.MJImport("mj.luaScript.Protocol.MJMessage")
-
-
- local hongzhongRoomToolView = class("hongzhongRoomToolView", MJRoomToolView)
-
- function hongzhongRoomToolView:ctor( ... )
- hongzhongRoomToolView.super.ctor(self)
- end
-
- function hongzhongRoomToolView:onEnter()
- hongzhongRoomToolView.super.onEnter(self)
- self.ui.Items.Button_tuoguan:registerClick(handler(self , self.onClickTuoGuan))
- self.ui.Items.Button_tuoguan:setEnabled(app.room.roomInfo.hosting~=1)
- self.ui.Items.Button_tuoguan:setVisible(false)
- self.ui.Items.Button_guoguan:registerClick(handler(self , self.onClickQXTuoGuan))
- self.ui.Items.Layout_tuoguan:registerClick(function ( sender )
- print("do nothing...")
- end)
- self.ui.Items.Layout_tuoguan:setLocalZOrder(1000)
- self:showTuoGuan(false)
-
- self.ui.Items.Button_fastStart:registerClick(handler(self, self.onClickFastStart))
- self:showFastStart(false)
- self:setMenuVisible(false, true)
- self.ui.Items.Button_Invite:setVisible(false)
- self.ui.Items.Button_Ready:setVisible(false)
-
-
- -- if self.ui.Items.Button_Face then
- -- self.ui.Items.Button_Face:registerClick(handler(self,self.onClickFace))
- -- end
-
- -- if self.ui.Items.Button_Voice then
- -- local voiceComponentView = import("luaScript.Views.Room.RoomVoiceComponentView"):new(self.ui.Items.Button_Voice)
- -- self:addChild(voiceComponentView)
- -- end
-
- end
-
- function hongzhongRoomToolView:loadUI()
- local ui = loadUI("hongzhong/res/ui_fangjian/hongzhong_ui_tool.ui")
- self.ui = ui
- self:addChild(ui)
- end
-
- -- 设置界面
- function hongzhongRoomToolView:onClickMenu()
- playBtnEffect()
- self:setMenuVisible(not self.ui.Items.Layout_Menu:isVisible())
- end
-
- --设置按钮菜单
- function hongzhongRoomToolView:setMenuVisible(bVisible, flag)
- self.ui.Items.Layout_Menu:setVisible(bVisible)
- self:hideOther()
- end
-
- --点击日记
- function hongzhongRoomToolView:onClickLog()
- hongzhongRoomToolView.super.onClickLog(self)
- self:hideOther()
- end
-
- function hongzhongRoomToolView:hideOther()
- -- 隐藏个人信息
- if self:getParent() and self:getParent().playerView then
- self:getParent().playerView:removePlayerInfoView()
- end
- end
-
- function hongzhongRoomToolView:onClickFastStart( sender )--发起申请
- playBtnEffect()
- local request = MJMessage.FastStartRequest:new()
- request.tp = 1
- self.ui:sendMsg(app.room, MJDefine.MJEvent.RequestFastsStart, request)
- end
-
- --[[function hongzhongRoomToolView:reloadCallback()
- -- 离开按钮
- self.ui.Items.Button_Leave:registerClick(function ()
- playBtnEffect()
- if app.room.roomInfo.tableOverFlag and app.room.roomInfo.tableOverFlag > MJDefine.TABLE_OVER_FLAG.TABLE_OVER_NORMAL then
- showTooltip(MJDefine.TABLE_OVER_FLAG_TEXT[app.room.roomInfo.tableOverFlag]);
- app:gotoView(import("luaScript.Views.Main.MainView"):new(GAME_IDS.LaiBing));
- else
- playBtnEffect()
- app.room.roomInfo.bQuitRoom = true
- self.ui:sendMsg(app.room, MJDefine.MJEvent.CallLeaveRequest)
- end
- end)
- end
- --]]
-
- function hongzhongRoomToolView:showFastStart(is)
- local roomInfo = app.room.roomInfo
- if roomInfo.nStatus and roomInfo.nStatus>=MJDefine.GameStatus.GAME_STATUS_WAIT_BANKER_START and roomInfo.nStatus<=MJDefine.GameStatus.GAME_STATUS_GAME_OVER then
- self.ui.Items.Button_fastStart:setVisible(false)
- else
- local playerCount = app.room:getPlayerCount()
- local roomInfo=app.room.roomInfo
- local gameInfo=json.decode(roomInfo.strGameInfo)
- if true == is and playerCount<app.room:getMaxPlayerCount() and app.room.roomInfo.nGameStartCount<=0 then
- local playerCount = app.room:getPlayerCount()
- self.ui.Items.Button_fastStart:setVisible(playerCount==2 or playerCount==3)
- else
- self.ui.Items.Button_fastStart:setVisible(false)
- end
- if gameInfo.isfaststart and gameInfo.isfaststart == 0 then
- self.ui.Items.Button_fastStart:setVisible(false)
- end
- end
- end
-
- --隐藏微信按钮
- function hongzhongRoomToolView:setWetChatVisible(bVisible)
- -- self.ui.Items.Button_Invite:setVisible(bVisible)
- self:setInviteClubVisible(bVisible)
- --self:updateButtonPosition()
- end
-
- function hongzhongRoomToolView:updateButton()
-
- end
-
- function hongzhongRoomToolView:onClickTuoGuan( sender )
- playBtnEffect()
- local request = MJMessage.HostingRequest:new()
- request.nUserId = app.room:getMyUserId()
- request.status = 1 --1托管 0取消托管
- self.ui:sendMsg(app.room, MJDefine.MJEvent.HostingRequest, request)
- end
-
- function hongzhongRoomToolView:onClickQXTuoGuan( sender )
- playBtnEffect()
- --
- local request = MJMessage.HostingRequest:new()
- request.nUserId = 0
- request.status = 0 --1托管 0取消托管
- self.ui:sendMsg(app.room, MJDefine.MJEvent.HostingRequest, request)
- end
-
- function hongzhongRoomToolView:showTuoGuan( is )
- self.ui.Items.Layout_tuoguan:setVisible(is==true)
- end
-
- -- function hongzhongRoomToolView:onClickFace()
- -- local chatView = import("luaScript.Views.Room.RoomChatView"):new(MJDefine.MJChatTxt,MJDefine.MJFaceConfig)
- -- chatView:setAnchorPoint(cc.p(0.5, 0.5))
- -- app:showWaitDialog(chatView,0,true)
- -- end
-
-
- return hongzhongRoomToolView
|