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.

62 lines
2.0 KiB

  1. local BaseLayer = require("luaScript.ModuleEapSdk.BaseLayers.BaseLayer")
  2. local LayerCreateTeam = class("LayerCreateTeam", BaseLayer)
  3. function LayerCreateTeam.createWithData(__node, __zorder)
  4. local layer = LayerCreateTeam.new()
  5. layer.m_parent = __node
  6. __node:addChild(layer, __zorder)
  7. return layer
  8. end
  9. function LayerCreateTeam:myShow()
  10. -- self:addListener(true)
  11. self:initUI()
  12. end
  13. function LayerCreateTeam:myClose()
  14. end
  15. function LayerCreateTeam:initUI()
  16. self.imgPath = {
  17. "res/ModuleEapSdk/eapsdk_public_back_bg1.png",
  18. "res/ModuleEapSdk/eapsdk_public_back_bg2.png",
  19. "res/ModuleEapSdk/eapsdk_public_back_bg3.png",
  20. "res/ModuleEapSdk/eapsdk_wj_icon_question.png",
  21. "res/ModuleEapSdk/eapsdk_wj_btn_lingjiang.png",
  22. }
  23. local fix_x = display.width
  24. local fix_y = display.cy
  25. local imgBack2 = G_EapAbbreviation.createImageView(self.imgPath[2], self, cc.p(fix_x-10, fix_y-106), true, 2, 2101, cc.p(1, 0.5))
  26. imgBack2:setSize(cc.size(530, 204))
  27. local title = "创建战队后即可加入赛事"
  28. G_EapAbbreviation.createSystemLabel(imgBack2, cc.p(265, 170), title, 25, cc.c3b(0xc8, 0xa8, 0x88), true)
  29. --赛事规则
  30. self.btnDes = ccui.Button:create(self.imgPath[4])
  31. self.btnDes:setPosition(cc.p(475, 185))
  32. self.btnDes:setScale(0.585)
  33. imgBack2:addChild(self.btnDes)
  34. addButtonListener(self.btnDes, function()
  35. print("LayerCreateTeam btnDes clicked === ")
  36. local coreId = G_EapSdkMgr.m_matchInfos[1] and G_EapSdkMgr.m_matchInfos[1].coreId
  37. if not G_EapSdkMgr.m_rulesDes and coreId then
  38. G_EapSocketLogin.request_core_info(coreId)
  39. end
  40. self.m_parent.m_parent:showLayer(LAYER_ENUM.LAYER_TEAM_RULE)
  41. end)
  42. --创建战队
  43. self.btnGo = ccui.Button:create(self.imgPath[5])
  44. self.btnGo:setPosition(cc.p(265, 45))
  45. self.btnGo:setScale(0.585)
  46. imgBack2:addChild(self.btnGo)
  47. addButtonListener(self.btnGo, function()
  48. F_EapOpenUrl(G_EapSdkMgr.m_awardUrl)
  49. end)
  50. end
  51. return LayerCreateTeam