1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

GDScript: Fix message when calling non-tool function in tool mode

This commit is contained in:
Danil Alexeev
2024-07-18 16:42:54 +03:00
parent db76de5de8
commit 2d8f6c1b1d
4 changed files with 57 additions and 47 deletions

View File

@@ -704,6 +704,18 @@ bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const {
return false;
}
Variant PlaceHolderScriptInstance::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
#if TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint()) {
return String("Attempt to call a method on a placeholder instance. Check if the script is in tool mode.");
} else {
return String("Attempt to call a method on a placeholder instance. Probably a bug, please report.");
}
#endif
return Variant();
}
void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, const HashMap<StringName, Variant> &p_values) {
HashSet<StringName> new_values;
for (const PropertyInfo &E : p_properties) {