You've already forked godot
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user