From de009a29c8836b6aa537f1edfb22977f66c4b4ee Mon Sep 17 00:00:00 2001 From: georgespatton Date: Mon, 13 Sep 2021 15:38:43 -0700 Subject: [PATCH] doc: Clarify need to save ConfigFile to apply changes to file See #52645 for context. (cherry picked from commit fd8bdddd5d42dcffbc1a3d6a08f0ff6d0636f5a8) --- doc/classes/ConfigFile.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index b8eacaa7776..2394f331165 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -45,6 +45,7 @@ var player_score = config.get_value(player, "best_score") score_data[player_name] = player_score [/codeblock] + Any operation that mutates the ConfigFile such as [method set_value], [method clear], or [method erase_section], only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with [method save], [method save_encrypted], or [method save_encrypted_pass]. Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. ConfigFiles can also contain manually written comment lines starting with a semicolon ([code];[/code]). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. [b]Note:[/b] The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the [code].cfg[/code] extension is used here, but any other extension such as [code].ini[/code] is also valid. Since neither [code].cfg[/code] nor [code].ini[/code] are standardized, Godot's ConfigFile formatting may differ from files written by other programs. @@ -55,6 +56,7 @@ + Removes the entire contents of the config.