Config menus not registering
jbezorg opened this issue · 2 comments
jbezorg commented
Is there a way for a mod to check if it's listed as a config option in the OnPlayerLoadGame event and, if not, put itself in the register queue again?
Something like
event OnPlayerLoadGame()
quest me = self.GetOwningQuest()
if UI.skyui_registered_mods.Find( me ) < 0
UI.skyui_register_mod( me )
endIf
endEvent
jbezorg commented
scriptname SKI_RegisterCheck extends SKI_ConfigManager
bool function IsModRegistered(SKI_ConfigBase a_menu)
return _modConfigs.Find(a_menu) >= 0
endFunction
; block usage
int function UnregisterMod(SKI_ConfigBase a_menu)
return -2
endFunction
function ForceReset()
endFunction
function CleanUp()
endFunction
int function NextID()
return -2
endFunction
Scriptname playerLoadGameAlias extends ReferenceAlias
SKI_RegisterCheck property check auto
event OnPlayerLoadGame()
SKI_ConfigBase base = self.GetOwningQuest() as SKI_ConfigBase
string name = self.GetOwningQuest().GetName()
if !check.IsModRegistered(base)
check.RegisterMod(base, name)
endIf
endEvent
schlangster commented
Well, aren't there are already mechanisms in place that handle re-registration?
If you think there's a bug in there somewhere, rather try to pin it down so we can fix it eventually.
Using a non-standard registration procedure in your mod is not recommended as it's not future-proof.