源战役客户端
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

61 líneas
2.0 KiB

  1. require("game.gameSetting.GameSettingModel")
  2. require("game.gameSetting.GameSettingView")
  3. require("game.gameSetting.BasicSettingView")
  4. require("game.gameSetting.AutoSettingView")
  5. require("game.gameSetting.ServiceView")
  6. require("game.gameSetting.BlockSettingItem")
  7. require("game.gameSetting.BlockSettingView")
  8. require("game.gameSetting.SettingPerformItem")
  9. require("game.gameSetting.SettingBtnItem")
  10. require("game.gameSetting.SelectSkillItem")
  11. require("game.gameSetting.GameSettingConst")
  12. require("game.gameSetting.SettingServiceTipsItem")
  13. require("game.gameSetting.ChannelSettingView")--聊天频道屏蔽部分暂时先不删
  14. require("game.gameSetting.PictureModeView")
  15. GameSettingController = GameSettingController or BaseClass(BaseController)
  16. function GameSettingController:__init()
  17. GameSettingController.Instance = self
  18. self.model = GameSettingModel:GetInstance()
  19. self:AddAllEvents()
  20. end
  21. function GameSettingController:AddAllEvents()
  22. local open_fun = function(index)
  23. self:OpenPanel(index)
  24. end
  25. GlobalEventSystem:Bind(EventName.OPEN_SETTING_GAME_VIEW,open_fun) --注册打开设置面板的全局事件
  26. local close_view = function()
  27. if self.gameSettingView and self.gameSettingView:HasOpen() then
  28. self.gameSettingView:Close()
  29. end
  30. end
  31. GlobalEventSystem:Bind(EventName.CHANGE_ACCOUNT, close_view) --注册关闭设置面板的全局事件
  32. GlobalEventSystem:Bind(EventName.CHANGE_ROLE, close_view)
  33. GlobalEventSystem:Bind(EventName.OUT_OF_STUCK, close_view)
  34. local on_open_picturemode_view = function()
  35. if self.PictureModeView ==nil then
  36. self.PictureModeView = PictureModeView.New()
  37. end
  38. self.PictureModeView:Open()
  39. end
  40. GlobalEventSystem:Bind(EventName.OPEN_PICTURE_MODE_VIEW, on_open_picturemode_view)
  41. local function onGameStart( )
  42. self.model:CheckIsLockScreen()
  43. end
  44. GlobalEventSystem:Bind(EventName.GAME_START, onGameStart)
  45. end
  46. function GameSettingController:OpenPanel(index)
  47. if self.gameSettingView ==nil then
  48. self.gameSettingView = GameSettingView.New()
  49. end
  50. self.gameSettingView:Open(index)
  51. end