UI display scripts do not work correctly on a game reload.
Scrivener07 opened this issue · comments
Scrivener07 commented
OnInit only occurs once ever during the entire lifetime of a script. The problem is likely the function OnInit
on the Games:Shared:UI:Display. Maybe F4SE/Scaleform does not persist injected UI elements across game reloads? I will try to use the OnPlayerLoadGame - Actor event to reload the UI display onto the target menu.
Papyrus
Event OnInit()
If (Data())
Load()
EndIf
EndEvent
Scrivener07 commented
Instead of loading only inside of OnInit
, I now also do a reload with the OnPlayerLoadGame
event.
Event OnInit()
RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
OnGameReload()
WriteLine(self, "Initialization is complete for "+ToString())
EndEvent
Event Actor.OnPlayerLoadGame(Actor akSender)
OnGameReload()
WriteLine(self, "Reload is complete for "+ToString())
EndEvent
Event OnGameReload()
If (Data())
Load()
EndIf
EndEvent
Scrivener07 commented
Fixed with commit 256e24f