Skip to content

Commit ebe7377

Browse files
committed
Merge pull request #92511 from KoBeWi/not_a_path
Remove unused `base_hint` from EditorPropertyNodePath
2 parents 036737e + 6479b56 commit ebe7377

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

editor/editor_properties.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,8 +2922,7 @@ void EditorPropertyNodePath::update_property() {
29222922
assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
29232923
}
29242924

2925-
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) {
2926-
base_hint = p_base_hint;
2925+
void EditorPropertyNodePath::setup(const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root, bool p_editing_node) {
29272926
valid_types = p_valid_types;
29282927
editing_node = p_editing_node;
29292928
use_path_from_scene_root = p_use_path_from_scene_root;
@@ -2943,10 +2942,6 @@ void EditorPropertyNodePath::_notification(int p_what) {
29432942
}
29442943

29452944
Node *EditorPropertyNodePath::get_base_node() {
2946-
if (!base_hint.is_empty() && get_tree()->get_root()->has_node(base_hint)) {
2947-
return get_tree()->get_root()->get_node(base_hint);
2948-
}
2949-
29502945
Node *base_node = Object::cast_to<Node>(get_edited_object());
29512946

29522947
if (!base_node) {
@@ -3800,7 +3795,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
38003795
if (p_hint == PROPERTY_HINT_NODE_PATH_VALID_TYPES && !p_hint_text.is_empty()) {
38013796
Vector<String> types = p_hint_text.split(",", false);
38023797
Vector<StringName> sn = Variant(types); //convert via variant
3803-
editor->setup(NodePath(), sn, (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT));
3798+
editor->setup(sn, (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT));
38043799
}
38053800
return editor;
38063801

@@ -3814,7 +3809,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
38143809
EditorPropertyNodePath *editor = memnew(EditorPropertyNodePath);
38153810
Vector<String> types = p_hint_text.split(",", false);
38163811
Vector<StringName> sn = Variant(types); //convert via variant
3817-
editor->setup(NodePath(), sn, false, true);
3812+
editor->setup(sn, false, true);
38183813
return editor;
38193814
} else {
38203815
EditorPropertyResource *editor = memnew(EditorPropertyResource);

editor/editor_properties.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ class EditorPropertyNodePath : public EditorProperty {
653653
LineEdit *edit = nullptr;
654654

655655
SceneTreeDialog *scene_tree = nullptr;
656-
NodePath base_hint;
657656
bool use_path_from_scene_root = false;
658657
bool editing_node = false;
659658

@@ -679,7 +678,7 @@ class EditorPropertyNodePath : public EditorProperty {
679678

680679
public:
681680
virtual void update_property() override;
682-
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);
681+
void setup(const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root = true, bool p_editing_node = false);
683682
EditorPropertyNodePath();
684683
};
685684

0 commit comments

Comments
 (0)