From 1344283a5c9890b37204fa3b46aecba17162f073 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Wed, 19 Oct 2022 01:41:55 +1100 Subject: [PATCH] Retain configuration meta data on ProjectSettings --- core/config/project_settings.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 001a351e0b61..c198ad986d78 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1185,6 +1185,20 @@ ProjectSettings::ProjectSettings() { // Initialization of engine variables should be done in the setup() method, // so that the values can be overridden from project.godot or project.binary. + if (singleton != nullptr) { + // If we already have a singleton this means that we're in our project manager + // and loading the settings of a selected project or creating a new project. + // In this case we're loosing all our definitions resulting in error spam. + + // So lets retain those by copying them. + props = singleton->props; + + // reset to default + for (const KeyValue &G : props) { + props[G.key].variant = props[G.key].initial; + } + } + singleton = this; GLOBAL_DEF_BASIC("application/config/name", "");