Skip to content

[FEATURE] Migrate to Resource persistence #432

Description

@ikostan

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:

  1. 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.

  2. 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)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions