|
|
|
@ -14,14 +14,10 @@ Scriptname _00E_AutoSaveSystem_Functions extends Quest |
|
|
|
|
; 1: Unknown flag. |
|
|
|
|
|
|
|
|
|
Event OnUpdate() |
|
|
|
|
|
|
|
|
|
If bAutosaveSystemStopped |
|
|
|
|
return |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
return |
|
|
|
|
endif |
|
|
|
@ -41,42 +37,20 @@ EndEvent |
|
|
|
|
; called from _00E_AutosaveIntervalAlias to update ini setting fAutosaveEveryXMins in case it was changed |
|
|
|
|
Function UpdateAutoSaveInterval() |
|
|
|
|
|
|
|
|
|
fUpdateTime = GetAutosaveEveryXMins() |
|
|
|
|
RegisterForSingleUpdate(fUpdateTime*60) |
|
|
|
|
|
|
|
|
|
EndFunction |
|
|
|
|
|
|
|
|
|
Function StopAutosaveSystem() |
|
|
|
|
bAutosaveSystemStopped = true |
|
|
|
|
UnregisterForUpdate() |
|
|
|
|
EndFunction |
|
|
|
|
|
|
|
|
|
Function ResumeAutosaveSystemInXMinutes(float _fMinutes = 0.0) |
|
|
|
|
if SKSE.GetVersion() <= 0 |
|
|
|
|
UnregisterForUpdate() |
|
|
|
|
return |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
If _fMinutes == 0.0 |
|
|
|
|
_fMinutes = fUpdateTime |
|
|
|
|
If _fMinutes <= 0.0 ; just in case |
|
|
|
|
_fMinutes = 30 |
|
|
|
|
EndIf |
|
|
|
|
fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame") |
|
|
|
|
|
|
|
|
|
If fUpdateTime <= 0.0 ; just in case |
|
|
|
|
fUpdateTime = 30 |
|
|
|
|
EndIf |
|
|
|
|
|
|
|
|
|
RegisterForSingleUpdate(_fMinutes*60) |
|
|
|
|
bAutosaveSystemStopped = false |
|
|
|
|
RegisterForSingleUpdate(fUpdateTime*60) |
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
float fUpdateTime |
|
|
|
|