summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-07-18 12:36:09 +0200
committerGitHub <noreply@github.com>2018-07-18 12:36:09 +0200
commitd603a74c53bbcd7d5f4b542999cea5ff9db33c89 (patch)
tree9a3413bfab76a504a58ecd74e248f99cbdc0d492
parentbd9b8098fef50b034f71ae1942c74131a984f6ba (diff)
parent25e64ffa20a15abe6c435ae8abf517be209fea53 (diff)
Merge pull request #20240 from matthew1006/has-custom-feature-tag-fix
Fixed OS.has_feature not using custom feature tags.
-rw-r--r--core/os/os.cpp3
-rw-r--r--core/project_settings.cpp4
-rw-r--r--core/project_settings.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 5eed10e30c..d0a7bc6fbe 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -614,6 +614,9 @@ bool OS::has_feature(const String &p_feature) {
if (_check_internal_feature_support(p_feature))
return true;
+ if (ProjectSettings::get_singleton()->has_custom_feature(p_feature))
+ return true;
+
return false;
}
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index b1fd66e566..db1d0a604c 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -912,6 +912,10 @@ Variant ProjectSettings::get_setting(const String &p_setting) const {
return get(p_setting);
}
+bool ProjectSettings::has_custom_feature(const String &p_feature) const {
+ return custom_features.has(p_feature);
+}
+
void ProjectSettings::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_setting", "name"), &ProjectSettings::has_setting);
diff --git a/core/project_settings.h b/core/project_settings.h
index 66f3ed954e..045d942b31 100644
--- a/core/project_settings.h
+++ b/core/project_settings.h
@@ -151,6 +151,8 @@ public:
void set_registering_order(bool p_enable);
+ bool has_custom_feature(const String &p_feature) const;
+
ProjectSettings();
~ProjectSettings();
};