Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

90 řádky
2.8 KiB

  1. local MJDefine=MJFramework.MJImport("mj.luaScript.MJDefine")
  2. local MJRoomPlayerView = MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Room.MJRoomPlayerView")
  3. local hongzhongRoomPlayerView = class("hongzhongRoomPlayerView", MJRoomPlayerView)
  4. function hongzhongRoomPlayerView:ctor()
  5. hongzhongRoomPlayerView.super.ctor(self)
  6. end
  7. function hongzhongRoomPlayerView:loadUI()
  8. local ui = loadUI("hongzhong/res/ui_fangjian/hongzhong_ui_player_view.ui")
  9. self.ui = ui
  10. self:addChild(ui)
  11. self:resetTuoGuanShow()
  12. end
  13. -- 托管显示
  14. function hongzhongRoomPlayerView:resetTuoGuanShow()
  15. for i=1,4 do
  16. self.ui.Items["ImageView_tuoguan_"..i]:setVisible(false)
  17. end
  18. end
  19. function hongzhongRoomPlayerView:showTuoGuanByViewId(viewId,bVisible)
  20. self.ui.Items["ImageView_tuoguan_"..viewId]:setVisible(bVisible)
  21. end
  22. function hongzhongRoomPlayerView:setPlayerOffLineVisible(bVisible,viewId)
  23. hongzhongRoomPlayerView.super.setPlayerOffLineVisible(self,bVisible,viewId)
  24. if self.allNodes[viewId] then
  25. local Text_offtime = self.allNodes[viewId].offLine:getChildByName("Text_offline_time_"..viewId)
  26. if Text_offtime then
  27. local userId = app.room:getUserIdByViewId(viewId)
  28. local member = app.room.roomInfo.memberList[userId]
  29. local offtime = member and member.offlinetime or 0
  30. Text_offtime:setText(formatTimeToStr(offtime))
  31. Text_offtime:stopAllActions()
  32. Text_offtime:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.DelayTime:create(1),cc.CallFunc:create(function()
  33. offtime = offtime + 1
  34. Text_offtime:setText(formatTimeToStr(offtime))
  35. end))))
  36. end
  37. end
  38. end
  39. function hongzhongRoomPlayerView:init()
  40. hongzhongRoomPlayerView.super.init(self)
  41. self:initChatComponent()
  42. end
  43. function hongzhongRoomPlayerView:initChatComponent()
  44. if self.chatComponentView and not tolua.isnull(self.chatComponentView) then
  45. return
  46. end
  47. local heads = {
  48. [1] = self.allNodes[1].head,
  49. [2] = self.allNodes[2].head,
  50. [3] = self.allNodes[3].head,
  51. [4] = self.allNodes[4].head,
  52. }
  53. self.chatComponentView = import("luaScript.Views.Room.RoomChatComponentView"):new(heads,MJDefine.MJChatTxt,MJDefine.MJFaceConfig)
  54. local voiceEnable = tonumber(loadUserInfo("voiceEnable")) or 1
  55. local propEnable = tonumber(loadUserInfo("propEnable")) or 1
  56. self.chatComponentView:setVoiceEnabled(voiceEnable==1)
  57. self.chatComponentView:setPropEnabled(propEnable==1)
  58. self:addChild(self.chatComponentView)
  59. end
  60. function hongzhongRoomPlayerView:onClickHead(index)
  61. playBtnEffect()
  62. local nUserId = app.room.seatShowList[index]
  63. local memberInfo = app.room.roomInfo.memberList[nUserId]
  64. if memberInfo then
  65. local view = import("luaScript.Views.Room.RoomPlayerInfoViewNew"):new(nUserId, memberInfo.userInfo)
  66. view:setAnchorPoint(cc.p(0.5, 0.5))
  67. app:showWaitDialog(view, 0, true)
  68. end
  69. end
  70. return hongzhongRoomPlayerView