|
|
- GameSettingModel = GameSettingModel or BaseClass(BaseModel)
-
- GameSettingModel.RETURN_ALL_DEFAULT = "RETURN_ALL_DEFAULT"
-
- GameSettingModel.TabData = {
- SYSYTEM = 1,--系统设置
- BLOCK = 2,--屏蔽设置
- AUTO = 3,--挂机设置
- CUSTOM = 4,--客服
- }
-
- function GameSettingModel:__init()
- GameSettingModel.Instance = self
- end
-
- function GameSettingModel:GetInstance()
- if GameSettingModel.Instance == nil then
- GameSettingModel.New()
- end
- return GameSettingModel.Instance
- end
-
- function GameSettingModel:CheckIsLockScreen( )
- local function on_lock_screen_timer( )
- if GlobalUserOperateTime and GlobalUserOperateTime > 0 then
- --120秒未操作
- local no_operate_time = Time.time - GlobalUserOperateTime
- if no_operate_time < 120 then
- return
- end
-
- --设置了自动锁屏,未锁屏,等级大于50,大世界场景中,自动战斗中
- local role_info = RoleManager and RoleManager.Instance.mainRoleInfo
- local is_power_save_state = lua_settingM:GetAutoPowerSaveSet()
- if is_power_save_state and not lua_viewM.is_lock_screen and role_info and role_info.level > 50 and
- SceneManager.Instance:IsMainCityAndFieldScene() and
- AutoFightManager:getInstance():GetAutoFightState() and Scene.Instance.main_role then
-
- GlobalEventSystem:Fire(SceneEventType.SCREEN_BRIGHT_DEL_EVENT)
- end
- end
- end
- if not self.lock_screen_id then
- self.lock_screen_id = GlobalTimerQuest:AddPeriodQuest(on_lock_screen_timer, 20, -1)
- end
- end
|