You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 rivejä
1.4 KiB

  1. local MJDefine = MJFramework.MJImport("mj.luaScript.MJDefine")
  2. local MJFunction = MJFramework.MJImport("mj.luaScript.MJFunction")
  3. local MJStatus = {
  4. Normal = 0,
  5. Select = 1,
  6. Disable = 2
  7. }
  8. local BaseMahjong3DCard = MJFramework.MJFrameworkClassImprot("mj.luaScript.Common.3d.Mahjong3DCard")
  9. local Card3D = class("Card3D", BaseMahjong3DCard)
  10. local Color_Ting_Yong_Card = cc.c3b(255, 255, 215)
  11. function Card3D:ctor(...)
  12. self._isTingYongCard = false
  13. self._isDingQueCard = false
  14. Card3D.super.ctor(self, ...)
  15. end
  16. -- 设置为听用牌
  17. function Card3D:setIsTingYongCard(isBool)
  18. self._isTingYongCard = isBool or false
  19. end
  20. -- 获取本牌是否是听用牌
  21. function Card3D:getIsTingYongCard()
  22. return false --self._isTingYongCard
  23. end
  24. -- 设置为定缺牌
  25. function Card3D:setIsDingQueCard(isBool)
  26. self._isDingQueCard = isBool or false
  27. end
  28. -- 获取本牌是否是定缺牌
  29. function Card3D:getIsDingQueCard()
  30. return self._isDingQueCard
  31. end
  32. function Card3D:setStatus(status)
  33. self.status = status
  34. if status == MJStatus.Select then--把选中和disable状态颜色区分一下,选中调浅一点
  35. self:setColor(cc.c3b(220, 220, 220))
  36. elseif status == MJStatus.Disable then
  37. self:setColor(cc.c3b(150, 150, 150))
  38. else
  39. self:setColor(cc.c3b(255, 255, 255))
  40. end
  41. if self.tang and self.tang == true then
  42. local color = cc.c3b(218, 218, 128)
  43. self:setColor(color)
  44. end
  45. end
  46. return Card3D