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.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 0c95a64d06..2302fb0780 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -63,7 +63,7 @@ void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button) {
search->popup_centered_ratio(0.65); // So it doesn't completely cover the dialog below it.
}
-void DependencyEditor::_fix_and_find(EditorFileSystemDirectory *efsd, Map<String, Map<String, String> > &candidates) {
+void DependencyEditor::_fix_and_find(EditorFileSystemDirectory *efsd, Map<String, Map<String, String>> &candidates) {
for (int i = 0; i < efsd->get_subdir_count(); i++) {
_fix_and_find(efsd->get_subdir(i), candidates);
@@ -124,7 +124,7 @@ void DependencyEditor::_fix_all() {
if (!EditorFileSystem::get_singleton()->get_filesystem())
return;
- Map<String, Map<String, String> > candidates;
+ Map<String, Map<String, String>> candidates;
for (List<String>::Element *E = missing.front(); E; E = E->next()) {
@@ -140,7 +140,7 @@ void DependencyEditor::_fix_all() {
Map<String, String> remaps;
- for (Map<String, Map<String, String> >::Element *E = candidates.front(); E; E = E->next()) {
+ for (Map<String, Map<String, String>>::Element *E = candidates.front(); E; E = E->next()) {
for (Map<String, String>::Element *F = E->get().front(); F; F = F->next()) {
@@ -174,7 +174,7 @@ void DependencyEditor::_update_list() {
TreeItem *root = tree->create_item();
- Ref<Texture2D> folder = get_icon("folder", "FileDialog");
+ Ref<Texture2D> folder = tree->get_theme_icon("folder", "FileDialog");
bool broken = false;
@@ -256,7 +256,7 @@ DependencyEditor::DependencyEditor() {
vb->add_child(hbc);
MarginContainer *mc = memnew(MarginContainer);
- mc->set_v_size_flags(SIZE_EXPAND_FILL);
+ mc->set_v_size_flags(Control::SIZE_EXPAND_FILL);
mc->add_child(tree);
vb->add_child(mc);
@@ -264,7 +264,7 @@ DependencyEditor::DependencyEditor() {
set_title(TTR("Dependency Editor"));
search = memnew(EditorFileDialog);
search->connect("file_selected", callable_mp(this, &DependencyEditor::_searched));
- search->set_mode(EditorFileDialog::MODE_OPEN_FILE);
+ search->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
search->set_title(TTR("Search Replacement Resource:"));
add_child(search);
}
@@ -422,17 +422,17 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed
if (!tree_items.has(rd.dependency_folder)) {
TreeItem *folder_item = owners->create_item(owners->get_root());
folder_item->set_text(0, rd.dependency_folder);
- folder_item->set_icon(0, get_icon("Folder", "EditorIcons"));
+ folder_item->set_icon(0, owners->get_theme_icon("Folder", "EditorIcons"));
tree_items[rd.dependency_folder] = folder_item;
}
TreeItem *dependency_item = owners->create_item(tree_items[rd.dependency_folder]);
dependency_item->set_text(0, rd.dependency);
- dependency_item->set_icon(0, get_icon("Warning", "EditorIcons"));
+ dependency_item->set_icon(0, owners->get_theme_icon("Warning", "EditorIcons"));
tree_items[rd.dependency] = dependency_item;
} else {
TreeItem *dependency_item = owners->create_item(owners->get_root());
dependency_item->set_text(0, rd.dependency);
- dependency_item->set_icon(0, get_icon("Warning", "EditorIcons"));
+ dependency_item->set_icon(0, owners->get_theme_icon("Warning", "EditorIcons"));
tree_items[rd.dependency] = dependency_item;
}
}
@@ -580,7 +580,7 @@ DependencyRemoveDialog::DependencyRemoveDialog() {
owners = memnew(Tree);
owners->set_hide_root(true);
vb->add_child(owners);
- owners->set_v_size_flags(SIZE_EXPAND_FILL);
+ owners->set_v_size_flags(Control::SIZE_EXPAND_FILL);
}
//////////////
@@ -592,7 +592,7 @@ void DependencyErrorDialog::show(Mode p_mode, const String &p_for_file, const Ve
set_title(TTR("Error loading:") + " " + p_for_file.get_file());
files->clear();
- TreeItem *root = files->create_item(NULL);
+ TreeItem *root = files->create_item(nullptr);
for (int i = 0; i < report.size(); i++) {
String dep;
@@ -636,9 +636,9 @@ DependencyErrorDialog::DependencyErrorDialog() {
files = memnew(Tree);
files->set_hide_root(true);
vb->add_margin_child(TTR("Load failed due to missing dependencies:"), files, true);
- files->set_v_size_flags(SIZE_EXPAND_FILL);
+ files->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- set_custom_minimum_size(Size2(500, 220) * EDSCALE);
+ set_min_size(Size2(500, 220) * EDSCALE);
get_ok()->set_text(TTR("Open Anyway"));
get_cancel()->set_text(TTR("Close"));
@@ -662,7 +662,7 @@ void OrphanResourcesDialog::ok_pressed() {
return;
delete_confirm->set_text(vformat(TTR("Permanently delete %d item(s)? (No undo!)"), paths.size()));
- delete_confirm->popup_centered_clamped(delete_confirm->get_minimum_size());
+ delete_confirm->popup_centered();
}
bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMap<String, int> &refs, TreeItem *p_parent) {
@@ -674,11 +674,11 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
for (int i = 0; i < efsd->get_subdir_count(); i++) {
- TreeItem *dir_item = NULL;
+ TreeItem *dir_item = nullptr;
if (p_parent) {
dir_item = files->create_item(p_parent);
dir_item->set_text(0, efsd->get_subdir(i)->get_name());
- dir_item->set_icon(0, get_icon("folder", "FileDialog"));
+ dir_item->set_icon(0, files->get_theme_icon("folder", "FileDialog"));
}
bool children = _fill_owners(efsd->get_subdir(i), refs, dir_item);
@@ -717,7 +717,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
int ds = efsd->get_file_deps(i).size();
ti->set_text(1, itos(ds));
if (ds) {
- ti->add_button(1, get_icon("GuiVisibilityVisible", "EditorIcons"), -1, false, TTR("Show Dependencies"));
+ ti->add_button(1, files->get_theme_icon("GuiVisibilityVisible", "EditorIcons"), -1, false, TTR("Show Dependencies"));
}
ti->set_metadata(0, path);
has_children = true;
@@ -730,7 +730,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
void OrphanResourcesDialog::refresh() {
HashMap<String, int> refs;
- _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(), refs, NULL);
+ _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(), refs, nullptr);
files->clear();
TreeItem *root = files->create_item();
_fill_owners(EditorFileSystem::get_singleton()->get_filesystem(), refs, root);