summaryrefslogtreecommitdiff
path: root/core/project_settings.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/project_settings.h')
-rw-r--r--core/project_settings.h61
1 files changed, 38 insertions, 23 deletions
diff --git a/core/project_settings.h b/core/project_settings.h
index 7b3ca18c62..686f6f3873 100644
--- a/core/project_settings.h
+++ b/core/project_settings.h
@@ -36,7 +36,6 @@
#include "core/set.h"
class ProjectSettings : public Object {
-
GDCLASS(ProjectSettings, Object);
_THREAD_SAFE_CLASS_
@@ -48,45 +47,49 @@ public:
NO_BUILTIN_ORDER_BASE = 1 << 16
};
+ struct AutoloadInfo {
+ StringName name;
+ String path;
+ bool is_singleton = false;
+ };
+
protected:
struct VariantContainer {
- int order;
- bool persist;
+ int order = 0;
+ bool persist = false;
Variant variant;
Variant initial;
- bool hide_from_editor;
- bool overridden;
- bool restart_if_changed;
- VariantContainer() :
- order(0),
- persist(false),
- hide_from_editor(false),
- overridden(false),
- restart_if_changed(false) {
- }
+ bool hide_from_editor = false;
+ bool overridden = false;
+ bool restart_if_changed = false;
+#ifdef DEBUG_METHODS_ENABLED
+ bool ignore_value_in_docs = false;
+#endif
+
+ VariantContainer() {}
+
VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) :
order(p_order),
persist(p_persist),
- variant(p_variant),
- hide_from_editor(false),
- overridden(false),
- restart_if_changed(false) {
+ variant(p_variant) {
}
};
- bool registering_order;
- int last_order;
- int last_builtin_order;
+ bool registering_order = true;
+ int last_order = 0;
+ int last_builtin_order = NO_BUILTIN_ORDER_BASE;
Map<StringName, VariantContainer> props;
String resource_path;
Map<StringName, PropertyInfo> custom_prop_info;
- bool disable_feature_overrides;
- bool using_datapack;
+ bool disable_feature_overrides = false;
+ bool using_datapack = false;
List<String> input_presets;
Set<String> custom_features;
Map<StringName, StringName> feature_overrides;
+ Map<StringName, AutoloadInfo> autoloads;
+
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
void _get_property_list(List<PropertyInfo> *p_list) const;
@@ -125,6 +128,9 @@ public:
void set_initial_value(const String &p_name, const Variant &p_value);
void set_restart_if_changed(const String &p_name, bool p_restart);
+ void set_ignore_value_in_docs(const String &p_name, bool p_ignore);
+ bool get_ignore_value_in_docs(const String &p_name) const;
+
bool property_can_revert(const String &p_name);
Variant property_get_revert(const String &p_name);
@@ -136,6 +142,7 @@ public:
int get_order(const String &p_name) const;
void set_order(const String &p_name, int p_order);
void set_builtin_order(const String &p_name);
+ bool is_builtin_setting(const String &p_name) const;
Error setup(const String &p_path, const String &p_main_pack, bool p_upwards = false);
@@ -156,14 +163,22 @@ public:
bool has_custom_feature(const String &p_feature) const;
+ Map<StringName, AutoloadInfo> get_autoload_list() const;
+ void add_autoload(const AutoloadInfo &p_autoload);
+ void remove_autoload(const StringName &p_autoload);
+ bool has_autoload(const StringName &p_autoload) const;
+ AutoloadInfo get_autoload(const StringName &p_name) const;
+
ProjectSettings();
~ProjectSettings();
};
//not a macro any longer
-Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default, bool p_restart_if_changed = false);
+Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default, bool p_restart_if_changed = false, bool p_ignore_value_in_docs = false);
#define GLOBAL_DEF(m_var, m_value) _GLOBAL_DEF(m_var, m_value)
#define GLOBAL_DEF_RST(m_var, m_value) _GLOBAL_DEF(m_var, m_value, true)
+#define GLOBAL_DEF_NOVAL(m_var, m_value) _GLOBAL_DEF(m_var, m_value, false, true)
+#define GLOBAL_DEF_RST_NOVAL(m_var, m_value) _GLOBAL_DEF(m_var, m_value, true, true)
#define GLOBAL_GET(m_var) ProjectSettings::get_singleton()->get(m_var)
#endif // PROJECT_SETTINGS_H