summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_loader.cpp2
-rw-r--r--core/io/resource_saver.cpp2
-rw-r--r--core/os/input_event.cpp3
-rw-r--r--core/os/input_event.h3
-rw-r--r--core/script_language.cpp8
-rw-r--r--core/script_language.h1
6 files changed, 17 insertions, 2 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index c917b9ba28..e4b694b64f 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -946,7 +946,7 @@ void ResourceLoader::add_custom_loaders() {
for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {
StringName class_name = E->get();
- StringName base_class = ScriptServer::get_global_class_base(class_name);
+ StringName base_class = ScriptServer::get_global_class_native_base(class_name);
if (base_class == custom_loader_base_class) {
String path = ScriptServer::get_global_class_path(class_name);
diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp
index c992e2bf94..0cecca904d 100644
--- a/core/io/resource_saver.cpp
+++ b/core/io/resource_saver.cpp
@@ -249,7 +249,7 @@ void ResourceSaver::add_custom_savers() {
for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) {
StringName class_name = E->get();
- StringName base_class = ScriptServer::get_global_class_base(class_name);
+ StringName base_class = ScriptServer::get_global_class_native_base(class_name);
if (base_class == custom_saver_base_class) {
String path = ScriptServer::get_global_class_path(class_name);
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 40308f4f7d..25a5c2afeb 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -33,6 +33,9 @@
#include "core/input_map.h"
#include "core/os/keyboard.h"
+const int InputEvent::DEVICE_ID_TOUCH_MOUSE = -1;
+const int InputEvent::DEVICE_ID_INTERNAL = -2;
+
void InputEvent::set_device(int p_device) {
device = p_device;
}
diff --git a/core/os/input_event.h b/core/os/input_event.h
index 47f9293a7f..ba01516519 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -165,6 +165,9 @@ protected:
static void _bind_methods();
public:
+ static const int DEVICE_ID_TOUCH_MOUSE;
+ static const int DEVICE_ID_INTERNAL;
+
void set_device(int p_device);
int get_device() const;
diff --git a/core/script_language.cpp b/core/script_language.cpp
index 1c244661b0..4a6f904f9d 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -190,6 +190,14 @@ StringName ScriptServer::get_global_class_base(const String &p_class) {
ERR_FAIL_COND_V(!global_classes.has(p_class), String());
return global_classes[p_class].base;
}
+StringName ScriptServer::get_global_class_native_base(const String &p_class) {
+ ERR_FAIL_COND_V(!global_classes.has(p_class), String());
+ String base = global_classes[p_class].base;
+ while (global_classes.has(base)) {
+ base = global_classes[base].base;
+ }
+ return base;
+}
void ScriptServer::get_global_class_list(List<StringName> *r_global_classes) {
const StringName *K = NULL;
List<StringName> classes;
diff --git a/core/script_language.h b/core/script_language.h
index 65fb0f0268..b6d7bea9c7 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -87,6 +87,7 @@ public:
static StringName get_global_class_language(const StringName &p_class);
static String get_global_class_path(const String &p_class);
static StringName get_global_class_base(const String &p_class);
+ static StringName get_global_class_native_base(const String &p_class);
static void get_global_class_list(List<StringName> *r_global_classes);
static void save_global_classes();