require("game.gameSetting.GameSettingModel") require("game.gameSetting.GameSettingView") require("game.gameSetting.BasicSettingView") require("game.gameSetting.AutoSettingView") require("game.gameSetting.ServiceView") require("game.gameSetting.BlockSettingItem") require("game.gameSetting.BlockSettingView") require("game.gameSetting.SettingPerformItem") require("game.gameSetting.SettingBtnItem") require("game.gameSetting.SelectSkillItem") require("game.gameSetting.GameSettingConst") require("game.gameSetting.SettingServiceTipsItem") require("game.gameSetting.ChannelSettingView")--聊天频道屏蔽部分暂时先不删 require("game.gameSetting.PictureModeView") GameSettingController = GameSettingController or BaseClass(BaseController) function GameSettingController:__init() GameSettingController.Instance = self self.model = GameSettingModel:GetInstance() self:AddAllEvents() end function GameSettingController:AddAllEvents() local open_fun = function(index) self:OpenPanel(index) end GlobalEventSystem:Bind(EventName.OPEN_SETTING_GAME_VIEW,open_fun) --注册打开设置面板的全局事件 local close_view = function() if self.gameSettingView and self.gameSettingView:HasOpen() then self.gameSettingView:Close() end end GlobalEventSystem:Bind(EventName.CHANGE_ACCOUNT, close_view) --注册关闭设置面板的全局事件 GlobalEventSystem:Bind(EventName.CHANGE_ROLE, close_view) GlobalEventSystem:Bind(EventName.OUT_OF_STUCK, close_view) local on_open_picturemode_view = function() if self.PictureModeView ==nil then self.PictureModeView = PictureModeView.New() end self.PictureModeView:Open() end GlobalEventSystem:Bind(EventName.OPEN_PICTURE_MODE_VIEW, on_open_picturemode_view) local function onGameStart( ) self.model:CheckIsLockScreen() end GlobalEventSystem:Bind(EventName.GAME_START, onGameStart) end function GameSettingController:OpenPanel(index) if self.gameSettingView ==nil then self.gameSettingView = GameSettingView.New() end self.gameSettingView:Open(index) end