Do not request autosaves when player is riding or swimming; removed unused starting/stopping functions
This commit is contained in:
parent
962a0861cd
commit
a3554130b4
Binary file not shown.
@ -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
|
||||||
|
UnregisterForUpdate()
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
|
||||||
|
|
||||||
|
If fUpdateTime <= 0.0 ; just in case
|
||||||
|
fUpdateTime = 30
|
||||||
|
EndIf
|
||||||
|
|
||||||
RegisterForSingleUpdate(fUpdateTime*60)
|
RegisterForSingleUpdate(fUpdateTime*60)
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function StopAutosaveSystem()
|
|
||||||
bAutosaveSystemStopped = true
|
|
||||||
UnregisterForUpdate()
|
|
||||||
EndFunction
|
|
||||||
|
|
||||||
Function ResumeAutosaveSystemInXMinutes(float _fMinutes = 0.0)
|
|
||||||
|
|
||||||
If _fMinutes == 0.0
|
|
||||||
_fMinutes = fUpdateTime
|
|
||||||
If _fMinutes <= 0.0 ; just in case
|
|
||||||
_fMinutes = 30
|
|
||||||
EndIf
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
RegisterForSingleUpdate(_fMinutes*60)
|
|
||||||
bAutosaveSystemStopped = false
|
|
||||||
|
|
||||||
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…
x
Reference in New Issue
Block a user