|
-
- local MJDefine=MJFramework.MJImport("mj.luaScript.MJDefine")
- local MJRoomPlayerView = MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Room.MJRoomPlayerView")
-
- local hongzhongRoomPlayerView = class("hongzhongRoomPlayerView", MJRoomPlayerView)
-
- function hongzhongRoomPlayerView:ctor()
- hongzhongRoomPlayerView.super.ctor(self)
- end
-
-
-
-
- function hongzhongRoomPlayerView:loadUI()
- local ui = loadUI("hongzhong/res/ui_fangjian/hongzhong_ui_player_view.ui")
- self.ui = ui
- self:addChild(ui)
-
- self:resetTuoGuanShow()
- end
-
- -- 托管显示
- function hongzhongRoomPlayerView:resetTuoGuanShow()
- for i=1,4 do
- self.ui.Items["ImageView_tuoguan_"..i]:setVisible(false)
- end
- end
-
- function hongzhongRoomPlayerView:showTuoGuanByViewId(viewId,bVisible)
- self.ui.Items["ImageView_tuoguan_"..viewId]:setVisible(bVisible)
- end
-
- function hongzhongRoomPlayerView:setPlayerOffLineVisible(bVisible,viewId)
- hongzhongRoomPlayerView.super.setPlayerOffLineVisible(self,bVisible,viewId)
-
- if self.allNodes[viewId] then
- local Text_offtime = self.allNodes[viewId].offLine:getChildByName("Text_offline_time_"..viewId)
- if Text_offtime then
- local userId = app.room:getUserIdByViewId(viewId)
- local member = app.room.roomInfo.memberList[userId]
- local offtime = member and member.offlinetime or 0
-
- Text_offtime:setText(formatTimeToStr(offtime))
- Text_offtime:stopAllActions()
- Text_offtime:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.DelayTime:create(1),cc.CallFunc:create(function()
- offtime = offtime + 1
- Text_offtime:setText(formatTimeToStr(offtime))
- end))))
- end
- end
- end
-
- function hongzhongRoomPlayerView:init()
- hongzhongRoomPlayerView.super.init(self)
- self:initChatComponent()
- end
-
- function hongzhongRoomPlayerView:initChatComponent()
- if self.chatComponentView and not tolua.isnull(self.chatComponentView) then
- return
- end
-
- local heads = {
- [1] = self.allNodes[1].head,
- [2] = self.allNodes[2].head,
- [3] = self.allNodes[3].head,
- [4] = self.allNodes[4].head,
- }
-
- self.chatComponentView = import("luaScript.Views.Room.RoomChatComponentView"):new(heads,MJDefine.MJChatTxt,MJDefine.MJFaceConfig)
- local voiceEnable = tonumber(loadUserInfo("voiceEnable")) or 1
- local propEnable = tonumber(loadUserInfo("propEnable")) or 1
- self.chatComponentView:setVoiceEnabled(voiceEnable==1)
- self.chatComponentView:setPropEnabled(propEnable==1)
- self:addChild(self.chatComponentView)
- end
-
-
- function hongzhongRoomPlayerView:onClickHead(index)
- playBtnEffect()
- local nUserId = app.room.seatShowList[index]
- local memberInfo = app.room.roomInfo.memberList[nUserId]
- if memberInfo then
- local view = import("luaScript.Views.Room.RoomPlayerInfoViewNew"):new(nUserId, memberInfo.userInfo)
- view:setAnchorPoint(cc.p(0.5, 0.5))
- app:showWaitDialog(view, 0, true)
- end
- end
-
- return hongzhongRoomPlayerView
|