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

46 line
1.4 KiB

  1. GameSettingModel = GameSettingModel or BaseClass(BaseModel)
  2. GameSettingModel.RETURN_ALL_DEFAULT = "RETURN_ALL_DEFAULT"
  3. GameSettingModel.TabData = {
  4. SYSYTEM = 1,--系统设置
  5. BLOCK = 2,--屏蔽设置
  6. AUTO = 3,--挂机设置
  7. CUSTOM = 4,--客服
  8. }
  9. function GameSettingModel:__init()
  10. GameSettingModel.Instance = self
  11. end
  12. function GameSettingModel:GetInstance()
  13. if GameSettingModel.Instance == nil then
  14. GameSettingModel.New()
  15. end
  16. return GameSettingModel.Instance
  17. end
  18. function GameSettingModel:CheckIsLockScreen( )
  19. local function on_lock_screen_timer( )
  20. if GlobalUserOperateTime and GlobalUserOperateTime > 0 then
  21. --120秒未操作
  22. local no_operate_time = Time.time - GlobalUserOperateTime
  23. if no_operate_time < 120 then
  24. return
  25. end
  26. --设置了自动锁屏,未锁屏,等级大于50,大世界场景中,自动战斗中
  27. local role_info = RoleManager and RoleManager.Instance.mainRoleInfo
  28. local is_power_save_state = lua_settingM:GetAutoPowerSaveSet()
  29. if is_power_save_state and not lua_viewM.is_lock_screen and role_info and role_info.level > 50 and
  30. SceneManager.Instance:IsMainCityAndFieldScene() and
  31. AutoFightManager:getInstance():GetAutoFightState() and Scene.Instance.main_role then
  32. GlobalEventSystem:Fire(SceneEventType.SCREEN_BRIGHT_DEL_EVENT)
  33. end
  34. end
  35. end
  36. if not self.lock_screen_id then
  37. self.lock_screen_id = GlobalTimerQuest:AddPeriodQuest(on_lock_screen_timer, 20, -1)
  38. end
  39. end