Skip to content

Commit

Permalink
Hint fallback property as node when it is a node
Browse files Browse the repository at this point in the history
  • Loading branch information
paulloz committed Mar 5, 2024
1 parent a07dd0d commit e7c90e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/object/script_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,12 @@ void PlaceHolderScriptInstance::property_set_fallback(const StringName &p_name,
}
}
if (!found) {
properties.push_back(PropertyInfo(p_value.get_type(), p_name, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_SCRIPT_VARIABLE));
PropertyHint hint = PROPERTY_HINT_NONE;
const Object *obj = p_value.get_validated_object();
if (obj && obj->is_class("Node")) {
hint = PROPERTY_HINT_NODE_TYPE;
}
properties.push_back(PropertyInfo(p_value.get_type(), p_name, hint, "", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_SCRIPT_VARIABLE));
}
}

Expand Down

0 comments on commit e7c90e0

Please sign in to comment.