You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Rename Node's filename property to scene_file_path for clarity
This commit is contained in:
@@ -1460,8 +1460,8 @@ bool CanvasItemEditor::_gui_input_open_scene_on_double_click(const Ref<InputEven
|
||||
List<CanvasItem *> selection = _get_edited_canvas_items();
|
||||
if (selection.size() == 1) {
|
||||
CanvasItem *canvas_item = selection[0];
|
||||
if (canvas_item->get_filename() != "" && canvas_item != editor->get_edited_scene()) {
|
||||
editor->open_request(canvas_item->get_filename());
|
||||
if (canvas_item->get_scene_file_path() != "" && canvas_item != editor->get_edited_scene()) {
|
||||
editor->open_request(canvas_item->get_scene_file_path());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -5800,7 +5800,7 @@ void CanvasItemEditorViewport::_remove_preview() {
|
||||
}
|
||||
|
||||
bool CanvasItemEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) {
|
||||
if (p_desired_node->get_filename() == p_target_scene_path) {
|
||||
if (p_desired_node->get_scene_file_path() == p_target_scene_path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5897,14 +5897,14 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons
|
||||
return false;
|
||||
}
|
||||
|
||||
if (editor->get_edited_scene()->get_filename() != "") { // cyclical instancing
|
||||
if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instantiated_scene)) {
|
||||
if (editor->get_edited_scene()->get_scene_file_path() != "") { // cyclical instancing
|
||||
if (_cyclical_dependency_exists(editor->get_edited_scene()->get_scene_file_path(), instantiated_scene)) {
|
||||
memdelete(instantiated_scene);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
instantiated_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path));
|
||||
instantiated_scene->set_scene_file_path(ProjectSettings::get_singleton()->localize_path(path));
|
||||
|
||||
editor_data->get_undo_redo().add_do_method(parent, "add_child", instantiated_scene);
|
||||
editor_data->get_undo_redo().add_do_method(instantiated_scene, "set_owner", editor->get_edited_scene());
|
||||
|
||||
Reference in New Issue
Block a user