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.

128 lines
4.6 KiB

  1. local BaseLayer = require("luaScript.ModuleEapSdk.BaseLayers.BaseLayer")
  2. local LayerBottom = EapClass("LayerBottom", BaseLayer)
  3. function LayerBottom.createWithData(__node, __zorder)
  4. local layer = LayerBottom.new()
  5. layer.m_parent = __node
  6. __node:addChild(layer, __zorder)
  7. return layer
  8. end
  9. function LayerBottom:myShow()
  10. -- self:addListener(true)
  11. self:initData()
  12. self:initUI()
  13. end
  14. function LayerBottom:myClose()
  15. end
  16. function LayerBottom:getCurSel()
  17. return self.m_curSel
  18. end
  19. function LayerBottom:initData()
  20. self.m_curSel = 1
  21. end
  22. function LayerBottom:initUI()
  23. self.imgPath = {
  24. "res/ModuleEapSdk/eapsdk_public_back_bg1.png",
  25. "res/ModuleEapSdk/eapsdk_public_back_bg2.png",
  26. "res/ModuleEapSdk/eapsdk_public_back_bg3.png",
  27. "res/ModuleEapSdk/eapsdk_wj_tab_game_off.png",
  28. "res/ModuleEapSdk/eapsdk_wj_tab_game_on.png", --5
  29. "res/ModuleEapSdk/eapsdk_wj_tab_mine_off.png",
  30. "res/ModuleEapSdk/eapsdk_wj_tab_mine_on.png",
  31. "res/ModuleEapSdk/eapsdk_bg_bj_sp3.png",
  32. "res/ModuleEapSdk/eapsdk_wj_tab_store_off.png",
  33. "res/ModuleEapSdk/eapsdk_wj_tab_store_on.png", --10
  34. }
  35. local fix_x = display.width
  36. local fix_y = display.cy
  37. local imgBack2 = G_EapAbbreviation.createImageView(self.imgPath[8], self, cc.p(fix_x, fix_y-255), false, 1, 1103, cc.p(1, 0.5))
  38. -- imgBack2:setSize(cc.size(564, 90))
  39. imgBack2:setScale(0.6)
  40. local btnMenus = cc.Node:create()
  41. btnMenus:setPosition(cc.p(fix_x-282, fix_y-255))
  42. self:addChild(btnMenus, 2)
  43. self.btnMatch = ccui.ImageView:create(self.imgPath[5])
  44. self.btnMatch:setPosition(cc.p(-188, 0))
  45. btnMenus:addChild(self.btnMatch)
  46. addButtonListener(self.btnMatch, function()
  47. print("self.btnMatch clicked ========= ")
  48. self.m_curSel = 1
  49. self.btnMatch:setTouchEnabled(false)
  50. self.btnInfo:setTouchEnabled(true)
  51. self.btnStore:setTouchEnabled(true)
  52. self.btnMatch:loadTexture(self.imgPath[5])
  53. self.btnInfo:loadTexture(self.imgPath[6])
  54. self.btnStore:loadTexture(self.imgPath[9])
  55. if G_EapSdkMgr.m_isMatching then
  56. if EAP_MATCH_STAGE == EAP_STAGE_SCORE then
  57. -- local isClick = G_EapSdkMgr:getClickEnter()
  58. -- if isClick ~= 1 and not G_EapSdkMgr.EapPhone then
  59. -- G_LayerMain:showLayer(LAYER_ENUM.LAYER_FREE)
  60. -- else
  61. G_LayerMain:showLayer(LAYER_ENUM.LAYER_MATCH)
  62. -- end
  63. elseif EAP_MATCH_STAGE == EAP_STAGE_PLATFORM then
  64. G_LayerMain:showLayer(LAYER_ENUM.LAYER_PLATFORM_MATCH)
  65. elseif EAP_MATCH_STAGE == EAP_STAGE_TEAM then
  66. G_LayerMain:showLayer(LAYER_ENUM.LAYER_TEAM)
  67. end
  68. else
  69. if EAP_MATCH_STAGE == EAP_STAGE_SCORE then
  70. G_LayerMain:showLayer(LAYER_ENUM.LAYER_END)
  71. elseif EAP_MATCH_STAGE == EAP_STAGE_PLATFORM then
  72. G_LayerMain:showLayer(LAYER_ENUM.LAYER_PLATFORM_FREE)
  73. elseif EAP_MATCH_STAGE == EAP_STAGE_TEAM then
  74. G_LayerMain:showLayer(LAYER_ENUM.LAYER_TEAM)
  75. end
  76. end
  77. end)
  78. self.btnInfo = ccui.ImageView:create(self.imgPath[6])
  79. self.btnInfo:setPosition(cc.p(188, 0))
  80. btnMenus:addChild(self.btnInfo)
  81. addButtonListener(self.btnInfo, function()
  82. print("self.btnInfo clicked ========= ")
  83. self.m_curSel = 3
  84. self.btnMatch:setTouchEnabled(true)
  85. self.btnInfo:setTouchEnabled(false)
  86. self.btnStore:setTouchEnabled(true)
  87. self.btnMatch:loadTexture(self.imgPath[4])
  88. self.btnInfo:loadTexture(self.imgPath[7])
  89. self.btnStore:loadTexture(self.imgPath[9])
  90. G_LayerMain:showLayer(LAYER_ENUM.LAYER_INFO)
  91. end)
  92. self.btnStore = ccui.ImageView:create(self.imgPath[9])
  93. self.btnStore:setPosition(cc.p(0, 0))
  94. btnMenus:addChild(self.btnStore)
  95. addButtonListener(self.btnStore, function()
  96. print("self.btnInfo clicked ========= ")
  97. self.m_curSel = 2
  98. self.btnMatch:setTouchEnabled(true)
  99. self.btnInfo:setTouchEnabled(true)
  100. self.btnStore:setTouchEnabled(false)
  101. self.btnMatch:loadTexture(self.imgPath[4])
  102. self.btnInfo:loadTexture(self.imgPath[6])
  103. self.btnStore:loadTexture(self.imgPath[10])
  104. G_LayerMain:showLayer(LAYER_ENUM.LAYER_STORE)
  105. end)
  106. self.btnMatch:setScale(0.6)
  107. self.btnInfo:setScale(0.6)
  108. self.btnStore:setScale(0.6)
  109. self.btnMatch:setTouchEnabled(false)
  110. self.btnInfo:setTouchEnabled(true)
  111. self.btnStore:setTouchEnabled(true)
  112. end
  113. return LayerBottom