diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 2075ca8..cf89716 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -985,7 +985,7 @@ void LimboAIEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { Ref cf; cf.instantiate(); - String conf_path = GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg"); + String conf_path = PROJECT_CONFIG_FILE(); if (cf->load(conf_path) == OK) { hsc->set_split_offset(cf->get_value("bt_editor", "bteditor_hsplit", hsc->get_split_offset())); } @@ -993,7 +993,7 @@ void LimboAIEditor::_notification(int p_what) { case NOTIFICATION_EXIT_TREE: { Ref cf; cf.instantiate(); - String conf_path = GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg"); + String conf_path = PROJECT_CONFIG_FILE(); cf->load(conf_path); cf->set_value("bt_editor", "bteditor_hsplit", hsc->get_split_offset()); cf->save(conf_path); diff --git a/editor/task_palette.cpp b/editor/task_palette.cpp index 31a49fe..a725d3a 100644 --- a/editor/task_palette.cpp +++ b/editor/task_palette.cpp @@ -390,7 +390,7 @@ void TaskPalette::refresh() { // Restore collapsed state from config. Ref cf; cf.instantiate(); - String conf_path = GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg"); + String conf_path = PROJECT_CONFIG_FILE(); if (cf->load(conf_path) == OK) { Variant value = cf->get_value("task_palette", "collapsed_sections", Array()); if (VARIANT_IS_ARRAY(value)) { @@ -525,7 +525,7 @@ void TaskPalette::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { Ref cf; cf.instantiate(); - String conf_path = GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg"); + String conf_path = PROJECT_CONFIG_FILE(); if (cf->load(conf_path) == OK) { Variant value = cf->get_value("task_palette", "type_filter", FilterSettings::TypeFilter(0)); if (VARIANT_IS_NUM(value)) { @@ -552,7 +552,7 @@ void TaskPalette::_notification(int p_what) { case NOTIFICATION_EXIT_TREE: { Ref cf; cf.instantiate(); - String conf_path = GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg"); + String conf_path = PROJECT_CONFIG_FILE(); cf->load(conf_path); Array collapsed_sections; diff --git a/util/limbo_compat.h b/util/limbo_compat.h index ae28ff2..efa2c76 100644 --- a/util/limbo_compat.h +++ b/util/limbo_compat.h @@ -149,4 +149,6 @@ inline void VARIANT_DELETE_IF_OBJECT(Variant m_variant) { } } +#define PROJECT_CONFIG_FILE() GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg") + #endif // LIMBO_COMPAT_H