local MJDefine=MJFramework.MJImport("mj.luaScript.MJDefine") local MJRoomDirection = MJFramework.MJFrameworkClassImprot("mj.luaScript.Views.Room.MJRoomDirection") local yibinmajiangRoomDirectionView = class("yibinmajiangRoomDirectionView", MJRoomDirection) function yibinmajiangRoomDirectionView:ctor(...) yibinmajiangRoomDirectionView.super.ctor(self, ...) end function yibinmajiangRoomDirectionView:updateView(desktopType) if self.ui then self.ui:removeFromParent() end self.desktopType = desktopType if self.desktopType == MJDefine.DesktopType.ThreeD then if MJDefine.IS_NEW_3D then local path = "mj/res/ui/ui_fangjian/mj_ui_room_direction_3d.ui" self.ui = loadUI(path) -- self:init3DDirectionNew() else local path = "mj/res/ui/ui_fangjian/mj_ui_room_direction.ui" self.ui = loadUI(path) self:init3DDirection() end else self.ui = loadUI("mj_yibinmajiang/res/ui_fangjian/mj_yibinmajiang_room_direction_2d.ui") self:init2DDirection() end self:addChild(self.ui) if self.seatId then self.currentDir = nil self:updateDirection(self.seatId) end end function yibinmajiangRoomDirectionView:init2DDirection() local roomInfo = app.room.roomInfo local nBankSeatId = roomInfo.nBankSeatId local bankViewId = app.room:getViewIdBySeatId(nBankSeatId) if bankViewId == MJDefine.PlayerViewType.My then self.direction = MJDefine.MJDirection.East elseif bankViewId == MJDefine.PlayerViewType.Left then self.direction = MJDefine.MJDirection.South elseif bankViewId == MJDefine.PlayerViewType.Right then self.direction = MJDefine.MJDirection.North elseif bankViewId == MJDefine.PlayerViewType.Top then self.direction = MJDefine.MJDirection.West end self.ui.Items.ImageView_Dir_Down:stopAllActions(); self.ui.Items.ImageView_Dir_Up:stopAllActions(); self.ui.Items.ImageView_Dir_Left:stopAllActions(); self.ui.Items.ImageView_Dir_Right:stopAllActions(); local acSeq = cc.Sequence:create(cc.FadeOut:create(1.0), cc.FadeIn:create(1.0)) self.ui.Items.ImageView_Dir_Down:runAction(cc.RepeatForever:create(acSeq:clone())); self.ui.Items.ImageView_Dir_Up:runAction(cc.RepeatForever:create(acSeq:clone())); self.ui.Items.ImageView_Dir_Left:runAction(cc.RepeatForever:create(acSeq:clone())); self.ui.Items.ImageView_Dir_Right:runAction(cc.RepeatForever:create(acSeq:clone())); end function yibinmajiangRoomDirectionView:initDirection(desktopType) yibinmajiangRoomDirectionView.super.initDirection(self, desktopType) self:updateCardNums(MJDefine.totalCard) end function yibinmajiangRoomDirectionView:updateCardNums(cardNum) if not cardNum then return end if self.ui then self.ui.Items.Text_Leave_Card_Num:setText(cardNum) end end return yibinmajiangRoomDirectionView