New-Project-Final-Final-WIP / HeadlessTweaks

A ResoniteModLoader mod for Resonite. Adds some nice to have features to headless clients
MIT License
14 stars 3 forks source link

Config JSON resets each launch #15

Open Ryn-Fox opened 7 months ago

Ryn-Fox commented 7 months ago

Each time I launch my headless with the mod, the rml_config/HeadlessTweaks.json resets to the following: { "version": "1.0.0", "values": { "_configSaved": true } }

Any idea what's going on?

badhaloninja commented 7 months ago

Are you perhaps editing the config file manually while the headless is running?

Ryn-Fox commented 7 months ago

To be absolutely sure, I've shutdown the headless, deleted the json, started the headless, and shut it down again without touching the file. Upon testing a few times, I see that it generates a full template on the first launch, but upon shutting down it wipes it to what's in the first post here.

badhaloninja commented 2 months ago

Sorry for taking such a long time to reply, I thought I had done so already

badhaloninja commented 2 months ago

I am now able to replicate this behavior consistently, I wonder why I wasn't able to before

I've found the problem, ResoniteModLoader saves all configs without defaults on shutdown, I'm fairly certain this did not behave like this when I first wrote HeadlessTweaks in Neos

ShutdownHook SaveInternal

I am able to fix this on my end in 2 different ways

One more solution is to create an issue on the ResoniteModLoader github requesting for a way to mark a config to auto save with defaults, which I might do later