1
Fork 0

Do not request autosaves when player is riding or swimming; removed unused starting/stopping functions

development
Eddoursul 6 months ago
parent 962a0861cd
commit a3554130b4
  1. BIN
      scripts/_00e_autosavesystem_functions.pex
  2. 46
      source/scripts/_00e_autosavesystem_functions.psc

@ -14,14 +14,10 @@ Scriptname _00E_AutoSaveSystem_Functions extends Quest
; 1: Unknown flag. ; 1: Unknown flag.
Event OnUpdate() Event OnUpdate()
If bAutosaveSystemStopped
return
EndIf
Actor PlayerREF = Game.GetForm(0x14) as Actor Actor PlayerREF = Game.GetForm(0x14) as Actor
If PlayerREF.IsInCombat() || ! Game.IsFightingControlsEnabled() || PlayerREF.IsDead() || Utility.IsInMenuMode() || UI.IsTextInputEnabled() || UI.IsMenuOpen("Dialogue Menu") If PlayerREF.IsInCombat() || PlayerREF.IsOnMount() || PlayerREF.IsSwimming() || ! Game.IsFightingControlsEnabled() || PlayerREF.IsDead() || Utility.IsInMenuMode() || UI.IsTextInputEnabled() || UI.IsMenuOpen("Dialogue Menu")
RegisterForSingleUpdate(5) RegisterForSingleUpdate(5)
return return
endif endif
@ -41,42 +37,20 @@ EndEvent
; called from _00E_AutosaveIntervalAlias to update ini setting fAutosaveEveryXMins in case it was changed ; called from _00E_AutosaveIntervalAlias to update ini setting fAutosaveEveryXMins in case it was changed
Function UpdateAutoSaveInterval() Function UpdateAutoSaveInterval()
fUpdateTime = GetAutosaveEveryXMins() if SKSE.GetVersion() <= 0
RegisterForSingleUpdate(fUpdateTime*60) UnregisterForUpdate()
return
EndFunction endif
Function StopAutosaveSystem()
bAutosaveSystemStopped = true
UnregisterForUpdate()
EndFunction
Function ResumeAutosaveSystemInXMinutes(float _fMinutes = 0.0)
If _fMinutes == 0.0 fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
_fMinutes = fUpdateTime
If _fMinutes <= 0.0 ; just in case If fUpdateTime <= 0.0 ; just in case
_fMinutes = 30 fUpdateTime = 30
EndIf
EndIf EndIf
RegisterForSingleUpdate(_fMinutes*60) RegisterForSingleUpdate(fUpdateTime*60)
bAutosaveSystemStopped = false
EndFunction EndFunction
float function GetAutosaveEveryXMins()
float fUpdateMinutes = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
If fUpdateMinutes <= 0.0 ; just in case
fUpdateMinutes = 30
EndIf
return fUpdateMinutes
endfunction
bool bAutosaveSystemStopped = false
int iAutosaveIndex = 0 int iAutosaveIndex = 0
float fUpdateTime float fUpdateTime

Loading…
Cancel
Save