summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_loader.h4
-rw-r--r--core/object/class_db.cpp6
-rw-r--r--core/object/undo_redo.cpp14
3 files changed, 13 insertions, 11 deletions
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index 5caf699d32..486f7bbf37 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -226,7 +226,7 @@ public:
// Loaders can safely use this regardless which thread they are running on.
static void notify_load_error(const String &p_err) {
if (err_notify) {
- callable_mp_static(err_notify).bind(p_err).call_deferred();
+ callable_mp_static(err_notify).call_deferred(p_err);
}
}
static void set_error_notify_func(ResourceLoadErrorNotify p_err_notify) {
@@ -239,7 +239,7 @@ public:
if (Thread::get_caller_id() == Thread::get_main_id()) {
dep_err_notify(p_path, p_dependency, p_type);
} else {
- callable_mp_static(dep_err_notify).bind(p_path, p_dependency, p_type).call_deferred();
+ callable_mp_static(dep_err_notify).call_deferred(p_path, p_dependency, p_type);
}
}
}
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp
index 3d93ce8e73..fe4345aa0d 100644
--- a/core/object/class_db.cpp
+++ b/core/object/class_db.cpp
@@ -505,7 +505,7 @@ Object *ClassDB::_instantiate_internal(const StringName &p_class, bool p_require
ERR_FAIL_NULL_V_MSG(ti->creation_func, nullptr, "Class '" + String(p_class) + "' or its base class cannot be instantiated.");
}
#ifdef TOOLS_ENABLED
- if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) {
+ if ((ti->api == API_EDITOR || ti->api == API_EDITOR_EXTENSION) && !Engine::get_singleton()->is_editor_hint()) {
ERR_PRINT("Class '" + String(p_class) + "' can only be instantiated by editor.");
return nullptr;
}
@@ -664,7 +664,7 @@ bool ClassDB::can_instantiate(const StringName &p_class) {
return scr.is_valid() && scr->is_valid() && !scr->is_abstract();
}
#ifdef TOOLS_ENABLED
- if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) {
+ if ((ti->api == API_EDITOR || ti->api == API_EDITOR_EXTENSION) && !Engine::get_singleton()->is_editor_hint()) {
return false;
}
#endif
@@ -684,7 +684,7 @@ bool ClassDB::is_virtual(const StringName &p_class) {
return scr.is_valid() && scr->is_valid() && scr->is_abstract();
}
#ifdef TOOLS_ENABLED
- if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) {
+ if ((ti->api == API_EDITOR || ti->api == API_EDITOR_EXTENSION) && !Engine::get_singleton()->is_editor_hint()) {
return false;
}
#endif
diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp
index 4d67cd930e..0f7884305a 100644
--- a/core/object/undo_redo.cpp
+++ b/core/object/undo_redo.cpp
@@ -159,10 +159,11 @@ void UndoRedo::add_do_method(const Callable &p_callable) {
do_op.ref = Ref<RefCounted>(Object::cast_to<RefCounted>(object));
}
do_op.type = Operation::TYPE_METHOD;
- do_op.name = p_callable.get_method();
- if (do_op.name == StringName()) {
- // There's no `get_method()` for custom callables, so use `operator String()` instead.
+ // There's no `get_method()` for custom callables, so use `operator String()` instead.
+ if (p_callable.is_custom()) {
do_op.name = static_cast<String>(p_callable);
+ } else {
+ do_op.name = p_callable.get_method();
}
actions.write[current_action + 1].do_ops.push_back(do_op);
@@ -190,10 +191,11 @@ void UndoRedo::add_undo_method(const Callable &p_callable) {
}
undo_op.type = Operation::TYPE_METHOD;
undo_op.force_keep_in_merge_ends = force_keep_in_merge_ends;
- undo_op.name = p_callable.get_method();
- if (undo_op.name == StringName()) {
- // There's no `get_method()` for custom callables, so use `operator String()` instead.
+ // There's no `get_method()` for custom callables, so use `operator String()` instead.
+ if (p_callable.is_custom()) {
undo_op.name = static_cast<String>(p_callable);
+ } else {
+ undo_op.name = p_callable.get_method();
}
actions.write[current_action + 1].undo_ops.push_back(undo_op);