summaryrefslogtreecommitdiff
path: root/editor/dependency_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/dependency_editor.cpp')
-rw-r--r--editor/dependency_editor.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 1f58eda396..e2a447cfcf 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,6 +33,7 @@
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "editor_node.h"
+#include "editor_scale.h"
#include "scene/gui/margin_container.h"
void DependencyEditor::_searched(const String &p_path) {
@@ -49,7 +50,6 @@ void DependencyEditor::_searched(const String &p_path) {
void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button) {
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
- String fname = ti->get_text(0);
replacing = ti->get_text(1);
search->set_title(TTR("Search Replacement For:") + " " + replacing.get_file());
@@ -174,7 +174,7 @@ void DependencyEditor::_update_list() {
TreeItem *root = tree->create_item();
- Ref<Texture> folder = get_icon("folder", "FileDialog");
+ Ref<Texture2D> folder = get_icon("folder", "FileDialog");
bool broken = false;
@@ -195,7 +195,7 @@ void DependencyEditor::_update_list() {
}
String name = path.get_file();
- Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
+ Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(type);
item->set_text(0, name);
item->set_icon(0, icon);
item->set_metadata(0, type);
@@ -247,7 +247,7 @@ DependencyEditor::DependencyEditor() {
tree->set_column_title(0, TTR("Resource"));
tree->set_column_title(1, TTR("Path"));
tree->set_hide_root(true);
- tree->connect("button_pressed", this, "_load_pressed");
+ tree->connect_compat("button_pressed", this, "_load_pressed");
HBoxContainer *hbc = memnew(HBoxContainer);
Label *label = memnew(Label(TTR("Dependencies:")));
@@ -255,7 +255,7 @@ DependencyEditor::DependencyEditor() {
hbc->add_spacer();
fixdeps = memnew(Button(TTR("Fix Broken")));
hbc->add_child(fixdeps);
- fixdeps->connect("pressed", this, "_fix_all");
+ fixdeps->connect_compat("pressed", this, "_fix_all");
vb->add_child(hbc);
@@ -267,7 +267,7 @@ DependencyEditor::DependencyEditor() {
set_title(TTR("Dependency Editor"));
search = memnew(EditorFileDialog);
- search->connect("file_selected", this, "_searched");
+ search->connect_compat("file_selected", this, "_searched");
search->set_mode(EditorFileDialog::MODE_OPEN_FILE);
search->set_title(TTR("Search Replacement Resource:"));
add_child(search);
@@ -338,7 +338,7 @@ void DependencyEditorOwners::_fill_owners(EditorFileSystemDirectory *efsd) {
if (!found)
continue;
- Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(efsd->get_file_type(i));
+ Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(efsd->get_file_type(i));
owners->add_item(efsd->get_file_path(i), icon);
}
@@ -360,12 +360,12 @@ DependencyEditorOwners::DependencyEditorOwners(EditorNode *p_editor) {
file_options = memnew(PopupMenu);
add_child(file_options);
- file_options->connect("id_pressed", this, "_file_option");
+ file_options->connect_compat("id_pressed", this, "_file_option");
owners = memnew(ItemList);
owners->set_select_mode(ItemList::SELECT_SINGLE);
- owners->connect("item_rmb_selected", this, "_list_rmb_select");
- owners->connect("item_activated", this, "_select_file");
+ owners->connect_compat("item_rmb_selected", this, "_list_rmb_select");
+ owners->connect_compat("item_activated", this, "_select_file");
owners->set_allow_rmb_select(true);
add_child(owners);
}
@@ -446,7 +446,7 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed
}
//List this file under this dependency
- Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(rd.file_type);
+ Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(rd.file_type);
TreeItem *file_item = owners->create_item(tree_items[rd.dependency]);
file_item->set_text(0, rd.file);
file_item->set_icon(0, icon);
@@ -609,7 +609,7 @@ void DependencyErrorDialog::show(Mode p_mode, const String &p_for_file, const Ve
if (report[i].get_slice_count("::") > 0)
type = report[i].get_slice("::", 1);
- Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
+ Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(type);
TreeItem *ti = files->create_item(root);
ti->set_text(0, dep);
@@ -720,7 +720,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
String type = efsd->get_file_type(i);
- Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
+ Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(type);
ti->set_icon(0, icon);
int ds = efsd->get_file_deps(i).size();
ti->set_text(1, itos(ds));
@@ -800,7 +800,7 @@ OrphanResourcesDialog::OrphanResourcesDialog() {
add_child(delete_confirm);
dep_edit = memnew(DependencyEditor);
add_child(dep_edit);
- delete_confirm->connect("confirmed", this, "_delete_confirm");
+ delete_confirm->connect_compat("confirmed", this, "_delete_confirm");
set_hide_on_ok(false);
VBoxContainer *vbc = memnew(VBoxContainer);
@@ -816,5 +816,5 @@ OrphanResourcesDialog::OrphanResourcesDialog() {
files->set_column_title(1, TTR("Owns"));
files->set_hide_root(true);
vbc->add_margin_child(TTR("Resources Without Explicit Ownership:"), files, true);
- files->connect("button_pressed", this, "_button_pressed");
+ files->connect_compat("button_pressed", this, "_button_pressed");
}