The new GameSettingsResource is currently used as an in-memory holder while _load_settings/_save_settings still persist via ConfigFile; if the goal is Resource-backed profiles, you may want to add explicit load/save paths for .tres assets rather than relying solely on the legacy config format.
@ikostan, you're absolutely right, and I apologize for the confusion!
The test is correct for your current implementation. Since you're still using ConfigFile in _save_settings() and _load_settings(), the test validating ConfigFile format is appropriate.
I was pointing out a discrepancy between the PR description and the actual code:
- PR objectives state: "replace the current ConfigFile approach" and "enable saving/loading profiles as .tres files"
- Actual implementation: Still uses
ConfigFile.save() and ConfigFile.load() (lines 170-185 and 120-135 in globals.gd)
Two paths forward:
-
Keep ConfigFile (what you have now): The test is fine as-is. Just update the PR description to clarify you're centralizing settings into a Resource object but keeping ConfigFile persistence.
-
Migrate to Resource persistence (stated goal): Replace ConfigFile with ResourceSaver.save(settings, path) and ResourceLoader.load(path) in _save_settings() and _load_settings(), then update this test accordingly.
Which direction would you prefer? If option 1, I'll mark my previous comments as addressed since the test matches the implementation.
Originally posted by @coderabbitai[bot] in #431 (comment)
The new
GameSettingsResourceis currently used as an in-memory holder while_load_settings/_save_settingsstill persist viaConfigFile; if the goal is Resource-backed profiles, you may want to add explicit load/save paths for.tresassets rather than relying solely on the legacy config format.@ikostan, you're absolutely right, and I apologize for the confusion!The test is correct for your current implementation. Since you're still using
ConfigFilein_save_settings()and_load_settings(), the test validating ConfigFile format is appropriate.I was pointing out a discrepancy between the PR description and the actual code:
ConfigFile.save()andConfigFile.load()(lines 170-185 and 120-135 in globals.gd)Two paths forward:
Keep ConfigFile (what you have now): The test is fine as-is. Just update the PR description to clarify you're centralizing settings into a Resource object but keeping ConfigFile persistence.
Migrate to Resource persistence (stated goal): Replace
ConfigFilewithResourceSaver.save(settings, path)andResourceLoader.load(path)in_save_settings()and_load_settings(), then update this test accordingly.Which direction would you prefer? If option 1, I'll mark my previous comments as addressed since the test matches the implementation.
Originally posted by @coderabbitai[bot] in #431 (comment)