When the player later hovers their crosshair over this object I hook the method that gets the "Interact" HUD text and add their label to it:
Plugin.ConfigInstance.TryGetEntry(
$"World.{guid}",
boxIndex.ToString(),
out ConfigEntry<string> entryMaybe
);
if (entryMaybe != null && !entryMaybe.Value.IsNullOrEmpty())
{
__result += $"\n{entryMaybe.Value}";
}
All of this works fine during a single play session. However when I restart the game the Entries property inside the ConfigFile is empty, and both entries have been moved to OrphanedEntries. How can I prevent this from happening? I read that entries are only orphaned if Bind isn't called on them, but I use that method to create them and they're saved, should they not be loaded back into Entries the next time I start the game? Since all the values are set at runtime I can't Bind everything inside my plugin Awake method, so I'm not sure how to keep them 'active' so to speak. Any help would be greatly appreciated!
BepInEx 5.4.21 x64
I'm making a plugin that lets the user assign a label to an object and saving their input using BepInEx's config manager:
I have
SaveOnConfigSet
set to true and tried a couple of test submissions which saved to the config file successfully:When the player later hovers their crosshair over this object I hook the method that gets the "Interact" HUD text and add their label to it:
All of this works fine during a single play session. However when I restart the game the
Entries
property inside theConfigFile
is empty, and both entries have been moved toOrphanedEntries
. How can I prevent this from happening? I read that entries are only orphaned ifBind
isn't called on them, but I use that method to create them and they're saved, should they not be loaded back intoEntries
the next time I start the game? Since all the values are set at runtime I can'tBind
everything inside my pluginAwake
method, so I'm not sure how to keep them 'active' so to speak. Any help would be greatly appreciated!