From 58b3e4b82f2ec5d841fc2ae7fa35d12af4415ec1 Mon Sep 17 00:00:00 2001 From: Feo Wu Date: Fri, 23 Feb 2024 15:00:26 +0800 Subject: [PATCH] fix: plugin setting doesn't show refers to: https://github.com/Ark2000/PankuConsole/issues/164 --- addons/panku_console/plugin.gd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/panku_console/plugin.gd b/addons/panku_console/plugin.gd index 07477bf..0c43b6e 100644 --- a/addons/panku_console/plugin.gd +++ b/addons/panku_console/plugin.gd @@ -57,16 +57,18 @@ func safe_remove_singleton() -> void: remove_autoload_singleton(SINGLETON_NAME) -func _enable_plugin() -> void: - ProjectSettings.set_setting(panku_option(OPTIONS.DISABLE_ON_RELEASE), false) - ProjectSettings.set_initial_value(panku_option(OPTIONS.DISABLE_ON_RELEASE), false) - ProjectSettings.save() +func create_setting() -> void: + if not ProjectSettings.has_setting(panku_option(OPTIONS.DISABLE_ON_RELEASE)): + ProjectSettings.set_setting(panku_option(OPTIONS.DISABLE_ON_RELEASE), false) + ProjectSettings.set_initial_value(panku_option(OPTIONS.DISABLE_ON_RELEASE), false) + ProjectSettings.save() func _enter_tree() -> void: exporter = PankuExporter.new() exporter.owner = self add_export_plugin(exporter) + create_setting() safe_add_singleton() print("Panku Console initialized! Project page: https://github.com/Ark2000/PankuConsole")