local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef") local ZPMessage = ZPFramework.ZPImport("zp_base.luaScript.Protocol.ZPMessage") local ZPRoomToolView = ZPFramework.ZPFrameworkClassImprot("zp_base.luaScript.Views.Room.ZPRoomToolView") local changpaiRoomToolView = class("changpaiRoomToolView", ZPRoomToolView) function changpaiRoomToolView:ctor( ... ) changpaiRoomToolView.super.ctor(self) end function changpaiRoomToolView:onEnter() changpaiRoomToolView.super.onEnter(self) --self:showFastStart(false) if PLN.CLUB_NAME == "茶馆" then self.ui.Items.Button_Invite_Club:loadTextureNormal("zp_changpai/res/ui/zy_fangjian/btn/yaoqing.png") else self.ui.Items.Button_Invite_Club:loadTextureNormal("zp_changpai/res/ui/zy_fangjian/btn/qinyouquanyaoqing.png") end self:initTuoGuan() end function changpaiRoomToolView:loadUi() local ui = loadUI("zp_changpai/res/ui/ui_fangjian/changpai_ui_Tool.ui") self.ui = ui; self:addChild(ui); end --- -- 初始化托管 -- @return -- function changpaiRoomToolView:initTuoGuan () if self.ui.Items.Layout_tuoguan then self.ui.Items.Button_guoguan:registerClick(handler(self , self.onClickQXTuoGuan)) self.ui.Items.Layout_tuoguan:setTouchEnabled(true) self.ui.Items.Layout_tuoguan:setLocalZOrder(1000) self:showTuoGuan(false) end end function changpaiRoomToolView:showFastStart(is) local roomInfo = app.room.roomInfo local curCount = roomInfo.nGameStartCount or 0 if curCount > 0 or (roomInfo.nStatus and roomInfo.nStatus>=ZPDef.ReconnectState.GAME_STATUS_WAIT_OUT_CARDS and roomInfo.nStatus<=ZPDef.ReconnectState.GAME_STATUS_GAME_OVER) then self.ui.Items.Button_EarlyStart:setVisible(false) else local gameInfo=json.decode(roomInfo.strGameInfo) local playnum = gameInfo.playnum or 0 if playnum == -1 then playnum = 4 end local isShowEarlyStart = table.nums(app.room.roomInfo.memberList) < playnum and app.room:getActualPlayerNum() >= 2 if true == is and isShowEarlyStart and curCount<=0 then --local playerCount = app.room:getPlayerCount() self.ui.Items.Button_EarlyStart:setVisible(true) else self.ui.Items.Button_EarlyStart:setVisible(false) end if gameInfo.startMode and gameInfo.startMode == 0 then--不是快速组局 self.ui.Items.Button_EarlyStart:setVisible(false) end end end --[[function changpaiRoomToolView:onClickFastStart( sender )--发起申请 playBtnEffect() local request = ZPMessage.FastStartRequest:new() request.tp = 1 self.ui:sendMsg(app.room, ZPDef.MJEvent.RequestFastsStart, request) end function changpaiRoomToolView:showFastStart(is) local roomInfo = app.room.roomInfo if roomInfo.nStatus and roomInfo.nStatus>=ZPDef.GameStatus.GAME_STATUS_WAIT_BANKER_START and roomInfo.nStatus<=ZPDef.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