1
Fork 0

Update autosave interval on journal menu close

development
Eddoursul 4 months ago
parent 01e66e9f57
commit db6dd31c9b
  1. BIN
      scripts/_00e_autosavesystem_functions.pex
  2. 20
      source/scripts/_00e_autosavesystem_functions.psc

@ -17,7 +17,11 @@ Event OnUpdate()
Actor PlayerREF = Game.GetForm(0x14) as Actor Actor PlayerREF = Game.GetForm(0x14) as Actor
If PlayerREF.IsInCombat() || PlayerREF.IsOnMount() || PlayerREF.IsSwimming() || ! Game.IsFightingControlsEnabled() || PlayerREF.IsDead() || Utility.IsInMenuMode() || UI.IsTextInputEnabled() || UI.IsMenuOpen("Dialogue Menu") if PlayerREF.IsDead()
return
endif
If PlayerREF.IsInCombat() || PlayerREF.IsOnMount() || PlayerREF.IsSwimming() || ! Game.IsFightingControlsEnabled() || Utility.IsInMenuMode() || UI.IsTextInputEnabled() || UI.IsMenuOpen("Dialogue Menu")
RegisterForSingleUpdate(5) RegisterForSingleUpdate(5)
return return
endif endif
@ -41,16 +45,26 @@ Function UpdateAutoSaveInterval()
UnregisterForUpdate() UnregisterForUpdate()
return return
endif endif
fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame") fUpdateTime = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
If fUpdateTime <= 0.0 ; just in case If fUpdateTime <= 0.0 ; just in case
fUpdateTime = 30 fUpdateTime = 30.0
EndIf EndIf
RegisterForSingleUpdate(fUpdateTime*60) RegisterForSingleUpdate(fUpdateTime*60)
RegisterForMenu("Journal Menu")
EndFunction EndFunction
Event OnMenuClose(String MenuName)
float fAutosaveEveryXMins = Utility.GetIniFloat("fAutosaveEveryXMins:SaveGame")
if fUpdateTime as int != fAutosaveEveryXMins as int
fUpdateTime = fAutosaveEveryXMins
RegisterForSingleUpdate(fUpdateTime*60)
endif
EndEvent
int iAutosaveIndex = 0 int iAutosaveIndex = 0
float fUpdateTime float fUpdateTime

Loading…
Cancel
Save