Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

81 linhas
2.9 KiB

  1. local MJDefine=MJFramework.MJImport("mj.luaScript.MJDefine")
  2. local MJRoomDirection = MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Room.MJRoomDirection")
  3. local huamajiangRoomDirectionView = class("huamajiangRoomDirectionView", MJRoomDirection)
  4. function huamajiangRoomDirectionView:ctor(...)
  5. huamajiangRoomDirectionView.super.ctor(self, ...)
  6. end
  7. function huamajiangRoomDirectionView:updateView(desktopType)
  8. if self.ui then
  9. self.ui:removeFromParent()
  10. end
  11. self.desktopType = desktopType
  12. if self.desktopType == MJDefine.DesktopType.ThreeD then
  13. if MJDefine.IS_NEW_3D then
  14. local path = "mj/res/ui/ui_fangjian/mj_ui_room_direction_3d.ui"
  15. self.ui = loadUI(path)
  16. -- self:init3DDirectionNew()
  17. else
  18. local path = "mj/res/ui/ui_fangjian/mj_ui_room_direction.ui"
  19. self.ui = loadUI(path)
  20. self:init3DDirection()
  21. end
  22. else
  23. self.ui = loadUI("mj_huamajiang/res/ui_fangjian/mj_huamajiang_room_direction_2d.ui")
  24. self:init2DDirection()
  25. end
  26. self:addChild(self.ui)
  27. if self.seatId then
  28. self.currentDir = nil
  29. self:updateDirection(self.seatId)
  30. end
  31. end
  32. function huamajiangRoomDirectionView:init2DDirection()
  33. local roomInfo = app.room.roomInfo
  34. local nBankSeatId = roomInfo.nBankSeatId
  35. local bankViewId = app.room:getViewIdBySeatId(nBankSeatId)
  36. if bankViewId == MJDefine.PlayerViewType.My then
  37. self.direction = MJDefine.MJDirection.East
  38. elseif bankViewId == MJDefine.PlayerViewType.Left then
  39. self.direction = MJDefine.MJDirection.South
  40. elseif bankViewId == MJDefine.PlayerViewType.Right then
  41. self.direction = MJDefine.MJDirection.North
  42. elseif bankViewId == MJDefine.PlayerViewType.Top then
  43. self.direction = MJDefine.MJDirection.West
  44. end
  45. self.ui.Items.ImageView_Dir_Down:stopAllActions();
  46. self.ui.Items.ImageView_Dir_Up:stopAllActions();
  47. self.ui.Items.ImageView_Dir_Left:stopAllActions();
  48. self.ui.Items.ImageView_Dir_Right:stopAllActions();
  49. local acSeq = cc.Sequence:create(cc.FadeOut:create(1.0), cc.FadeIn:create(1.0))
  50. self.ui.Items.ImageView_Dir_Down:runAction(cc.RepeatForever:create(acSeq:clone()));
  51. self.ui.Items.ImageView_Dir_Up:runAction(cc.RepeatForever:create(acSeq:clone()));
  52. self.ui.Items.ImageView_Dir_Left:runAction(cc.RepeatForever:create(acSeq:clone()));
  53. self.ui.Items.ImageView_Dir_Right:runAction(cc.RepeatForever:create(acSeq:clone()));
  54. end
  55. function huamajiangRoomDirectionView:initDirection(desktopType)
  56. huamajiangRoomDirectionView.super.initDirection(self, desktopType)
  57. self:updateCardNums("144")
  58. end
  59. function huamajiangRoomDirectionView:updateCardNums(cardNum)
  60. if not cardNum then
  61. return
  62. end
  63. if self.ui then
  64. self.ui.Items.Text_Leave_Card_Num:setText(cardNum)
  65. end
  66. end
  67. return huamajiangRoomDirectionView