mirror of
https://github.com/godotengine/godot
synced 2024-09-05 09:08:28 +00:00
Merge pull request #92511 from KoBeWi/not_a_path
Remove unused `base_hint` from EditorPropertyNodePath
This commit is contained in:
commit
ebe7377563
|
@ -2922,8 +2922,7 @@ void EditorPropertyNodePath::update_property() {
|
|||
assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
|
||||
}
|
||||
|
||||
void EditorPropertyNodePath::setup(const NodePath &p_base_hint, const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root, bool p_editing_node) {
|
||||
base_hint = p_base_hint;
|
||||
void EditorPropertyNodePath::setup(const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root, bool p_editing_node) {
|
||||
valid_types = p_valid_types;
|
||||
editing_node = p_editing_node;
|
||||
use_path_from_scene_root = p_use_path_from_scene_root;
|
||||
|
@ -2943,10 +2942,6 @@ void EditorPropertyNodePath::_notification(int p_what) {
|
|||
}
|
||||
|
||||
Node *EditorPropertyNodePath::get_base_node() {
|
||||
if (!base_hint.is_empty() && get_tree()->get_root()->has_node(base_hint)) {
|
||||
return get_tree()->get_root()->get_node(base_hint);
|
||||
}
|
||||
|
||||
Node *base_node = Object::cast_to<Node>(get_edited_object());
|
||||
|
||||
if (!base_node) {
|
||||
|
@ -3800,7 +3795,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
|
|||
if (p_hint == PROPERTY_HINT_NODE_PATH_VALID_TYPES && !p_hint_text.is_empty()) {
|
||||
Vector<String> types = p_hint_text.split(",", false);
|
||||
Vector<StringName> sn = Variant(types); //convert via variant
|
||||
editor->setup(NodePath(), sn, (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT));
|
||||
editor->setup(sn, (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT));
|
||||
}
|
||||
return editor;
|
||||
|
||||
|
@ -3814,7 +3809,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
|
|||
EditorPropertyNodePath *editor = memnew(EditorPropertyNodePath);
|
||||
Vector<String> types = p_hint_text.split(",", false);
|
||||
Vector<StringName> sn = Variant(types); //convert via variant
|
||||
editor->setup(NodePath(), sn, false, true);
|
||||
editor->setup(sn, false, true);
|
||||
return editor;
|
||||
} else {
|
||||
EditorPropertyResource *editor = memnew(EditorPropertyResource);
|
||||
|
|
|
@ -653,7 +653,6 @@ class EditorPropertyNodePath : public EditorProperty {
|
|||
LineEdit *edit = nullptr;
|
||||
|
||||
SceneTreeDialog *scene_tree = nullptr;
|
||||
NodePath base_hint;
|
||||
bool use_path_from_scene_root = false;
|
||||
bool editing_node = false;
|
||||
|
||||
|
@ -679,7 +678,7 @@ protected:
|
|||
|
||||
public:
|
||||
virtual void update_property() override;
|
||||
void setup(const NodePath &p_base_hint, const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root = true, bool p_editing_node = false);
|
||||
void setup(const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root = true, bool p_editing_node = false);
|
||||
EditorPropertyNodePath();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue