源战役客户端
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.

67 lines
2.1 KiB

  1. require("game.strength.StrengthView")
  2. require("game.strength.StrengthItem")
  3. require("game.strength.StrengthModel")
  4. -- require("game.strength.StrengthBaseView")
  5. -- require("game.strength.StrengthMainView")
  6. -- require("game.strength.StrengthMainItem")
  7. StrengthController = StrengthController or BaseClass(BaseController)
  8. function StrengthController:__init()
  9. StrengthController.Instance = self
  10. self.model = StrengthModel:getInstance()
  11. self:InitEvent()
  12. end
  13. function StrengthController:InitEvent( )
  14. local function onOpenStrengthView(show)
  15. if show then
  16. if self.StrengthView == nil then
  17. self.StrengthView = StrengthView.New()
  18. end
  19. self.StrengthView:Open()
  20. else
  21. if self.StrengthView and self.StrengthView:HasOpen() then
  22. self.StrengthView:Close()
  23. end
  24. end
  25. end
  26. GlobalEventSystem:Bind(EventName.OPEN_STRENGTH_VIEW, onOpenStrengthView)
  27. -- local function onOpenStrengthMainView(index)
  28. -- if RoleManager.Instance.mainRoleInfo.level >= Config.ConfigOpenLv.Other.strong then
  29. -- if self.strengthBaseView == nil then
  30. -- self.strengthBaseView = StrengthBaseView.New()
  31. -- end
  32. -- -- self.strengthBaseView:Open()
  33. -- self.strengthBaseView:Open(index)
  34. -- else
  35. -- Message.show("未达到开放等级")
  36. -- end
  37. -- end
  38. -- GlobalEventSystem:Bind(EventName.OPEN_STRENGTH_MAIN_VIEW, onOpenStrengthMainView)
  39. -- -- GlobalEventSystem:Bind(EventName.OPEN_STRENGTH_VIEW, onOpenStrengthMainView)
  40. -- local function onCloseStrengthView()
  41. -- if self.strengthBaseView ~= nil and self.strengthBaseView:HasOpen() then
  42. -- self.strengthBaseView:Close()
  43. -- end
  44. -- end
  45. -- GlobalEventSystem:Bind(EventName.CLOSE_STRENGTH_MAIN_VIEW, onCloseStrengthView)
  46. -- local func = function()
  47. -- local data = {}
  48. -- data = {
  49. -- strength_flag_1 = self.model.strength_flag_1,
  50. -- strength_flag_2 = self.model.strength_flag_2,
  51. -- strength_flag_3 = self.model.strength_flag_3,
  52. -- }
  53. -- GlobalEventSystem:Fire(EventName.SENT_MODULE_DEBUG_DATA, "strength", data)
  54. -- end
  55. -- GlobalEventSystem:Bind(EventName.CHECK_MODULE_DEBUG_DATA,func)
  56. local function onStartGame()
  57. self.model:ResetInfo()
  58. end
  59. GlobalEventSystem:Bind(EventName.GAME_START, onStartGame)
  60. end