So i've got a resource set up which holds my game settings. It works just fine, except when I go to apply the game settings on startup. Applying the volume settings for example doesn't apply what was saved and then loaded, it puts the volume to max. Same with fullscreen, it kind of works but the tickbox in the settings isn't refreshed to indicate fullscreen mode is on. Any ideas on how to apply it properly?
#Trying to apply user preferences from resource on startup.
1 messages · Page 1 of 1 (latest)
Here's Applier.gd:
Settings_Menu.gd:
And user_preferences.gd
To clarify a bit, if I go into my options menu and change things, then hit the back button, it applies.
It does not however apply on startup. That's what i'm trying to solve.
Trying to apply user preferences from resource on startup.
It sounds like it isn't saving the settings to disk.
If you delete the file and try to press the button that attempts the save, do you see a new one being creted?
When using breakpoints, do you see the _ready() of Applier.gd run?
Did you consider. Using resource loader for loading ?
I can see a new one being created, and if I refresh it while the game is live and change options around, they are being saved to disk.
I haven't exactly considered that, but you're right, it might be worth a shot
As for breakpoints, I don't see the _ready() of my applier script running....
Putting a print at the end of the ready call does reveal it loaded though...huh.
The cached version of the resource may be messing with things. Use the extra parameters of the load() function to avoid using the cache
Noted, I'll check the documentation and give that a shot.
Still no luck. This is odd.
To be fair though, I did forget to mention I have a disclaimer scene before the game loads, but no audio plays there currently.
Here's what's in Disclaimer.gd
That said, even changing the default scene on boot to be the main menu still results in the same exact issue.
So it's obviously not the disclaimer scene...
@grand rover did changing towards Resource Loader change anything. Maybe this asks for a short debug session
Changing to resource loader did nothing it seems.