Moved SetAutoSaveInterval() to the AutoSave quest alias

This commit is contained in:
Eddoursul 2023-11-28 18:14:37 +01:00
parent f3605bb8d6
commit e6e3f324fb
7 changed files with 12 additions and 16 deletions

BIN
UpdateAutosaveInterval.esp Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
Scriptname _00E_AutosaveIntervalAlias extends ReferenceAlias Hidden
Event OnPlayerLoadGame()
(GetOwningQuest() as _00E_AutoSaveSystem_Functions).UpdateAutoSaveInterval()
EndEvent

View File

@ -3,6 +3,10 @@ Scriptname _00E_AutoSaveSystem_Functions extends Quest
Event OnInit()
fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
If fUpdateTime <= 0.0 ; just in case
fUpdateTime = 60
EndIf
RegisterForSingleUpdate(fUpdateTime*60)
EndEvent
@ -24,7 +28,7 @@ EndEvent
Function UpdateAutoSaveInterval()
fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
If fUpdateTime == 0.0 ; just in case
If fUpdateTime <= 0.0 ; just in case
fUpdateTime = 60
EndIf

View File

@ -27,19 +27,6 @@ Event OnPlayerLoadGame()
EndEvent
;=====================================================================================
; ALL UPDATES
;=====================================================================================
Function SetAutoSaveInterval()
; updates the autosave interval
_00E_AutoSaveSystem_Functions AutoSaveSystem_Functions = Game.GetFormFromFile(0x00048141, "Skyrim.esm") as _00E_AutoSaveSystem_Functions
AutoSaveSystem_Functions.UpdateAutoSaveInterval()
EndFunction
;=====================================================================================
; MAINTENANCE
;=====================================================================================
@ -60,8 +47,6 @@ Function Maintenance()
Message.ResetHelpMessage("Clear")
(Game.GetForm(0xAC80E) as Message).ShowAsHelpMessage("Clear", 0.1, 1, 1)
SetAutoSaveInterval()
EndFunction
;=====================================================================================