|
- local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
- local ZPMessage = ZPFramework.ZPImport("zp_base.luaScript.Protocol.ZPMessage")
- local ZPFunctions = require("zp_xichong.luaScript.xichongFunctions")
-
- local ZPRoomToolView = ZPFramework.ZPFrameworkClassImprot("zp_base.luaScript.Views.Room.ZPRoomToolView")
- local xichongRoomToolView = class("xichongRoomToolView", ZPRoomToolView)
-
- function xichongRoomToolView:ctor( ... )
- xichongRoomToolView.super.ctor(self)
- end
-
- function xichongRoomToolView:onEnter()
- xichongRoomToolView.super.onEnter(self)
- --self:showFastStart(false)
- self:initVoiceComponent()
- self:initTuoGuan()
- end
-
- function xichongRoomToolView:loadUi()
- local ui = loadUI("zp_xichong/res/ui/ui_fangjian/xichong_ui_Tool.ui")
- self.ui = ui;
- self:addChild(ui);
- end
-
-
- function xichongRoomToolView: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 table.nums(app.room.roomInfo.memberList) > 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 xichongRoomToolView:onClickFastStart( sender )--发起申请
- playBtnEffect()
- local request = ZPMessage.FastStartRequest:new()
- request.tp = 1
- self.ui:sendMsg(app.room, ZPDef.MJEvent.RequestFastsStart, request)
- end
-
- function xichongRoomToolView: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<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 xichongRoomToolView:onClickFace()
- local chatView = import("luaScript.Views.Room.RoomChatView"):new(ZPDef.XICHONG_GAME_CHAT_TXT)
- chatView:setAnchorPoint(cc.p(0.5, 0.5))
- app:showWaitDialog(chatView,0,true)
- end
-
- function xichongRoomToolView:initVoiceComponent()
- local voiceComponentView = import("luaScript.Views.Room.RoomVoiceComponentView"):new(self.ui.Items.Button_Voice)
- self:addChild(voiceComponentView)
- end
-
- -- 初始化托管
- function xichongRoomToolView: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 xichongRoomToolView:onClickQXTuoGuan( sender )
- playBtnEffect()
- --
- local request = ZPMessage.HostingRequest:new()
- request.status = 0 --1托管 0取消托管
- self.ui:sendMsg(app.room, ZPDef.ZPEvent.HostingRequest, request)
- end
-
- -- 显示托管
- function xichongRoomToolView:showTuoGuan( is )
- self.ui.Items.Layout_tuoguan:setVisible(is==true)
- end
- return xichongRoomToolView
|