diff options
author | Lyuma <xn.lyuma@gmail.com> | 2021-08-26 20:46:51 -0700 |
---|---|---|
committer | Lyuma <xn.lyuma@gmail.com> | 2021-08-26 21:55:26 -0700 |
commit | 31f790299c1649680b48c00230e89318d864624f (patch) | |
tree | 08217b561017e7150910769240ac7fb5b82eea91 /core/config | |
parent | 6e87d628735cb201cb3de49a723baaf60d9c942d (diff) |
Use OrderedHashMap for autoloads to preserve order
Diffstat (limited to 'core/config')
-rw-r--r-- | core/config/project_settings.cpp | 2 | ||||
-rw-r--r-- | core/config/project_settings.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index c5e6c6d685..03892d1d4f 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1006,7 +1006,7 @@ bool ProjectSettings::has_custom_feature(const String &p_feature) const { return custom_features.has(p_feature); } -Map<StringName, ProjectSettings::AutoloadInfo> ProjectSettings::get_autoload_list() const { +OrderedHashMap<StringName, ProjectSettings::AutoloadInfo> ProjectSettings::get_autoload_list() const { return autoloads; } diff --git a/core/config/project_settings.h b/core/config/project_settings.h index ed8fb19fa0..7e93f26f0d 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -33,6 +33,7 @@ #include "core/object/class_db.h" #include "core/os/thread_safe.h" +#include "core/templates/ordered_hash_map.h" #include "core/templates/set.h" class ProjectSettings : public Object { @@ -91,7 +92,7 @@ protected: Set<String> custom_features; Map<StringName, StringName> feature_overrides; - Map<StringName, AutoloadInfo> autoloads; + OrderedHashMap<StringName, AutoloadInfo> autoloads; bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; @@ -168,7 +169,7 @@ public: bool has_custom_feature(const String &p_feature) const; - Map<StringName, AutoloadInfo> get_autoload_list() const; + OrderedHashMap<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; |